I have a contract we will call A that uses the transfer function from an ERC20 contract we will call B through an interface. However, the transfer function will not work as expected because in the call from user -> A -> B the msg.sender is now the contract address of A and not the user's address anymore.
I can think of two immediate ways to solve this.
- Pass the original msg.sender (user's address) as a param to the transfer function
- Change msg.sender in contract B's transfer function to tx.origin
However both of these solutions modify the ERC20 token standard contract which I am not sure if that is good practice.
I can see how this could be a common issue devs run into. Should I implement one of the above solutions even though it changes the standard contract? If not, then how should I solve it?