I'm trying to call a function in one contract from another contract with the following simple example:
Untitled.sol:
pragma solidity ^0.4.16;
contract helloworld {
function returnint() returns (uint) {
return 15;
}
}
And the second contract:
pragma solidity ^0.4.16;
import "./Untitled.sol";
contract pullother {
function callFunctionInContractOne (address _address) returns (uint) {
helloworld contractOne = helloworld(_address);
contractOne.returnint();
}
}
When calling callFunctionInContractOne() in the second contract, the address of the deployed Untitled.sol is given as a parameter, then the returnint() function in the first contract is called (which should return 15). When I try this in the remix editor I get the following returned instead:
I am copying from calling simple function from another contract but getting a different result. I've also tried running a function on one contract from another on a private blockchain in a similar way but am unsuccessful.
Adding a return value I get the same thing:



constantforcallFunctionInContractOnefunction, try it.function callFunctionInContractOne (address _address) constant returns (uint) { helloworld contractOne = helloworld(_address); return contractOne.returnint(); }– BinGoBinBin Aug 30 '17 at 11:26