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

Allow custom api and explorer urls #169

Closed Mukundan314 closed 2 years ago

Mukundan314 commented 2 years ago

This PR allow specifying custom API and explorer URLs

Sample configuration:

// truffle-config.js

module.exports = {
  networks: {
    development: {
      host: 'localhost',
      port: 8545,
      network_id: '*',
      verify: {
        apiUrl: 'http://localhost:4000/api',
        apiKey: 'TEST_KEY',
        explorerUrl: 'http://localhost:4000/address',
      }
    },
  },
};

Currently a API key needs to be provided even if the block explorer does not need one. Should I make the API key optional?

Mukundan314 commented 2 years ago

Currently getImplementationAddress does not work properly on ganache. This seems to be because ganache does not pad the result of eth_getStorateAt. Should I include the fix for this in this PR or should that be a separate PR?

rkalis commented 2 years ago

Thanks for this PR! Sorry for the delay in response as well. Looks good!

A fix to the ganache issue would be great to include in this PR.

Also, could you add some information about this feature to the README?

Mukundan314 commented 2 years ago

Made the requested changes, it now works with ganache and README has information on how to use this feature

rkalis commented 2 years ago

Thanks! This is great 💪

Will merge + publish soon!