Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [chainlink-vrf]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

Error while calling "requestRandomWords" function while implementing Chainlink VRF mock contract on local Remix environment

I've followed this tutorial, but when I tried to call function RandomNumberConsumerV2.requestRandomWords, I got the following error: [vm]from: 0x5B3...eddC4to: RandomNumberConsumerV2....
rebwar's user avatar
  • 3
0 votes
2 answers
44 views

Does Remix need to be deployed every time code changes are made?

I am writing Solidity code in Remix (creating a VRF with Chainlink) and every time I make changes, I deploy using my subscriptionID, and then call functions under Deployed/Unpinned Contracts. This is ...
matta's user avatar
  • 17
0 votes
1 answer
41 views

How to implement Chainlink VRFv2 with Upgradeable Transparent Proxy smart contract?

I'm trying to implement Chainlink VRFv2 with my upgradeable smart contract, and none of the versions seem to work. Although I'm able to deploy the proxy correctly, when I'm trying to call function ...
BlackH3art's user avatar
1 vote
0 answers
20 views

Chainlink VRF on Arbitrum Sepolia fork: requestRandomWords Failing

I am going through the Foundry Course by Patrick Collins (@Big Shoutout) and I have just completed the section on creating the Raffle. I deployed the Raffle successfully on Eth Sepolia and created the ...
Charlie Mack's user avatar
2 votes
0 answers
45 views

How to mock vrf random number in foundry/solidity

My smart contract is basically like a casino with a coinflip game. 50% of the time, you double your money, the other 50% you lose your bet and the contract keeps it. I've managed to unit test the ...
Edsard Grisel 's user avatar
0 votes
1 answer
26 views

How to get the hash of the Fulfill Random Words transaction (callback) that gets mined after calling the Chainlink's VRF?

I have the hash of the transaction that called Chainlink's VRF but I need to get the hash of the callback transaction that gets executed after the RandomWordsRequested event is fulfilled. How do I do ...
Falcon Stakepool's user avatar
1 vote
0 answers
64 views

How to Implement Chainlink VRF into EIP2535 Standard Contract

I'm currently working on a smart contract that involves using Chainlink VRF (Verifiable Random Function) through a Diamond contract. My contract structure includes a performUpkeep function, which ...
PraveenMatheesha's user avatar
0 votes
0 answers
27 views

Error: cannot estimate gas; transaction may fail or may require manual gas limit,reason="execution reverted"

$ yarn hardhat run scripts/mockOffChain.js --network goerli yarn run v1.22.19 warning package.json: No license field $ '/home/rajvir_singh/FCC Full stack Web3 course/Hardhat Lottery L9/node_modules/....
Rajvir Singh's user avatar
0 votes
0 answers
13 views

Calling a function inside a contract using hardhat deploy scripts

I'm writing a dice betting game which uses Chainlink VRF V2 to get random numbers for the dices. I'm trying to deploy the VRF V2 Mock and then create a subscription and add My currently deployed ...
Rjey's user avatar
  • 17
0 votes
1 answer
52 views

Cannot read properties of undefined (reading 'checkUpkeep')

mockOffChain.js const { ethers, network } = require("hardhat") async function mockKeepers() { // const raffle = await ethers.getContractAt("Raffle") const contractAddress =...
Rajvir Singh's user avatar
0 votes
0 answers
25 views

VRF v2 for makeing randomnes number

I am trying to write a contract that generates a randomness number for some users who are going to mine (digging) in my game, and by chance one of them may find the random number and mine it and win ...
Helia Marami's user avatar
0 votes
2 answers
76 views

VRFCoordinatorV2Mock.createSubscription is not a function contract error

const { network, ethers } = require("hardhat") const { developmentChain } = require("../helper-hardhat-config") const { networkConfig } = require("../helper-hardhat-config&...
Rajvir Singh's user avatar
0 votes
0 answers
16 views

Brownie Request for Random number (Mock VRF) reverts

Using chainlink tutorial and concept for testing a random request locally, Request Randomness fails to execute in brownie for VRFCoordinatorV2Mock, however, I tested the same code in remix IDE and it ...
Obanla Andrew's user avatar
0 votes
0 answers
25 views

VRFV2Wrapper::onTokenTransfer reverts, although it shouldnt

I'm trying to test a contract "BrewBurner" which inherits VRFV2WrapperConsumerBase and should receive a a callback to the fulfillRandomWords() function. I deploy all the contracts on the ...
itsPinkDev's user avatar
0 votes
1 answer
16 views

How to guarantee or ensure uniqueness based on Chainlink VRF?

I am using Chainlink VRF V2 to generate 10 random numbers. Assuming VRF generated something like this below. [ 111.., 222.., 333.., 444.., 555.. 666.., 777.., 888.., 999.., 000..] As best practice to ...
Jake Tawagon's user avatar
1 vote
0 answers
72 views

ChainLink VRF requestRandomnes() failing

Here is the txn on sepolia: https://sepolia.etherscan.io/tx/0xb530e49bb505fad002923e957d784a4fa18084b65d79eabd4fc29b326a7e797e Given below is the Factory contract that deploys a Raffle contract. ...
ASLAM's user avatar
  • 11
1 vote
0 answers
67 views

Chainlink performUpkeep not being executed

I am trying to implement a decentralized raffle that works with custom tokens and randomly select the winner using chainlink automated keepers. I selected a time-based keeper so that "...
yksooh's user avatar
  • 11
0 votes
1 answer
26 views

Restricting External Adapter Access to a Specific Smart Contract: Is it Feasible?

How can I ensure that my external adapter is only accessible by a specific contract? Does the Post express middleware in the external adapter have a header key indicating the calling smart contract? I'...
Jp98's user avatar
  • 11
0 votes
0 answers
12 views

why/ how does VRFCoordinatorV2 automatically fulfill randomness when LINK is deposited?

0 In my smart contract I've created an instances of both the LINK and VRFCoordinatorV2.sol contracts. I am also listening for the 'RandomWordsFulfilled' event which is emitted when 'fulfillRandomWords'...
wayne 's user avatar
1 vote
1 answer
28 views

Is paying to an API provider the only way to get reliable events notifications?

I am new to Blockchain development. I am developing a game that depends heavily in random numbers. My first naive implementation was flagged by the auditor as I was generating them on-chain. So I ...
ElCoco's user avatar
  • 13
1 vote
1 answer
40 views

Is it possible to wait for one block in order to get the VRF requested Number of words ? CoinFlip program

I am trying to create a CoinFlip program and using VRF Chainlink subscription funding method. In VRF we need to define two functions in order to get first the request ID and then the random number of ...
kaushik choudhury's user avatar
0 votes
1 answer
36 views

Facing errors with contract invocation ( Unable to access a function stating only owner can access it , even tho I am the owner)

(sorry for structuring the question in a wrong way as I am not sure what term to use precisely) I am facing issue while trying to call the function flip in the program below , I am using chainlinks ...
kaushik choudhury's user avatar
0 votes
1 answer
12 views

How can I get randomNumber from chainlinkVRF?

this is RandomNumberConsumer.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; contract RandomNumberConsumer is ...
Tomas Wolfgang's user avatar
1 vote
1 answer
40 views

Using inherited constructors with a proxy factory

I am attempting to use Chainlink VRF along with OpenZeppelin's upgradable contracts to generate a random number. In order to use VRF, I must inherit the constructor from VRFV2WrapperConsumerBase. ...
root's user avatar
  • 11
0 votes
0 answers
25 views

Chainlink PriceFeed Not Working

I'm writing a smart contract for school fee management. but when I call get pay the function is showing this. why they not converting ether to USD with price feed chain link contract!. Contract is ...
Kashif Sattar's user avatar
0 votes
1 answer
21 views

What are the chances the Chainlink oracle will respond to a non-existent request?

The Chainlink documentation specifies that you should check that a request for a given _requestId exists before continuing. Chainlink Docs I'm curious to further understand why this is, is it wrong to ...
ItsCuzzo's user avatar
1 vote
1 answer
78 views

Unable to fetch a random number from chainlink VRF. Can someone help

array of randomWords is set 0 in the function requestRandomWords() s_requests[requestId] = RequestStatus({ randomWords: new uint256[](0), exists: true, fulfilled: ...
Daneshwari Pattanashetti's user avatar
0 votes
1 answer
46 views

Can I send ETH to Chainlink's fulfillRandomWords callback function?

I have this function that requests random words from Chainlink VRF... function requestNFTs( address[] memory _variants, uint256 _variantsType, uint32 _amount, address _paymentToken ) ...
Falcon Stakepool's user avatar
1 vote
2 answers
145 views

Chainlink VRF2, Automation - Raffle Game

i am writing a raffle game contract, I integrated Chainlink keepers to check how much time has passed and pick the winner to move on to next round. function checkUpkeep( bytes calldata ...
Bengican Altunsu's user avatar
1 vote
0 answers
62 views

Is VRFCoordinatorV2Mock working on mainnet forking or only in local network?

I'm testing my contracts, where I use Chainlink's VRF. I use the mainnet forking in a hardhat. I deployed VRFCoordinatorV2Mock, although it doesn't seem to work. Is VRFCoordinatorV2Mock supposed to ...
cutedwannabe's user avatar
0 votes
1 answer
45 views

Random words generation using Chainlink VRF

If the Total request cost lets say 190 gwei which is the sum of verification gas cost + callback gas cost, exceeds the specified Gas Lane ( we define it as keyhash in consumer contract and it ...
gopi vanama's user avatar
0 votes
1 answer
73 views

Address to String in Chainlink Request is giving error?

When i am using req.add("publicKey","any_public_key_here_as_string"); I have 2 steps mentioned in our job specification decode_cbor [type=cborparse data="$(decode_log.data)&...
Dummy Mail's user avatar
1 vote
1 answer
215 views

Remix Testing ChainLink VRF v2 Direct Funding Method

I'm using ChainLink VRF V2 Direct Funding method to generate random number. I'm facing problem while generate random number, that my random number request is not getting full-filled after confirming ...
Rahul Pithadia's user avatar
1 vote
2 answers
159 views

How can I add consumers to a Chainlink VRF2 subscription with an external smart contract?

When I try to add a consumer to my VRF2 subscription via the Subscription Manager, the transaction completes successfully. This also works when interacting with the chainlink contract directly on ...
0xheartcode's user avatar
1 vote
1 answer
59 views

Hardhat Lottery test is failing

const { deployments, getNamedAccounts, ethers, network } = require("hardhat") const { assert, expect } = require("chai") const { developmentChains, networkConfig, } = require(&...
Yana Gupta's user avatar
1 vote
0 answers
45 views

VRFV2MockCoordinator contract deploy

const { network, ethers } = require("hardhat") const { developmentChains, networkConfig } = require("../helper-hardhat-config") const { verify } = require("../utils/verify&...
Yana Gupta's user avatar
1 vote
1 answer
80 views

VRFConsumerBaseV2, fulfillRandomWords can't transfer ERC721

I was surprised, I can't call safe transfer in fulfillRandomWords, I didn't find any documentation about that or exception. I did a lot of googled, I've found nothing. My code is /** * Callback ...
Akira Kitamura's user avatar
0 votes
2 answers
252 views

VRFCoordinatorV2Mock contract error

const { network, ethers } = require("hardhat") const { developmentChains, networkConfig } = require("../helper-hardhat-config") const { verify } = require("../utils/verify&...
Yana Gupta's user avatar
1 vote
0 answers
30 views

I want to run my algo game via fulfillRandomWords is VRF2 Chainlink

function fulfillRandomWords(uint256 requestId, uint256[] memory randomness) internal override { //_requestIdToGameId already has gameId, a function who requests randomness, set it ...
Akira Kitamura's user avatar
0 votes
1 answer
169 views

How to generate secure and pure Randomness number without Chainlink VRF?

I found that the Chainlink VRF do not really support all the networks. So, I am considering to use off-chain and make my oracle to generate random number. I have a vague idea just down below Create a ...
DHC's user avatar
  • 367
0 votes
2 answers
152 views

VRFCoordinatorV2Mock's fulfillRandomWords not being called in hardhat local deployment

I'm building a smart contract that generates 3 random numbers using Chainlink VRF. My contract (SlotMachine.sol) implements the VRFConsumerBaseV2 and the constructor has 2 parameters: _subscriptionId ...
Camilo Sacanamboy's user avatar
1 vote
0 answers
321 views

How to calculate chainlink VRF V2 fee cost?

I'm developing a contract on testnet using Chainlink's VRF V2. I want to calculate the cost incurred when running on mainnet. As shown in the picture above, a fee of 0.000523300633249633 LINK was ...
imelon2's user avatar
  • 538
1 vote
3 answers
75 views

Why Does This Chainlink Example Code Revert?

I seem to be doing everything exactly as stated in the docs and example code I am following. When I deploy this to polygon mumbai though and call "generateRandomNumber" it just reverts with ...
Jim's user avatar
  • 173
0 votes
1 answer
36 views

Allowance failed when attempting to transfer LINK tokens

I'm creating a smart contract where users can create NFT raffles. I will be using Chainlink VRF for getting provably fair results. For this, the user who creates the raffle needs to supply the ...
TRS's user avatar
  • 131
1 vote
0 answers
63 views

Call the _mint function of an ERC1155 contract in the fulfillRandomWords callback

I want to call the _mint function of an ERC1155 contract in the fulfillRandomWords callback but i'm getting an error, i guess is due to max fee reached. How can i solve this? function ...
Jp98's user avatar
  • 11
0 votes
0 answers
320 views

Why does Chainlink VRFv2 not support L2 rollup chain like arbitrum or optimism?

All the popular L2 rollup chains are not listed in the supported networks per doc: https://docs.chain.link/vrf/v2/direct-funding/supported-networks/. Meanwhile, Aribitrum and Optimism do have ...
yl35's user avatar
  • 11
0 votes
1 answer
233 views

VRFV2WrapperConsumerBase function requestRandomness with error undeclared identifier

Working on migrating VRF to V2 but met with error that requestRandomness function is undeclared identifier. Previous V1 the VRF was implemented using 'VRFConsumerBase.sol'. Currently using V2 '...
0x Senzel's user avatar
0 votes
2 answers
102 views

Chainlink VRF V2 - TypeError: Wrong argument count for function call: 2 arguments given but expected 1

I tried to use Chainlink VRF V2 on my contract but got errors like shown picture below. Does anyone know how to solve this? My Chainlink VRFV2 Oracle function /// @dev chainlink oracle function to ...
BadGenius's user avatar
0 votes
0 answers
555 views

Error processing <UnrecognizedContract>.<unknown>

I try to create a subscription programmatically for Chainlink VRF through a script with hardhat. I go into an issue when I try to call a function related to the LINK Token : Here is my script : const ...
jrmunchkin's user avatar
0 votes
1 answer
263 views

Chainlink VRFV2 fulfillRandomWords() not being called after requestRandomWords()

Hi I want to get a random number using Chainlink VRFConsumerBaseV2 but the fulfillRandomWords() isn't being called after calling VRFCoordinatorV2Interface.requestRandomWords(). I can confirm that as &...
BlockDev's user avatar