smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.83k stars 2.91k forks source link

Cannot verify source code #1273

Open babe8901 opened 2 years ago

babe8901 commented 2 years ago

Cannot verify source code using publish_source on ftm-test, arbitrum-test and aurora-test networks. Waiting for https://testnet.ftmscan.com/api to process contract... File "C:\Users\lucky\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\_cli\run.py", line 51, in main return_value, frame = run( File "C:\Users\lucky\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\project\scripts.py", line 103, in run return_value = f_locals[method_name](*args, **kwargs) File "\Users\lucky\Desktop\Investing\Courses\Solidity\demos\upgrades\scripts\deploy_and_upgrade.py", line 70, in main else BoxV2.deploy( File "C:\Users\lucky\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\contract.py", line 532, in __call__ return tx["from"].deploy( File "C:\Users\lucky\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\account.py", line 557, in deploy contract.publish_source(deployed_contract, silent=silent) File "C:\Users\lucky\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\contract.py", line 433, in publish_source raise ValueError(f"Failed to submit verification request: {data['result']}") ValueError: Failed to submit verification request: Error!

cromewar commented 2 years ago

The flag verify = true just works on etherscan if you have the private key, this does not work with arbitrum as far as I know.

babe8901 commented 2 years ago

@cromewar I checked the documentation, it works for etherscan, snowtrace(AVALANCHE), bscscan(BINANCE), polygonscan(MATIC), ftmscan(FANTOM), arbiscan and aurorascan. I can verify source for the first four but not the last three.

cromewar commented 2 years ago

Interesting, do you have an API key for those networks ?

babe8901 commented 2 years ago

Yes, I made them by going to the explorer websites of the respective chains. You can save them by these names in the .env file: ETHERSCAN_TOKEN, BSCSCAN_TOKEN, POLYGONSCAN_TOKEN, FTMSCAN_TOKEN, ARBISCAN_TOKEN, SNOWTRACE_TOKEN, AURORASCAN_TOKEN.

edit: I am using Brownie for my project.

cromewar commented 2 years ago

Didn't know that last I tried it didn't work for me, I'll do more research on this