I’m trying to create a contract A that contains a function fA that call other contract B function fB, passing the msg.sender that initiate the transaction. The idea was to use a simple delegatecall to it,
address(B).delegatecall(signature)
But the contract B is a InitializableImmutableAdminUpgradeabilityProxy, so when the delegate call execution, the context is not reaching the B implementation but the B proxy, and the delegate function is not working, always returns success but assume that is because the fallback.
Is there any way to delegate the call in the contract A to the contract B using the proxy? How can I send the tx to the contract B maintaining the msg.sender that originate the transaction?
You have Contract A and Contract B. Contract B is the proxy.
There should be a Contract C, which is the implementation contract, behind Contract B.
Try the address of the implemented contract. If you need some help with figuring that out, link your contracts on etherscan or bscscan and we can try to help figure out that address.
Yep that's your implementation and if you tried with that address, I'm not sure what to do here. Usually when you call the proxy to do something, it goes automatically to the implementation. So I'm stumped, perhaps someone else can answer that has experience with delegatecall