@d20dao/vrf-sdk 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/abi.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // Generated from canonical protocol sources with solc 0.8.28+commit.7893614a.Emscripten.clang.
2
- export const coordinatorAbi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "AlreadyDelivered", "type": "error" }, { "inputs": [], "name": "AlreadyFulfilled", "type": "error" }, { "inputs": [], "name": "BlockHashUnavailable", "type": "error" }, { "inputs": [], "name": "ContractConsumerRequired", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "EpochUnavailable", "type": "error" }, { "inputs": [], "name": "EvidencePacketTooLarge", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "expected", "type": "uint256" }, { "internalType": "uint256", "name": "actual", "type": "uint256" }], "name": "IncorrectFee", "type": "error" }, { "inputs": [], "name": "InsufficientCallbackGas", "type": "error" }, { "inputs": [], "name": "InvalidCallbackGas", "type": "error" }, { "inputs": [], "name": "InvalidConfig", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "InvalidMapping", "type": "error" }, { "inputs": [], "name": "InvalidPublicKey", "type": "error" }, { "inputs": [], "name": "InvalidRefundAddress", "type": "error" }, { "inputs": [], "name": "InvalidScan", "type": "error" }, { "inputs": [], "name": "NoKeeperCredit", "type": "error" }, { "inputs": [], "name": "NoRefundCredit", "type": "error" }, { "inputs": [], "name": "NotFulfilled", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "NotReady", "type": "error" }, { "inputs": [], "name": "NotRefunded", "type": "error" }, { "inputs": [], "name": "OnlyFeeRecipient", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "ReentrancyGuardReentrantCall", "type": "error" }, { "inputs": [], "name": "RefundCallbackAlreadyDelivered", "type": "error" }, { "inputs": [], "name": "RefundNotAvailable", "type": "error" }, { "inputs": [], "name": "RequestExpired", "type": "error" }, { "inputs": [], "name": "RequestRefunded", "type": "error" }, { "inputs": [], "name": "TransferFailed", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "inputs": [], "name": "UnknownRequest", "type": "error" }, { "inputs": [], "name": "WrongPublicKey", "type": "error" }, { "inputs": [], "name": "WrongSeed", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "uint64", "name": "targetBlock", "type": "uint64" }, { "indexed": false, "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }], "name": "BlockHashStored", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "bool", "name": "success", "type": "bool" }, { "indexed": false, "internalType": "uint32", "name": "gasLimit", "type": "uint32" }], "name": "CallbackAttempted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousRecipient", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newRecipient", "type": "address" }], "name": "FeeRecipientChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "FeesWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "transcriptHash", "type": "bytes32" }, { "indexed": false, "internalType": "bytes", "name": "packet", "type": "bytes" }], "name": "FulfillmentEvidence", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "keeper", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "KeeperCreditWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint16", "name": "previousBps", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "newBps", "type": "uint16" }], "name": "KeeperFeeBpsChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "keeper", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "bool", "name": "paid", "type": "bool" }], "name": "KeeperFeePaid", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "mappingHash", "type": "bytes32" }, { "components": [{ "internalType": "enum RandomnessMapping.Operation", "name": "operation", "type": "uint8" }, { "internalType": "uint256", "name": "lower", "type": "uint256" }, { "internalType": "uint256", "name": "upper", "type": "uint256" }, { "internalType": "uint32", "name": "count", "type": "uint32" }, { "internalType": "uint32", "name": "population", "type": "uint32" }], "indexed": false, "internalType": "struct RandomnessMapping.Spec", "name": "spec", "type": "tuple" }], "name": "MappingRequested", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferStarted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "keyHash", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "seed", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "proofHash", "type": "bytes32" }], "name": "ProofVerified", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "randomness", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "submitter", "type": "address" }], "name": "RandomnessFulfilled", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "consumer", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "keyHash", "type": "bytes32" }, { "indexed": false, "internalType": "bytes32", "name": "clientSeed", "type": "bytes32" }, { "indexed": false, "internalType": "uint64", "name": "requestBlock", "type": "uint64" }, { "indexed": false, "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "indexed": false, "internalType": "uint256", "name": "feePaid", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "refundAddress", "type": "address" }, { "indexed": false, "internalType": "uint64", "name": "deadline", "type": "uint64" }], "name": "RandomnessRequested", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "consumer", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "success", "type": "bool" }, { "indexed": false, "internalType": "uint32", "name": "gasLimit", "type": "uint32" }], "name": "RefundCallbackAttempted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "RefundCreditWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "refundAddress", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "bool", "name": "paid", "type": "bool" }], "name": "RequestRefundedTo", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "serveIndex", "type": "uint256" }], "name": "RequestServed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "CONFIG_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_CALLBACK_GAS", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_EVIDENCE_PACKET_BYTES", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MIN_CALLBACK_GAS", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "REFUND_CALLBACK_GAS", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "RESPONSE_TIMEOUT", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "SEED_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "TRANSCRIPT_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "confirmationBlocks", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "earnedFees", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "epochRegistry", "outputs": [{ "internalType": "contract EpochEntropy", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeRecipient", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "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" }], "name": "fulfillRandomness", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "getMappedResult", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "getMapping", "outputs": [{ "components": [{ "internalType": "enum RandomnessMapping.Operation", "name": "operation", "type": "uint8" }, { "internalType": "uint256", "name": "lower", "type": "uint256" }, { "internalType": "uint256", "name": "upper", "type": "uint256" }, { "internalType": "uint32", "name": "count", "type": "uint32" }, { "internalType": "uint32", "name": "population", "type": "uint32" }], "internalType": "struct RandomnessMapping.Spec", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "fromId", "type": "uint256" }, { "internalType": "uint256", "name": "limit", "type": "uint256" }], "name": "getPendingRequestIds", "outputs": [{ "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, { "internalType": "uint256", "name": "nextCursor", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "getProofContext", "outputs": [{ "internalType": "uint256", "name": "seed", "type": "uint256" }, { "internalType": "uint64", "name": "deadline", "type": "uint64" }, { "internalType": "bool", "name": "fulfilled", "type": "bool" }, { "internalType": "bool", "name": "refunded", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "getRequest", "outputs": [{ "components": [{ "internalType": "address", "name": "consumer", "type": "address" }, { "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "internalType": "uint64", "name": "requestBlock", "type": "uint64" }, { "internalType": "uint64", "name": "targetBlock", "type": "uint64" }, { "internalType": "uint64", "name": "deadline", "type": "uint64" }, { "internalType": "address", "name": "refundAddress", "type": "address" }, { "internalType": "bytes32", "name": "clientSeed", "type": "bytes32" }, { "internalType": "bytes32", "name": "mappingHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "randomness", "type": "bytes32" }, { "internalType": "bytes32", "name": "proofHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "transcriptHash", "type": "bytes32" }, { "internalType": "bool", "name": "fulfilled", "type": "bool" }, { "internalType": "bool", "name": "delivered", "type": "bool" }, { "internalType": "bool", "name": "refunded", "type": "bool" }, { "internalType": "uint64", "name": "epochId", "type": "uint64" }, { "internalType": "bytes32", "name": "epochHash", "type": "bytes32" }], "internalType": "struct D20VRFCoordinator.Request", "name": "result", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "initialFeeRecipient", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[2]", "name": "publicKey", "type": "uint256[2]" }, { "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint16", "name": "confirmations", "type": "uint16" }, { "internalType": "contract EpochEntropy", "name": "registry", "type": "address" }, { "internalType": "uint16", "name": "keeperBps", "type": "uint16" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "keeperCredits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "keeperFeeBps", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "keyHash", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastServedIndex", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastServedRequestId", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "randomness", "type": "bytes32" }, { "components": [{ "internalType": "enum RandomnessMapping.Operation", "name": "operation", "type": "uint8" }, { "internalType": "uint256", "name": "lower", "type": "uint256" }, { "internalType": "uint256", "name": "upper", "type": "uint256" }, { "internalType": "uint32", "name": "count", "type": "uint32" }, { "internalType": "uint32", "name": "population", "type": "uint32" }], "internalType": "struct RandomnessMapping.Spec", "name": "spec", "type": "tuple" }], "name": "mapRandomness", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "nextRequestId", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingOwner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "protocolConfigurationHash", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "publicKeyX", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "publicKeyY", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "refundCallbackDelivered", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "refundCredits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "refundRequest", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "requestFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "clientSeed", "type": "bytes32" }, { "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "internalType": "address", "name": "_refundAddress", "type": "address" }, { "components": [{ "internalType": "enum RandomnessMapping.Operation", "name": "operation", "type": "uint8" }, { "internalType": "uint256", "name": "lower", "type": "uint256" }, { "internalType": "uint256", "name": "upper", "type": "uint256" }, { "internalType": "uint32", "name": "count", "type": "uint32" }, { "internalType": "uint32", "name": "population", "type": "uint32" }], "internalType": "struct RandomnessMapping.Spec", "name": "spec", "type": "tuple" }], "name": "requestMappedRandomness", "outputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "clientSeed", "type": "bytes32" }, { "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "internalType": "address", "name": "_refundAddress", "type": "address" }], "name": "requestRandomness", "outputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "requestSeed", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "internalType": "uint32", "name": "gasLimit", "type": "uint32" }], "name": "retryCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "internalType": "uint32", "name": "gasLimit", "type": "uint32" }], "name": "retryRefundCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "servedRequestAt", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "next", "type": "address" }], "name": "setFeeRecipient", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint16", "name": "next", "type": "uint16" }], "name": "setKeeperFeeBps", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "storeBlockHash", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "totalKeeperCredits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalRefundCredits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "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" }], "name": "verifyRequestProof", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "recipient", "type": "address" }], "name": "withdrawFees", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "recipient", "type": "address" }], "name": "withdrawKeeperCredit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "recipient", "type": "address" }], "name": "withdrawRefundCredit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
3
- export const epochEntropyAbi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "AlreadyCommitted", "type": "error" }, { "inputs": [], "name": "AnchorUnavailable", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidConfig", "type": "error" }, { "inputs": [], "name": "InvalidData", "type": "error" }, { "inputs": [], "name": "InvalidEpoch", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "InvalidSigner", "type": "error" }, { "inputs": [], "name": "InvalidTime", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "OnlyCommitter", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "PacketTooLarge", "type": "error" }, { "inputs": [], "name": "PreparationClosed", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousCommitter", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newCommitter", "type": "address" }], "name": "CommitterChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint64", "name": "epochId", "type": "uint64" }, { "indexed": true, "internalType": "bytes32", "name": "epochHash", "type": "bytes32" }, { "indexed": false, "internalType": "bytes", "name": "packet", "type": "bytes" }], "name": "EpochCommitted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferStarted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "EPOCH_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "EPOCH_LENGTH", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_PACKET_BYTES", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "RECIPE_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "SELECT_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "anuSigner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "btcTradeSigner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "catalogHash", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "checkpointEpoch", "outputs": [{ "internalType": "bytes32", "name": "anchor", "type": "bytes32" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }, { "components": [{ "internalType": "uint256", "name": "timestamp", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "bytes", "name": "signature", "type": "bytes" }], "internalType": "struct EpochEntropy.Attestation", "name": "a", "type": "tuple" }], "name": "commitEpoch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "committer", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "name": "epochAnchors", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "number", "type": "uint256" }], "name": "epochForBlock", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "epochStart", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ethTradeSigner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "firstEpochStart", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "getEpoch", "outputs": [{ "components": [{ "internalType": "bytes32", "name": "epochHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "catalogHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "anchorHash", "type": "bytes32" }, { "internalType": "uint8", "name": "source", "type": "uint8" }, { "internalType": "bytes32", "name": "queryHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "dataHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "attestationHash", "type": "bytes32" }, { "internalType": "uint256", "name": "signedAt", "type": "uint256" }, { "internalType": "uint64", "name": "committedBlock", "type": "uint64" }], "internalType": "struct EpochEntropy.Epoch", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "getEpochSelection", "outputs": [{ "components": [{ "internalType": "uint8", "name": "source", "type": "uint8" }, { "internalType": "address", "name": "airnode", "type": "address" }, { "internalType": "bytes32", "name": "selector", "type": "bytes32" }, { "internalType": "bytes32", "name": "queryHash", "type": "bytes32" }, { "internalType": "string", "name": "canonicalRequest", "type": "string" }], "internalType": "struct EpochEntropy.Selection", "name": "s", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "hyperliquidSigner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[4]", "name": "signers", "type": "address[4]" }, { "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "address", "name": "initialCommitter", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "number", "type": "uint256" }], "name": "nextEpochToPrepare", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingOwner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "next", "type": "address" }], "name": "setCommitter", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
2
+ export const coordinatorAbi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "AlreadyDelivered", "type": "error" }, { "inputs": [], "name": "AlreadyFulfilled", "type": "error" }, { "inputs": [], "name": "BlockHashUnavailable", "type": "error" }, { "inputs": [], "name": "ContractConsumerRequired", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "EpochUnavailable", "type": "error" }, { "inputs": [], "name": "EvidencePacketTooLarge", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "FeeOverflow", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "expected", "type": "uint256" }, { "internalType": "uint256", "name": "actual", "type": "uint256" }], "name": "IncorrectFee", "type": "error" }, { "inputs": [], "name": "InsufficientCallbackGas", "type": "error" }, { "inputs": [], "name": "InvalidBatch", "type": "error" }, { "inputs": [], "name": "InvalidCallbackGas", "type": "error" }, { "inputs": [], "name": "InvalidConfig", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "InvalidMapping", "type": "error" }, { "inputs": [], "name": "InvalidPublicKey", "type": "error" }, { "inputs": [], "name": "InvalidRefundAddress", "type": "error" }, { "inputs": [], "name": "InvalidScan", "type": "error" }, { "inputs": [], "name": "NoKeeperCredit", "type": "error" }, { "inputs": [], "name": "NoRefundCredit", "type": "error" }, { "inputs": [], "name": "NotFulfilled", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "NotReady", "type": "error" }, { "inputs": [], "name": "NotRefunded", "type": "error" }, { "inputs": [], "name": "OnlyFeeRecipient", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "ReentrancyGuardReentrantCall", "type": "error" }, { "inputs": [], "name": "RefundCallbackAlreadyDelivered", "type": "error" }, { "inputs": [], "name": "RefundNotAvailable", "type": "error" }, { "inputs": [], "name": "RenounceDisabled", "type": "error" }, { "inputs": [], "name": "RequestExpired", "type": "error" }, { "inputs": [], "name": "RequestRefunded", "type": "error" }, { "inputs": [], "name": "TransferFailed", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "inputs": [], "name": "UnknownRequest", "type": "error" }, { "inputs": [], "name": "WrongPublicKey", "type": "error" }, { "inputs": [], "name": "WrongSeed", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "uint64", "name": "targetBlock", "type": "uint64" }, { "indexed": false, "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }], "name": "BlockHashStored", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "bool", "name": "success", "type": "bool" }, { "indexed": false, "internalType": "uint32", "name": "gasLimit", "type": "uint32" }], "name": "CallbackAttempted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "refundAddress", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "FeeOverpaymentCredited", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousRecipient", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newRecipient", "type": "address" }], "name": "FeeRecipientChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "FeesWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "transcriptHash", "type": "bytes32" }, { "indexed": false, "internalType": "bytes", "name": "packet", "type": "bytes" }], "name": "FulfillmentEvidence", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "uint8", "name": "reason", "type": "uint8" }], "name": "FulfillmentSkipped", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "keeper", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "KeeperCreditWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint16", "name": "previousBps", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "newBps", "type": "uint16" }], "name": "KeeperFeeBpsChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "keeper", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "bool", "name": "paid", "type": "bool" }], "name": "KeeperFeePaid", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "mappingHash", "type": "bytes32" }, { "components": [{ "internalType": "enum RandomnessMapping.Operation", "name": "operation", "type": "uint8" }, { "internalType": "uint256", "name": "lower", "type": "uint256" }, { "internalType": "uint256", "name": "upper", "type": "uint256" }, { "internalType": "uint32", "name": "count", "type": "uint32" }, { "internalType": "uint32", "name": "population", "type": "uint32" }], "indexed": false, "internalType": "struct RandomnessMapping.Spec", "name": "spec", "type": "tuple" }], "name": "MappingRequested", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferStarted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint256", "name": "minFee", "type": "uint256" }, { "indexed": false, "internalType": "uint16", "name": "feeMultiplier", "type": "uint16" }, { "indexed": false, "internalType": "uint32", "name": "fulfillGasOverhead", "type": "uint32" }], "name": "PricingChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "bytes32", "name": "keyHash", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "seed", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "proofHash", "type": "bytes32" }], "name": "ProofVerified", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "randomness", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "submitter", "type": "address" }], "name": "RandomnessFulfilled", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "consumer", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "keyHash", "type": "bytes32" }, { "indexed": false, "internalType": "bytes32", "name": "clientSeed", "type": "bytes32" }, { "indexed": false, "internalType": "uint64", "name": "requestBlock", "type": "uint64" }, { "indexed": false, "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "indexed": false, "internalType": "uint256", "name": "feePaid", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "refundAddress", "type": "address" }, { "indexed": false, "internalType": "uint64", "name": "deadline", "type": "uint64" }], "name": "RandomnessRequested", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint16", "name": "previousBps", "type": "uint16" }, { "indexed": false, "internalType": "uint16", "name": "newBps", "type": "uint16" }], "name": "RefundBpsChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "consumer", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "success", "type": "bool" }, { "indexed": false, "internalType": "uint32", "name": "gasLimit", "type": "uint32" }], "name": "RefundCallbackAttempted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "RefundCreditWithdrawn", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "address", "name": "refundAddress", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, { "indexed": false, "internalType": "bool", "name": "paid", "type": "bool" }], "name": "RequestRefundedTo", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "indexed": true, "internalType": "uint256", "name": "serveIndex", "type": "uint256" }], "name": "RequestServed", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "CONFIG_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_CALLBACK_GAS", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_EVIDENCE_PACKET_BYTES", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_FEE_MULTIPLIER", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_FULFILL_BATCH", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_FULFILL_GAS_OVERHEAD", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_MIN_FEE", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MIN_CALLBACK_GAS", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MIN_FULFILL_GAS_OVERHEAD", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MIN_REFUND_BPS", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "REFUND_CALLBACK_GAS", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "RESPONSE_TIMEOUT", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "SEED_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "TRANSCRIPT_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "confirmationBlocks", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "earnedFees", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "epochRegistry", "outputs": [{ "internalType": "contract EpochEntropy", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeMultiplier", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "feeRecipient", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "fulfillGasOverhead", "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "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" }], "name": "fulfillRandomness", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, { "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": "proofs", "type": "tuple[]" }], "name": "fulfillRandomnessBatch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "getMappedResult", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "getMapping", "outputs": [{ "components": [{ "internalType": "enum RandomnessMapping.Operation", "name": "operation", "type": "uint8" }, { "internalType": "uint256", "name": "lower", "type": "uint256" }, { "internalType": "uint256", "name": "upper", "type": "uint256" }, { "internalType": "uint32", "name": "count", "type": "uint32" }, { "internalType": "uint32", "name": "population", "type": "uint32" }], "internalType": "struct RandomnessMapping.Spec", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "fromId", "type": "uint256" }, { "internalType": "uint256", "name": "limit", "type": "uint256" }], "name": "getPendingRequestIds", "outputs": [{ "internalType": "uint256[]", "name": "ids", "type": "uint256[]" }, { "internalType": "uint256", "name": "nextCursor", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "getProofContext", "outputs": [{ "internalType": "uint256", "name": "seed", "type": "uint256" }, { "internalType": "uint64", "name": "deadline", "type": "uint64" }, { "internalType": "bool", "name": "fulfilled", "type": "bool" }, { "internalType": "bool", "name": "refunded", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "getRequest", "outputs": [{ "components": [{ "internalType": "address", "name": "consumer", "type": "address" }, { "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "internalType": "uint64", "name": "requestBlock", "type": "uint64" }, { "internalType": "uint64", "name": "targetBlock", "type": "uint64" }, { "internalType": "uint64", "name": "deadline", "type": "uint64" }, { "internalType": "address", "name": "refundAddress", "type": "address" }, { "internalType": "bytes32", "name": "clientSeed", "type": "bytes32" }, { "internalType": "bytes32", "name": "mappingHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "blockHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "randomness", "type": "bytes32" }, { "internalType": "bytes32", "name": "proofHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "transcriptHash", "type": "bytes32" }, { "internalType": "bool", "name": "fulfilled", "type": "bool" }, { "internalType": "bool", "name": "delivered", "type": "bool" }, { "internalType": "bool", "name": "refunded", "type": "bool" }, { "internalType": "uint64", "name": "epochId", "type": "uint64" }, { "internalType": "bytes32", "name": "epochHash", "type": "bytes32" }], "internalType": "struct D20VRFCoordinator.Request", "name": "result", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "initialFeeRecipient", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "initialMinFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256[2]", "name": "publicKey", "type": "uint256[2]" }, { "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "uint256", "name": "fee", "type": "uint256" }, { "internalType": "uint16", "name": "confirmations", "type": "uint16" }, { "internalType": "contract EpochEntropy", "name": "registry", "type": "address" }, { "internalType": "uint16", "name": "keeperBps", "type": "uint16" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "keeperCredits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "keeperFeeBps", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "keyHash", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastServedIndex", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "lastServedRequestId", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "randomness", "type": "bytes32" }, { "components": [{ "internalType": "enum RandomnessMapping.Operation", "name": "operation", "type": "uint8" }, { "internalType": "uint256", "name": "lower", "type": "uint256" }, { "internalType": "uint256", "name": "upper", "type": "uint256" }, { "internalType": "uint32", "name": "count", "type": "uint32" }, { "internalType": "uint32", "name": "population", "type": "uint32" }], "internalType": "struct RandomnessMapping.Spec", "name": "spec", "type": "tuple" }], "name": "mapRandomness", "outputs": [{ "internalType": "uint256[]", "name": "", "type": "uint256[]" }], "stateMutability": "pure", "type": "function" }, { "inputs": [], "name": "minFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "nextRequestId", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingOwner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pricing", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "uint16", "name": "", "type": "uint16" }, { "internalType": "uint32", "name": "", "type": "uint32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "protocolConfigurationHash", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "publicKeyX", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "publicKeyY", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }], "name": "quoteFee", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "internalType": "uint256", "name": "baseFee", "type": "uint256" }], "name": "quoteFeeAt", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "refundBps", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "refundCallbackDelivered", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "", "type": "address" }], "name": "refundCredits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "refundRequest", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "requestFeePaid", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "clientSeed", "type": "bytes32" }, { "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "internalType": "address", "name": "_refundAddress", "type": "address" }, { "components": [{ "internalType": "enum RandomnessMapping.Operation", "name": "operation", "type": "uint8" }, { "internalType": "uint256", "name": "lower", "type": "uint256" }, { "internalType": "uint256", "name": "upper", "type": "uint256" }, { "internalType": "uint32", "name": "count", "type": "uint32" }, { "internalType": "uint32", "name": "population", "type": "uint32" }], "internalType": "struct RandomnessMapping.Spec", "name": "spec", "type": "tuple" }], "name": "requestMappedRandomness", "outputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "clientSeed", "type": "bytes32" }, { "internalType": "uint32", "name": "callbackGasLimit", "type": "uint32" }, { "internalType": "address", "name": "_refundAddress", "type": "address" }], "name": "requestRandomness", "outputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "requestRefundBps", "outputs": [{ "internalType": "uint16", "name": "", "type": "uint16" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "requestSeed", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "internalType": "uint32", "name": "gasLimit", "type": "uint32" }], "name": "retryCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "internalType": "uint32", "name": "gasLimit", "type": "uint32" }], "name": "retryRefundCallback", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "name": "servedRequestAt", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "next", "type": "address" }], "name": "setFeeRecipient", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint16", "name": "next", "type": "uint16" }], "name": "setKeeperFeeBps", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "nextMinFee", "type": "uint256" }, { "internalType": "uint16", "name": "multiplier", "type": "uint16" }, { "internalType": "uint32", "name": "overhead", "type": "uint32" }], "name": "setPricing", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint16", "name": "next", "type": "uint16" }], "name": "setRefundBps", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }], "name": "storeBlockHash", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "totalKeeperCredits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalRefundCredits", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "requestId", "type": "uint256" }, { "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" }], "name": "verifyRequestProof", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "recipient", "type": "address" }], "name": "withdrawFees", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "recipient", "type": "address" }], "name": "withdrawKeeperCredit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address payable", "name": "recipient", "type": "address" }], "name": "withdrawRefundCredit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }];
3
+ export const epochEntropyAbi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [{ "internalType": "address", "name": "target", "type": "address" }], "name": "AddressEmptyCode", "type": "error" }, { "inputs": [], "name": "AlreadyCommitted", "type": "error" }, { "inputs": [], "name": "AnchorUnavailable", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }], "name": "ERC1967InvalidImplementation", "type": "error" }, { "inputs": [], "name": "ERC1967NonPayable", "type": "error" }, { "inputs": [], "name": "FailedCall", "type": "error" }, { "inputs": [], "name": "InvalidConfig", "type": "error" }, { "inputs": [], "name": "InvalidData", "type": "error" }, { "inputs": [], "name": "InvalidEpoch", "type": "error" }, { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "InvalidSigner", "type": "error" }, { "inputs": [], "name": "InvalidTime", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "inputs": [], "name": "OnlyCommitter", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "PacketTooLarge", "type": "error" }, { "inputs": [], "name": "PreparationClosed", "type": "error" }, { "inputs": [], "name": "RenounceDisabled", "type": "error" }, { "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }], "name": "UUPSUnsupportedProxiableUUID", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint64", "name": "fromEpoch", "type": "uint64" }, { "indexed": true, "internalType": "bytes32", "name": "catalogHash", "type": "bytes32" }, { "indexed": false, "internalType": "address[4]", "name": "signers", "type": "address[4]" }], "name": "CatalogScheduled", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousCommitter", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newCommitter", "type": "address" }], "name": "CommitterChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "uint64", "name": "epochId", "type": "uint64" }, { "indexed": true, "internalType": "bytes32", "name": "epochHash", "type": "bytes32" }, { "indexed": false, "internalType": "bytes", "name": "packet", "type": "bytes" }], "name": "EpochCommitted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferStarted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "EPOCH_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "EPOCH_LENGTH", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_ATTESTATION_AGE", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "MAX_PACKET_BYTES", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "RECIPE_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "SELECT_DOMAIN", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "UPGRADE_INTERFACE_VERSION", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "anuSigner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "btcTradeSigner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "catalogHash", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "catalogHashAt", "outputs": [{ "internalType": "bytes32", "name": "hash", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "checkpointEpoch", "outputs": [{ "internalType": "bytes32", "name": "anchor", "type": "bytes32" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }, { "components": [{ "internalType": "uint256", "name": "timestamp", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "bytes", "name": "signature", "type": "bytes" }], "internalType": "struct EpochEntropy.Attestation", "name": "a", "type": "tuple" }], "name": "commitEpoch", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "committer", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "name": "epochAnchors", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "number", "type": "uint256" }], "name": "epochForBlock", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "epochStart", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "ethTradeSigner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "firstEpochStart", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "getEpoch", "outputs": [{ "components": [{ "internalType": "bytes32", "name": "epochHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "catalogHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "anchorHash", "type": "bytes32" }, { "internalType": "uint8", "name": "source", "type": "uint8" }, { "internalType": "bytes32", "name": "queryHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "dataHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "attestationHash", "type": "bytes32" }, { "internalType": "uint256", "name": "signedAt", "type": "uint256" }, { "internalType": "uint64", "name": "committedBlock", "type": "uint64" }], "internalType": "struct EpochEntropy.Epoch", "name": "", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "getEpochSelection", "outputs": [{ "components": [{ "internalType": "uint8", "name": "source", "type": "uint8" }, { "internalType": "address", "name": "airnode", "type": "address" }, { "internalType": "bytes32", "name": "selector", "type": "bytes32" }, { "internalType": "bytes32", "name": "queryHash", "type": "bytes32" }, { "internalType": "string", "name": "canonicalRequest", "type": "string" }], "internalType": "struct EpochEntropy.Selection", "name": "s", "type": "tuple" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "hyperliquidSigner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[4]", "name": "signers", "type": "address[4]" }, { "internalType": "address", "name": "initialOwner", "type": "address" }, { "internalType": "address", "name": "initialCommitter", "type": "address" }], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint256", "name": "number", "type": "uint256" }], "name": "nextEpochToPrepare", "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "pendingOwner", "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "proxiableUUID", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address[4]", "name": "signers", "type": "address[4]" }, { "internalType": "uint64", "name": "fromEpoch", "type": "uint64" }], "name": "scheduleCatalog", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "next", "type": "address" }], "name": "setCommitter", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "uint64", "name": "epochId", "type": "uint64" }], "name": "signersAt", "outputs": [{ "internalType": "address[4]", "name": "signers", "type": "address[4]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "newImplementation", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" }], "name": "upgradeToAndCall", "outputs": [], "stateMutability": "payable", "type": "function" }];
package/dist/epoch.d.ts CHANGED
@@ -2,6 +2,7 @@ import { type ApiAttestation } from "./sources.js";
2
2
  import { type VRFProof, type RequestContext } from "./verification.js";
3
3
  import type { XY } from "./verification.js";
4
4
  export declare const EPOCH_LENGTH = 200n;
5
+ export declare const MAX_ATTESTATION_AGE = 240n;
5
6
  export declare const EPOCH_RECIPE_DOMAIN: string;
6
7
  export type EpochSigners = readonly [string, string, string, string];
7
8
  export interface EpochCatalog {
@@ -25,7 +26,7 @@ export type EpochRequestContext = RequestContext;
25
26
  export interface EpochProtocolConfiguration {
26
27
  publicKey: XY;
27
28
  feeRecipient: string;
28
- requestFee: bigint;
29
+ initialMinFee: bigint;
29
30
  confirmationBlocks: number;
30
31
  registry: string;
31
32
  catalogHash: string;
package/dist/epoch.js CHANGED
@@ -4,6 +4,7 @@ import { deriveRequestSeed, hashPublicKey, hashProof, verifyVRFProof } from "./v
4
4
  import { hashMapping, mapRandomness } from "./mapping.js";
5
5
  const abi = AbiCoder.defaultAbiCoder();
6
6
  export const EPOCH_LENGTH = 200n;
7
+ export const MAX_ATTESTATION_AGE = 240n;
7
8
  export const EPOCH_RECIPE_DOMAIN = id("D20_EPOCH_RECIPES");
8
9
  export function epochCatalogHash(signers) {
9
10
  return keccak256(abi.encode(["bytes32", "address[4]"], [EPOCH_RECIPE_DOMAIN, signers]));
@@ -28,7 +29,7 @@ export function selectEpoch(catalog, epochId, anchorHash) {
28
29
  }
29
30
  export function verifyEpochAttestation(selected, a, commitTimestamp) {
30
31
  validateApiSignatureEncoding(a.signature);
31
- if (a.timestamp > commitTimestamp || commitTimestamp - a.timestamp > 120n)
32
+ if (a.timestamp > commitTimestamp || commitTimestamp - a.timestamp > MAX_ATTESTATION_AGE)
32
33
  throw new Error("Invalid epoch attestation time");
33
34
  const body = toUtf8String(a.data);
34
35
  const number = "(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?";
@@ -76,17 +77,20 @@ export function replayEpochCommitment(input) {
76
77
  return { epochHash, selected, ...verified };
77
78
  }
78
79
  export function epochProtocolConfigurationHash(c) {
79
- return keccak256(abi.encode(["bytes32", "uint256[2]", "address", "uint256", "uint16", "address", "bytes32", "uint64", "uint64"], [id("D20_VRF_CONFIG"), c.publicKey, c.feeRecipient, c.requestFee, c.confirmationBlocks, c.registry, c.catalogHash, c.firstEpochStart, EPOCH_LENGTH]));
80
+ return keccak256(abi.encode(["bytes32", "uint256[2]", "address", "uint256", "uint16", "address", "bytes32", "uint64", "uint64"], [id("D20_VRF_CONFIG"), c.publicKey, c.feeRecipient, c.initialMinFee, c.confirmationBlocks, c.registry, c.catalogHash, c.firstEpochStart, EPOCH_LENGTH]));
80
81
  }
81
82
  export function epochTranscriptHash(c, configurationHash, proofHash, randomness) {
82
83
  return keccak256(abi.encode(["bytes32", "uint256", "address", "uint256", "bytes32", "bytes32", "bytes32", "bytes32", "bytes32", "uint64", "bytes32"], [id("D20_VRF_TRANSCRIPT"), c.chainId, c.coordinator, c.requestId, configurationHash, c.blockHash, proofHash, randomness, hashMapping(c.mapping), c.epochId, c.epochHash]));
83
84
  }
84
85
  /// Canonical blocks, transaction inclusion/timestamps and the proxy implementation code active
85
86
  /// at each receipt must be independently trusted chain context. A proxy code hash alone is insufficient.
87
+ /// The signer catalog is per epoch: epoch.catalog.signers must be the catalog in force for context.epochId
88
+ /// (CatalogScheduled events or signersAt on the registry); replayEpochCommitment binds them to record.catalogHash,
89
+ /// while configuration.catalogHash remains the initial catalog bound into protocolConfigurationHash.
86
90
  export function replayEpochCoordinator(input) {
87
91
  const c = input.context, cfg = input.configuration, e = input.epoch;
88
92
  const epoch = replayEpochCommitment({ ...e, epochId: c.epochId });
89
- if (e.catalog.registry.toLowerCase() !== cfg.registry.toLowerCase() || e.catalog.chainId !== c.chainId || e.catalog.firstEpochStart !== cfg.firstEpochStart || epochCatalogHash(e.catalog.signers) !== cfg.catalogHash || epoch.epochHash !== c.epochHash || epochForBlock(cfg.firstEpochStart, c.requestBlock) !== c.epochId)
93
+ if (e.catalog.registry.toLowerCase() !== cfg.registry.toLowerCase() || e.catalog.chainId !== c.chainId || e.catalog.firstEpochStart !== cfg.firstEpochStart || epoch.epochHash !== c.epochHash || epochForBlock(cfg.firstEpochStart, c.requestBlock) !== c.epochId)
90
94
  throw new Error("Epoch request binding mismatch");
91
95
  const expectedTarget = c.requestBlock > e.record.committedBlock + 1n ? c.requestBlock : e.record.committedBlock + 1n;
92
96
  if (c.targetBlock !== expectedTarget || e.record.committedBlock >= c.targetBlock)
package/dist/fees.d.ts ADDED
@@ -0,0 +1,56 @@
1
+ import { type BlockTag, type TransactionRequest } from "ethers";
2
+ /**
3
+ * Provider surface needed to quote a request. Any ethers v6 `Provider` (for example `JsonRpcProvider`) satisfies it;
4
+ * tests can pass a small mock.
5
+ */
6
+ export interface FeeQuoteProvider {
7
+ getBlock(blockTag: BlockTag): Promise<{
8
+ number: number;
9
+ baseFeePerGas: bigint | null;
10
+ } | null>;
11
+ call(tx: TransactionRequest): Promise<string>;
12
+ }
13
+ export interface FeeQuoteOptions {
14
+ /** Base-fee headroom in basis points used for `value`. Default 3000 (30%). */
15
+ bufferBps?: number | bigint;
16
+ /** Block whose `baseFeePerGas` anchors the quote. Default `"latest"`. */
17
+ blockTag?: BlockTag;
18
+ }
19
+ export interface FeeQuote {
20
+ /** Number of the block whose base fee was read. */
21
+ blockNumber: number;
22
+ /** `baseFeePerGas` of that block. */
23
+ baseFee: bigint;
24
+ /** Buffer applied, in basis points. */
25
+ bufferBps: bigint;
26
+ /** `baseFee` raised by `bufferBps` (rounded up). */
27
+ bufferedBaseFee: bigint;
28
+ /** `quoteFeeAt(callbackGasLimit, baseFee)`: the fee if the request were included at exactly `baseFee`. */
29
+ fee: bigint;
30
+ /** `quoteFeeAt(callbackGasLimit, bufferedBaseFee)`: send this as `msg.value`. Never below `fee`. */
31
+ value: bigint;
32
+ }
33
+ /** Default headroom: 30% above the header base fee (an EIP-1559 base fee can rise 12.5% per block). */
34
+ export declare const DEFAULT_FEE_BUFFER_BPS = 3000n;
35
+ /**
36
+ * Quote a request fee off-chain from a block header's base fee.
37
+ *
38
+ * The coordinator prices each request with `block.basefee` of the transaction that creates it:
39
+ * `fee = max(minFee, feeMultiplier * baseFee * (fulfillGasOverhead + callbackGasLimit))`. `quoteFee(callbackGasLimit)`
40
+ * is therefore exact only inside that transaction; through `eth_call` the base fee is commonly reported as 0
41
+ * (observed on Arc), so it must not be used as an off-chain quote. This helper reads `baseFeePerGas` from the
42
+ * requested block (default `latest`) and calls `quoteFeeAt(callbackGasLimit, baseFee)` instead.
43
+ *
44
+ * Why `value` carries a buffer: the base fee can move between reading the header and the block that includes the
45
+ * request. `value` is the quote recomputed at a base fee `bufferBps` higher, so the request still pays if the base fee
46
+ * rises by up to that much. If the minimum fee dominates even at the buffered base fee, `value` equals `fee` and
47
+ * nothing extra is sent. Whatever is sent above the fee the coordinator computes in the transaction is not revenue:
48
+ * it is credited to the request's refund address as refund credit (`FeeOverpaymentCredited`) and can be pulled by that
49
+ * address with `withdrawRefundCredit(recipient)`. Sending less than the transaction's own quote reverts with
50
+ * `IncorrectFee(expected, actual)`; re-quote and resend.
51
+ *
52
+ * @param provider ethers v6 provider (or any object with `getBlock` and `call`).
53
+ * @param coordinator Coordinator proxy address on the configured chain.
54
+ * @param callbackGasLimit The `callbackGasLimit` the request will use (uint32).
55
+ */
56
+ export declare function quoteRequestFee(provider: FeeQuoteProvider, coordinator: string, callbackGasLimit: number | bigint, options?: FeeQuoteOptions): Promise<FeeQuote>;
package/dist/fees.js ADDED
@@ -0,0 +1,48 @@
1
+ // SDK-owned helper (not part of the vendored protocol copy): off-chain request fee quoting for ethers v6.
2
+ import { Interface } from "ethers";
3
+ /** Default headroom: 30% above the header base fee (an EIP-1559 base fee can rise 12.5% per block). */
4
+ export const DEFAULT_FEE_BUFFER_BPS = 3000n;
5
+ const MAX_UINT32 = 0xffffffffn;
6
+ const quoteInterface = new Interface(["function quoteFeeAt(uint32 callbackGasLimit, uint256 baseFee) view returns (uint256)"]);
7
+ /**
8
+ * Quote a request fee off-chain from a block header's base fee.
9
+ *
10
+ * The coordinator prices each request with `block.basefee` of the transaction that creates it:
11
+ * `fee = max(minFee, feeMultiplier * baseFee * (fulfillGasOverhead + callbackGasLimit))`. `quoteFee(callbackGasLimit)`
12
+ * is therefore exact only inside that transaction; through `eth_call` the base fee is commonly reported as 0
13
+ * (observed on Arc), so it must not be used as an off-chain quote. This helper reads `baseFeePerGas` from the
14
+ * requested block (default `latest`) and calls `quoteFeeAt(callbackGasLimit, baseFee)` instead.
15
+ *
16
+ * Why `value` carries a buffer: the base fee can move between reading the header and the block that includes the
17
+ * request. `value` is the quote recomputed at a base fee `bufferBps` higher, so the request still pays if the base fee
18
+ * rises by up to that much. If the minimum fee dominates even at the buffered base fee, `value` equals `fee` and
19
+ * nothing extra is sent. Whatever is sent above the fee the coordinator computes in the transaction is not revenue:
20
+ * it is credited to the request's refund address as refund credit (`FeeOverpaymentCredited`) and can be pulled by that
21
+ * address with `withdrawRefundCredit(recipient)`. Sending less than the transaction's own quote reverts with
22
+ * `IncorrectFee(expected, actual)`; re-quote and resend.
23
+ *
24
+ * @param provider ethers v6 provider (or any object with `getBlock` and `call`).
25
+ * @param coordinator Coordinator proxy address on the configured chain.
26
+ * @param callbackGasLimit The `callbackGasLimit` the request will use (uint32).
27
+ */
28
+ export async function quoteRequestFee(provider, coordinator, callbackGasLimit, options = {}) {
29
+ const gas = BigInt(callbackGasLimit);
30
+ if (gas < 0n || gas > MAX_UINT32)
31
+ throw new Error("callbackGasLimit must fit uint32");
32
+ const bufferBps = BigInt(options.bufferBps ?? DEFAULT_FEE_BUFFER_BPS);
33
+ if (bufferBps < 0n)
34
+ throw new Error("bufferBps must not be negative");
35
+ const block = await provider.getBlock(options.blockTag ?? "latest");
36
+ if (!block || block.baseFeePerGas == null)
37
+ throw new Error("Block has no baseFeePerGas; quoting needs an EIP-1559 header");
38
+ const baseFee = block.baseFeePerGas;
39
+ const bufferedBaseFee = baseFee + (baseFee * bufferBps + 9999n) / 10000n;
40
+ const quote = async (atBaseFee) => {
41
+ const result = await provider.call({ to: coordinator, data: quoteInterface.encodeFunctionData("quoteFeeAt", [gas, atBaseFee]) });
42
+ if (result === "0x")
43
+ throw new Error("quoteFeeAt returned no data; check that coordinator is the coordinator proxy on this chain");
44
+ return quoteInterface.decodeFunctionResult("quoteFeeAt", result)[0];
45
+ };
46
+ const [fee, value] = await Promise.all([quote(baseFee), quote(bufferedBaseFee)]);
47
+ return { blockNumber: block.number, baseFee, bufferBps, bufferedBaseFee, fee, value };
48
+ }
package/dist/index.d.ts CHANGED
@@ -8,3 +8,5 @@ export { replayCoordinator, transcriptHash } from "./replay.js";
8
8
  export { encodeEvidencePacket, decodeEvidencePacket, EVIDENCE_PACKET_BYTES } from "./evidence.js";
9
9
  export { EPOCH_LENGTH, EPOCH_RECIPE_DOMAIN, epochCatalogHash, epochStart, epochForBlock, selectEpoch, verifyEpochAttestation, epochCommitmentHash, encodeEpochEvidencePacket, decodeEpochEvidencePacket, replayEpochCommitment, epochProtocolConfigurationHash } from "./epoch.js";
10
10
  export type { EpochCatalog, EpochSigners, EpochRecord, EpochProtocolConfiguration } from "./epoch.js";
11
+ export { quoteRequestFee, DEFAULT_FEE_BUFFER_BPS } from "./fees.js";
12
+ export type { FeeQuote, FeeQuoteOptions, FeeQuoteProvider } from "./fees.js";
package/dist/index.js CHANGED
@@ -4,3 +4,4 @@ export { canonicalApiRequest, attestationDigest, hashAttestation, validateApiSig
4
4
  export { replayCoordinator, transcriptHash } from "./replay.js";
5
5
  export { encodeEvidencePacket, decodeEvidencePacket, EVIDENCE_PACKET_BYTES } from "./evidence.js";
6
6
  export { EPOCH_LENGTH, EPOCH_RECIPE_DOMAIN, epochCatalogHash, epochStart, epochForBlock, selectEpoch, verifyEpochAttestation, epochCommitmentHash, encodeEpochEvidencePacket, decodeEpochEvidencePacket, replayEpochCommitment, epochProtocolConfigurationHash } from "./epoch.js";
7
+ export { quoteRequestFee, DEFAULT_FEE_BUFFER_BPS } from "./fees.js";
@@ -3,24 +3,31 @@ pragma solidity 0.8.28;
3
3
 
4
4
  import {D20VRFConsumer} from "@d20dao/vrf-sdk/contracts/D20VRFConsumer.sol";
5
5
  import {ID20VRF} from "@d20dao/vrf-sdk/contracts/interfaces/ID20VRF.sol";
6
- import {D20VRFRequests} from "@d20dao/vrf-sdk/contracts/libraries/D20VRFRequests.sol";
6
+ import {RandomnessMapping} from "@d20dao/vrf-sdk/contracts/libraries/RandomnessMapping.sol";
7
7
 
8
8
  /// @notice Minimal request/storage starter; no game payment, proof, mint or deployment policy.
9
+ /// @dev The player pays the request. A wallet cannot know the exact same-transaction quote in advance, so it quotes
10
+ /// off-chain with quoteFeeAt(callbackGasLimit, latestBlock.baseFeePerGas) plus a buffer (the SDK's quoteRequestFee
11
+ /// helper does this) and sends that value. The whole payment is forwarded: the coordinator escrows exactly
12
+ /// quoteFee(callbackGasLimit) and credits any excess to the player (the refund address) as refund credit that only
13
+ /// the player can pull with withdrawRefundCredit. Underpayment reverts inside the coordinator with
14
+ /// IncorrectFee(expected, actual). A contract that funds requests from its own balance would instead pay
15
+ /// rng.quoteFee(callbackGasLimit) in the same transaction, as the D20VRFRequests helpers do.
9
16
  contract DiceConsumer is D20VRFConsumer {
10
- using D20VRFRequests for ID20VRF;
11
17
  struct Roll { address player; bytes32 rawWord; bool ready; }
12
18
  mapping(uint256 => Roll) public rolls;
13
19
  mapping(uint256 => bool) public refunded;
14
- error WrongFee();
15
20
  error UnexpectedCallback();
16
21
  error NotReady();
17
22
 
18
23
  constructor(address coordinator) D20VRFConsumer(coordinator) {}
19
24
 
20
25
  function roll(bytes32 clientSeed, uint32 callbackGasLimit) external payable returns (uint256 requestId) {
21
- ID20VRF rng = ID20VRF(vrfCoordinator);
22
- if (msg.value != rng.requestFee()) revert WrongFee();
23
- requestId = rng.d20(D20VRFRequests.Options(clientSeed, callbackGasLimit, msg.sender));
26
+ // One d20. The callback still receives the raw word; result() reads the canonical mapped value.
27
+ RandomnessMapping.Spec memory spec = RandomnessMapping.Spec(RandomnessMapping.Operation.DiceRoll, 0, 20, 1, 0);
28
+ requestId = ID20VRF(vrfCoordinator).requestMappedRandomness{value: msg.value}(
29
+ clientSeed, callbackGasLimit, msg.sender, spec
30
+ );
24
31
  rolls[requestId] = Roll(msg.sender, bytes32(0), false);
25
32
  }
26
33
 
@@ -31,7 +38,7 @@ contract DiceConsumer is D20VRFConsumer {
31
38
  result.ready = true;
32
39
  }
33
40
 
34
- // Requires a coordinator implementation supporting refund notifications.
41
+ // Called after an expired request's refund share was paid to the player or recorded as the player's refund credit.
35
42
  function _onRefund(uint256 requestId) internal override {
36
43
  Roll storage result = rolls[requestId];
37
44
  if (result.player == address(0) || result.ready) revert UnexpectedCallback();
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@d20dao/vrf-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "D20DAO verifiable randomness: Solidity consumer helpers, contract ABIs and public proof replay",
5
- "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/"
8
+ },
6
9
  "type": "module",
7
10
  "license": "MIT",
8
11
  "engines": {