You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In VRF and Automations contract there is one parameter subscriptionId in requestRandomWords of VRFCoordinatorV2Interface interface and addConsumer function from VRFCoordinatorV2Mock interface.
The issue is that the type of subscriptionId is uint64 but the id provided by chainlink site is way to big
e.g. 15356376269897563744780985323350096414521302577903754215356556594835422566595
Something like this which leads to error
TypeError: value out-of-bounds (argument="_subId", value="15366376269897563744780985323350096414521302377970374217356556294839422166091", code=INVALID_ARGUMENT, version=6.12.0)
at makeError (node_modules/ethers/src.ts/utils/errors.ts:687:21)
at assert (node_modules/ethers/src.ts/utils/errors.ts:715:25)
at assertArgument (node_modules/ethers/src.ts/utils/errors.ts:727:5)
at NumberCoder._throwError (node_modules/ethers/src.ts/abi/coders/abstract-coder.ts:350:23)
at NumberCoder.encode (node_modules/ethers/src.ts/abi/coders/number.ts:47:18)
at /home/arshli-hapani/arshil/Future Span/Practice Span/web3/hardhat_smart_contract_lottery/hardhat_lottery_contracts/node_modules/ethers/src.ts/abi/coders/array.ts:64:19
at Array.forEach (<anonymous>)
at pack (node_modules/ethers/src.ts/abi/coders/array.ts:47:12)
at TupleCoder.encode (node_modules/ethers/src.ts/abi/coders/tuple.ts:62:20)
at AbiCoder.encode (node_modules/ethers/src.ts/abi/abi-coder.ts:195:15)
But there is no mock interface for v2.5 (or I couldn’t find it). So now you have two options:
for the real interface and testnet/mainnet use v2.5 with your subscription ID, and for the local chain use v2 code and a random subscription ID in uint64.
Hi again, I just got an advice from someone, and I managed to create a version 2.0 subscription that has a usable subId with this contract here!
Once you use the "createSubscription", you can check here that your v2.0 subscription has been created.
In VRF and Automations contract there is one parameter
subscriptionId
inrequestRandomWords
ofVRFCoordinatorV2Interface
interface andaddConsumer
function fromVRFCoordinatorV2Mock
interface.The issue is that the type of
subscriptionId
isuint64
but the id provided by chainlink site is way to bige.g.
15356376269897563744780985323350096414521302577903754215356556594835422566595
Something like this which leads to error
Version
The text was updated successfully, but these errors were encountered: