Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can´t run Brownie Console on a Testnet After selfdestruct Contract #1716

Open
zzjose opened this issue Dec 29, 2023 · 1 comment
Open

Can´t run Brownie Console on a Testnet After selfdestruct Contract #1716

zzjose opened this issue Dec 29, 2023 · 1 comment

Comments

@zzjose
Copy link

zzjose commented Dec 29, 2023

Hi, Im am not sure if is a bug but mith be. I am new on programing on vyper and blockchain related

What was wrong?

I am deploying contracts to Bsc Testnet from brownie and until now no problem at all.
However in the last test i deployed the contract and then run a SEF-DESTRUCT FUNCTION on Test-net.
After that i keep done changes on code and wanted to try a new deployment to test.
When i run "brownie console --network bsc-test" i get this error: ContractNotFound: No contract deployed at 0xEeCe0a7EA6636FaA3b6B6276714996eeD398eCEc

This contract can be found on testnet and was selfdestructed, but now i cant deploy more contracts, and dont understand why?
It seems that brownie try to load all my deployments made to testnet and check if they are there, and because contract was selfdestructed it cant be Loaded of contracts.py of brownie.

Flow:

1. Deploy a contract in bsc testnet
2. verify contract on bsc testnet scanner
3. Self destruct the same contract
4. try to run brownie console --network bsc-test to deploy new contract to testnet
5. get this error
: File "C:\Users\josefeio\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie_cli_main_.py", line 64, in main

importlib.import_module(f"brownie._cli.{cmd}").main()

File "C:\Users\josefeio\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie_cli\console.py", line 58, in main
network.connect(CONFIG.argv["network"])
File "C:\Users\josefeio\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\network\main.py", line 55, in connect
p._load_deployments()
File "C:\Users\josefeio\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\project\main.py", line 382, in _load_deployments
contract = ProjectContract(self, build, build_json.stem)
File "C:\Users\josefeio\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\network\contract.py", line 1308, in init
_DeployedContractBase.init(self, address, owner, tx)
File "C:\Users\josefeio\AppData\Local\Programs\Python\Python39\lib\site-packages\brownie\network\contract.py", line 708, in init
raise ContractNotFound(f"No contract deployed at {address}")

@zzjose
Copy link
Author

zzjose commented Dec 29, 2023

Found on documentation "Deleting the build/deployments/ directory will erase all information about deployed contracts".
It solves the problem.
But its remains a question if is a big or no, and if a note can be added to documentation for future similar issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant