Hello,
Please see below for packages used:
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.0",
"@nomiclabs/hardhat-waffle": "^2.0.0",
"@openzeppelin/contracts": "^3.2.0",
"@openzeppelin/hardhat-upgrades": "^1.4.1",
"@openzeppelin/upgrades-core": "^1.4.1",
"@typechain/ethers-v5": "^4.0.0",
"@typechain/web3-v1": "^1.0.0",
"@types/chai": "^4.2.14",
"@types/mocha": "^8.0.4",
"@types/node": "^14.14.8",
"@types/web3": "^1.2.2",
"chai": "^4.2.0",
"concurrently": "^5.3.0",
"dotenv": "^8.2.0",
"ethereum-waffle": "^3.2.0",
"ethers": "^5.0.0",
"hardhat": "^2.0.3",
"hardhat-gas-reporter": "^1.0.1",
"hardhat-typechain": "^0.3.3",
"husky": "^4.3.0",
"lint-staged": "^10.5.1",
"mocha": "^8.2.1",
"moment": "^2.29.1",
"prettier": "^2.1.2",
"pretty-quick": "^3.1.0",
"ts-generator": "^0.1.1",
"ts-node": "^9.0.0",
"typechain": "^4.0.0",
"typescript": "^4.0.5",
"web3-utils": "^1.3.0"
}
Today I deployed 5 smart contracts to the mainnet, each with its own proxy. I used the following methods:
await upgrades.deployProxy(await ethers.getContractFactory(CONTRACT_NAME_HERE))
When I went to verify the byte code on etherscan I was NOT met with the usual:
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x343a1cae36b1ca047b24fc2780869dc2c1b84137
Instead I was met with:
Note: We also found another 5 contracts with exact matching byte codes
Upon further digging, the byte code on etherscan matches the byte code found in the following file:
node_modules/@openzeppelin/upgrades-core/artifacts/AdminUpgradeabilityProxy.json
My theory is as follows:
-
The byte code produced by AdminUpgradeabilityProxy is different from the byte code etherscan looks for
-
Because of above I am not shown that it’s a proxy and thus cannot verify the implementation contract
Questions:
-
Was a different compiler used when AdminUpgradeabilityProxy was compiled to produce AdminUpgradeabilityProxy.json? Here https://etherscan.io/address/0x343a1cae36b1ca047b24fc2780869dc2c1b84137#code it says v0.6.8+commit.0bbfe453 is used.
-
Did the source code and the compiler change?
-
How can this issue be resolved on etherscan?