When the user calls the delegatecallSetN function of contract D below, the msg.sender in contract E is the address of the user (as shown in this example).
contract D {
uint public n;
address public sender;
function delegatecallSetN(address _e, uint _n) {
_e.delegatecall(bytes4(sha3("setN(uint256)")), _n); // D's storage is set, E is not modified
}
}
contract E {
uint public n;
address public sender;
function setN(uint _n) {
n = _n;
sender = msg.sender;
}
}
My question is: How can we check in contract E that the call was done through contract D and not directly through the user?