Closed elenadimitrova closed 3 years ago
Hey @elenadimitrova, I somehow missed this report. Sorry about that.
I took a look at your repository, but it's a bit more complicated than most Truffle projects, so could you provide me with some instructions on what to run to compile + deploy your contracts to a testnet, then I'll try to look into this.
@rkalis to reproduce, please use the migrate-to-truffle
branch here https://github.com/argentlabs/argent-contracts/tree/experiment/migrate-to-truffle
Run npm run cc
to compile everything. Since we are not using truffle migrations we need to pass the contract addresses explicitly:
npx truffle run verify ApprovedTransfer@0x2d5186B00eE04d7ca6DBf3E3E07ce6003DFFEF2B --network test --debug
This currently produces the following error
Fail - Unable to verify
Failed to verify 1 contract(s): ApprovedTransfer@0x2d5186B00eE04d7ca6DBf3E3E07ce6003DFFEF2B
Hey @elenadimitrova, I managed to verify the contract manually, and I think I tracked down the issue in the plugin. Do you have another deployed contract name + address that I can use to test it further, since I verified ApprovedTransfer@0x2d5186B00eE04d7ca6DBf3E3E07ce6003DFFEF2B
manually through the form.
Thanks for your help @rkalis , please use the following:
WalletFactory@0x31301b8ab26814a40a24128ee1d984fbd66c6992
CompoundRegistry@0xbfad9acd0d1529cec09d15896d873e46928f19df
BaseWallet@0xa1832b5d79bdbba645fd6969275ee1c6cf503e99
MakerV2Manager@0x9efcd441bd4d1d25f066347dfa1f33214a741080
I can provide more if needed.
Alright, looks like I've been able to fix the bug that caused this, I've been able to verify WalletFactory, BaseWallet and MakerV2Manager using the plugin locally. I haven't published the new version though.
I wasn't able to verify CompoundRegistry, but it's because of some different reason that I haven't been able to figure out. It is the only one of the 4 that you listed that uses 0.5.4 rather than 0.6.12. Is there anything special about your deployment settings for the 0.5 contracts as opposed to the 0.6 contracts?
There are nine different groups of contracts compiled differently. The contracts group CompoundRegistry
lives in has the following compilation settings configured https://github.com/argentlabs/argent-contracts/blob/cf7e41fa6e9e9f2bd4ff6be464173030884f4098/truffle-config-infrastructure-0.5.js#L7
Although I am not too worried about verifying the 0.5 contracts as those are legacy and verified and will likely never be redeployed and verified again. Still here are some other 0.5 based examples you can try with to be sure it's a problem with that solc version:
ModuleRegistry@0xfe0a3ea221de42612bd6782bbba0c71feb20dc29
ArgentENSResolver@0x728ce7265872f12139cac55906cd7cbbcbec5f3a
I tried those contracts and they also both failed, so it does appear to be related to that somehow. If you're not too concerned with verifying the 0.5 contracts, I'll publish the bug-fix to a new version of the plugin, so you can try it out with the 0.6 contracts.
I just published truffle-plugin-verify@0.5.2
, which includes the fix to the first issue. Let me know if you still encounter issues with different contracts when using this version.
Thanks @rkalis that solves this issue 🎉 . Closing now.
So you mean to call the verification as a JS function?
I've never done it before, but I suppose you could require the plugin and then call the exported function, but you'd need to pass in the contract
parameter into the function somehow.
const verifyContracts = require('truffle-plugin-verify');
// Get the current truffle config from truffle
const config = ...;
// Add truffle-plugin-verify specific config parameters
config._ = ['verify', 'ContractName1', 'ContractName2', ...];
config.network_id = 3; // ropsten
// Verify contracts
verifyContracts(config);
Note that the function can make process.exit() calls if something goes wrong, and it logs results to stdout/stderr (and doesn't return anything). It should be possible to update the plugin so that it has more first-class support for this kind of workflow, but currently it's kind of convoluted.
I have added the plugin to my truffle setup here https://github.com/argentlabs/argent-contracts/pull/146/commits/54d619e5585814ec9bcabb0f5a5eb20b375e5200 Running verification for two different contracts produces the same issue. Example below is the output for
GuardianStorage
validationWhen checking on the EtherScan API the result for the above verification request I get:
I haven't been able to get anything more descriptive than that error and I have been able to verify that contract (on a different network) manually. Any help is appreciated.