Generate flattened version of AdminUpgradeabilityProxy.sol?

I’m using “@openzeppelin/truffle-upgrades”: “^1.2.5” and it seems there’s no easy way to verify the contract on the etherscan (it’s done automatically on mainnet, but not on goerli testnet).

I tried to copy the source code manually with many different versions, but none of them worked (always with a different byte code)

Is there any way I can generate a flattened version of AdminUpgradeabilityProxy.sol?
I tried like: truffle-flattener node_modules/@openzeppelin/upgrades-core/contracts/AdminUpgradeabilityProxy.sol but it seems there’s only JSON version in the package (no solidity source file)

1 Like

Hi @sydneyitguy,

Welcome to the community :wave:

I recommend not flattening contracts for verification. It makes them harder to read and imports and licenses are removed.

I used the following method to verify (yesterday I used similar with Hardhat) Verify Upgrades Plugins proxy on Etherscan

If you get stuck I can verify next week when I am back in the office.

Hi @sydneyitguy,

Were you able to verify?

no success yet… I’m using truffle, and it seems truffle-plugin-verify doesn’t work well with truffle-upgrades.

The AdminUpgradeabilityProxy is deployed on

and its implementation is here: 0xBD7B355002163d555bE4482a392A501A3253EBD9

and the project is open-sourced on

it would be great if you can have a look.

1 Like

Hi @sydneyitguy,

Truffle Plugin Verify works with contracts deployed by Truffle. For verifying the Proxy and the ProxyAdmin I would use the Hardhat Etherscan plugin.

I will verify when I am back in the office tomorrow.

1 Like