I'm trying to make a transaction to create an NFT collectible and the transaction gets reverted with the message: Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually. when I add the max gas limit it stills revert.
I had the same issue. After 2 hours lost I found the problem. I was using the wrong version of vrf coordinator. As you can see on the following, I was viewing the VRF v2 guide but my code was using the vrf v1 and thus I was using the wrong contract address and keyhash. In order to fix it, I clicked on VRF v1 guide, and I retrieved the contract address and keyhash from there. Now it is working. https://docs.chain.link/docs/vrf-contracts/
If you have enough funds for gas, then probably there's issue with the function that you call. That function seems to fall so there's the gas estimation failed message as you see.
The following setting in brownie-config.yaml worked for me:
settings:
gas_limit: "100000000000"
I had no problem after I set gasPrice to 100000000000000000 (I picked any random value).
creating_tx = advanced_collectible.createCollectible({"from": account, "gasPrice": 100000000000000000})
Another reason why the issue you're experiencing may be happening is the lack of funds. Ensure that you have enough ETH and LINK in your wallet. Both can be obtained from the ChainLink faucet.
The author must have changed the title of the qestion? "allow_revert" is a parameter which brownie recognizes (follow the error code and see the '...brownie\network\account.py' folder ~ lines 600-750. So you can include it in a transaction, e.g.
reqeustRandomWord(...,{"from": account, "gas_limit": 3000000, "allow_revert": True}))
Unfortunately what you'll likely find in response (should it revert) is something like
Accessing `TransactionReceipt.revert_msg` on a reverted transaction requires the `debug_traceTransaction` RPC endpoint, but the node client does not support it or has not made it available.
So its a node provider problem not a brownie problem. For a long time I was frustrated with brownie because it hid specified revert messages which makes debugging very difficult. As I understand it infura does not return specific revert messages. I think Alchemy does but have yet to find a way to configure brownie to use alchemy as a node provider....
© 2022 - 2024 — McMap. All rights reserved.