@chainlink/contracts
Version:
Chainlink smart contracts
1,181 lines (1,180 loc) • 23 kB
JSON
[
{
"inputs": [
{
"internalType": "uint96",
"name": "_baseFee",
"type": "uint96"
},
{
"internalType": "uint96",
"name": "_gasPrice",
"type": "uint96"
},
{
"internalType": "int256",
"name": "_weiPerUnitLink",
"type": "int256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "internalBalance",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "externalBalance",
"type": "uint256"
}
],
"name": "BalanceInvariantViolated",
"type": "error"
},
{
"inputs": [],
"name": "FailedToSendNative",
"type": "error"
},
{
"inputs": [],
"name": "FailedToTransferLink",
"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": [],
"name": "InvalidRandomWords",
"type": "error"
},
{
"inputs": [],
"name": "InvalidRequest",
"type": "error"
},
{
"inputs": [],
"name": "InvalidSubscription",
"type": "error"
},
{
"inputs": [],
"name": "LinkAlreadySet",
"type": "error"
},
{
"inputs": [],
"name": "LinkNotSet",
"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": "NotImplemented",
"type": "error"
},
{
"inputs": [],
"name": "OnlyCallableFromLink",
"type": "error"
},
{
"inputs": [],
"name": "PendingRequestExists",
"type": "error"
},
{
"inputs": [],
"name": "Reentrant",
"type": "error"
},
{
"inputs": [],
"name": "TooManyConsumers",
"type": "error"
},
{
"anonymous": false,
"inputs": [],
"name": "ConfigSet",
"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": "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": 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": "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": "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": [
{
"internalType": "uint256",
"name": "_subId",
"type": "uint256"
},
{
"internalType": "address",
"name": "_consumer",
"type": "address"
}
],
"name": "consumerIsAdded",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "createSubscription",
"outputs": [
{
"internalType": "uint256",
"name": "subId",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_requestId",
"type": "uint256"
},
{
"internalType": "address",
"name": "_consumer",
"type": "address"
}
],
"name": "fulfillRandomWords",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_requestId",
"type": "uint256"
},
{
"internalType": "address",
"name": "_consumer",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "_words",
"type": "uint256[]"
}
],
"name": "fulfillRandomWordsWithOverride",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_subId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "fundSubscription",
"outputs": [],
"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": [],
"name": "i_base_fee",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "i_gas_price",
"outputs": [
{
"internalType": "uint96",
"name": "",
"type": "uint96"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "i_wei_per_unit_link",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"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": "",
"type": "uint256"
}
],
"name": "pendingRequestExists",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "pure",
"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": "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": "",
"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_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": [],
"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"
}
]