I have two proxies:
- Root Proxy, this is created during deployment
- Secondary proxies, this is created at start of each transaction, and is initialized with the context of the transaction
Both are OpenZepplin transparent proxies.
The secondary proxy initializer needs to be guarded, such that only the primary proxy can call it. I cannot figure out how the secondary proxy can be aware of the address of the primary proxy?
..And, We want to do this because :
- The secondary proxy is initialized with an array of contract addresses to execute
- delegateCalls are being made in the context of the secondary proxy
- so, we want to be safe against a malicious contract injected into the initializer, which calls a self-destruct, destroying the whole secondary proxy.
any help would be great! :)
We started this analysis after Slither scan gave us this vulnerability on unprotected upgradable contract