diff --git a/contracts/deploy/00-chainlink-rng.ts b/contracts/deploy/00-chainlink-rng.ts new file mode 100644 index 000000000..4ff7011e7 --- /dev/null +++ b/contracts/deploy/00-chainlink-rng.ts @@ -0,0 +1,76 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { HomeChains, isSkipped } from "./utils"; +import { getContractOrDeploy } from "./utils/getContractOrDeploy"; + +const deployArbitration: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { deployments, getNamedAccounts, getChainId } = hre; + const { deploy } = deployments; + + // fallback to hardhat node signers on local network + const deployer = (await getNamedAccounts()).deployer ?? (await hre.ethers.getSigners())[0].address; + const chainId = Number(await getChainId()) as unknown as HomeChains; // Checked at runtime by skip() + console.log("deploying to %s with deployer %s", HomeChains[chainId], deployer); + + const KEY_HASHES = { + // https://docs.chain.link/vrf/v2-5/supported-networks#arbitrum-mainnet + [HomeChains.ARBITRUM_ONE]: { + 2: "0x9e9e46732b32662b9adc6f3abdf6c5e926a666d174a4d6b8e39c4cca76a38897", + 30: "0x8472ba59cf7134dfe321f4d61a430c4857e8b19cdd5230b09952a92671c24409", + 150: "0xe9f223d7d83ec85c4f78042a4845af3a1c8df7757b4997b815ce4b8d07aca68c", + }, + // https://docs.chain.link/vrf/v2-5/supported-networks#arbitrum-sepolia-testnet + [HomeChains.ARBITRUM_SEPOLIA]: { + 150: "0x1770bdc7eec7771f7ba4ffd640f34260d7f095b79c92d34a5b2551d6f6cfd2be", + }, + [HomeChains.HARDHAT]: { + 0: "0x0000000000000000000000000000000000000000000000000000000000000000", + }, + }; + + const SUBSCRIPTION_ID = { + [HomeChains.ARBITRUM_ONE]: "66240499937595191069677958665918759554657443303079118766000192000140992834352", + [HomeChains.ARBITRUM_SEPOLIA]: "38502597312983100069991953687934627561654236680431968938019951490339399569548", + [HomeChains.HARDHAT]: "0x0000000000000000000000000000000000000000000000000000000000000000", + }; + + function getKeyHash({ gasPrice }: { gasPrice: keyof (typeof KEY_HASHES)[HomeChains.ARBITRUM_ONE] }): string { + if (chainId == HomeChains.HARDHAT) return KEY_HASHES[chainId][0]; + if (chainId == HomeChains.ARBITRUM_ONE) return KEY_HASHES[chainId][gasPrice]; + if (chainId == HomeChains.ARBITRUM_SEPOLIA) return KEY_HASHES[chainId][150]; + throw new Error(`Unknown chainId ${chainId}`); + } + + const ChainlinkVRFCoordinator = await getContractOrDeploy(hre, "ChainlinkVRFCoordinator", { + from: deployer, + contract: "ChainlinkVRFCoordinator", + args: [], + log: true, + }); + + const keyHash = getKeyHash({ gasPrice: 150 }); + const subscriptionId = SUBSCRIPTION_ID[chainId]; + const requestConfirmations = 200; // between 1 and 200 L2 blocks + const callbackGasLimit = 100000; + + await deploy("ChainlinkRNG", { + from: deployer, + args: [ + deployer, + deployer, + ChainlinkVRFCoordinator.target, + keyHash, + subscriptionId, + requestConfirmations, + callbackGasLimit, + ], + log: true, + }); +}; + +deployArbitration.tags = ["ChainlinkRNG"]; +deployArbitration.skip = async ({ network }) => { + return isSkipped(network, !HomeChains[network.config.chainId ?? 0]); +}; + +export default deployArbitration; diff --git a/contracts/deployments/arbitrum/ChainlinkVRFCoordinator.json b/contracts/deployments/arbitrum/ChainlinkVRFCoordinator.json new file mode 100644 index 000000000..6dbd1fef2 --- /dev/null +++ b/contracts/deployments/arbitrum/ChainlinkVRFCoordinator.json @@ -0,0 +1,18 @@ +{ + "address": "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} diff --git a/contracts/deployments/arbitrumSepolia/ChainlinkVRFCoordinator.json b/contracts/deployments/arbitrumSepolia/ChainlinkVRFCoordinator.json new file mode 100644 index 000000000..0ad1f85b2 --- /dev/null +++ b/contracts/deployments/arbitrumSepolia/ChainlinkVRFCoordinator.json @@ -0,0 +1,1753 @@ +{ + "address": "0x5CE8D5A2BC84beb22a398CCA51996F7930313D61", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "blockhashStore", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "internalBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "externalBalance", + "type": "uint256" + } + ], + "name": "BalanceInvariantViolated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNum", + "type": "uint256" + } + ], + "name": "BlockhashNotInStore", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "coordinatorAddress", + "type": "address" + } + ], + "name": "CoordinatorAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "coordinatorAddress", + "type": "address" + } + ], + "name": "CoordinatorNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "FailedToSendNative", + "type": "error" + }, + { + "inputs": [], + "name": "FailedToTransferLink", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "have", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "want", + "type": "uint32" + } + ], + "name": "GasLimitTooBig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxGas", + "type": "uint256" + } + ], + "name": "GasPriceExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "IncorrectCommitment", + "type": "error" + }, + { + "inputs": [], + "name": "IndexOutOfRange", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidCalldata", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "InvalidConsumer", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidExtraArgsTag", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "linkWei", + "type": "int256" + } + ], + "name": "InvalidLinkWeiPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "premiumPercentage", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "max", + "type": "uint8" + } + ], + "name": "InvalidPremiumPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "have", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "min", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "max", + "type": "uint16" + } + ], + "name": "InvalidRequestConfirmations", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSubscription", + "type": "error" + }, + { + "inputs": [], + "name": "LinkAlreadySet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "flatFeeLinkDiscountPPM", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "flatFeeNativePPM", + "type": "uint32" + } + ], + "name": "LinkDiscountTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "LinkNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "have", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "MsgDataTooBig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proposedOwner", + "type": "address" + } + ], + "name": "MustBeRequestedOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "MustBeSubOwner", + "type": "error" + }, + { + "inputs": [], + "name": "NoCorrespondingRequest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + } + ], + "name": "NoSuchProvingKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "have", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "want", + "type": "uint32" + } + ], + "name": "NumWordsTooBig", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyCallableFromLink", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentTooLarge", + "type": "error" + }, + { + "inputs": [], + "name": "PendingRequestExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + } + ], + "name": "ProvingKeyAlreadyRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "Reentrant", + "type": "error" + }, + { + "inputs": [], + "name": "TooManyConsumers", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "minimumRequestConfirmations", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxGasLimit", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "stalenessSeconds", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gasAfterPaymentCalculation", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "int256", + "name": "fallbackWeiPerUnitLink", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "fulfillmentFlatFeeNativePPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "fulfillmentFlatFeeLinkDiscountPPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "nativePremiumPercentage", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "linkPremiumPercentage", + "type": "uint8" + } + ], + "name": "ConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "coordinatorAddress", + "type": "address" + } + ], + "name": "CoordinatorDeregistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "coordinatorAddress", + "type": "address" + } + ], + "name": "CoordinatorRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "fallbackWeiPerUnitLink", + "type": "int256" + } + ], + "name": "FallbackWeiPerUnitLinkUsed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "FundsRecovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newCoordinator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "MigrationCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "NativeFundsRecovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OwnershipTransferRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "maxGas", + "type": "uint64" + } + ], + "name": "ProvingKeyDeregistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "maxGas", + "type": "uint64" + } + ], + "name": "ProvingKeyRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "outputSeed", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "payment", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "nativePayment", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "onlyPremium", + "type": "bool" + } + ], + "name": "RandomWordsFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "preSeed", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "minimumRequestConfirmations", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "numWords", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "extraArgs", + "type": "bytes" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RandomWordsRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountLink", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountNative", + "type": "uint256" + } + ], + "name": "SubscriptionCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "SubscriptionConsumerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "SubscriptionConsumerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "SubscriptionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "SubscriptionFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldNativeBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newNativeBalance", + "type": "uint256" + } + ], + "name": "SubscriptionFundedWithNative", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "SubscriptionOwnerTransferRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "SubscriptionOwnerTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "BLOCKHASH_STORE", + "outputs": [ + { + "internalType": "contract BlockhashStoreInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LINK", + "outputs": [ + { + "internalType": "contract LinkTokenInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LINK_NATIVE_FEED", + "outputs": [ + { + "internalType": "contract AggregatorV3Interface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_CONSUMERS", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_NUM_WORDS", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_REQUEST_CONFIRMATIONS", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "acceptSubscriptionOwnerTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "addConsumer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "cancelSubscription", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "createSubscription", + "outputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "deregisterMigratableCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "publicProvingKey", + "type": "uint256[2]" + } + ], + "name": "deregisterProvingKey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256[2]", + "name": "pk", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "gamma", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "c", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "s", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "seed", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uWitness", + "type": "address" + }, + { + "internalType": "uint256[2]", + "name": "cGammaWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "sHashWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "zInv", + "type": "uint256" + } + ], + "internalType": "struct VRF.Proof", + "name": "proof", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "blockNum", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "numWords", + "type": "uint32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "extraArgs", + "type": "bytes" + } + ], + "internalType": "struct VRFTypes.RequestCommitmentV2Plus", + "name": "rc", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "onlyPremium", + "type": "bool" + } + ], + "name": "fulfillRandomWords", + "outputs": [ + { + "internalType": "uint96", + "name": "payment", + "type": "uint96" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "fundSubscriptionWithNative", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCount", + "type": "uint256" + } + ], + "name": "getActiveSubscriptionIds", + "outputs": [ + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "getSubscription", + "outputs": [ + { + "internalType": "uint96", + "name": "balance", + "type": "uint96" + }, + { + "internalType": "uint96", + "name": "nativeBalance", + "type": "uint96" + }, + { + "internalType": "uint64", + "name": "reqCount", + "type": "uint64" + }, + { + "internalType": "address", + "name": "subOwner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "consumers", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "publicKey", + "type": "uint256[2]" + } + ], + "name": "hashOfKey", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newCoordinator", + "type": "address" + } + ], + "name": "migrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "ownerCancelSubscription", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "pendingRequestExists", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "recoverFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "to", + "type": "address" + } + ], + "name": "recoverNativeFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "registerMigratableCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "publicProvingKey", + "type": "uint256[2]" + }, + { + "internalType": "uint64", + "name": "maxGas", + "type": "uint64" + } + ], + "name": "registerProvingKey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "removeConsumer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "requestConfirmations", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "numWords", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "extraArgs", + "type": "bytes" + } + ], + "internalType": "struct VRFV2PlusClient.RandomWordsRequest", + "name": "req", + "type": "tuple" + } + ], + "name": "requestRandomWords", + "outputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "requestSubscriptionOwnerTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "s_config", + "outputs": [ + { + "internalType": "uint16", + "name": "minimumRequestConfirmations", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "maxGasLimit", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "reentrancyLock", + "type": "bool" + }, + { + "internalType": "uint32", + "name": "stalenessSeconds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "gasAfterPaymentCalculation", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "fulfillmentFlatFeeNativePPM", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "fulfillmentFlatFeeLinkDiscountPPM", + "type": "uint32" + }, + { + "internalType": "uint8", + "name": "nativePremiumPercentage", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "linkPremiumPercentage", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "s_currentSubNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "s_fallbackWeiPerUnitLink", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "s_provingKeyHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "s_provingKeys", + "outputs": [ + { + "internalType": "bool", + "name": "exists", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "maxGas", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "s_requestCommitments", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "s_totalBalance", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "s_totalNativeBalance", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "minimumRequestConfirmations", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "maxGasLimit", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "stalenessSeconds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "gasAfterPaymentCalculation", + "type": "uint32" + }, + { + "internalType": "int256", + "name": "fallbackWeiPerUnitLink", + "type": "int256" + }, + { + "internalType": "uint32", + "name": "fulfillmentFlatFeeNativePPM", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "fulfillmentFlatFeeLinkDiscountPPM", + "type": "uint32" + }, + { + "internalType": "uint8", + "name": "nativePremiumPercentage", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "linkPremiumPercentage", + "type": "uint8" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "link", + "type": "address" + }, + { + "internalType": "address", + "name": "linkNativeFeed", + "type": "address" + } + ], + "name": "setLINKAndLINKNativeFeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + } + ], + "name": "withdrawNative", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/ChainlinkRNG.json b/contracts/deployments/arbitrumSepoliaDevnet/ChainlinkRNG.json new file mode 100644 index 000000000..589a64d7f --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/ChainlinkRNG.json @@ -0,0 +1,736 @@ +{ + "address": "0x1ce7F5771bA530a6b2d7129268E0c04441DF95c9", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_sortitionModule", + "type": "address" + }, + { + "internalType": "address", + "name": "_vrfCoordinator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "_keyHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_subscriptionId", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_requestConfirmations", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "_callbackGasLimit", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "have", + "type": "address" + }, + { + "internalType": "address", + "name": "want", + "type": "address" + } + ], + "name": "OnlyCoordinatorCanFulfill", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "have", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "OnlyOwnerOrCoordinator", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddress", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "vrfCoordinator", + "type": "address" + } + ], + "name": "CoordinatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OwnershipTransferRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "randomWord", + "type": "uint256" + } + ], + "name": "RequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "name": "RequestSent", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "callbackGasLimit", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_callbackGasLimit", + "type": "uint32" + } + ], + "name": "changeCallbackGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_governor", + "type": "address" + } + ], + "name": "changeGovernor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_keyHash", + "type": "bytes32" + } + ], + "name": "changeKeyHash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "_requestConfirmations", + "type": "uint16" + } + ], + "name": "changeRequestConfirmations", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_sortitionModule", + "type": "address" + } + ], + "name": "changeSortitionModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_subscriptionId", + "type": "uint256" + } + ], + "name": "changeSubscriptionId", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vrfCoordinator", + "type": "address" + } + ], + "name": "changeVrfCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keyHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "name": "randomNumbers", + "outputs": [ + { + "internalType": "uint256", + "name": "number", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "randomWords", + "type": "uint256[]" + } + ], + "name": "rawFulfillRandomWords", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "receiveRandomness", + "outputs": [ + { + "internalType": "uint256", + "name": "randomNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "requestConfirmations", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "requestRandomness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "s_vrfCoordinator", + "outputs": [ + { + "internalType": "contract IVRFCoordinatorV2Plus", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_vrfCoordinator", + "type": "address" + } + ], + "name": "setCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "sortitionModule", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "subscriptionId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x98e0e5095a628df19a3987f45637207b99ec2e91a7fdfc335244f625ca1faac2", + "receipt": { + "to": null, + "from": "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "contractAddress": "0x1ce7F5771bA530a6b2d7129268E0c04441DF95c9", + "transactionIndex": 1, + "gasUsed": "925617", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3b1792895296c1c77836af5d139a7883f2abdfc845856c7486214d4fb826f768", + "transactionHash": "0x98e0e5095a628df19a3987f45637207b99ec2e91a7fdfc335244f625ca1faac2", + "logs": [], + "blockNumber": 104436407, + "cumulativeGasUsed": "925617", + "status": 1, + "byzantium": true + }, + "args": [ + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0xf1C7c037891525E360C59f708739Ac09A7670c59", + "0x5CE8D5A2BC84beb22a398CCA51996F7930313D61", + "0x1770bdc7eec7771f7ba4ffd640f34260d7f095b79c92d34a5b2551d6f6cfd2be", + "38502597312983100069991953687934627561654236680431968938019951490339399569548", + 20, + 100000 + ], + "numDeployments": 1, + "solcInputHash": "75a40fe267f89917a94a61837d7b8dfe", + "metadata": "{\"compiler\":{\"version\":\"0.8.24+commit.e11b9ed9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_sortitionModule\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_subscriptionId\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"want\",\"type\":\"address\"}],\"name\":\"OnlyCoordinatorCanFulfill\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"have\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"coordinator\",\"type\":\"address\"}],\"name\":\"OnlyOwnerOrCoordinator\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"vrfCoordinator\",\"type\":\"address\"}],\"name\":\"CoordinatorSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"randomWord\",\"type\":\"uint256\"}],\"name\":\"RequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"name\":\"RequestSent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"callbackGasLimit\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_callbackGasLimit\",\"type\":\"uint32\"}],\"name\":\"changeCallbackGasLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governor\",\"type\":\"address\"}],\"name\":\"changeGovernor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_keyHash\",\"type\":\"bytes32\"}],\"name\":\"changeKeyHash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_requestConfirmations\",\"type\":\"uint16\"}],\"name\":\"changeRequestConfirmations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sortitionModule\",\"type\":\"address\"}],\"name\":\"changeSortitionModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_subscriptionId\",\"type\":\"uint256\"}],\"name\":\"changeSubscriptionId\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"changeVrfCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"keyHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"}],\"name\":\"randomNumbers\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestId\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"randomWords\",\"type\":\"uint256[]\"}],\"name\":\"rawFulfillRandomWords\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"receiveRandomness\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"randomNumber\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"requestConfirmations\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"requestRandomness\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"s_vrfCoordinator\",\"outputs\":[{\"internalType\":\"contract IVRFCoordinatorV2Plus\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vrfCoordinator\",\"type\":\"address\"}],\"name\":\"setCoordinator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sortitionModule\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"subscriptionId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"RequestFulfilled(uint256,uint256)\":{\"params\":{\"randomWord\":\"The random value answering the request.\",\"requestId\":\"The ID of the request\"}},\"RequestSent(uint256)\":{\"details\":\"Emitted when a request is sent to the VRF Coordinator\",\"params\":{\"requestId\":\"The ID of the request\"}}},\"kind\":\"dev\",\"methods\":{\"changeCallbackGasLimit(uint32)\":{\"details\":\"Changes the callback gas limit of the contract.\",\"params\":{\"_callbackGasLimit\":\"The new callback gas limit.\"}},\"changeGovernor(address)\":{\"details\":\"Changes the governor of the contract.\",\"params\":{\"_governor\":\"The new governor.\"}},\"changeKeyHash(bytes32)\":{\"details\":\"Changes the key hash of the contract.\",\"params\":{\"_keyHash\":\"The new key hash.\"}},\"changeRequestConfirmations(uint16)\":{\"details\":\"Changes the request confirmations of the contract.\",\"params\":{\"_requestConfirmations\":\"The new request confirmations.\"}},\"changeSortitionModule(address)\":{\"details\":\"Changes the sortition module of the contract.\",\"params\":{\"_sortitionModule\":\"The new sortition module.\"}},\"changeSubscriptionId(uint256)\":{\"details\":\"Changes the subscription ID of the contract.\",\"params\":{\"_subscriptionId\":\"The new subscription ID.\"}},\"changeVrfCoordinator(address)\":{\"details\":\"Changes the VRF Coordinator of the contract.\",\"params\":{\"_vrfCoordinator\":\"The new VRF Coordinator.\"}},\"constructor\":{\"details\":\"Constructor, initializing the implementation to reduce attack surface.https://docs.chain.link/vrf/v2-5/subscription/get-a-random-number\",\"params\":{\"_callbackGasLimit\":\"The limit for how much gas to use for the callback request to the contract's fulfillRandomWords() function.\",\"_governor\":\"The Governor of the contract.\",\"_keyHash\":\"The gas lane key hash value - Defines the maximum gas price you are willing to pay for a request in wei (ID of the off-chain VRF job).\",\"_requestConfirmations\":\"How many confirmations the Chainlink node should wait before responding.\",\"_sortitionModule\":\"The address of the SortitionModule contract.\",\"_subscriptionId\":\"The unique identifier of the subscription used for funding requests.\",\"_vrfCoordinator\":\"The address of the VRFCoordinator contract.\"}},\"receiveRandomness(uint256)\":{\"details\":\"Return the random number.\",\"returns\":{\"randomNumber\":\"The random number or 0 if it is not ready or has not been requested.\"}},\"requestRandomness(uint256)\":{\"details\":\"Request a random number. SortitionModule only.\"}},\"title\":\"Random Number Generator that uses Chainlink VRF v2.5 https://blog.chain.link/introducing-vrf-v2-5/\",\"version\":1},\"userdoc\":{\"events\":{\"RequestFulfilled(uint256,uint256)\":{\"notice\":\"Emitted when a request has been fulfilled.\"}},\"kind\":\"user\",\"methods\":{\"acceptOwnership()\":{\"notice\":\"Allows an ownership transfer to be completed by the recipient.\"},\"owner()\":{\"notice\":\"Get the current owner\"},\"setCoordinator(address)\":{\"notice\":\"Sets the VRF Coordinator addressThis method should only be callable by the coordinator or contract owner\"},\"transferOwnership(address)\":{\"notice\":\"Allows an owner to begin transferring ownership to a new address.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/rng/ChainlinkRNG.sol\":\"ChainlinkRNG\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100},\"remappings\":[]},\"sources\":{\"@chainlink/contracts/src/v0.8/shared/access/ConfirmedOwner.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport {ConfirmedOwnerWithProposal} from \\\"./ConfirmedOwnerWithProposal.sol\\\";\\n\\n/// @title The ConfirmedOwner contract\\n/// @notice A contract with helpers for basic contract ownership.\\ncontract ConfirmedOwner is ConfirmedOwnerWithProposal {\\n constructor(address newOwner) ConfirmedOwnerWithProposal(newOwner, address(0)) {}\\n}\\n\",\"keccak256\":\"0xdcb0e9135ddbe71ee27ba99fa06656960c66c964cf2ecb29696da1c1427d9861\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/shared/access/ConfirmedOwnerWithProposal.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport {IOwnable} from \\\"../interfaces/IOwnable.sol\\\";\\n\\n/// @title The ConfirmedOwner contract\\n/// @notice A contract with helpers for basic contract ownership.\\ncontract ConfirmedOwnerWithProposal is IOwnable {\\n address private s_owner;\\n address private s_pendingOwner;\\n\\n event OwnershipTransferRequested(address indexed from, address indexed to);\\n event OwnershipTransferred(address indexed from, address indexed to);\\n\\n constructor(address newOwner, address pendingOwner) {\\n // solhint-disable-next-line gas-custom-errors\\n require(newOwner != address(0), \\\"Cannot set owner to zero\\\");\\n\\n s_owner = newOwner;\\n if (pendingOwner != address(0)) {\\n _transferOwnership(pendingOwner);\\n }\\n }\\n\\n /// @notice Allows an owner to begin transferring ownership to a new address.\\n function transferOwnership(address to) public override onlyOwner {\\n _transferOwnership(to);\\n }\\n\\n /// @notice Allows an ownership transfer to be completed by the recipient.\\n function acceptOwnership() external override {\\n // solhint-disable-next-line gas-custom-errors\\n require(msg.sender == s_pendingOwner, \\\"Must be proposed owner\\\");\\n\\n address oldOwner = s_owner;\\n s_owner = msg.sender;\\n s_pendingOwner = address(0);\\n\\n emit OwnershipTransferred(oldOwner, msg.sender);\\n }\\n\\n /// @notice Get the current owner\\n function owner() public view override returns (address) {\\n return s_owner;\\n }\\n\\n /// @notice validate, transfer ownership, and emit relevant events\\n function _transferOwnership(address to) private {\\n // solhint-disable-next-line gas-custom-errors\\n require(to != msg.sender, \\\"Cannot transfer to self\\\");\\n\\n s_pendingOwner = to;\\n\\n emit OwnershipTransferRequested(s_owner, to);\\n }\\n\\n /// @notice validate access\\n function _validateOwnership() internal view {\\n // solhint-disable-next-line gas-custom-errors\\n require(msg.sender == s_owner, \\\"Only callable by owner\\\");\\n }\\n\\n /// @notice Reverts if called by anyone other than the contract owner.\\n modifier onlyOwner() {\\n _validateOwnership();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x2422a055657a87e98be61f8f31abb1824ec50fd0f73949f4e3c6ac877efb6da8\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/shared/interfaces/IOwnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\ninterface IOwnable {\\n function owner() external returns (address);\\n\\n function transferOwnership(address recipient) external;\\n\\n function acceptOwnership() external;\\n}\\n\",\"keccak256\":\"0x885de72b7b4e4f1bf8ba817a3f2bcc37fd9022d342c4ce76782151c30122d767\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\nimport {IVRFCoordinatorV2Plus} from \\\"./interfaces/IVRFCoordinatorV2Plus.sol\\\";\\nimport {IVRFMigratableConsumerV2Plus} from \\\"./interfaces/IVRFMigratableConsumerV2Plus.sol\\\";\\nimport {ConfirmedOwner} from \\\"../../shared/access/ConfirmedOwner.sol\\\";\\n\\n/** ****************************************************************************\\n * @notice Interface for contracts using VRF randomness\\n * *****************************************************************************\\n * @dev PURPOSE\\n *\\n * @dev Reggie the Random Oracle (not his real job) wants to provide randomness\\n * @dev to Vera the verifier in such a way that Vera can be sure he's not\\n * @dev making his output up to suit himself. Reggie provides Vera a public key\\n * @dev to which he knows the secret key. Each time Vera provides a seed to\\n * @dev Reggie, he gives back a value which is computed completely\\n * @dev deterministically from the seed and the secret key.\\n *\\n * @dev Reggie provides a proof by which Vera can verify that the output was\\n * @dev correctly computed once Reggie tells it to her, but without that proof,\\n * @dev the output is indistinguishable to her from a uniform random sample\\n * @dev from the output space.\\n *\\n * @dev The purpose of this contract is to make it easy for unrelated contracts\\n * @dev to talk to Vera the verifier about the work Reggie is doing, to provide\\n * @dev simple access to a verifiable source of randomness. It ensures 2 things:\\n * @dev 1. The fulfillment came from the VRFCoordinatorV2Plus.\\n * @dev 2. The consumer contract implements fulfillRandomWords.\\n * *****************************************************************************\\n * @dev USAGE\\n *\\n * @dev Calling contracts must inherit from VRFConsumerBaseV2Plus, and can\\n * @dev initialize VRFConsumerBaseV2Plus's attributes in their constructor as\\n * @dev shown:\\n *\\n * @dev contract VRFConsumerV2Plus is VRFConsumerBaseV2Plus {\\n * @dev constructor(, address _vrfCoordinator, address _subOwner)\\n * @dev VRFConsumerBaseV2Plus(_vrfCoordinator, _subOwner) public {\\n * @dev \\n * @dev }\\n * @dev }\\n *\\n * @dev The oracle will have given you an ID for the VRF keypair they have\\n * @dev committed to (let's call it keyHash). Create a subscription, fund it\\n * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface\\n * @dev subscription management functions).\\n * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,\\n * @dev callbackGasLimit, numWords, extraArgs),\\n * @dev see (IVRFCoordinatorV2Plus for a description of the arguments).\\n *\\n * @dev Once the VRFCoordinatorV2Plus has received and validated the oracle's response\\n * @dev to your request, it will call your contract's fulfillRandomWords method.\\n *\\n * @dev The randomness argument to fulfillRandomWords is a set of random words\\n * @dev generated from your requestId and the blockHash of the request.\\n *\\n * @dev If your contract could have concurrent requests open, you can use the\\n * @dev requestId returned from requestRandomWords to track which response is associated\\n * @dev with which randomness request.\\n * @dev See \\\"SECURITY CONSIDERATIONS\\\" for principles to keep in mind,\\n * @dev if your contract could have multiple requests in flight simultaneously.\\n *\\n * @dev Colliding `requestId`s are cryptographically impossible as long as seeds\\n * @dev differ.\\n *\\n * *****************************************************************************\\n * @dev SECURITY CONSIDERATIONS\\n *\\n * @dev A method with the ability to call your fulfillRandomness method directly\\n * @dev could spoof a VRF response with any random value, so it's critical that\\n * @dev it cannot be directly called by anything other than this base contract\\n * @dev (specifically, by the VRFConsumerBaseV2Plus.rawFulfillRandomness method).\\n *\\n * @dev For your users to trust that your contract's random behavior is free\\n * @dev from malicious interference, it's best if you can write it so that all\\n * @dev behaviors implied by a VRF response are executed *during* your\\n * @dev fulfillRandomness method. If your contract must store the response (or\\n * @dev anything derived from it) and use it later, you must ensure that any\\n * @dev user-significant behavior which depends on that stored value cannot be\\n * @dev manipulated by a subsequent VRF request.\\n *\\n * @dev Similarly, both miners and the VRF oracle itself have some influence\\n * @dev over the order in which VRF responses appear on the blockchain, so if\\n * @dev your contract could have multiple VRF requests in flight simultaneously,\\n * @dev you must ensure that the order in which the VRF responses arrive cannot\\n * @dev be used to manipulate your contract's user-significant behavior.\\n *\\n * @dev Since the block hash of the block which contains the requestRandomness\\n * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful\\n * @dev miner could, in principle, fork the blockchain to evict the block\\n * @dev containing the request, forcing the request to be included in a\\n * @dev different block with a different hash, and therefore a different input\\n * @dev to the VRF. However, such an attack would incur a substantial economic\\n * @dev cost. This cost scales with the number of blocks the VRF oracle waits\\n * @dev until it calls responds to a request. It is for this reason that\\n * @dev that you can signal to an oracle you'd like them to wait longer before\\n * @dev responding to the request (however this is not enforced in the contract\\n * @dev and so remains effective only in the case of unmodified oracle software).\\n */\\nabstract contract VRFConsumerBaseV2Plus is IVRFMigratableConsumerV2Plus, ConfirmedOwner {\\n error OnlyCoordinatorCanFulfill(address have, address want);\\n error OnlyOwnerOrCoordinator(address have, address owner, address coordinator);\\n error ZeroAddress();\\n\\n // s_vrfCoordinator should be used by consumers to make requests to vrfCoordinator\\n // so that coordinator reference is updated after migration\\n IVRFCoordinatorV2Plus public s_vrfCoordinator;\\n\\n /**\\n * @param _vrfCoordinator address of VRFCoordinator contract\\n */\\n constructor(address _vrfCoordinator) ConfirmedOwner(msg.sender) {\\n if (_vrfCoordinator == address(0)) {\\n revert ZeroAddress();\\n }\\n s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator);\\n }\\n\\n /**\\n * @notice fulfillRandomness handles the VRF response. Your contract must\\n * @notice implement it. See \\\"SECURITY CONSIDERATIONS\\\" above for important\\n * @notice principles to keep in mind when implementing your fulfillRandomness\\n * @notice method.\\n *\\n * @dev VRFConsumerBaseV2Plus expects its subcontracts to have a method with this\\n * @dev signature, and will call it once it has verified the proof\\n * @dev associated with the randomness. (It is triggered via a call to\\n * @dev rawFulfillRandomness, below.)\\n *\\n * @param requestId The Id initially returned by requestRandomness\\n * @param randomWords the VRF output expanded to the requested number of words\\n */\\n // solhint-disable-next-line chainlink-solidity/prefix-internal-functions-with-underscore\\n function fulfillRandomWords(uint256 requestId, uint256[] calldata randomWords) internal virtual;\\n\\n // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF\\n // proof. rawFulfillRandomness then calls fulfillRandomness, after validating\\n // the origin of the call\\n function rawFulfillRandomWords(uint256 requestId, uint256[] calldata randomWords) external {\\n if (msg.sender != address(s_vrfCoordinator)) {\\n revert OnlyCoordinatorCanFulfill(msg.sender, address(s_vrfCoordinator));\\n }\\n fulfillRandomWords(requestId, randomWords);\\n }\\n\\n /**\\n * @inheritdoc IVRFMigratableConsumerV2Plus\\n */\\n function setCoordinator(address _vrfCoordinator) external override onlyOwnerOrCoordinator {\\n if (_vrfCoordinator == address(0)) {\\n revert ZeroAddress();\\n }\\n s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator);\\n\\n emit CoordinatorSet(_vrfCoordinator);\\n }\\n\\n modifier onlyOwnerOrCoordinator() {\\n if (msg.sender != owner() && msg.sender != address(s_vrfCoordinator)) {\\n revert OnlyOwnerOrCoordinator(msg.sender, owner(), address(s_vrfCoordinator));\\n }\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x0c92838396c5abe72754ebeae526a0434dd53fdaf63e6b98111aebd6114cfcc2\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport {VRFV2PlusClient} from \\\"../libraries/VRFV2PlusClient.sol\\\";\\nimport {IVRFSubscriptionV2Plus} from \\\"./IVRFSubscriptionV2Plus.sol\\\";\\n\\n// Interface that enables consumers of VRFCoordinatorV2Plus to be future-proof for upgrades\\n// This interface is supported by subsequent versions of VRFCoordinatorV2Plus\\ninterface IVRFCoordinatorV2Plus is IVRFSubscriptionV2Plus {\\n /**\\n * @notice Request a set of random words.\\n * @param req - a struct containing following fields for randomness request:\\n * keyHash - Corresponds to a particular oracle job which uses\\n * that key for generating the VRF proof. Different keyHash's have different gas price\\n * ceilings, so you can select a specific one to bound your maximum per request cost.\\n * subId - The ID of the VRF subscription. Must be funded\\n * with the minimum subscription balance required for the selected keyHash.\\n * requestConfirmations - How many blocks you'd like the\\n * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS\\n * for why you may want to request more. The acceptable range is\\n * [minimumRequestBlockConfirmations, 200].\\n * callbackGasLimit - How much gas you'd like to receive in your\\n * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords\\n * may be slightly less than this amount because of gas used calling the function\\n * (argument decoding etc.), so you may need to request slightly more than you expect\\n * to have inside fulfillRandomWords. The acceptable range is\\n * [0, maxGasLimit]\\n * numWords - The number of uint256 random values you'd like to receive\\n * in your fulfillRandomWords callback. Note these numbers are expanded in a\\n * secure way by the VRFCoordinator from a single random value supplied by the oracle.\\n * extraArgs - abi-encoded extra args\\n * @return requestId - A unique identifier of the request. Can be used to match\\n * a request to a response in fulfillRandomWords.\\n */\\n function requestRandomWords(VRFV2PlusClient.RandomWordsRequest calldata req) external returns (uint256 requestId);\\n}\\n\",\"keccak256\":\"0x7dca2a64690ddd95ee05e422e1f61e7c1d701aaf5be1390ae12e9bd144266c36\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFMigratableConsumerV2Plus.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @notice The IVRFMigratableConsumerV2Plus interface defines the\\n/// @notice method required to be implemented by all V2Plus consumers.\\n/// @dev This interface is designed to be used in VRFConsumerBaseV2Plus.\\ninterface IVRFMigratableConsumerV2Plus {\\n event CoordinatorSet(address vrfCoordinator);\\n\\n /// @notice Sets the VRF Coordinator address\\n /// @notice This method should only be callable by the coordinator or contract owner\\n function setCoordinator(address vrfCoordinator) external;\\n}\\n\",\"keccak256\":\"0x8be8744e3b8380dc85354cf110e8caef8f394266e79120ad675a7da835ed2a85\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFSubscriptionV2Plus.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/// @notice The IVRFSubscriptionV2Plus interface defines the subscription\\n/// @notice related methods implemented by the V2Plus coordinator.\\ninterface IVRFSubscriptionV2Plus {\\n /**\\n * @notice Add a consumer to a VRF subscription.\\n * @param subId - ID of the subscription\\n * @param consumer - New consumer which can use the subscription\\n */\\n function addConsumer(uint256 subId, address consumer) external;\\n\\n /**\\n * @notice Remove a consumer from a VRF subscription.\\n * @param subId - ID of the subscription\\n * @param consumer - Consumer to remove from the subscription\\n */\\n function removeConsumer(uint256 subId, address consumer) external;\\n\\n /**\\n * @notice Cancel a subscription\\n * @param subId - ID of the subscription\\n * @param to - Where to send the remaining LINK to\\n */\\n function cancelSubscription(uint256 subId, address to) external;\\n\\n /**\\n * @notice Accept subscription owner transfer.\\n * @param subId - ID of the subscription\\n * @dev will revert if original owner of subId has\\n * not requested that msg.sender become the new owner.\\n */\\n function acceptSubscriptionOwnerTransfer(uint256 subId) external;\\n\\n /**\\n * @notice Request subscription owner transfer.\\n * @param subId - ID of the subscription\\n * @param newOwner - proposed new owner of the subscription\\n */\\n function requestSubscriptionOwnerTransfer(uint256 subId, address newOwner) external;\\n\\n /**\\n * @notice Create a VRF subscription.\\n * @return subId - A unique subscription id.\\n * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.\\n * @dev Note to fund the subscription with LINK, use transferAndCall. For example\\n * @dev LINKTOKEN.transferAndCall(\\n * @dev address(COORDINATOR),\\n * @dev amount,\\n * @dev abi.encode(subId));\\n * @dev Note to fund the subscription with Native, use fundSubscriptionWithNative. Be sure\\n * @dev to send Native with the call, for example:\\n * @dev COORDINATOR.fundSubscriptionWithNative{value: amount}(subId);\\n */\\n function createSubscription() external returns (uint256 subId);\\n\\n /**\\n * @notice Get a VRF subscription.\\n * @param subId - ID of the subscription\\n * @return balance - LINK balance of the subscription in juels.\\n * @return nativeBalance - native balance of the subscription in wei.\\n * @return reqCount - Requests count of subscription.\\n * @return owner - owner of the subscription.\\n * @return consumers - list of consumer address which are able to use this subscription.\\n */\\n function getSubscription(\\n uint256 subId\\n )\\n external\\n view\\n returns (uint96 balance, uint96 nativeBalance, uint64 reqCount, address owner, address[] memory consumers);\\n\\n /*\\n * @notice Check to see if there exists a request commitment consumers\\n * for all consumers and keyhashes for a given sub.\\n * @param subId - ID of the subscription\\n * @return true if there exists at least one unfulfilled request for the subscription, false\\n * otherwise.\\n */\\n function pendingRequestExists(uint256 subId) external view returns (bool);\\n\\n /**\\n * @notice Paginate through all active VRF subscriptions.\\n * @param startIndex index of the subscription to start from\\n * @param maxCount maximum number of subscriptions to return, 0 to return all\\n * @dev the order of IDs in the list is **not guaranteed**, therefore, if making successive calls, one\\n * @dev should consider keeping the blockheight constant to ensure a holistic picture of the contract state\\n */\\n function getActiveSubscriptionIds(uint256 startIndex, uint256 maxCount) external view returns (uint256[] memory);\\n\\n /**\\n * @notice Fund a subscription with native.\\n * @param subId - ID of the subscription\\n * @notice This method expects msg.value to be greater than or equal to 0.\\n */\\n function fundSubscriptionWithNative(uint256 subId) external payable;\\n}\\n\",\"keccak256\":\"0x85b348297ce36794e3bf97a47c001fc216bd0ee243e91514a7b395f3fcd189b0\",\"license\":\"MIT\"},\"@chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.4;\\n\\n// End consumer library.\\nlibrary VRFV2PlusClient {\\n // extraArgs will evolve to support new features\\n bytes4 public constant EXTRA_ARGS_V1_TAG = bytes4(keccak256(\\\"VRF ExtraArgsV1\\\"));\\n struct ExtraArgsV1 {\\n bool nativePayment;\\n }\\n\\n struct RandomWordsRequest {\\n bytes32 keyHash;\\n uint256 subId;\\n uint16 requestConfirmations;\\n uint32 callbackGasLimit;\\n uint32 numWords;\\n bytes extraArgs;\\n }\\n\\n function _argsToBytes(ExtraArgsV1 memory extraArgs) internal pure returns (bytes memory bts) {\\n return abi.encodeWithSelector(EXTRA_ARGS_V1_TAG, extraArgs);\\n }\\n}\\n\",\"keccak256\":\"0x839ad7a737ef18147b518b4ec3cbaf4a49dc994db65cf8369ed4e69d169a98a6\",\"license\":\"MIT\"},\"src/rng/ChainlinkRNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\nimport {VRFConsumerBaseV2Plus, IVRFCoordinatorV2Plus} from \\\"@chainlink/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol\\\";\\nimport {VRFV2PlusClient} from \\\"@chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol\\\";\\n\\nimport \\\"./RNG.sol\\\";\\n\\n/// @title Random Number Generator that uses Chainlink VRF v2.5\\n/// https://blog.chain.link/introducing-vrf-v2-5/\\ncontract ChainlinkRNG is RNG, VRFConsumerBaseV2Plus {\\n // ************************************* //\\n // * Storage * //\\n // ************************************* //\\n\\n address public governor; // The address that can withdraw funds.\\n address public sortitionModule; // The address of the SortitionModule.\\n bytes32 public keyHash; // The gas lane key hash value - Defines the maximum gas price you are willing to pay for a request in wei (ID of the off-chain VRF job).\\n uint256 public subscriptionId; // The unique identifier of the subscription used for funding requests.\\n uint16 public requestConfirmations; // How many confirmations the Chainlink node should wait before responding.\\n // 22 bytes remaining in slot\\n uint32 public callbackGasLimit; // Gas limit for the Chainlink callback.\\n uint256 lastRequestId; // The last request ID.\\n mapping(uint256 requestId => uint256 number) public randomNumbers; // randomNumbers[requestID] is the random number for this request id, 0 otherwise.\\n\\n // ************************************* //\\n // * Events * //\\n // ************************************* //\\n\\n /// @dev Emitted when a request is sent to the VRF Coordinator\\n /// @param requestId The ID of the request\\n event RequestSent(uint256 indexed requestId);\\n\\n /// Emitted when a request has been fulfilled.\\n /// @param requestId The ID of the request\\n /// @param randomWord The random value answering the request.\\n event RequestFulfilled(uint256 indexed requestId, uint256 randomWord);\\n\\n // ************************************* //\\n // * Function Modifiers * //\\n // ************************************* //\\n\\n modifier onlyByGovernor() {\\n require(governor == msg.sender, \\\"Governor only\\\");\\n _;\\n }\\n\\n modifier onlyBySortitionModule() {\\n require(sortitionModule == msg.sender, \\\"SortitionModule only\\\");\\n _;\\n }\\n\\n // ************************************* //\\n // * Constructor * //\\n // ************************************* //\\n\\n /// @dev Constructor, initializing the implementation to reduce attack surface.\\n /// @param _governor The Governor of the contract.\\n /// @param _sortitionModule The address of the SortitionModule contract.\\n /// @param _vrfCoordinator The address of the VRFCoordinator contract.\\n /// @param _keyHash The gas lane key hash value - Defines the maximum gas price you are willing to pay for a request in wei (ID of the off-chain VRF job).\\n /// @param _subscriptionId The unique identifier of the subscription used for funding requests.\\n /// @param _requestConfirmations How many confirmations the Chainlink node should wait before responding.\\n /// @param _callbackGasLimit The limit for how much gas to use for the callback request to the contract's fulfillRandomWords() function.\\n /// @dev https://docs.chain.link/vrf/v2-5/subscription/get-a-random-number\\n constructor(\\n address _governor,\\n address _sortitionModule,\\n address _vrfCoordinator,\\n bytes32 _keyHash,\\n uint256 _subscriptionId,\\n uint16 _requestConfirmations,\\n uint32 _callbackGasLimit\\n ) VRFConsumerBaseV2Plus(_vrfCoordinator) {\\n governor = _governor;\\n sortitionModule = _sortitionModule;\\n keyHash = _keyHash;\\n subscriptionId = _subscriptionId;\\n requestConfirmations = _requestConfirmations;\\n callbackGasLimit = _callbackGasLimit;\\n }\\n\\n // ************************************* //\\n // * Governance * //\\n // ************************************* //\\n\\n /// @dev Changes the governor of the contract.\\n /// @param _governor The new governor.\\n function changeGovernor(address _governor) external onlyByGovernor {\\n governor = _governor;\\n }\\n\\n /// @dev Changes the sortition module of the contract.\\n /// @param _sortitionModule The new sortition module.\\n function changeSortitionModule(address _sortitionModule) external onlyByGovernor {\\n sortitionModule = _sortitionModule;\\n }\\n\\n /// @dev Changes the VRF Coordinator of the contract.\\n /// @param _vrfCoordinator The new VRF Coordinator.\\n function changeVrfCoordinator(address _vrfCoordinator) external onlyByGovernor {\\n s_vrfCoordinator = IVRFCoordinatorV2Plus(_vrfCoordinator);\\n emit CoordinatorSet(_vrfCoordinator);\\n }\\n\\n /// @dev Changes the key hash of the contract.\\n /// @param _keyHash The new key hash.\\n function changeKeyHash(bytes32 _keyHash) external onlyByGovernor {\\n keyHash = _keyHash;\\n }\\n\\n /// @dev Changes the subscription ID of the contract.\\n /// @param _subscriptionId The new subscription ID.\\n function changeSubscriptionId(uint256 _subscriptionId) external onlyByGovernor {\\n subscriptionId = _subscriptionId;\\n }\\n\\n /// @dev Changes the request confirmations of the contract.\\n /// @param _requestConfirmations The new request confirmations.\\n function changeRequestConfirmations(uint16 _requestConfirmations) external onlyByGovernor {\\n requestConfirmations = _requestConfirmations;\\n }\\n\\n /// @dev Changes the callback gas limit of the contract.\\n /// @param _callbackGasLimit The new callback gas limit.\\n function changeCallbackGasLimit(uint32 _callbackGasLimit) external onlyByGovernor {\\n callbackGasLimit = _callbackGasLimit;\\n }\\n\\n // ************************************* //\\n // * State Modifiers * //\\n // ************************************* //\\n\\n /// @dev Request a random number. SortitionModule only.\\n function requestRandomness(uint256 /*_block*/) external override onlyBySortitionModule {\\n // Will revert if subscription is not set and funded.\\n uint256 requestId = s_vrfCoordinator.requestRandomWords(\\n VRFV2PlusClient.RandomWordsRequest({\\n keyHash: keyHash,\\n subId: subscriptionId,\\n requestConfirmations: requestConfirmations,\\n callbackGasLimit: callbackGasLimit,\\n numWords: 1,\\n extraArgs: VRFV2PlusClient._argsToBytes(\\n // Set nativePayment to true to pay for VRF requests with ETH instead of LINK\\n VRFV2PlusClient.ExtraArgsV1({nativePayment: true})\\n )\\n })\\n );\\n lastRequestId = requestId;\\n emit RequestSent(requestId);\\n }\\n\\n /// @dev Callback function called by the VRF Coordinator when the random value is generated.\\n /// @param _requestId The ID of the request.\\n /// @param _randomWords The random values answering the request.\\n function fulfillRandomWords(uint256 _requestId, uint256[] calldata _randomWords) internal override {\\n // Access control is handled by the parent VRFCoordinator.rawFulfillRandomWords()\\n randomNumbers[_requestId] = _randomWords[0];\\n emit RequestFulfilled(_requestId, _randomWords[0]);\\n }\\n\\n // ************************************* //\\n // * Public Views * //\\n // ************************************* //\\n\\n /// @dev Return the random number.\\n /// @return randomNumber The random number or 0 if it is not ready or has not been requested.\\n function receiveRandomness(uint256 /*_block*/) external view override returns (uint256 randomNumber) {\\n randomNumber = randomNumbers[lastRequestId];\\n }\\n}\\n\",\"keccak256\":\"0xf7babff149b7892449b4346d637d1890cfaf579498d366598fff91fe1efcbfcc\",\"license\":\"MIT\"},\"src/rng/RNG.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity 0.8.24;\\n\\ninterface RNG {\\n /// @dev Request a random number.\\n /// @param _block Block linked to the request.\\n function requestRandomness(uint256 _block) external;\\n\\n /// @dev Receive the random number.\\n /// @param _block Block the random number is linked to.\\n /// @return randomNumber Random Number. If the number is not ready or has not been required 0 instead.\\n function receiveRandomness(uint256 _block) external returns (uint256 randomNumber);\\n}\\n\",\"keccak256\":\"0xf92e0cf768afefc5cc6ef786c263b67dd00c021aa5753213dbbc33014adb68c5\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040523480156200001157600080fd5b5060405162000f4c38038062000f4c83398101604081905262000034916200022d565b8433806000816200008c5760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000bf57620000bf8162000165565b5050506001600160a01b038116620000ea5760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b03199081166001600160a01b03938416179091556003805482169983169990991790985560048054909816961695909517909555600591909155600655506007805461ffff90931665ffffffffffff19909316929092176201000063ffffffff90921691909102179055620002c5565b336001600160a01b03821603620001bf5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c66000000000000000000604482015260640162000083565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b80516001600160a01b03811681146200022857600080fd5b919050565b600080600080600080600060e0888a0312156200024957600080fd5b620002548862000210565b9650620002646020890162000210565b9550620002746040890162000210565b9450606088015193506080880151925060a088015161ffff811681146200029a57600080fd5b60c089015190925063ffffffff81168114620002b557600080fd5b8091505092959891949750929550565b610c7780620002d56000396000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c806379ba5097116100b8578063b0fb162f1161007c578063b0fb162f146102b9578063e4c0aaf4146102da578063e86a51cb146102ed578063f2fde38b14610300578063f50d390d14610313578063f9f5dd911461032657600080fd5b806379ba5097146102675780638da5cb5b1461026f5780638ea98117146102805780639eccacf614610293578063b0049637146102a657600080fd5b80632e1daf2f1161010a5780632e1daf2f146101f25780632f68f4821461020557806339b1e245146102185780635257cd901461022b57806361728f391461024b5780637363ae1f1461025457600080fd5b806309c1ba2e146101475780630c340a241461016357806313cf90541461018e5780631fe543e3146101b257806324f74697146101c7575b600080fd5b61015060065481565b6040519081526020015b60405180910390f35b600354610176906001600160a01b031681565b6040516001600160a01b03909116815260200161015a565b61015061019c366004610a3b565b5060085460009081526009602052604090205490565b6101c56101c0366004610a54565b610339565b005b6007546101dd9062010000900463ffffffff1681565b60405163ffffffff909116815260200161015a565b600454610176906001600160a01b031681565b6101c5610213366004610a3b565b61038e565b6101c5610226366004610a3b565b6103bd565b610150610239366004610a3b565b60096020526000908152604090205481565b61015060055481565b6101c5610262366004610a3b565b6103ec565b6101c5610547565b6000546001600160a01b0316610176565b6101c561028e366004610ad3565b6105f1565b600254610176906001600160a01b031681565b6101c56102b4366004610ad3565b6106e3565b6007546102c79061ffff1681565b60405161ffff909116815260200161015a565b6101c56102e8366004610ad3565b61072f565b6101c56102fb366004610b03565b61077b565b6101c561030e366004610ad3565b6107c9565b6101c5610321366004610b29565b6107dd565b6101c5610334366004610ad3565b61081f565b6002546001600160a01b0316331461037e5760025460405163073e64fd60e21b81523360048201526001600160a01b0390911660248201526044015b60405180910390fd5b610389838383610849565b505050565b6003546001600160a01b031633146103b85760405162461bcd60e51b815260040161037590610b4d565b600555565b6003546001600160a01b031633146103e75760405162461bcd60e51b815260040161037590610b4d565b600655565b6004546001600160a01b0316331461043d5760405162461bcd60e51b8152602060048201526014602482015273536f72746974696f6e4d6f64756c65206f6e6c7960601b6044820152606401610375565b6002546040805160c081018252600554815260065460208083019190915260075461ffff81168385015262010000900463ffffffff16606083015260016080830181905283519182019093529182526000926001600160a01b031691639b1c385e919060a08201906104ae906108d2565b8152506040518263ffffffff1660e01b81526004016104cd9190610b74565b6020604051808303816000875af11580156104ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105109190610c12565b600881905560405190915081907f0cd21a41891ff04ecd9a8754bec97e2fb85d2a4e7694329d4dc364c796f23d0690600090a25050565b6001546001600160a01b0316331461059a5760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b6044820152606401610375565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000546001600160a01b0316331480159061061757506002546001600160a01b03163314155b15610668573361062f6000546001600160a01b031690565b60025460405163061db9c160e01b81526001600160a01b0393841660048201529183166024830152919091166044820152606401610375565b6001600160a01b03811661068f5760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fd1a6a14209a385a964d036e404cb5cfb71f4000cdb03c9366292430787261be69060200160405180910390a150565b6003546001600160a01b0316331461070d5760405162461bcd60e51b815260040161037590610b4d565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031633146107595760405162461bcd60e51b815260040161037590610b4d565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031633146107a55760405162461bcd60e51b815260040161037590610b4d565b6007805463ffffffff909216620100000265ffffffff000019909216919091179055565b6107d1610943565b6107da81610998565b50565b6003546001600160a01b031633146108075760405162461bcd60e51b815260040161037590610b4d565b6007805461ffff191661ffff92909216919091179055565b6003546001600160a01b0316331461068f5760405162461bcd60e51b815260040161037590610b4d565b8181600081811061085c5761085c610c2b565b905060200201356009600085815260200190815260200160002081905550827f5c69e7026b653d8606b5613bb00fd8c4b0504b1cbe8db600c406faac180924d5838360008181106108af576108af610c2b565b905060200201356040516108c591815260200190565b60405180910390a2505050565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161090b91511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b6000546001600160a01b031633146109965760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b6044820152606401610375565b565b336001600160a01b038216036109ea5760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b6044820152606401610375565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215610a4d57600080fd5b5035919050565b600080600060408486031215610a6957600080fd5b83359250602084013567ffffffffffffffff80821115610a8857600080fd5b818601915086601f830112610a9c57600080fd5b813581811115610aab57600080fd5b8760208260051b8501011115610ac057600080fd5b6020830194508093505050509250925092565b600060208284031215610ae557600080fd5b81356001600160a01b0381168114610afc57600080fd5b9392505050565b600060208284031215610b1557600080fd5b813563ffffffff81168114610afc57600080fd5b600060208284031215610b3b57600080fd5b813561ffff81168114610afc57600080fd5b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b60006020808352835160208401526020840151604084015261ffff6040850151166060840152606084015163ffffffff80821660808601528060808701511660a0860152505060a084015160c08085015280518060e086015260005b81811015610bed5782810184015186820161010001528301610bd0565b506101009250600083828701015282601f19601f830116860101935050505092915050565b600060208284031215610c2457600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220b1b6124dbccf3f00c097f6ec7ed9e50782f84104bf8df5577b9728b9e27f9ed864736f6c63430008180033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c806379ba5097116100b8578063b0fb162f1161007c578063b0fb162f146102b9578063e4c0aaf4146102da578063e86a51cb146102ed578063f2fde38b14610300578063f50d390d14610313578063f9f5dd911461032657600080fd5b806379ba5097146102675780638da5cb5b1461026f5780638ea98117146102805780639eccacf614610293578063b0049637146102a657600080fd5b80632e1daf2f1161010a5780632e1daf2f146101f25780632f68f4821461020557806339b1e245146102185780635257cd901461022b57806361728f391461024b5780637363ae1f1461025457600080fd5b806309c1ba2e146101475780630c340a241461016357806313cf90541461018e5780631fe543e3146101b257806324f74697146101c7575b600080fd5b61015060065481565b6040519081526020015b60405180910390f35b600354610176906001600160a01b031681565b6040516001600160a01b03909116815260200161015a565b61015061019c366004610a3b565b5060085460009081526009602052604090205490565b6101c56101c0366004610a54565b610339565b005b6007546101dd9062010000900463ffffffff1681565b60405163ffffffff909116815260200161015a565b600454610176906001600160a01b031681565b6101c5610213366004610a3b565b61038e565b6101c5610226366004610a3b565b6103bd565b610150610239366004610a3b565b60096020526000908152604090205481565b61015060055481565b6101c5610262366004610a3b565b6103ec565b6101c5610547565b6000546001600160a01b0316610176565b6101c561028e366004610ad3565b6105f1565b600254610176906001600160a01b031681565b6101c56102b4366004610ad3565b6106e3565b6007546102c79061ffff1681565b60405161ffff909116815260200161015a565b6101c56102e8366004610ad3565b61072f565b6101c56102fb366004610b03565b61077b565b6101c561030e366004610ad3565b6107c9565b6101c5610321366004610b29565b6107dd565b6101c5610334366004610ad3565b61081f565b6002546001600160a01b0316331461037e5760025460405163073e64fd60e21b81523360048201526001600160a01b0390911660248201526044015b60405180910390fd5b610389838383610849565b505050565b6003546001600160a01b031633146103b85760405162461bcd60e51b815260040161037590610b4d565b600555565b6003546001600160a01b031633146103e75760405162461bcd60e51b815260040161037590610b4d565b600655565b6004546001600160a01b0316331461043d5760405162461bcd60e51b8152602060048201526014602482015273536f72746974696f6e4d6f64756c65206f6e6c7960601b6044820152606401610375565b6002546040805160c081018252600554815260065460208083019190915260075461ffff81168385015262010000900463ffffffff16606083015260016080830181905283519182019093529182526000926001600160a01b031691639b1c385e919060a08201906104ae906108d2565b8152506040518263ffffffff1660e01b81526004016104cd9190610b74565b6020604051808303816000875af11580156104ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105109190610c12565b600881905560405190915081907f0cd21a41891ff04ecd9a8754bec97e2fb85d2a4e7694329d4dc364c796f23d0690600090a25050565b6001546001600160a01b0316331461059a5760405162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b6044820152606401610375565b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b6000546001600160a01b0316331480159061061757506002546001600160a01b03163314155b15610668573361062f6000546001600160a01b031690565b60025460405163061db9c160e01b81526001600160a01b0393841660048201529183166024830152919091166044820152606401610375565b6001600160a01b03811661068f5760405163d92e233d60e01b815260040160405180910390fd5b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fd1a6a14209a385a964d036e404cb5cfb71f4000cdb03c9366292430787261be69060200160405180910390a150565b6003546001600160a01b0316331461070d5760405162461bcd60e51b815260040161037590610b4d565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031633146107595760405162461bcd60e51b815260040161037590610b4d565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b031633146107a55760405162461bcd60e51b815260040161037590610b4d565b6007805463ffffffff909216620100000265ffffffff000019909216919091179055565b6107d1610943565b6107da81610998565b50565b6003546001600160a01b031633146108075760405162461bcd60e51b815260040161037590610b4d565b6007805461ffff191661ffff92909216919091179055565b6003546001600160a01b0316331461068f5760405162461bcd60e51b815260040161037590610b4d565b8181600081811061085c5761085c610c2b565b905060200201356009600085815260200190815260200160002081905550827f5c69e7026b653d8606b5613bb00fd8c4b0504b1cbe8db600c406faac180924d5838360008181106108af576108af610c2b565b905060200201356040516108c591815260200190565b60405180910390a2505050565b60607f92fd13387c7fe7befbc38d303d6468778fb9731bc4583f17d92989c6fcfdeaaa8260405160240161090b91511515815260200190565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915292915050565b6000546001600160a01b031633146109965760405162461bcd60e51b815260206004820152601660248201527527b7363c9031b0b63630b1363290313c9037bbb732b960511b6044820152606401610375565b565b336001600160a01b038216036109ea5760405162461bcd60e51b815260206004820152601760248201527621b0b73737ba103a3930b739b332b9103a379039b2b63360491b6044820152606401610375565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600060208284031215610a4d57600080fd5b5035919050565b600080600060408486031215610a6957600080fd5b83359250602084013567ffffffffffffffff80821115610a8857600080fd5b818601915086601f830112610a9c57600080fd5b813581811115610aab57600080fd5b8760208260051b8501011115610ac057600080fd5b6020830194508093505050509250925092565b600060208284031215610ae557600080fd5b81356001600160a01b0381168114610afc57600080fd5b9392505050565b600060208284031215610b1557600080fd5b813563ffffffff81168114610afc57600080fd5b600060208284031215610b3b57600080fd5b813561ffff81168114610afc57600080fd5b6020808252600d908201526c476f7665726e6f72206f6e6c7960981b604082015260600190565b60006020808352835160208401526020840151604084015261ffff6040850151166060840152606084015163ffffffff80821660808601528060808701511660a0860152505060a084015160c08085015280518060e086015260005b81811015610bed5782810184015186820161010001528301610bd0565b506101009250600083828701015282601f19601f830116860101935050505092915050565b600060208284031215610c2457600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220b1b6124dbccf3f00c097f6ec7ed9e50782f84104bf8df5577b9728b9e27f9ed864736f6c63430008180033", + "devdoc": { + "events": { + "RequestFulfilled(uint256,uint256)": { + "params": { + "randomWord": "The random value answering the request.", + "requestId": "The ID of the request" + } + }, + "RequestSent(uint256)": { + "details": "Emitted when a request is sent to the VRF Coordinator", + "params": { + "requestId": "The ID of the request" + } + } + }, + "kind": "dev", + "methods": { + "changeCallbackGasLimit(uint32)": { + "details": "Changes the callback gas limit of the contract.", + "params": { + "_callbackGasLimit": "The new callback gas limit." + } + }, + "changeGovernor(address)": { + "details": "Changes the governor of the contract.", + "params": { + "_governor": "The new governor." + } + }, + "changeKeyHash(bytes32)": { + "details": "Changes the key hash of the contract.", + "params": { + "_keyHash": "The new key hash." + } + }, + "changeRequestConfirmations(uint16)": { + "details": "Changes the request confirmations of the contract.", + "params": { + "_requestConfirmations": "The new request confirmations." + } + }, + "changeSortitionModule(address)": { + "details": "Changes the sortition module of the contract.", + "params": { + "_sortitionModule": "The new sortition module." + } + }, + "changeSubscriptionId(uint256)": { + "details": "Changes the subscription ID of the contract.", + "params": { + "_subscriptionId": "The new subscription ID." + } + }, + "changeVrfCoordinator(address)": { + "details": "Changes the VRF Coordinator of the contract.", + "params": { + "_vrfCoordinator": "The new VRF Coordinator." + } + }, + "constructor": { + "details": "Constructor, initializing the implementation to reduce attack surface.https://docs.chain.link/vrf/v2-5/subscription/get-a-random-number", + "params": { + "_callbackGasLimit": "The limit for how much gas to use for the callback request to the contract's fulfillRandomWords() function.", + "_governor": "The Governor of the contract.", + "_keyHash": "The gas lane key hash value - Defines the maximum gas price you are willing to pay for a request in wei (ID of the off-chain VRF job).", + "_requestConfirmations": "How many confirmations the Chainlink node should wait before responding.", + "_sortitionModule": "The address of the SortitionModule contract.", + "_subscriptionId": "The unique identifier of the subscription used for funding requests.", + "_vrfCoordinator": "The address of the VRFCoordinator contract." + } + }, + "receiveRandomness(uint256)": { + "details": "Return the random number.", + "returns": { + "randomNumber": "The random number or 0 if it is not ready or has not been requested." + } + }, + "requestRandomness(uint256)": { + "details": "Request a random number. SortitionModule only." + } + }, + "title": "Random Number Generator that uses Chainlink VRF v2.5 https://blog.chain.link/introducing-vrf-v2-5/", + "version": 1 + }, + "userdoc": { + "events": { + "RequestFulfilled(uint256,uint256)": { + "notice": "Emitted when a request has been fulfilled." + } + }, + "kind": "user", + "methods": { + "acceptOwnership()": { + "notice": "Allows an ownership transfer to be completed by the recipient." + }, + "owner()": { + "notice": "Get the current owner" + }, + "setCoordinator(address)": { + "notice": "Sets the VRF Coordinator addressThis method should only be callable by the coordinator or contract owner" + }, + "transferOwnership(address)": { + "notice": "Allows an owner to begin transferring ownership to a new address." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 29, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "s_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 31, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "s_pendingOwner", + "offset": 0, + "slot": "1", + "type": "t_address" + }, + { + "astId": 231, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "s_vrfCoordinator", + "offset": 0, + "slot": "2", + "type": "t_contract(IVRFCoordinatorV2Plus)380" + }, + { + "astId": 35404, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "governor", + "offset": 0, + "slot": "3", + "type": "t_address" + }, + { + "astId": 35406, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "sortitionModule", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 35408, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "keyHash", + "offset": 0, + "slot": "5", + "type": "t_bytes32" + }, + { + "astId": 35410, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "subscriptionId", + "offset": 0, + "slot": "6", + "type": "t_uint256" + }, + { + "astId": 35412, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "requestConfirmations", + "offset": 0, + "slot": "7", + "type": "t_uint16" + }, + { + "astId": 35414, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "callbackGasLimit", + "offset": 2, + "slot": "7", + "type": "t_uint32" + }, + { + "astId": 35416, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "lastRequestId", + "offset": 0, + "slot": "8", + "type": "t_uint256" + }, + { + "astId": 35420, + "contract": "src/rng/ChainlinkRNG.sol:ChainlinkRNG", + "label": "randomNumbers", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint256,t_uint256)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IVRFCoordinatorV2Plus)380": { + "encoding": "inplace", + "label": "contract IVRFCoordinatorV2Plus", + "numberOfBytes": "20" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_uint16": { + "encoding": "inplace", + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} diff --git a/contracts/deployments/arbitrumSepoliaDevnet/ChainlinkVRFCoordinator.json b/contracts/deployments/arbitrumSepoliaDevnet/ChainlinkVRFCoordinator.json new file mode 100644 index 000000000..0ad1f85b2 --- /dev/null +++ b/contracts/deployments/arbitrumSepoliaDevnet/ChainlinkVRFCoordinator.json @@ -0,0 +1,1753 @@ +{ + "address": "0x5CE8D5A2BC84beb22a398CCA51996F7930313D61", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "blockhashStore", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "internalBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "externalBalance", + "type": "uint256" + } + ], + "name": "BalanceInvariantViolated", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNum", + "type": "uint256" + } + ], + "name": "BlockhashNotInStore", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "coordinatorAddress", + "type": "address" + } + ], + "name": "CoordinatorAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "coordinatorAddress", + "type": "address" + } + ], + "name": "CoordinatorNotRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "FailedToSendNative", + "type": "error" + }, + { + "inputs": [], + "name": "FailedToTransferLink", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "have", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "want", + "type": "uint32" + } + ], + "name": "GasLimitTooBig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxGas", + "type": "uint256" + } + ], + "name": "GasPriceExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "IncorrectCommitment", + "type": "error" + }, + { + "inputs": [], + "name": "IndexOutOfRange", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidCalldata", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "InvalidConsumer", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidExtraArgsTag", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "linkWei", + "type": "int256" + } + ], + "name": "InvalidLinkWeiPrice", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "premiumPercentage", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "max", + "type": "uint8" + } + ], + "name": "InvalidPremiumPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "have", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "min", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "max", + "type": "uint16" + } + ], + "name": "InvalidRequestConfirmations", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSubscription", + "type": "error" + }, + { + "inputs": [], + "name": "LinkAlreadySet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "flatFeeLinkDiscountPPM", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "flatFeeNativePPM", + "type": "uint32" + } + ], + "name": "LinkDiscountTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "LinkNotSet", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "have", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "MsgDataTooBig", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proposedOwner", + "type": "address" + } + ], + "name": "MustBeRequestedOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "MustBeSubOwner", + "type": "error" + }, + { + "inputs": [], + "name": "NoCorrespondingRequest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + } + ], + "name": "NoSuchProvingKey", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "have", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "want", + "type": "uint32" + } + ], + "name": "NumWordsTooBig", + "type": "error" + }, + { + "inputs": [], + "name": "OnlyCallableFromLink", + "type": "error" + }, + { + "inputs": [], + "name": "PaymentTooLarge", + "type": "error" + }, + { + "inputs": [], + "name": "PendingRequestExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + } + ], + "name": "ProvingKeyAlreadyRegistered", + "type": "error" + }, + { + "inputs": [], + "name": "Reentrant", + "type": "error" + }, + { + "inputs": [], + "name": "TooManyConsumers", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "minimumRequestConfirmations", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxGasLimit", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "stalenessSeconds", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "gasAfterPaymentCalculation", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "int256", + "name": "fallbackWeiPerUnitLink", + "type": "int256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "fulfillmentFlatFeeNativePPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "fulfillmentFlatFeeLinkDiscountPPM", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "nativePremiumPercentage", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "linkPremiumPercentage", + "type": "uint8" + } + ], + "name": "ConfigSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "coordinatorAddress", + "type": "address" + } + ], + "name": "CoordinatorDeregistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "coordinatorAddress", + "type": "address" + } + ], + "name": "CoordinatorRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "fallbackWeiPerUnitLink", + "type": "int256" + } + ], + "name": "FallbackWeiPerUnitLinkUsed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "FundsRecovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newCoordinator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "MigrationCompleted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "NativeFundsRecovered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OwnershipTransferRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "maxGas", + "type": "uint64" + } + ], + "name": "ProvingKeyDeregistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "maxGas", + "type": "uint64" + } + ], + "name": "ProvingKeyRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "outputSeed", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint96", + "name": "payment", + "type": "uint96" + }, + { + "indexed": false, + "internalType": "bool", + "name": "nativePayment", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "indexed": false, + "internalType": "bool", + "name": "onlyPremium", + "type": "bool" + } + ], + "name": "RandomWordsFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "preSeed", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "minimumRequestConfirmations", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "numWords", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "extraArgs", + "type": "bytes" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RandomWordsRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountLink", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountNative", + "type": "uint256" + } + ], + "name": "SubscriptionCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "SubscriptionConsumerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "SubscriptionConsumerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "SubscriptionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "SubscriptionFunded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldNativeBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newNativeBalance", + "type": "uint256" + } + ], + "name": "SubscriptionFundedWithNative", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "SubscriptionOwnerTransferRequested", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "SubscriptionOwnerTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "BLOCKHASH_STORE", + "outputs": [ + { + "internalType": "contract BlockhashStoreInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LINK", + "outputs": [ + { + "internalType": "contract LinkTokenInterface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "LINK_NATIVE_FEED", + "outputs": [ + { + "internalType": "contract AggregatorV3Interface", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_CONSUMERS", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_NUM_WORDS", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_REQUEST_CONFIRMATIONS", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "acceptSubscriptionOwnerTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "addConsumer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "cancelSubscription", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "createSubscription", + "outputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "deregisterMigratableCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "publicProvingKey", + "type": "uint256[2]" + } + ], + "name": "deregisterProvingKey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256[2]", + "name": "pk", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "gamma", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "c", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "s", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "seed", + "type": "uint256" + }, + { + "internalType": "address", + "name": "uWitness", + "type": "address" + }, + { + "internalType": "uint256[2]", + "name": "cGammaWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "sHashWitness", + "type": "uint256[2]" + }, + { + "internalType": "uint256", + "name": "zInv", + "type": "uint256" + } + ], + "internalType": "struct VRF.Proof", + "name": "proof", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint64", + "name": "blockNum", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "numWords", + "type": "uint32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "extraArgs", + "type": "bytes" + } + ], + "internalType": "struct VRFTypes.RequestCommitmentV2Plus", + "name": "rc", + "type": "tuple" + }, + { + "internalType": "bool", + "name": "onlyPremium", + "type": "bool" + } + ], + "name": "fulfillRandomWords", + "outputs": [ + { + "internalType": "uint96", + "name": "payment", + "type": "uint96" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "fundSubscriptionWithNative", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "startIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxCount", + "type": "uint256" + } + ], + "name": "getActiveSubscriptionIds", + "outputs": [ + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "getSubscription", + "outputs": [ + { + "internalType": "uint96", + "name": "balance", + "type": "uint96" + }, + { + "internalType": "uint96", + "name": "nativeBalance", + "type": "uint96" + }, + { + "internalType": "uint64", + "name": "reqCount", + "type": "uint64" + }, + { + "internalType": "address", + "name": "subOwner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "consumers", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "publicKey", + "type": "uint256[2]" + } + ], + "name": "hashOfKey", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newCoordinator", + "type": "address" + } + ], + "name": "migrate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "onTokenTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "ownerCancelSubscription", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + } + ], + "name": "pendingRequestExists", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "recoverFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "to", + "type": "address" + } + ], + "name": "recoverNativeFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "registerMigratableCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[2]", + "name": "publicProvingKey", + "type": "uint256[2]" + }, + { + "internalType": "uint64", + "name": "maxGas", + "type": "uint64" + } + ], + "name": "registerProvingKey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "consumer", + "type": "address" + } + ], + "name": "removeConsumer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "keyHash", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "requestConfirmations", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "callbackGasLimit", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "numWords", + "type": "uint32" + }, + { + "internalType": "bytes", + "name": "extraArgs", + "type": "bytes" + } + ], + "internalType": "struct VRFV2PlusClient.RandomWordsRequest", + "name": "req", + "type": "tuple" + } + ], + "name": "requestRandomWords", + "outputs": [ + { + "internalType": "uint256", + "name": "requestId", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "subId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "requestSubscriptionOwnerTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "s_config", + "outputs": [ + { + "internalType": "uint16", + "name": "minimumRequestConfirmations", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "maxGasLimit", + "type": "uint32" + }, + { + "internalType": "bool", + "name": "reentrancyLock", + "type": "bool" + }, + { + "internalType": "uint32", + "name": "stalenessSeconds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "gasAfterPaymentCalculation", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "fulfillmentFlatFeeNativePPM", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "fulfillmentFlatFeeLinkDiscountPPM", + "type": "uint32" + }, + { + "internalType": "uint8", + "name": "nativePremiumPercentage", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "linkPremiumPercentage", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "s_currentSubNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "s_fallbackWeiPerUnitLink", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "s_provingKeyHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "s_provingKeys", + "outputs": [ + { + "internalType": "bool", + "name": "exists", + "type": "bool" + }, + { + "internalType": "uint64", + "name": "maxGas", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "s_requestCommitments", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "s_totalBalance", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "s_totalNativeBalance", + "outputs": [ + { + "internalType": "uint96", + "name": "", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "minimumRequestConfirmations", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "maxGasLimit", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "stalenessSeconds", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "gasAfterPaymentCalculation", + "type": "uint32" + }, + { + "internalType": "int256", + "name": "fallbackWeiPerUnitLink", + "type": "int256" + }, + { + "internalType": "uint32", + "name": "fulfillmentFlatFeeNativePPM", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "fulfillmentFlatFeeLinkDiscountPPM", + "type": "uint32" + }, + { + "internalType": "uint8", + "name": "nativePremiumPercentage", + "type": "uint8" + }, + { + "internalType": "uint8", + "name": "linkPremiumPercentage", + "type": "uint8" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "link", + "type": "address" + }, + { + "internalType": "address", + "name": "linkNativeFeed", + "type": "address" + } + ], + "name": "setLINKAndLINKNativeFeed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + } + ], + "name": "withdrawNative", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/contracts/src/rng/ChainlinkRNG.sol b/contracts/src/rng/ChainlinkRNG.sol index 41f2f770a..54883b283 100644 --- a/contracts/src/rng/ChainlinkRNG.sol +++ b/contracts/src/rng/ChainlinkRNG.sol @@ -21,7 +21,7 @@ contract ChainlinkRNG is RNG, VRFConsumerBaseV2Plus { uint16 public requestConfirmations; // How many confirmations the Chainlink node should wait before responding. // 22 bytes remaining in slot uint32 public callbackGasLimit; // Gas limit for the Chainlink callback. - uint256 lastRequestId; // The last request ID. + uint256 public lastRequestId; // The last request ID. mapping(uint256 requestId => uint256 number) public randomNumbers; // randomNumbers[requestID] is the random number for this request id, 0 otherwise. // ************************************* //