I'm getting this error when I try to run my Brownie Python script:

myAwesomeGasLimit = 200000
def enter_for_free():
    account = get_account()
    lottery = Lottery[-1]
    tx = lottery.claimFreeEntry(
        {"from" : account, "gasLimit" : myAwesomeGasLimit}
    print("You successfully entered for free")

And here is the function from the solidity smart contract:

function claimFreeEntry(address _erc721_contract) public {
        require(IERC721(msg.sender).balanceOf(_erc721_contract) > 0, "You are not eligible to play for free");

As you can see there is not much going on, nevertheless I haven't been able to solve it for one hour now. Does anyone know what is wrong?

Exact Error: ValueError: Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.