I'm confused about how msg.sender
changes through relaying function calls. I know that msg.sender
sets to the caller(it should be me) address at first, but through the process, msg.sender
can change to contract address. Like when one contract calls the function of the another contract, then the function of the another contract's msg.sender
should be the first contract. Now, if like this,
contract example1 {
function A() {
print msg.sender; // just fake code to imagine it prints out the result
example2.B();
}
}
contract example2 {
function B() {
print msg.sender;
C();
}
function C() { print msg.sender; }
}
If I call function A()
, then it will print my address, and followed by the process, B()
will print contract example1
's address. Then is C()
will print contract example1
's address or contract example2
's address?