rkalis / truffle-plugin-verify

✅ Verify your smart contracts on Etherscan from the Truffle CLI
https://kalis.me/verify-truffle-smart-contracts-etherscan/
MIT License
467 stars 130 forks source link

How to force empty constructor args? #158

Closed convexman closed 2 years ago

convexman commented 2 years ago

Describe the feature

If I call npx truffle run verify MyContract --forceConstructorArgs string: --network mainnet --debug my override is not taken into account. This is happening because of following line, since empty string is falsey.

const encodedConstructorArgs = options.forceConstructorArgs || await fetchConstructorValues(artifact, options)

I want to be able to force empty constructor args. Maybe add separate flag for this?

rkalis commented 2 years ago

Thanks for the bug report and for finding the cause as well. I updated that code so that you can pass an empty string as constructor args and published it in v0.5.24.