contract A {
uint public u;
event abc(address);
constructor() payable{
u=100;
}
function () payable{
emit abc(msg.sender);
u = 25;
}
function setu(uint i) {
u = i;
}
function getBalance() view returns(uint){
return address(this).balance;
}
}
contract B {
uint public a;
A ac;
function(){
a= 20;
}
constructor() payable {
a=10;
}
function send(A b){
b.call.gas(210000).value(100 wei)();
}
function getBalance() view returns(uint){
return address(this).balance;
}
}
I have updated the code. Now, I am passing gas along with the call to avoid gas estimation failure.
I am trying to trigger contract A's fallback function by sending some ether by calling send function from contract Attacker.
This works fine in Remix using javascript VM but getting failed in Rinkeby.
Send()ofContract Attackerit shows Gas Estimation Failed error. – rohit_sethi Oct 08 '18 at 12:07