-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verifying diamonds with hardhat etherscan-verify results in error #188
Comments
If you have a repo, that would help But at least put the command you use and give the full console output Thanks |
You can find the repo I'm trying to verify here (https://github.com/oncyberio/factory/tree/verification/packages/contracts), I've taken out the deployment script for the first contract as I'm only trying to deploy & verify the second. I run hardhat etherscan-verify --network rinkeby `
verifying CyberDestinationUtilityFactoryFacet (0x0d84BF4A82DC7771c09c37BAcF5B7DD6a37d50Ae) ... Error: types/values length mismatch (count={"types":2,"values":1}, value={"types":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"components":[{"internalType":"address","name":"owner","type":"address"}],"internalType":"struct Diamond.DiamondArgs","name":"_args","type":"tuple"}],"values":["0xB812f503607Ee2259E9607Cb5E5836B550ac6492"]}, code=INVALID_ARGUMENT, version=abi/5.4.1) |
SO there seems to be 2 different issues As for the error thrown it is due to the number of arguments in the deployment file not matching the number of arguments the constructor expect. it expect 2 argument but only 1 was saved here : https://github.com/oncyberio/factory/blob/65b0ba1be56bc079f61d911b5f78b494143f2cb3/packages/contracts/deployments/rinkeby/DiamondCyberDestinationFactory.json#L887 |
should be fixed in newer version. for existing deployment you can replace the args field with the following:
|
When using etherscan-verify to verify a Diamond contract, the following error gets thrown for the facet
Error: types/values length mismatch (count={"types":2,"values":1}, value={"types":[{"components":[{"internalType":"address","name":"facetAddress","type":"address"},{"internalType":"enum IDiamondCut.FacetCutAction","name":"action","type":"uint8"},{"internalType":"bytes4[]","name":"functionSelectors","type":"bytes4[]"}],"internalType":"struct IDiamondCut.FacetCut[]","name":"_diamondCut","type":"tuple[]"},{"components":[{"internalType":"address","name":"owner","type":"address"}],"internalType":"struct Diamond.DiamondArgs","name":"_args","type":"tuple"}],"values":["0xB812f503607Ee2259E9607Cb5E5836B550ac6492"]}, code=INVALID_ARGUMENT, version=abi/5.4.1) at Logger.makeError (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat-deploy/node_modules/@ethersproject/logger/src.ts/index.ts:225:28) at Logger.throwError (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat-deploy/node_modules/@ethersproject/logger/src.ts/index.ts:237:20) at AbiCoder.encode (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat-deploy/node_modules/@ethersproject/abi/src.ts/abi-coder.ts:102:20) at submit (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat-deploy/src/etherscan.ts:308:12) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Object.submitSources (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat-deploy/src/etherscan.ts:425:5) at async SimpleTaskDefinition.action (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat-deploy/src/index.ts:774:5) at async Environment._runTaskDefinition (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14) at async Environment.run (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14) at async main (/Users/rayan/Documents/Cyber/Tech/factory/packages/contracts/node_modules/hardhat/src/internal/cli/cli.ts:197:5) { reason: 'types/values length mismatch', code: 'INVALID_ARGUMENT', count: { types: 2, values: 1 }, value: { types: [ [Object], [Object] ], values: [ '0xB812f503607Ee2259E9607Cb5E5836B550ac6492' ] } }
The text was updated successfully, but these errors were encountered: