Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Look at how msg.sender works across contracts
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IMo{
function callMeDifferentContract() external returns(address);
contract Me{
address public senderOne;
address public senderTwo;
address public senderThree;
function callMe(address moAddress) public{
senderOne = msg.sender;
senderTwo = callMeSameContract();
senderThree = IMo(moAddress).callMeDifferentContract();
function callMeSameContract() public returns(address){
return msg.sender;
contract Mo{
function callMeDifferentContract() public view returns(address){
return msg.sender;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment