Skip to content

Instantly share code, notes, and snippets.

@shingonu
Created December 11, 2018 14:07
Show Gist options
  • Save shingonu/d1f0d8865e645788c79df114cfbc48fa to your computer and use it in GitHub Desktop.
Save shingonu/d1f0d8865e645788c79df114cfbc48fa to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.24;
contract A {
address public sender;
function setMsgSender() public {
sender = msg.sender;
}
}
contract B {
address public sender;
A a;
constructor(address _a) public {
sender = msg.sender;
a = A(_a);
}
function callA() public {
a.setMsgSender();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment