0

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?

Pearl
  • 392
  • 2
  • 12

2 Answers2

0

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

  • Any luck with this? To bad brownie wouldnt flatten the file if you wanted as could just verify with that source code. For now I am manually creating the flattened file. I do not understand what you are doing with the json in the github answer? – Pearl Mar 31 '22 at 00:45
  • the json file can be directly uploaded in the code verification dialog of the blockchain explorer. – matthiaszimmermann Apr 01 '22 at 06:56
0

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

Ganesh sali
  • 116
  • 1
  • 5