Last active
June 19, 2018 06:59
-
-
Save angelmariadas/28498ca80994824efd7e479efb32a2ed to your computer and use it in GitHub Desktop.
Interaction of contracts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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