Is there any way to check if a contract is OZ's UUPSProxy ?
I let users to deploy the contracts by themselves in my framework, meaning that they might make a mistake or something and deploy the contract directly or with other proxies.
What's the good way of checking in solidity that the contract they deployed is actually UUPSProxy ?
One way I could find is:
try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
But this seems problematic.
Reason: Instead of having newImplementation
which is a new logic contract, i only have acces to the proxy contract and because of this, I can't call proxiableUUID
as it's protected by notDelegated
call.
What would be the safe way to detect/figure this out ?