How to verify a contract on Avalanche testnet using Brownie

674 views Asked by At

I am trying deploy and verify a contract using brownie on avalanche testnet.

The contract deploys and verifies fine on kovan. It deploys on avalanche testnet but I cannot get it verified.

The default brownie does not come with an explorer for avax testnet(kept getting explorer error) so I tried to add it.

I have tried variations of the testnet.snowtrace.io and they all give connection error except:

https://testnet.snowtrace.io/api - gives valueerror: error

I am using export SNOWTRACE_TOKEN= as per the documentation for avalanche and obtained an API key from https://snowtrace.io

Any idea IF and how this can be accomplished?

2

There are 2 answers

2
matthiaszimmermann On

this does not seem to work on avax-test, using manual workaround so far ... https://github.com/eth-brownie/brownie/issues/1417

0
Ganesh sali On

Actually by default brownie "avax-test" network doesn't have set explorer field, So we have to set it manually by running below command,

brownie networks modify avax-test explorer=https://api-testnet.snowtrace.io/api

And you will able to verify contract.

Don't forget to add env variable, SNOWTRACE_TOKEN=YOUR_TOKEN