Closed reddigszymon closed 1 week ago
I will also add links to some of the subscriptions i created. All of them have a "pending request" that never ends for whatever reason.
https://vrf.chain.link/sepolia/11950 https://vrf.chain.link/sepolia/11949 https://vrf.chain.link/sepolia/11948
Okay, so it seems like depositing 3 LINK as it stated in the documentation is way off. After depositing 25 LINK it is working now. If you have a similiar issue and you are sure your code is correct, just try to put more link into the subscription.
Description I am trying to request a random number from VRF V2 on the sepolia testnet. Locally when mocking the work of the coordinator everything worked smoothly. When i deployed my contract to the testnet, the coordinator never responds by calling the fulfillrandomwords function. I can see the subscription being created, funded and the random word request being sent with the correct parameters (i analyzed events). But unfortunately the coordinator never responds with a random number.
Your Environment Solidity version 0.8.4
Basic Information I am using a UUPS pattern with my smart contract. I scouted chainlinks past issues and found the VRFConsumerBaseV2Upgradeable implementation which seemed to work fine locally.
It looks like this:
``
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
abstract contract VRFConsumerBaseV2Upgradeable is Initializable { error OnlyCoordinatorCanFulfill(address have, address want);
}
``
My smart contract looks like this:
`` // SPDX-License-Identifier: MIT pragma solidity ^0.8.4;
import "@chainlink/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import {LinkTokenInterface} from "@chainlink/contracts/src/v0.8/shared/interfaces/LinkTokenInterface.sol"; import "./VRFConsumerBaseV2Upgradeable.sol"; import "./DisputeManagementContract.sol"; import "./VotingContract.sol";
contract DisputeResolution is OwnableUpgradeable, VRFConsumerBaseV2Upgradeable, UUPSUpgradeable { // ============= STRUCTS ============
}
``
Straight away as i deploy the contract i fund it with 3 LINK and call the topUpSubscription function to have enough link to fund the VRF. I can confirm that indeed the coordinator receives the link, as i checked on sepolia etherscan.
Examples of my contract deployed:
https://sepolia.etherscan.io/address/0xA6fE2621935187fFF4172B11587a0E4D677Fd529 https://sepolia.etherscan.io/address/0xBAEec702A34e14329831e37ff345E50E07eeedB0
Steps to Reproduce Call the closeVotingAndRequestVRF function with any serviceId, it will successfully send a request to the coordinator, but the fulfillRandomWords function will never get called.
Additional Information
I spent literally over 2 days on this issue, trying all sort of stuff. Nothing seems to work.