0

is it possible to call a function in deployed contract B from contract A while preserving msg.sender to be original sender that invoked contract A. I know there is delegatecall method but also passes the entire context. I only need to pass the msg.sender.

For example, I want to invoke transfer function in my contract A that sets balance of addr of my contract B to X when I deploy my secondary contract B. Since I created and deployed both contracts I can do this but only if I do 2 tx calls.

marked as duplicate by Achala Dissanayake, mirg, Richard Horrocks, TC8, Vignesh Karthikeyan Jun 20 '18 at 15:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Don't think that's possible. Essentially, it's asking for tx.origin, which is already a security vulnerability: https://github.com/ethereum/solidity/issues/683

Not the answer you're looking for? Browse other questions tagged or ask your own question.