Skip to main content

Questions tagged [vrf]

The tag has no usage guidance.

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

How do i update this code from vrf version 2 to version 2.5 with the subscription id changes and everything?

pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@chainlink/contracts/...
shreyash1611peep's user avatar
0 votes
1 answer
54 views

What is the VRF input value of the Chainlink VRF off-chain operator?

A VRF accepts a value as input, and produces an output (i.e., the pseudorandom number) and its proof (via DSA). From Chainlink's documentation, I can't find what the off-chain operator uses as the ...
Yan's user avatar
  • 146
0 votes
0 answers
20 views

fulfillRandomWords function of VRF2.5 not responding back after I override my custom logic

I'm creating a lottery contract using which I’m going to reward the participant with some ETH, and I’ve deployed the contract on Eth-Sepolia testnet. I did a transaction with 2 participants (my two ...
Muhammad Ammar's user avatar
0 votes
1 answer
42 views

Unable to Execute VRF 2.5 Function in solidity

Im building a candle auction smart contract for my internship assignment, for getting complete random end time of the auction I'm using random number generator from chainlink. However when executing ...
Rohit Jambhulkar's user avatar
0 votes
1 answer
21 views

VRF subscription sepolita testnet

i'm new on ethereum. I followed the following guide: https://docs.chain.link/vrf/v2-5/subscription/get-a-random-number and everything seems to have gone fine. but after 15 hours the process is still ...
Ota Repo's user avatar
0 votes
1 answer
59 views

Invalid type for argument in function call. Invalid implicit conversion from literal_string "" to bytes calldata requested

I'm doing the course of Patrick Collins to learn about programming in Solidity; but some libraries from Chainlink has been changed since 2 years ago. So, when I try to compile the code I have the next ...
Tucan's user avatar
  • 3
0 votes
0 answers
26 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
1 vote
1 answer
31 views

Cannot read properties of undefined (reading 'vrfCoordinatorV2')

Here Is my 01-Deploy-raffle.js Code const { network } = require("hardhat"); const { ethers } = require("hardhat"); const { networkConfig, developmentChains, ...
Apex Aryan's user avatar
0 votes
3 answers
88 views

Chainlink VRF Contract Logic Error

I am beginning my journey in web3 so please be understanding 🙂 I am struggling to find an issue in my contract that uses VRF. It is a simple coinflip written in Vyper. I have deployed a consumer and ...
szaleju's user avatar
0 votes
1 answer
21 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
0 votes
1 answer
106 views

Why did Ethereum choose RANDAO rather than VRF for PoS?

I think RANDAO and VRF have different pros and cons for constructing a random number. And I read that RANDAO is very useful when it comes with VDF. But RANDAO is currently adapted without VDF (but ...
Suhyeon's user avatar
1 vote
1 answer
33 views

Call fundSubcription() chain link vrf v2 using brownie gas fee error?

def addCustomerAndFundsub(_subId, _cunsumerContract): account = get_account() if network.show_active() in LOCAL_BLOCKCHIAN_ENVIROMENTS: VRF_contract = VRFCoordinatorV2Mock[-1] else:...
Rhaegar's user avatar
  • 31
1 vote
0 answers
30 views

I can't get API3 QRNG to select a random enum value and mint an NFT based on this enum choice

I tried to make a contract that mints a token from an enum of options https://gist.github.com/ChristianOConnor/0ae15b021521c9583dde6c3cc782d4d3. This code fails at every turn. I started with the code ...
ChristianOConnor's user avatar
2 votes
0 answers
223 views

Is there an alternative to Chainlink to get a random number in a solidity contract?

I'm trying to create an NFT that selects at random between 3 json metadata files. The only way I know of to do this is to use Chainlink. I've seen one tutorial that implements "@chainlink/...
ChristianOConnor's user avatar
1 vote
0 answers
63 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
251 views

Chainlink VRF getRandomNumber not working

I'm trying to use Chainlink's VRF to produce a random number. I've followed guides and produced a basic contract to do this, but getRandomNumber() isn't working. I am using the Sepolia test network. //...
wolfblade87's user avatar
1 vote
1 answer
83 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
1 vote
2 answers
146 views

Is ChainLink's VRF susceptible to a 51% attack?

I do not know all of the details of how ChainLink's nodes and oracles work (hence why I am on here) but I did a little research on my own. According to a Gemini blog post by Cryptopedia, chainlink ...
chriscrutt's user avatar
1 vote
0 answers
31 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
1 vote
0 answers
66 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 ...
Yo2e43's user avatar
  • 11
0 votes
1 answer
249 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
110 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
1 vote
0 answers
132 views

Chainlink Random Number generator failing with Gas error

I am trying to generate a random number using chainlink VRF i have changed all the address as per goreli I have deployed in goreli testnet and sent some link token to the contract address Clicking on ...
Sunny's user avatar
  • 11
1 vote
1 answer
177 views

Which blockhash is used as seed in Chainlink VRF?

Chainlink VRF is a service using the VRF(Verifiable random function) to generate verifiable randomness on-chain, a smart contract supplies a seed (which should be unpredictable to the oracles to whom ...
Frank Kong's user avatar
2 votes
3 answers
610 views

How to generate random number and get it at the same time using Chainlink VRFv2?

I need to generate random number, on a single function hit and get it there only. I am not able to do that, due to block confirmations required which is set to min. 3. Is there any way to get this or ...
Manav Notnani's user avatar
0 votes
0 answers
217 views

Transaction execution failed when deploying contract (Chainlink VRF)

I've successfully deployed VrfTest.sol contract which is same as Get a Random Number example in Chainlink. After that I tried to deploy my BullBear.sol contract. This is for minting NFT that change ...
Shift_that's user avatar
3 votes
2 answers
788 views

Testing VrfCoordinatorV2Mock fulfillRandomWords gets stuck

I am testing a smart contract that uses Chainlink's VRF Oracle. Locally, I am using a mock to test with. In the unit test it never executes the fulfillRandomWords function that on my smart contract, ...
Anas Latique's user avatar
1 vote
1 answer
16 views

Link tokens required on Avg for random number generation

Can someone tell how much link tokens are required on an avg. to generate random number via VRF chainlink method??
Manav Notnani's user avatar
0 votes
0 answers
122 views

explain get chainlink VRF fee cost

Hi can somebody explain to me every variable and operator of this function
Dũng Đàm's user avatar
2 votes
2 answers
561 views

Chainlink VRF how to call requestRandomWords in fulfillRandomWords?

I am trying to create a chain of 3 random requests in a row. Source Code: // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.16; // Debugging import "hardhat/console.sol"; // VRF ...
Danny B's user avatar
  • 333
2 votes
1 answer
325 views

What is the recommended waiting time between requestRandomWords and fulfillRandomWords calls in Chainlink VRF V2?

Recently, Chainlink published their VRF v2. The new VRF uses subscription management app. There is a delay between the requestRandomWords and fulfillRandomWords function. On the Goerli test net, ...
Shubham Sharma's user avatar
0 votes
1 answer
301 views

Chainlink VRF: Calling s_randomWords array shows execution reverted in Remix

Hi I am using the demo contract provided by chainlink at https://docs.chain.link/docs/vrf/v2/examples/get-a-random-number/ . I did read the documentaion and followed the steps - Created subscription ...
Priyanshu Jha's user avatar
3 votes
1 answer
796 views

Keepers with VRF Error "Callback gas limit set too low error"

Im trying to create a dynamic nft by following the tutorial by alchemy, the NFT should update when performUpkeep is called which should get a random number using VRF v2 and change the NFT token URI. ...
abdulqgg's user avatar
0 votes
1 answer
45 views

How does VRF add random numbers to a contract storage variables without calling a transaction on that contract?

After calling Request Random Words on a VRF consumer, I can see that the request was fulfilled in the contract and the storage now contains the random numbers. However, I don't see any transactions on ...
Danny B's user avatar
  • 333
3 votes
1 answer
345 views

What are the differences between the gaslanes in Chainlink VRFv2?

I'm looking to implement Chainlink VRF on the Avalanche Chain, and I have an issue estimating the gasLane. On chainlink docs, they have 3 tiers: 200 gwei Key Hash 500 gwei Key Hash 1000 gwei Key Hash ...
Laurent Knauss's user avatar
2 votes
1 answer
203 views

Can I generate multiple random uint8 from a uint256?

The chainlink VRF returns a uint256, for my application I need a uint8. If I utilize one uint256 and break it up into separate uint8 is that still secure as a source of randomness? Also, what's the ...
Danny B's user avatar
  • 333
0 votes
1 answer
60 views

Why does my contract's function require so much gas when using the VRFConsumerBaseV2?

I am trying to make a Coinflip contract but when I call flipCoin the gas requred is 0.02 ETH and I dont know why? I have followed this tutorial and copied this code https://rinkeby.etherscan.io/...
jockowilli's user avatar
0 votes
1 answer
307 views

Is using modulo to get a range from Chainlink's VRF number a good idea?

I'm building a lottery game contract and I need to get a range of values from chainlink VRF's number. The range is the length of the players list. For simplicity, I've made a simple contract that ...
AncientVeil's user avatar
2 votes
1 answer
290 views

Chainlink Keepers not Upkeeping after i enterLottery. Can you spot issue that would be causing this?

I've spent many weeks on this project trying to figure out why "Chainlink Keepers" is not working. I can successfully deploy and verify the contract on Rinkeby. Then i do the following... 1.)...
Blockpain's user avatar
  • 173
1 vote
1 answer
272 views

How can I add consumers to a Chainlink VRF2 subscription via the Subscription Manager web page?

When I try to add a consumer to my VRF2 subscription via the Subscription Manager, the transaction completes successfully, but the consumer doesn't get added: the list of consumers for my subscription ...
Fanta's user avatar
  • 141
1 vote
1 answer
306 views

random number from chainlink vrf at hardhat test always 0

I tried to test chainlink vrf at hardhat test with vrfcoordinatormock. test is work fine but random words and request id are always 0. is It correct that returning 0 from MockVRF? const ...
Dean97K's user avatar
  • 23
1 vote
2 answers
865 views

*SOLVED* CHAINLINK VRF V2 Not Invoking Callback fulfillRandomWords()

I have the following code that is deployed using REMIX Injected Web3 into AVALANCHE FUJI TESTNET import '@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol'; import '@chainlink/...
momoja's user avatar
  • 239
0 votes
1 answer
337 views

Read a variable from a onchain deployed contract

I was deploying a NFT and the VRF coordinator takes too much time to respond and I cant see if the _safemint function is working or not. Also i cant verify the contract on rinkeby.io Is there a way to ...
Into Etherium's user avatar
0 votes
1 answer
196 views

Whenever i write some code in Chianlink VRF fulfillRandomWords function it does not get updated

I have already set my Subscriptions for Chainlink Added consumer and subscription have sufficient Link as well No Error occurs whenever I call the requestRandomWords function The chainlink ...
Sulaman Khan's user avatar
0 votes
0 answers
314 views

Stuck in Chainlink VRF Randomness Function Implementation

[URGENT QUESTION] I am trying to get a random number in my contract. I have imported both VRFCoordinatorV2Interface.sol and VRFConsumerBaseV2.sol and inherited them in my contract. I am using the ...
Abdullah Hanif Chaudhary's user avatar
0 votes
1 answer
72 views

Pseudo Random generator based on real random seed

I have a big array of numbers and need to choose X of them randomly without repetition. I have a real random seed provided by an external oracle. Is there a known fair algorithm to create a pseudo ...
Stormsson's user avatar
  • 379
0 votes
1 answer
139 views

How chainlink oracle works incase of state update?

I was trying to understand this pizza sample build by Patrick Collins. so my understanding is that when we send a transaction (for example store which stores a user provided number) all the nodes in ...
Venessa's user avatar
5 votes
1 answer
1k views

How Chainlink VRF fulfillRandomWords() callback function works?

I am using Chainlink VRF2 where I receive random numbers via a callback to this function: function fulfillRandomWords( uint256, /* requestId */ uint256[] memory randomWords ) internal ...
Emrah's user avatar
  • 1,722
0 votes
0 answers
32 views

revert InvalidCalldata error VRFCoordinator

I am using a clone of the pancakeSwap lottery and attempting to use a write function. I keep getting an error in the BSC testnet VRFCoordinatorV2 contract saying revert InvalidCalldata();. The ...
EKN's user avatar
  • 31
0 votes
1 answer
164 views

VRF2 createSubscription() help

I am very new to Solidity and Blockchain, have a background of Web Developer though, and as many i am following the Youtube video on these technologies by freeCodeCamp.org channel, where the VRF v1 is ...
salderosa's user avatar