Search code examples
soliditychainlinkchainlink-keepers

Chainlink VRF v1 Error Message: Below Paid Agreement


I've set up a smart contract lottery using the vrf. I ran it on testnet and it was fine. I then deployed on mainnet, and passed through the values as referenced here

:https://docs.chain.link/vrf/v1/supported-networks#ethereum-mainnet

Item Value LINK Token 0x514910771AF9Ca656af840dff83E8264EcF986CA

VRF Coordinator 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952

Key Hash 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445

Fee 2 LINK - initial fees on Ethereum are meant to cover the highest gas cost prices.

The conditions for the lottery to begin have been met on main net, similar to when on testnet when it executed flawlessly in a variety of scenarios. The contract has been funded with more than enough link, and yet when I review the revert/lack of execution in tenderly I get the following:

Status: Failed Error Reason: Below agreed payment

Any ideas? I know someone had a seemingly similar issue on rinkeby, but it was not entirely clear how they resolved theirs. Is this something that can be resolved by manually calling the start lottery fun when gas is much lower? is there something re: the vrf that can be done. . . would setting up a subscription and adding the contract address have the vrf pull from the subscription instead and then I could increase the fee?

Any help is appreciated, thanks.

I increased the amount of Link in the smart contract but that has done nothing thus far when I attempt to call the lottery manually.

I also increased the gas limit in MM when manually calling the start lottery function, but nothing so far, again

I am expecting for the vrf to fulfill request randomness and the lottery to pick a winner and distribute the funds to said winner


Solution

  • I noticed that you have set the fee to 2 in the constructor. To ensure proper functionality, update it to "2 * 10 ** 18" instead. Make this change in the code and try again. This adjustment should resolve the issue.

    fee = 2 * 10 ** 18;