I have simple code that deploys and calls method from other contract. I am always getting 0 (by calling Test.get()
) instead of the actual value from the other contract. I am using Geth 1.8.11 (private network, only single node) and Remix IDE.
pragma solidity ^0.4.17;
contract Test {
address public d_address;
function deployOther() public {
d_address = new Referred(123);
}
function get() public returns (uint){
return Referred(d_address).toReturn();
}
function set() public payable {
Referred(d_address).set.gas(21000).value(msg.value)(456);
}
}
contract Referred {
uint public val;
constructor(uint v) public {
val = v;
}
function set(uint nv) public payable{
val = nv;
}
function toReturn() public view returns (uint){
return val;
}
}
I see this error in the geth log,
DEBUG[06-25|19:34:00|core/state_transition.go:216] VM returned with error err="out of gas".