Skip to main content

Truffle Verify

This truffle plugin allows you to automatically verify your smart contracts' source code on Gnosisscan (by Etherscan), straight from the Truffle CLI.

Installation

Install the plugin with npm or yarn

yarn add -D truffle-plugin-verify

Add the plugin to your truffle-config.js file

module.exports = {
/* ... rest of truffle-config */

plugins: ['truffle-plugin-verify']
}

Generate an API Key on your Gnosisscan account.

Add your Gnosisscan API key to your truffle config (make sure to use something like dotenv so you don't commit the api key)

module.exports = {
/* ... rest of truffle-config */

api_keys: {
gnosisscan: 'MY_API_KEY'
}
}