2
from brownie import AdvancedCollectible, accounts, config, network
from scripts.helpful_scripts import get_breed
import time

static_seed = 123

def main():
    dev = accounts.add(config["wallets"]["from_key"])
    advanced_collectible = AdvancedCollectible[len(AdvancedCollectible) - 1]
    transaction = advanced_collectible.createCollectible(static_seed, "None", {"from": dev})
    print("Waiting on second transaction...")
    # wait for the 2nd transaction
    transaction.wait(1)
    requestId = transaction.events["requestedCollectible"]["requestId"]
    token_id = advanced_collectible.requestIdToTokenId(requestId)
    time.sleep(35)
    breed = get_breed(advanced_collectible.tokenIdToBreed(token_id))
    print("Dragotherium breed of tokenId {} is {}".format(token_id, breed))

Error:

Error : Running 'scripts\advanced_collectible\create_collectible.py::main'...
  File "C:\Users\SM\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\_cli\run.py", line 49, in main
    return_value, frame = run(
  File "C:\Users\SM\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\project\scripts.py", line 103, in run
    return_value = f_locals[method_name](*args, **kwargs)
  File ".\scripts\advanced_collectible\create_collectible.py", line 10, in main
    transaction = advanced_collectible.createCollectible(static_seed, "None", {"from": dev})
  File "C:\Users\SM\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\contract.py", line 1693, in __call__
    return self.transact(*args)
  File "C:\Users\SM\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\contract.py", line 1566, in transact
    return tx["from"].transfer(
  File "C:\Users\SM\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\account.py", line 642, in transfer
    receipt, exc = self._make_transaction(
  File "C:\Users\SM\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\network\account.py", line 725, in _make_transaction
    raise VirtualMachineError(e) from None
  File "C:\Users\SM\AppData\Local\Programs\Python\Python310\lib\site-packages\brownie\exceptions.py", line 121, 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.  
2
  • Did you run the fund with link script? Nov 30, 2021 at 16:33
  • Did you ever get this resolved? I am having the exact same issue.
    – Peter
    Jan 27 at 4:19

2 Answers 2

1

I think this has already been answered here. To summarize it, you probably have vrf_coordinator version error. Try the rinkeby's values from the official docs. Try changing values in the config.yaml.

vrf_coordinator:'0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B'
link_token: '0x01BE23585060835E02B77ef475b0Cc51aA1e0709' keyhash:'0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311'

0

Try this on a dev net (do not do this on main-net):

....
# arbitrary gasLimit amount...
myAwesomeGasLimit = 50000 

transaction = advanced_collectible.createCollectible(
                    static_seed, 
                    "None", 
                    {"from": dev, "gasLimit": myAwesomeGasLimit}
               )
....
 

If it works then it's an issue w/ your gasLimit. To narrow it down, try also playing with the other "parameters of a typical Eth transaction" :

reference doc'n:

Parameters of a typical Ethereum transaction

from: The sender address, a 20-byte address representing the account initiating the transaction. ...... ......

gasLimit: This is the maximum amount in wei that a transaction can use as gas.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.