Testing transactions to proxy behind another proxy


I’m testing my upgradeable smart contract and I have noticed that, a call to a function behind 2 proxys is not returning a revert, it returns the success of the second proxy delegated call.

(pass) (pass) (pass) (?)
User call to proxy1 => delegated to implementation => passed proxy2 => fail in implementation

On Etherscan I could see a success. I think It can only see up to the second proxy but not any further.
When testing, I get the same kind of behavior. The only way I can see that these call failed is by looking at the second implementation log on Etherscan. Is there a way around this? I can test most case by calling directly the second proxy but some cases require the caller to be the first proxy.

:computer: Environment

@openzeppelin/contracts-upgradeable”: “^4.0.0”,

"@openzeppelin/hardhat-upgrades": "^1.6.0",

"chai": "^4.3.4",

"ethers": "^5.1.1",

"hardhat": "^2.2.0",

Since this is an Etherscan behavior as well, I guess there this is the behavior to expect. I think it’s worth asking the community how they deal with this?

What kind of proxies are proxy1 and proxy2? Does everything else work normally?

They are the adminUpgradeable Proxy. They do work like they should. But we are unable to make test on the the second proxy when the call go thought the first proxy.

This sounds very weird and I have the feeling there must be something else that is wrong in your code.

Can you try to share code so I can reproduce this issue on my end?

I Moved it to Rinkeby to run further test. The “no revert msg” seem to happen on the main-net fork within Ganache. I will write specific test for this and let you know so you can test is as well.

1 Like