Verifying already compiled upgradable proxy contracts on other chains

Attempting to verify a proxy contract (TransparentUpgradeableProxy) based on deployment logs) in polygon mumbai testnet chain explorer: https://explorer-mumbai.maticvigil.com

:computer: Environment
Using Truffle with following package versions:

    "@openzeppelin/contracts": "^3.4.0",
    "@openzeppelin/contracts-upgradeable": "^3.4.0",
    "@openzeppelin/truffle-upgrades": "^1.7.0",
    "truffle": "^5.3.7"

The reason for using older versions is consistency between all our contacts, we’re not ready to migrate to latest versions yet

:memo:Details
Verifying requires full Solidity code (I could not find TransparentUpgradeableProxy, I was only able to locate AdminUpgradeabilityProxy and flatten that.
Additionally I will need compiler details which are not available in the JSON files of the upgrade package, proxy contracts come pre-compiled

Are you able to provide details on where to locate sol files for the deployed proxy contracts and which compiler versions are used to create them?

:1234: Code to reproduce
Create a truffle project with above dependencies, deploy any contract as an upgradable (Initializable), and attempt to verify the proxy contract on Mumbai testnet

Unfortunately this process is fairly tedious and I wish they did not require sol code, realistically ABI should be all that is needed to interface with a contract

1 Like

For more context see my previous comments about Mumbai in: Help me to verifying proxy contract in Mumbai Testnet Network

The proxy contracts are taken from OpenZeppelin Contracts 4.1.0.

The compiler was 0.8.2 and settings are found in hardhat.config.js.

Here is the Solidity standard JSON input that was used to compile the proxies:
input.json

Thanks, I had reviewed that thread, it was mostly regarding a newer contract version than the one we are using. We are using v3.4.0. The sol files have compiler restriction on ^5.0.0, however I was still unable to find a matching compiler version or the sol files for TransparentUpgradeableProxy.

Your direct dependency being v3.4.0 has no effect on the proxies that the plugins are deploying, because they have their own dependency on the contracts:

1 Like

I see, my mistake there, I assumed it’ll use the installed contract versions. That clears things up. I managed to find and flatten the contracts from the 4.1.0. Last piece seems to be constructor arguments. I can see address _logic, address admin_, bytes memory _data in the contract, however unsure what the _data would be. (I also assumed admin address is the ProxyAdmin contract address)

Yeah, you are right,

_logic ---- >> implementation contract
_admin ---- >> proxyAdmin contract
_data ---- >> This is a optional parameter, if you want to call one function when deploy contract, such as initialize(), you can use this parameter to do. And if you do not want to do anything, this parameter should be empty 0x

1 Like