Closed SiKi02 closed 2 years ago
What happens when you git clone the repo and try to run it from the start?
Sorry Patrick, I'm barely learning how to use everything in this world. Should I git clone this repo or should I make a repo with my code, clone it and then running it again?
thanks!
Ah sorry, yes git clone this repo (my code) and see if you still get this error.
Basically, let's isolate where the issue is. We want to rule out whether or not it's an issue with the code I wrote, or a simple mistake somewhere.
Hi Patrick, been trying to work on the repo and now I get this error.
brownie run scripts/advanced_collectible/create_collectible.py --network rinkeby Brownie v1.18.2 - Python development framework for Ethereum
NftMixProject is the active project.
Running 'scripts/advanced_collectible/create_collectible.py::main'...
File "brownie/_cli/run.py", line 51, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 110, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/advanced_collectible/create_collectible.py", line 9, in main
advanced_collectible = AdvancedCollectible[len(AdvancedCollectible) - 1]
File "brownie/network/contract.py", line 192, in __getitem__
return self._contracts[i]
IndexError: list index out of range
I thought i needed to compile first the advancedcollectible.sol contract, but it didn't work.
Hi once again Patrick, I found my mistake while deploying your repo. I didn't deploy and fund before running the create collectible.py. After doing that I get the same error as my code above. Look.
brownie run scripts/advanced_collectible/deploy_advanced.py --network rinkeby
Brownie v1.18.2 - Python development framework for Ethereum
NftMixProject is the active project.
Running 'scripts/advanced_collectible/deploy_advanced.py::main'...
rinkeby
Transaction sent: 0x63ff69a87f3327b8e73335b36a7bc8c0f1bdf5ef734c8631f976682388e0403c
Gas price: 1.099995462 gwei Gas limit: 2559546 Nonce: 92
AdvancedCollectible.constructor confirmed Block: 10989825 Gas used: 2326860 (90.91%)
AdvancedCollectible deployed at: 0xe9Da9A3329B3ac935EdcC517bf708fF766aA10F5
Transaction sent: 0x56679025bd6983773d4a819de6e634e66d83b979fa200f7f4897d9531fbe7561
Gas price: 1.099995462 gwei Gas limit: 56992 Nonce: 93
LinkToken.transfer confirmed Block: 10989826 Gas used: 51811 (90.91%)
Funded 0xe9Da9A3329B3ac935EdcC517bf708fF766aA10F5
------------
export IPFS_URL=http://127.0.0.1:5001
------------
brownie run scripts/advanced_collectible/fund_collectible.py --network rinkeby
Brownie v1.18.2 - Python development framework for Ethereum
NftMixProject is the active project.
Running 'scripts/advanced_collectible/fund_collectible.py::main'...
Transaction sent: 0x4a486da75ff30ec0ee1753485f04e699b847b34f6aaa4e59dd42abd3e87491ff
Gas price: 1.099995462 gwei Gas limit: 38182 Nonce: 94
LinkToken.transfer confirmed Block: 10989830 Gas used: 34711 (90.91%)
Funded 0xe9Da9A3329B3ac935EdcC517bf708fF766aA10F5
---------
brownie run scripts/advanced_collectible/create_collectible.py --network rinkeby
Brownie v1.18.2 - Python development framework for Ethereum
NftMixProject is the active project.
Running 'scripts/advanced_collectible/create_collectible.py::main'...
Transaction sent: 0xe908dd75386d1aa71437e2d5f82f8d6c846c34ec1ec5bb3c900bbb228638faf0
Gas price: 1.099995461 gwei Gas limit: 38182 Nonce: 95
LinkToken.transfer confirmed Block: 10989835 Gas used: 34711 (90.91%)
Funded 0xe9Da9A3329B3ac935EdcC517bf708fF766aA10F5
File "brownie/_cli/run.py", line 51, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 110, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/advanced_collectible/create_collectible.py", line 11, in main
transaction = advanced_collectible.createCollectible("None", {"from": dev})
File "brownie/network/contract.py", line 1861, in __call__
return self.transact(*args)
File "brownie/network/contract.py", line 1734, in transact
return tx["from"].transfer(
File "brownie/network/account.py", line 644, in transfer
receipt, exc = self._make_transaction(
File "brownie/network/account.py", line 727, in _make_transaction
raise VirtualMachineError(e) from None
File "brownie/exceptions.py", line 93, in __init__
raise ValueError(str(exc)) from None
ValueError: Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.
Hi @PatrickAlphaC ! Could you find the answer to the problem?
Please start from scratch and let me know on what step you get the error:
Clone this repo
brownie bake nft-mix
cd nft
Add your environment variables to the .env
file:
export WEB3_INFURA_PROJECT_ID=<PROJECT_ID>
export PRIVATE_KEY=<PRIVATE_KEY>
brownie run scripts/advanced_collectible/deploy_advanced.py --network rinkeby
brownie run scripts/advanced_collectible/fund_collectible.py --network rinkeby
brownie run scripts/advanced_collectible/create_collectible.py --network rinkeby
Wait a few minutes, then run:
brownie run scripts/advanced_collectible/create_metadata.py --network rinkeby
brownie run scripts/advanced_collectible/set_tokenuri.py --network rinkeby
Hi @PatrickAlphaC Good Night. I succesfully clone the repo and runned all the command lines on my terminal with success.
Nevertheless I still get a problem with my orginal code which is the one of your youtube video. https://www.youtube.com/watch?v=p36tXHX1JD8 1:22:30
When I deploy the createcollectible.py I get this error:
Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.
Here is my code for the create_collectible.py file.
from brownie import AdvancedCollectible, accounts, config
from scripts.helpful_scripts import get_breed
import time
def main():
dev = accounts.add(config['wallets']['from_key'])
advanced_collectible = AdvancedCollectible[len(AdvancedCollectible) - 1]
transaction = advanced_collectible.createCollectible("None", {'from': dev},)
transaction.wait(1)
time.sleep(35)
requestId = transaction.events['RequestedCollectible']['requestID']
token_id = advanced_collectible.requestIDToTokenID(requestId)
breed = get_breed(advanced_collectible.tokenIDToBreed(token_id))
print('Dog breed of token ID {} is {}'.format(token_id, breed))
You can note that you have the STATIC_SEED VARIABLE in this part of the video, when I deploy it like that I get the following error:
createCollectible Sequence has incorrect length, expected 1 but got 2
Which I think is because I give "None" and STATIC_SEED as parameters when the function in the contract only accepts one.
Thanks.
Ahhh, yes. This is outdated, the code in the repo is correct, the video is incorrect. Thanks for finding this!
Error: Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.
Helpful_scripts.py
AdvancedCollectible.sol
Create_collectible.py
Brownie-config.yaml
Complete error tab:
Thanks people!