Skip to content

Instantly share code, notes, and snippets.

@angelmariadas
Last active June 19, 2018 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelmariadas/28498ca80994824efd7e479efb32a2ed to your computer and use it in GitHub Desktop.
Save angelmariadas/28498ca80994824efd7e479efb32a2ed to your computer and use it in GitHub Desktop.
Interaction of contracts
pragma solidity ^0.4.23;
import "./Test.sol";
contract CallFunction {
address public useraddress;
constructor(address _t) public {
useraddress = _t;
}
function thirdfun(uint256 a) public view returns(uint256 c) {
Test instanceuser = Test(useraddress);
c = instanceuser.secfun(a);
return c;
}
}
pragma solidity ^0.4.23;
contract Test {
function secfun(uint256 a) public pure returns(uint256) {
uint l;
l = l + a;
return l;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment