Questions tagged [vrf]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
1 vote
1 answer
24 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
70 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
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
0 votes
0 answers
38 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
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
29 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
27 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
184 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
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
165 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
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
1 vote
2 answers
106 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
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
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
1 answer
229 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
98 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
123 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
0 votes
1 answer
159 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
496 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
206 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
675 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
14 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
116 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
505 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
  • 323
2 votes
1 answer
265 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
275 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
2 answers
724 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
44 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
  • 323
3 votes
1 answer
305 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
194 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
  • 323
0 votes
1 answer
54 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
257 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
262 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
227 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
276 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
784 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
311 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
189 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
308 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
65 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
131 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,654
0 votes
0 answers
31 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
147 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
2 votes
1 answer
1k views

Chainlink VRF - fee costs

I am giving my first steps into chainlink more precisly with VRF v2 but I have some doubts regarding the fees costs. I would prefer to have a concrete value of the costs per request. in this article I ...
fatada's user avatar
  • 23
3 votes
1 answer
972 views

How to mint one or more randomly selected token ids on ERC1155 using Chainlink VRF?

I'm looking to have an ERC1155 smart contract with a set number of tokens, each with their own max supply, and when a user mints it selects randomly from the available tokens. Creating the 5 tokens (...
nifty's user avatar
  • 31
1 vote
1 answer
553 views

Why does getting random numbers using Chainlink take more than 30 seconds?

I'm writing an article and I'm using Chainlink VRF in one part. Theoretically, this is a two-transaction process, as it is impossible to storethe cryptographic proof on the blockchain and read the ...
Joncarre's user avatar
  • 281
0 votes
0 answers
62 views

The endLottery function doesn't work on rinkeby from freecodecamp's video

so i was following that 'beginners to expert' video and my lottery contract works fine on kovan but on rinkeby the "start" and "enter" functions work but the "endLottery" ...
0xVinx's user avatar
  • 1
0 votes
1 answer
96 views

what is the chainlink VRF randomness details for xDai/Gnosis chain?

I looked into docs of chainlink but I couldn't find the VRF details for xDai/Gnosis chain network. Could you please help me find the following details? Chainlink VRF Coordinator address: LINK token ...
toddash's user avatar
  • 92