deployProxy error

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!!

:1234: 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:

        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:
    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

:computer: 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",

I have solved this problem, and the final solution is to add parameters to the verified command. Like this:
truffle run verify SimpleStorage@0x61C9157A9EfCaf6022243fA65Ef4666ECc9FD3D7 --network rinkeby

1 Like