When I deploy an upgradeable contract on the mainnet, I am using @openzeppelin/truffle-upgrades, an error is thrown at the end of the deployment, but when I go to etherscan at this time, proxy, proxyAdmin, LogicContract are all Deployment was successful. But when I go to verify the error, "Cannot read properties of undefined (reading 'address')."
Later, I used etherscan to manually verify the logic contract, but now the etherscan contract does not display properly, and the buttons "Read as Proxy" and "White as Proxy" cannot appear on the proxy contract page.
Can anyone help me, this problem has been bothering me for a long time, and it is on the mainnet, thank you very much!!
Code to reproduce
1. deploy code:
await deployProxy(MyContractName, [multiSign],
{ deployer, initializer: 'initialize', overwrite: true });
2. The error thrown at the end of deployment is:
/Users/MyProject/node_modules/eth-block-tracker/src/polling.js:51
const newErr = new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${err.stack}`)
^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
undefined
at PollingBlockTracker._performSync (/Users/henry/solProject/kyoko-pawn/node_modules/eth-block-tracker/src/polling.js:51:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
3. verify contract code:
truffle run verify MyContractName --network mainnet
Environment
"@openzeppelin/truffle-upgrades": "^1.11.0",
"truffle-plugin-verify": "^0.5.20"
"@openzeppelin/contracts": "^4.4.2",
"@openzeppelin/contracts-upgradeable": "^4.4.1",
"@truffle/hdwallet-provider": "^2.0.0",
"truffle": "^5.4.28",