Created
March 17, 2019 16:07
-
-
Save maojui/3e7044b67d42fc3b0106589089a59dbd to your computer and use it in GitHub Desktop.
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
contract DelegateCaller { | |
uint public n; | |
address public sender; | |
function delegatecallSetN(address _e, uint _n) { | |
_e.delegatecall(bytes4(keccak256("setN(uint256)")), _n); // D's storage is set, E is not modified | |
} | |
} | |
contract OuterContract { | |
uint public n; | |
address public sender; | |
function setN(uint _n) { | |
n = _n; | |
sender = msg.sender; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment