Is there any way to verify with oz command line. I’ve tried with npx oz verify but look like it doesn’t work. I couldn’t get symbol(), totalSupply() as well as other functions.
Here is step by step what i did with oz command line.
$ npx oz create
The create command is deprecated. Use deploy instead.
Nothing to compile, all contracts are up to date.
? Pick a contract to instantiate TOKENERC20UpgradeSafe
? Pick a network ropsten
✓ Linked dependency @openzeppelin/contracts-ethereum-package 3.0.0
✓ Contract TOKENERC20UpgradeSafe deployed
All implementations have been deployed
? Call a function to initialize the instance after creating it? Yes
? Select which function * initialize(escrow: address)
? escrow: address: 0xDc63C389e72d9f803f5c8fDe241A11e66E8D6531
✓ Setting everything up to create contract instances
✓ Instance created at 0xDb050b5eb8232e9f61694BA7c553A141712CE5cE
To upgrade this instance run 'oz upgrade'
0xDb050b5eb8232e9f61694BA7c553A141712CE5cE
$ npx oz verify
? Pick a network ropsten
? Was your contract compiled with optimizations enabled? No
? Choose a remote endpoint etherscan
? Enter your Etherscan API key (get one at https://etherscan.io/myapikey) EtherscanKey
? Pick a contract to verify TOKENERC20UpgradeSafe
(node:36046) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:36046) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
✓ Contract source code of TOKENERC20UpgradeSafe verified and published successfully. You can check it here: https://ropsten.etherscan.io/address/0x5c1cc30CaCF74d29052cb37C9Fb952F7269E7760#code
No, not yet. I’ve tried with hardhat. but it shows the error something like the contract code mismatch with a deployed address. I will show you the detailed steps that I did with hardhat soon
If you can share the error, I may be able to guide you.
If you get stuck verifying, you can post your address, Solidity code, parameters and whether optimization was enabled and someone may be able to help you verify.
Finally, I can verify the code with hardhat configuration. but it has another issue. it seems that etherescan couldn’t read the state data when i 've tried to read name, symbol, decimals of token contract.
$ npx hardhat verify --network ropsten 0xd859864F6c88f45b2831c25092798d91Bd91028b
Successfully submitted source code for contract
contracts/QUOCERC20.sol:QUOCERC20UpgradeSafe at 0xd859864F6c88f45b2831c25092798d91Bd91028b
for verification on Etherscan. Waiting for verification result…
Successfully verified contract QUOCERC20UpgradeSafe on Etherscan