@d20dao/vrf-sdk 0.3.2 → 0.3.4
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/AGENTS.md +48 -8
- package/API.md +2057 -0
- package/BUILD-MANIFEST.json +1 -1
- package/README.md +289 -41
- package/package.json +5 -2
package/API.md
ADDED
|
@@ -0,0 +1,2057 @@
|
|
|
1
|
+
# D20DAO coordinator API reference
|
|
2
|
+
|
|
3
|
+
<!-- Generated by scripts/api-reference.mjs from abi/*.json and scripts/api-descriptions.mjs. Do not edit by hand. -->
|
|
4
|
+
|
|
5
|
+
Every function, event and error of `D20VRFCoordinator` and `EpochEntropy`, generated from the ABIs of `@d20dao/vrf-sdk` 0.3.4. Regenerate with `npm run build && npm run api-reference`; `npm test` fails when this file is out of date.
|
|
6
|
+
|
|
7
|
+
- Package: `@d20dao/vrf-sdk` 0.3.4
|
|
8
|
+
- Protocol source: commit `640b60cb992a7e3add1efe8e7b392341732ea004`, copied to [`protocol/contracts/`](protocol/contracts/) (hashes in `PROTOCOL-PROVENANCE.json`)
|
|
9
|
+
- Compiler: solc 0.8.28+commit.7893614a.Emscripten.clang, EVM version `cancun`
|
|
10
|
+
- `abi/D20VRFCoordinator.json` SHA-256: `4764ba62745e109f3b968b21ed23e88da739a4a26906fc2ed3192fa23b8d79c1`
|
|
11
|
+
- `abi/EpochEntropy.json` SHA-256: `90d465fd2fbd5321a6ec87ab81850cf63b7b9c00b1b7d8aa00f30abad40e583a`
|
|
12
|
+
|
|
13
|
+
This reference describes that source. A deployment runs it only while the implementation behind each proxy is the one the deployment manifest records for that commit: check when you integrate and whenever a proxy emits `Upgraded` (README [Security and trust](README.md#security-and-trust)).
|
|
14
|
+
|
|
15
|
+
## Conventions
|
|
16
|
+
|
|
17
|
+
- **Addresses.** Call the proxies listed in README [Deployments](README.md#deployments). The ABIs are those of the implementations; `D20Proxy` adds no functions of its own.
|
|
18
|
+
- **Units.** Fees and credits are wei of native USDC, which has 18 decimals (`1e18` is 1 USDC). Deadlines and timestamps are Unix seconds. Ratios are basis points (10000 is 100%).
|
|
19
|
+
- **Callers.** "Anyone" means any account or contract; "Any contract" means `msg.sender` must have code. Owner-only functions revert `OwnableUnauthorizedAccount` for other callers.
|
|
20
|
+
- **Selectors.** Functions and errors show their 4-byte selector, events their topic 0, so revert data and logs can be matched by hand.
|
|
21
|
+
- **Decoding errors.** `coordinatorAbi` and `epochEntropyAbi` (`@d20dao/vrf-sdk/abi`) contain every custom error below. When your consumer calls the coordinator with an ordinary Solidity call, a coordinator revert is passed through unchanged, so a wallet sending a transaction to your consumer sees the coordinator's selector. Decode with `coordinator.interface.parseError(data)` in ethers or `decodeErrorResult({ abi: coordinatorAbi, data })` in viem, or build your consumer's contract object from its ABI plus the coordinator's error entries. Your consumer's own errors, such as `OnlyCoordinator` and `InvalidCoordinator` from `D20VRFConsumer`, are only in your consumer's ABI. Arithmetic overflow reverts with `Panic(uint256)`.
|
|
22
|
+
- **ethers v6 results.** Structs and multiple return values arrive as `Result` objects, which are arrays. A named value is also a property unless its name collides with an `Array` or `Result` member, such as `length`, `values`, `keys`, `map` or `filter`; read such a value with `result.getValue(name)`, by position, or from `result.toObject()`. Unnamed outputs, such as those of `pricing()`, are positional only.
|
|
23
|
+
- **Consumer contracts.** `D20VRFConsumer` implements `rawFulfillRandomness(requestId, randomness)` and `onRefund(requestId)`; both revert `OnlyCoordinator` unless called by the coordinator proxy given to its constructor, which reverts `InvalidCoordinator` for an address without code.
|
|
24
|
+
|
|
25
|
+
## Contents
|
|
26
|
+
|
|
27
|
+
- [D20VRFCoordinator](#coordinator)
|
|
28
|
+
- [Types](#coordinator-types)
|
|
29
|
+
- [Requesting](#coordinator-requesting)
|
|
30
|
+
- [Pricing and refund settings](#coordinator-pricing-and-refund-settings)
|
|
31
|
+
- [Reading request state and results](#coordinator-reading-request-state-and-results)
|
|
32
|
+
- [Settlement, refunds and credits](#coordinator-settlement-refunds-and-credits)
|
|
33
|
+
- [Settlement balances](#coordinator-settlement-balances)
|
|
34
|
+
- [Keeper and proof functions](#coordinator-keeper-and-proof-functions)
|
|
35
|
+
- [Keeper, key and configuration reads](#coordinator-keeper-key-and-configuration-reads)
|
|
36
|
+
- [Owner administration](#coordinator-owner-administration)
|
|
37
|
+
- [Constants](#coordinator-constants)
|
|
38
|
+
- [Events](#coordinator-events)
|
|
39
|
+
- [Errors](#coordinator-errors)
|
|
40
|
+
- [EpochEntropy](#registry)
|
|
41
|
+
- [Types](#registry-types)
|
|
42
|
+
- [Epoch state for consumers and verifiers](#registry-epoch-state-for-consumers-and-verifiers)
|
|
43
|
+
- [Registry reads](#registry-registry-reads)
|
|
44
|
+
- [Source selection and publication](#registry-source-selection-and-publication)
|
|
45
|
+
- [Owner administration](#registry-owner-administration)
|
|
46
|
+
- [Constants](#registry-constants)
|
|
47
|
+
- [Events](#registry-events)
|
|
48
|
+
- [Errors](#registry-errors)
|
|
49
|
+
|
|
50
|
+
## <a id="coordinator"></a>D20VRFCoordinator
|
|
51
|
+
|
|
52
|
+
The consumer entry point. Call the coordinator proxy for your chain (README [Deployments](README.md#deployments)). `ID20VRF` in `contracts/interfaces/ID20VRF.sol` declares the five functions a consumer contract needs (`quoteFee`, `quoteFeeAt`, `requestRandomness`, `requestMappedRandomness`, `getMappedResult`); `coordinatorAbi` from `@d20dao/vrf-sdk/abi` carries everything below. In Solidity, declare a local interface for any other function you call.
|
|
53
|
+
|
|
54
|
+
Requests, fulfillment, `storeBlockHash`, retries, `refundRequest` and withdrawals are `nonReentrant`. A consumer callback (`rawFulfillRandomness`, `onRefund`) that calls one of them fails with `ReentrancyGuardReentrantCall`, and the coordinator records the callback as failed. Views stay callable from callbacks.
|
|
55
|
+
|
|
56
|
+
### <a id="coordinator-types"></a>Types
|
|
57
|
+
|
|
58
|
+
#### <a id="coordinator-type-d20vrfcoordinator-request"></a>`D20VRFCoordinator.Request`
|
|
59
|
+
|
|
60
|
+
Returned by `getRequest`. It does not contain the escrowed fee or the refund ratio; read `requestFeePaid` and `requestRefundBps`.
|
|
61
|
+
|
|
62
|
+
Source: `D20VRFCoordinator.sol` lines 58–76
|
|
63
|
+
|
|
64
|
+
| Field | Type | Meaning |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `consumer` | `address` | Contract that made the request; receives `rawFulfillRandomness` and `onRefund`. |
|
|
67
|
+
| `callbackGasLimit` | `uint32` | Gas forwarded to `rawFulfillRandomness` at fulfillment, and the lowest `gasLimit` that `retryCallback` accepts. |
|
|
68
|
+
| `requestBlock` | `uint64` | Block of the request transaction. |
|
|
69
|
+
| `targetBlock` | `uint64` | Block whose hash enters the seed: `max(requestBlock, committedBlock + 1)` of the epoch. 0 until the epoch packet is published. |
|
|
70
|
+
| `deadline` | `uint64` | Request block timestamp plus `RESPONSE_TIMEOUT` (60 seconds), in Unix seconds. A proof accepted in a block with timestamp at or before `deadline` serves the request; `refundRequest` needs a block timestamp after it. |
|
|
71
|
+
| `refundAddress` | `address` | Fixed recipient of the expiry refund and of any overpayment credit. |
|
|
72
|
+
| `clientSeed` | `bytes32` | Value supplied by the consumer, bound into the seed and emitted in `RandomnessRequested`. |
|
|
73
|
+
| `mappingHash` | `bytes32` | `keccak256(abi.encode(operation, lower, upper, count, population))` of the stored spec; `hashMapping(spec)` in TypeScript. |
|
|
74
|
+
| `blockHash` | `bytes32` | Target block hash once `storeBlockHash` or fulfillment stored it; zero before. |
|
|
75
|
+
| `randomness` | `bytes32` | Accepted VRF output. Zero until `fulfilled`. |
|
|
76
|
+
| `proofHash` | `bytes32` | `keccak256(abi.encode(proof))` of the accepted proof. Zero until `fulfilled`. |
|
|
77
|
+
| `transcriptHash` | `bytes32` | `keccak256(abi.encode(TRANSCRIPT_DOMAIN, chainId, coordinator, requestId, protocolConfigurationHash, blockHash, proofHash, randomness, mappingHash, epochId, epochHash))`. Zero until `fulfilled`. |
|
|
78
|
+
| `fulfilled` | `bool` | A proof was accepted. Final: the word can no longer change. |
|
|
79
|
+
| `delivered` | `bool` | A callback attempt succeeded. Stays false after a failed callback until `retryCallback` succeeds; it says nothing about acceptance. |
|
|
80
|
+
| `refunded` | `bool` | `refundRequest` settled the request. Never true together with `fulfilled`. |
|
|
81
|
+
| `epochId` | `uint64` | Epoch of `requestBlock`, fixed at creation; never zero for an existing request. |
|
|
82
|
+
| `epochHash` | `bytes32` | Commitment of the published epoch packet. Zero until the packet is published. |
|
|
83
|
+
|
|
84
|
+
#### <a id="coordinator-type-randomnessmapping-spec"></a>`RandomnessMapping.Spec`
|
|
85
|
+
|
|
86
|
+
A randomness mapping stored with a request ("mapping" here is not a Solidity `mapping`). The TypeScript `MappingSpec` returned by `builtins` has the same five fields in the same order, with `lower` and `upper` as `bigint`, and ethers encodes it for this struct unchanged. Valid combinations: README [Randomness options](README.md#randomness-options).
|
|
87
|
+
|
|
88
|
+
Source: `libraries/RandomnessMapping.sol` lines 7–14
|
|
89
|
+
|
|
90
|
+
| Field | Type | Meaning |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| `operation` | `RandomnessMapping.Operation` | Enum encoded as uint8: 0 Raw, 1 DiceRoll, 2 CoinFlip, 3 NumberRange, 4 ChooseOne, 5 ChooseMany, 6 Shuffle. |
|
|
93
|
+
| `lower` | `uint256` | NumberRange minimum; zero for every other operation. |
|
|
94
|
+
| `upper` | `uint256` | DiceRoll sides or NumberRange maximum; zero otherwise. |
|
|
95
|
+
| `count` | `uint32` | Values returned: the dice count; 1 for CoinFlip, NumberRange and ChooseOne; the number of choices for ChooseMany; the population for Shuffle; 0 for Raw. |
|
|
96
|
+
| `population` | `uint32` | Number of items (1 to 256) for ChooseOne, ChooseMany and Shuffle; zero otherwise. |
|
|
97
|
+
|
|
98
|
+
#### <a id="coordinator-type-vrf-proof"></a>`VRF.Proof`
|
|
99
|
+
|
|
100
|
+
Chainlink secp256k1 VRF proof, verified by the unmodified vendored `VRF.sol`. ABI-encoded it is 416 bytes: the `FulfillmentEvidence` packet.
|
|
101
|
+
|
|
102
|
+
Source: `vendor/VRF.sol` lines 570–580
|
|
103
|
+
|
|
104
|
+
| Field | Type | Meaning |
|
|
105
|
+
| --- | --- | --- |
|
|
106
|
+
| `pk` | `uint256[2]` | VRF public key; must equal `(publicKeyX, publicKeyY)`. |
|
|
107
|
+
| `gamma` | `uint256[2]` | Proof point. The accepted word is `keccak256(abi.encode(3, gamma))`. |
|
|
108
|
+
| `c` | `uint256` | Proof challenge scalar. |
|
|
109
|
+
| `s` | `uint256` | Proof response scalar. |
|
|
110
|
+
| `seed` | `uint256` | Must equal `requestSeed(requestId)`. |
|
|
111
|
+
| `uWitness` | `address` | Address of `c·pk + s·G`, checked by the verifier. |
|
|
112
|
+
| `cGammaWitness` | `uint256[2]` | Precomputed `c·gamma`, checked by the verifier. |
|
|
113
|
+
| `sHashWitness` | `uint256[2]` | Precomputed `s·hashToCurve(pk, seed)`, checked by the verifier. |
|
|
114
|
+
| `zInv` | `uint256` | Inverse of the projective z coordinate of `cGammaWitness + sHashWitness`. |
|
|
115
|
+
|
|
116
|
+
### <a id="coordinator-requesting"></a>Requesting
|
|
117
|
+
|
|
118
|
+
Requests must come from a contract and pay at least the fee computed in their own transaction; see README [Paying for a request](README.md#paying-for-a-request). The registry call a request makes (`checkpointEpoch` for the current epoch) cannot fail in practice, so requests revert only with the errors listed.
|
|
119
|
+
|
|
120
|
+
#### <a id="coordinator-fn-quotefee"></a>`quoteFee`
|
|
121
|
+
|
|
122
|
+
```solidity
|
|
123
|
+
function quoteFee(uint32 callbackGasLimit) external view returns (uint256)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Selector `0xc9caa0c3` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 227–232
|
|
127
|
+
|
|
128
|
+
Fee for a request with this `callbackGasLimit` priced at `block.basefee`, that is `quoteFeeAt(callbackGasLimit, block.basefee)`. Exact inside the requesting transaction, which is how `D20VRFRequests` helpers pay. Through `eth_call` the base fee is commonly reported as 0 (observed on Arc), so the answer collapses to `minFee` and a transaction sent with it reverts `IncorrectFee`. Off-chain, quote with `quoteFeeAt` and the latest header base fee plus a buffer, as `quoteRequestFee` does. It does not check the gas limit range.
|
|
129
|
+
|
|
130
|
+
**Errors:** [`FeeOverflow`](#coordinator-error-feeoverflow).
|
|
131
|
+
|
|
132
|
+
#### <a id="coordinator-fn-quotefeeat"></a>`quoteFeeAt`
|
|
133
|
+
|
|
134
|
+
```solidity
|
|
135
|
+
function quoteFeeAt(uint32 callbackGasLimit, uint256 baseFee) external view returns (uint256)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Selector `0x26fa8481` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 219–226
|
|
139
|
+
|
|
140
|
+
`max(minFee, feeMultiplier × baseFee × (fulfillGasOverhead + callbackGasLimit))` over the live pricing for a base fee in wei that you supply; with `feeMultiplier` 0 it returns `minFee`. A quote, not a reservation: pricing can change before your transaction. A `baseFee` large enough to overflow uint256 reverts with `Panic(0x11)` instead of `FeeOverflow`.
|
|
141
|
+
|
|
142
|
+
**Errors:** [`FeeOverflow`](#coordinator-error-feeoverflow).
|
|
143
|
+
|
|
144
|
+
#### <a id="coordinator-fn-requestrandomness"></a>`requestRandomness`
|
|
145
|
+
|
|
146
|
+
```solidity
|
|
147
|
+
function requestRandomness(bytes32 clientSeed, uint32 callbackGasLimit, address _refundAddress) external payable returns (uint256 requestId)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Selector `0x9849d1e5` · Caller: Any contract · Source: `D20VRFCoordinator.sol` lines 234–239, 247–286
|
|
151
|
+
|
|
152
|
+
Creates a raw request (spec all zero) with `msg.sender` as consumer and returns its ID. Needs `msg.value` at least the fee computed in this transaction; escrows exactly that fee and credits any excess to `_refundAddress` as refund credit. Fixes the request block, epoch, client seed, refund address, fee, refund ratio (`refundBps`) and a deadline of `block.timestamp + RESPONSE_TIMEOUT`. After acceptance the consumer receives `rawFulfillRandomness(requestId, randomness)` with exactly `callbackGasLimit` gas. Checks run in this order: caller has code, refund address non-zero, gas limit in range, fee, mapping, epoch started.
|
|
153
|
+
|
|
154
|
+
**Emits:** [`FeeOverpaymentCredited`](#coordinator-event-feeoverpaymentcredited), [`RandomnessRequested`](#coordinator-event-randomnessrequested), [`MappingRequested`](#coordinator-event-mappingrequested).
|
|
155
|
+
|
|
156
|
+
**Errors:** [`ContractConsumerRequired`](#coordinator-error-contractconsumerrequired), [`InvalidRefundAddress`](#coordinator-error-invalidrefundaddress), [`InvalidCallbackGas`](#coordinator-error-invalidcallbackgas), [`FeeOverflow`](#coordinator-error-feeoverflow), [`IncorrectFee`](#coordinator-error-incorrectfee), [`EpochUnavailable`](#coordinator-error-epochunavailable).
|
|
157
|
+
|
|
158
|
+
#### <a id="coordinator-fn-requestmappedrandomness"></a>`requestMappedRandomness`
|
|
159
|
+
|
|
160
|
+
```solidity
|
|
161
|
+
function requestMappedRandomness(bytes32 clientSeed, uint32 callbackGasLimit, address _refundAddress, RandomnessMapping.Spec spec) external payable returns (uint256 requestId)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Selector `0xe6b41a8c` · Caller: Any contract · Source: `D20VRFCoordinator.sol` lines 241–245, 247–286
|
|
165
|
+
|
|
166
|
+
Same as `requestRandomness`, storing `spec` with the request (`getMapping`, `mappingHash`). The callback still carries the raw word; read the mapped values with `getMappedResult`. `D20VRFRequests` helpers call this function and pay `quoteFee` from the calling contract balance.
|
|
167
|
+
|
|
168
|
+
**Emits:** [`FeeOverpaymentCredited`](#coordinator-event-feeoverpaymentcredited), [`RandomnessRequested`](#coordinator-event-randomnessrequested), [`MappingRequested`](#coordinator-event-mappingrequested).
|
|
169
|
+
|
|
170
|
+
**Errors:** [`ContractConsumerRequired`](#coordinator-error-contractconsumerrequired), [`InvalidRefundAddress`](#coordinator-error-invalidrefundaddress), [`InvalidCallbackGas`](#coordinator-error-invalidcallbackgas), [`FeeOverflow`](#coordinator-error-feeoverflow), [`IncorrectFee`](#coordinator-error-incorrectfee), [`InvalidMapping`](#coordinator-error-invalidmapping), [`EpochUnavailable`](#coordinator-error-epochunavailable).
|
|
171
|
+
|
|
172
|
+
### <a id="coordinator-pricing-and-refund-settings"></a>Pricing and refund settings
|
|
173
|
+
|
|
174
|
+
Views, callable by anyone. They describe requests created from now on; an existing request settles from its own snapshots (`requestFeePaid`, `requestRefundBps`).
|
|
175
|
+
|
|
176
|
+
| Function | Selector | Meaning | Source |
|
|
177
|
+
| --- | --- | --- | --- |
|
|
178
|
+
| <a id="coordinator-fn-pricing"></a>`pricing() returns (uint256, uint16, uint32)` | `0x7ce91411` | Live `(minFee, feeMultiplier, fulfillGasOverhead)`. The outputs are unnamed, so read them by position. | lines 210–212 |
|
|
179
|
+
| <a id="coordinator-fn-minfee"></a>`minFee() returns (uint256)` | `0x24ec7590` | Minimum fee in wei, at most `MAX_MIN_FEE` (10 USDC). | line 43 |
|
|
180
|
+
| <a id="coordinator-fn-feemultiplier"></a>`feeMultiplier() returns (uint16)` | `0xe5a70ef7` | Base-fee multiplier, 0 to `MAX_FEE_MULTIPLIER` (20); 0 makes every fee `minFee`. | lines 45–46 |
|
|
181
|
+
| <a id="coordinator-fn-fulfillgasoverhead"></a>`fulfillGasOverhead() returns (uint32)` | `0x19d40839` | Gas added to `callbackGasLimit` in the fee formula, `MIN_FULFILL_GAS_OVERHEAD` to `MAX_FULFILL_GAS_OVERHEAD`. | line 47 |
|
|
182
|
+
| <a id="coordinator-fn-refundbps"></a>`refundBps() returns (uint16)` | `0xec8c9a0b` | Current refund ratio in basis points (5000 to 10000), copied into each new request. Not the ratio of an existing request: use `requestRefundBps(requestId)`. | lines 48–49 |
|
|
183
|
+
|
|
184
|
+
### <a id="coordinator-reading-request-state-and-results"></a>Reading request state and results
|
|
185
|
+
|
|
186
|
+
Views, callable by anyone, including from a callback. Request IDs start at 1 and increase by one; functions taking a `requestId` revert `UnknownRequest` for an ID that was never issued. README [Reading results](README.md#reading-results) shows a polling loop.
|
|
187
|
+
|
|
188
|
+
#### <a id="coordinator-fn-getrequest"></a>`getRequest`
|
|
189
|
+
|
|
190
|
+
```solidity
|
|
191
|
+
function getRequest(uint256 requestId) external view returns (D20VRFCoordinator.Request result)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Selector `0xc58343ef` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 288–307, 547–552
|
|
195
|
+
|
|
196
|
+
Full state of a request, see [`D20VRFCoordinator.Request`](#coordinator-type-d20vrfcoordinator-request). `targetBlock` and `epochHash` are resolved from the registry, so they become non-zero as soon as the epoch packet is published. `fulfilled` means the word is final; `delivered` only reports that a callback succeeded. A request that is not `fulfilled` in a block whose timestamp is after `deadline` has expired and can only be refunded. When polling, read the latest block before `getRequest`, so that a proof included up to that block is visible.
|
|
197
|
+
|
|
198
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest).
|
|
199
|
+
|
|
200
|
+
#### <a id="coordinator-fn-getmapping"></a>`getMapping`
|
|
201
|
+
|
|
202
|
+
```solidity
|
|
203
|
+
function getMapping(uint256 requestId) external view returns (RandomnessMapping.Spec)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Selector `0xede9ba8b` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 339–342
|
|
207
|
+
|
|
208
|
+
The stored [`RandomnessMapping.Spec`](#coordinator-type-randomnessmapping-spec); all fields zero (Raw) for `requestRandomness`.
|
|
209
|
+
|
|
210
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest).
|
|
211
|
+
|
|
212
|
+
#### <a id="coordinator-fn-getmappedresult"></a>`getMappedResult`
|
|
213
|
+
|
|
214
|
+
```solidity
|
|
215
|
+
function getMappedResult(uint256 requestId) external view returns (uint256[])
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Selector `0x8f09a3e6` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 344–348
|
|
219
|
+
|
|
220
|
+
The accepted word mapped with the stored spec: `[uint256(word)]` for a raw request, otherwise the values in README [Randomness options](README.md#randomness-options). Part of `ID20VRF`. Reverts `NotFulfilled` until a proof is accepted, so an expired or refunded request never has a result. Gas grows with the mapping; a 256-item shuffle is expensive onchain.
|
|
221
|
+
|
|
222
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`NotFulfilled`](#coordinator-error-notfulfilled).
|
|
223
|
+
|
|
224
|
+
#### <a id="coordinator-fn-maprandomness"></a>`mapRandomness`
|
|
225
|
+
|
|
226
|
+
```solidity
|
|
227
|
+
function mapRandomness(bytes32 randomness, RandomnessMapping.Spec spec) external pure returns (uint256[])
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Selector `0x41c2a199` · Caller: Anyone (pure) · Source: `D20VRFCoordinator.sol` lines 350–355
|
|
231
|
+
|
|
232
|
+
Maps any word with any valid spec, like the SDK `mapRandomness(word, spec)` off-chain. It does not show that a request was fulfilled.
|
|
233
|
+
|
|
234
|
+
**Errors:** [`InvalidMapping`](#coordinator-error-invalidmapping).
|
|
235
|
+
|
|
236
|
+
#### <a id="coordinator-fn-requestfeepaid"></a>`requestFeePaid`
|
|
237
|
+
|
|
238
|
+
```solidity
|
|
239
|
+
function requestFeePaid(uint256 requestId) external view returns (uint256)
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Selector `0xef7cc992` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 330–333
|
|
243
|
+
|
|
244
|
+
Fee escrowed by the request (`feePaid` in `RandomnessRequested`), excluding any overpayment. The keeper share, the protocol share and the refund are computed from it.
|
|
245
|
+
|
|
246
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest).
|
|
247
|
+
|
|
248
|
+
#### <a id="coordinator-fn-requestrefundbps"></a>`requestRefundBps`
|
|
249
|
+
|
|
250
|
+
```solidity
|
|
251
|
+
function requestRefundBps(uint256 requestId) external view returns (uint16)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Selector `0x5d170fd7` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 334–337
|
|
255
|
+
|
|
256
|
+
Refund ratio the request copied from `refundBps` at creation. An expiry refund pays `requestFeePaid × requestRefundBps / 10000`; a later `setRefundBps` does not change it.
|
|
257
|
+
|
|
258
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest).
|
|
259
|
+
|
|
260
|
+
#### <a id="coordinator-fn-refundcallbackdelivered"></a>`refundCallbackDelivered`
|
|
261
|
+
|
|
262
|
+
```solidity
|
|
263
|
+
function refundCallbackDelivered(uint256) external view returns (bool)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Selector `0x281d3157` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 102, 500
|
|
267
|
+
|
|
268
|
+
True once an `onRefund` notification for the request succeeded, at `refundRequest` or `retryRefundCallback`. Returns false for unknown IDs instead of reverting.
|
|
269
|
+
|
|
270
|
+
#### <a id="coordinator-fn-nextrequestid"></a>`nextRequestId`
|
|
271
|
+
|
|
272
|
+
```solidity
|
|
273
|
+
function nextRequestId() external view returns (uint256)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Selector `0x6a84a985` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 50, 172, 260
|
|
277
|
+
|
|
278
|
+
ID the next request will receive. Issued IDs are 1 to `nextRequestId() - 1`.
|
|
279
|
+
|
|
280
|
+
### <a id="coordinator-settlement-refunds-and-credits"></a>Settlement, refunds and credits
|
|
281
|
+
|
|
282
|
+
Recovery calls need no value or role. They forward gas to the consumer and revert `InsufficientCallbackGas` rather than forward less, so the transaction gas limit must cover it (README [Gas for refund and retry calls](README.md#gas-for-refund-and-retry-calls)). Refund credit and keeper credit are pull balances: only the holder withdraws them.
|
|
283
|
+
|
|
284
|
+
#### <a id="coordinator-fn-refundrequest"></a>`refundRequest`
|
|
285
|
+
|
|
286
|
+
```solidity
|
|
287
|
+
function refundRequest(uint256 requestId) external
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Selector `0x7411484e` · Caller: Anyone · Source: `D20VRFCoordinator.sol` lines 455–479, 491–502
|
|
291
|
+
|
|
292
|
+
Refunds an unfulfilled request once a block timestamp is after its deadline. Marks it refunded, sends `feePaid × requestRefundBps / 10000` to the fixed refund address with a 30,000-gas transfer, or adds it to that address's refund credit if the transfer fails, and adds the rest of the fee to `earnedFees`. Then calls `onRefund(requestId)` on the consumer with 100,000 gas; a failed notification does not undo the refund. The caller receives nothing. Measured minimum transaction gas limit 302,558 to 357,517; use 400,000.
|
|
293
|
+
|
|
294
|
+
**Emits:** [`RequestRefundedTo`](#coordinator-event-requestrefundedto), [`RefundCallbackAttempted`](#coordinator-event-refundcallbackattempted).
|
|
295
|
+
|
|
296
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`RefundNotAvailable`](#coordinator-error-refundnotavailable), [`InsufficientCallbackGas`](#coordinator-error-insufficientcallbackgas).
|
|
297
|
+
|
|
298
|
+
#### <a id="coordinator-fn-retrycallback"></a>`retryCallback`
|
|
299
|
+
|
|
300
|
+
```solidity
|
|
301
|
+
function retryCallback(uint256 requestId, uint32 gasLimit) external
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Selector `0xdd11c275` · Caller: Anyone · Source: `D20VRFCoordinator.sol` lines 445–453, 602–619
|
|
305
|
+
|
|
306
|
+
Calls `rawFulfillRandomness` again with the same accepted word after a failed callback, forwarding `gasLimit` (30,000 to 1,000,000 and not below the request's `callbackGasLimit`). Sets `delivered` on success. Pays nobody and never changes the word. Transaction gas limit: about `gasLimit + 250,000`.
|
|
307
|
+
|
|
308
|
+
**Emits:** [`CallbackAttempted`](#coordinator-event-callbackattempted).
|
|
309
|
+
|
|
310
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`NotFulfilled`](#coordinator-error-notfulfilled), [`AlreadyDelivered`](#coordinator-error-alreadydelivered), [`InvalidCallbackGas`](#coordinator-error-invalidcallbackgas), [`InsufficientCallbackGas`](#coordinator-error-insufficientcallbackgas).
|
|
311
|
+
|
|
312
|
+
#### <a id="coordinator-fn-retryrefundcallback"></a>`retryRefundCallback`
|
|
313
|
+
|
|
314
|
+
```solidity
|
|
315
|
+
function retryRefundCallback(uint256 requestId, uint32 gasLimit) external
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Selector `0x054f6962` · Caller: Anyone · Source: `D20VRFCoordinator.sol` lines 481–489, 491–502
|
|
319
|
+
|
|
320
|
+
Repeats a failed `onRefund` notification for a refunded request with `gasLimit` (100,000 to 1,000,000). Never transfers funds again. Transaction gas limit: about `gasLimit + 150,000`.
|
|
321
|
+
|
|
322
|
+
**Emits:** [`RefundCallbackAttempted`](#coordinator-event-refundcallbackattempted).
|
|
323
|
+
|
|
324
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`NotRefunded`](#coordinator-error-notrefunded), [`RefundCallbackAlreadyDelivered`](#coordinator-error-refundcallbackalreadydelivered), [`InvalidCallbackGas`](#coordinator-error-invalidcallbackgas), [`InsufficientCallbackGas`](#coordinator-error-insufficientcallbackgas).
|
|
325
|
+
|
|
326
|
+
#### <a id="coordinator-fn-withdrawrefundcredit"></a>`withdrawRefundCredit`
|
|
327
|
+
|
|
328
|
+
```solidity
|
|
329
|
+
function withdrawRefundCredit(address recipient) external
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Selector `0x445071f2` · Caller: Refund-credit holder · Source: `D20VRFCoordinator.sol` lines 504–514
|
|
333
|
+
|
|
334
|
+
Sends all of the caller's refund credit, `refundCredits(msg.sender)`, to `recipient` with all remaining gas. Credit comes from overpayment and from refund transfers that failed, and belongs to the request's refund address, so that address must make the call. If `recipient` rejects the transfer the call reverts and the credit stays.
|
|
335
|
+
|
|
336
|
+
**Emits:** [`RefundCreditWithdrawn`](#coordinator-event-refundcreditwithdrawn).
|
|
337
|
+
|
|
338
|
+
**Errors:** [`InvalidRefundAddress`](#coordinator-error-invalidrefundaddress), [`NoRefundCredit`](#coordinator-error-norefundcredit), [`TransferFailed`](#coordinator-error-transferfailed).
|
|
339
|
+
|
|
340
|
+
#### <a id="coordinator-fn-withdrawfees"></a>`withdrawFees`
|
|
341
|
+
|
|
342
|
+
```solidity
|
|
343
|
+
function withdrawFees(address recipient) external
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Selector `0x164e68de` · Caller: Fee recipient · Source: `D20VRFCoordinator.sol` lines 516–525
|
|
347
|
+
|
|
348
|
+
Sends all `earnedFees` to `recipient`. Fees accrue at acceptance (fee minus keeper share) and from the part of a refunded fee that is not returned; open escrow is never included. With nothing earned it sends zero without reverting.
|
|
349
|
+
|
|
350
|
+
**Emits:** [`FeesWithdrawn`](#coordinator-event-feeswithdrawn).
|
|
351
|
+
|
|
352
|
+
**Errors:** [`OnlyFeeRecipient`](#coordinator-error-onlyfeerecipient), [`InvalidConfig`](#coordinator-error-invalidconfig), [`TransferFailed`](#coordinator-error-transferfailed).
|
|
353
|
+
|
|
354
|
+
#### <a id="coordinator-fn-withdrawkeepercredit"></a>`withdrawKeeperCredit`
|
|
355
|
+
|
|
356
|
+
```solidity
|
|
357
|
+
function withdrawKeeperCredit(address recipient) external
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
Selector `0xf62c546b` · Caller: Keeper-credit holder · Source: `D20VRFCoordinator.sol` lines 527–536
|
|
361
|
+
|
|
362
|
+
Sends all of the caller's keeper credit (keeper-share transfers that failed) to `recipient`.
|
|
363
|
+
|
|
364
|
+
**Emits:** [`KeeperCreditWithdrawn`](#coordinator-event-keepercreditwithdrawn).
|
|
365
|
+
|
|
366
|
+
**Errors:** [`InvalidConfig`](#coordinator-error-invalidconfig), [`NoKeeperCredit`](#coordinator-error-nokeepercredit), [`TransferFailed`](#coordinator-error-transferfailed).
|
|
367
|
+
|
|
368
|
+
### <a id="coordinator-settlement-balances"></a>Settlement balances
|
|
369
|
+
|
|
370
|
+
Views, callable by anyone. Amounts are in wei of native USDC.
|
|
371
|
+
|
|
372
|
+
| Function | Selector | Meaning | Source |
|
|
373
|
+
| --- | --- | --- | --- |
|
|
374
|
+
| <a id="coordinator-fn-refundcredits"></a>`refundCredits(address) returns (uint256)` | `0x61137e40` | Refund credit that an address can withdraw with `withdrawRefundCredit`. | line 56 |
|
|
375
|
+
| <a id="coordinator-fn-totalrefundcredits"></a>`totalRefundCredits() returns (uint256)` | `0x6e0842e1` | Sum of all refund credit held by the coordinator. | line 55 |
|
|
376
|
+
| <a id="coordinator-fn-earnedfees"></a>`earnedFees() returns (uint256)` | `0xb1b3ffd9` | Protocol fees that the fee recipient can withdraw. | line 51 |
|
|
377
|
+
| <a id="coordinator-fn-feerecipient"></a>`feeRecipient() returns (address)` | `0x46904840` | Address allowed to call `withdrawFees`; changed with `setFeeRecipient`. | line 39 |
|
|
378
|
+
| <a id="coordinator-fn-keeperfeebps"></a>`keeperFeeBps() returns (uint16)` | `0x0eab7d63` | Keeper share of each accepted fee in basis points (0 to 10000). Read at acceptance, not snapshotted: a change applies to open requests accepted afterwards. It only splits the escrowed fee; what the consumer paid and can be refunded does not change. | lines 40, 422 |
|
|
379
|
+
| <a id="coordinator-fn-keepercredits"></a>`keeperCredits(address) returns (uint256)` | `0xf5c764f6` | Keeper credit that an address can withdraw with `withdrawKeeperCredit`. | line 41 |
|
|
380
|
+
| <a id="coordinator-fn-totalkeepercredits"></a>`totalKeeperCredits() returns (uint256)` | `0xc7281b7a` | Sum of all keeper credit held by the coordinator. | line 42 |
|
|
381
|
+
|
|
382
|
+
### <a id="coordinator-keeper-and-proof-functions"></a>Keeper and proof functions
|
|
383
|
+
|
|
384
|
+
Proof submission is permissionless: anyone holding a valid proof may submit it, and the keeper share always goes to the registry `committer()`. Consumers normally only read `getRequest`. Besides the custom errors listed, proof functions can revert with `Error(string)` messages from the vendored VRF verifier, such as `invalid proof`, which are not in the ABI.
|
|
385
|
+
|
|
386
|
+
#### <a id="coordinator-fn-fulfillrandomness"></a>`fulfillRandomness`
|
|
387
|
+
|
|
388
|
+
```solidity
|
|
389
|
+
function fulfillRandomness(uint256 requestId, VRF.Proof proof) external
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Selector `0xef7c2b19` · Caller: Anyone · Source: `D20VRFCoordinator.sol` lines 388–396, 412–437
|
|
393
|
+
|
|
394
|
+
Accepts a proof for a request that is not fulfilled, not refunded and not past its deadline; acceptance in a block with timestamp equal to `deadline` is timely. Stores the target block hash if needed, verifies the proof against `requestSeed(requestId)`, stores the word, proof hash and transcript hash, sets `fulfilled`, adds `feePaid` minus the keeper share to `earnedFees` and calls the consumer with `callbackGasLimit` gas. It then sends the keeper share (`keeperFeeBps` of `feePaid`) to `committer()` with 30,000 gas, or records it as keeper credit. A failing callback does not revert the fulfillment.
|
|
395
|
+
|
|
396
|
+
**Emits:** [`BlockHashStored`](#coordinator-event-blockhashstored), [`RequestServed`](#coordinator-event-requestserved), [`ProofVerified`](#coordinator-event-proofverified), [`RandomnessFulfilled`](#coordinator-event-randomnessfulfilled), [`FulfillmentEvidence`](#coordinator-event-fulfillmentevidence), [`CallbackAttempted`](#coordinator-event-callbackattempted), [`KeeperFeePaid`](#coordinator-event-keeperfeepaid).
|
|
397
|
+
|
|
398
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`AlreadyFulfilled`](#coordinator-error-alreadyfulfilled), [`RequestRefunded`](#coordinator-error-requestrefunded), [`RequestExpired`](#coordinator-error-requestexpired), [`NotReady`](#coordinator-error-notready), [`BlockHashUnavailable`](#coordinator-error-blockhashunavailable), [`WrongPublicKey`](#coordinator-error-wrongpublickey), [`WrongSeed`](#coordinator-error-wrongseed), [`EvidencePacketTooLarge`](#coordinator-error-evidencepackettoolarge), [`InsufficientCallbackGas`](#coordinator-error-insufficientcallbackgas).
|
|
399
|
+
|
|
400
|
+
#### <a id="coordinator-fn-fulfillrandomnessbatch"></a>`fulfillRandomnessBatch`
|
|
401
|
+
|
|
402
|
+
```solidity
|
|
403
|
+
function fulfillRandomnessBatch(uint256[] ids, VRF.Proof[] proofs) external
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
Selector `0x9497b180` · Caller: Anyone · Source: `D20VRFCoordinator.sol` lines 398–410
|
|
407
|
+
|
|
408
|
+
Fulfills up to `MAX_FULFILL_BATCH` (16) requests, one proof each. Members already fulfilled, refunded or past their deadline, including an ID repeated in the batch, are skipped with `FulfillmentSkipped`; every other member runs exactly like `fulfillRandomness` and emits the same events, so an unknown ID, an unready member or an invalid proof reverts the whole batch.
|
|
409
|
+
|
|
410
|
+
**Emits:** [`FulfillmentSkipped`](#coordinator-event-fulfillmentskipped), [`BlockHashStored`](#coordinator-event-blockhashstored), [`RequestServed`](#coordinator-event-requestserved), [`ProofVerified`](#coordinator-event-proofverified), [`RandomnessFulfilled`](#coordinator-event-randomnessfulfilled), [`FulfillmentEvidence`](#coordinator-event-fulfillmentevidence), [`CallbackAttempted`](#coordinator-event-callbackattempted), [`KeeperFeePaid`](#coordinator-event-keeperfeepaid).
|
|
411
|
+
|
|
412
|
+
**Errors:** [`InvalidBatch`](#coordinator-error-invalidbatch), [`UnknownRequest`](#coordinator-error-unknownrequest), [`NotReady`](#coordinator-error-notready), [`BlockHashUnavailable`](#coordinator-error-blockhashunavailable), [`WrongPublicKey`](#coordinator-error-wrongpublickey), [`WrongSeed`](#coordinator-error-wrongseed), [`EvidencePacketTooLarge`](#coordinator-error-evidencepackettoolarge), [`InsufficientCallbackGas`](#coordinator-error-insufficientcallbackgas).
|
|
413
|
+
|
|
414
|
+
#### <a id="coordinator-fn-storeblockhash"></a>`storeBlockHash`
|
|
415
|
+
|
|
416
|
+
```solidity
|
|
417
|
+
function storeBlockHash(uint256 requestId) external returns (bytes32)
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
Selector `0x262fd733` · Caller: Anyone · Source: `D20VRFCoordinator.sol` lines 367–371, 553–568
|
|
421
|
+
|
|
422
|
+
Resolves the target block from the published epoch, stores its hash if not stored yet and returns it. Fulfillment does this automatically; calling it earlier keeps a request provable after its target leaves the 256-block `BLOCKHASH` window. Needs `block.number` at least `targetBlock + confirmationBlocks`. Works on any request, whatever its status.
|
|
423
|
+
|
|
424
|
+
**Emits:** [`BlockHashStored`](#coordinator-event-blockhashstored).
|
|
425
|
+
|
|
426
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`NotReady`](#coordinator-error-notready), [`BlockHashUnavailable`](#coordinator-error-blockhashunavailable).
|
|
427
|
+
|
|
428
|
+
#### <a id="coordinator-fn-verifyrequestproof"></a>`verifyRequestProof`
|
|
429
|
+
|
|
430
|
+
```solidity
|
|
431
|
+
function verifyRequestProof(uint256 requestId, VRF.Proof proof) external view returns (bytes32)
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Selector `0x0846de99` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 357–365
|
|
435
|
+
|
|
436
|
+
Returns the word a proof yields for the request's seed, without changing state. A valid proof is not acceptance: check `getRequest(requestId).fulfilled`.
|
|
437
|
+
|
|
438
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`NotReady`](#coordinator-error-notready), [`BlockHashUnavailable`](#coordinator-error-blockhashunavailable), [`WrongPublicKey`](#coordinator-error-wrongpublickey), [`WrongSeed`](#coordinator-error-wrongseed).
|
|
439
|
+
|
|
440
|
+
#### <a id="coordinator-fn-requestseed"></a>`requestSeed`
|
|
441
|
+
|
|
442
|
+
```solidity
|
|
443
|
+
function requestSeed(uint256 requestId) external view returns (uint256)
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
Selector `0xa9df851a` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 373–378, 570–578
|
|
447
|
+
|
|
448
|
+
Seed the proof must use: `keccak256(abi.encode(SEED_DOMAIN, chainId, coordinator, keyHash, requestId, consumer, clientSeed, mappingHash, requestBlock, targetBlock, blockHash, epochId, epochHash))` as uint256. Available only after publication and `confirmationBlocks` confirmations of the target block.
|
|
449
|
+
|
|
450
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`NotReady`](#coordinator-error-notready), [`BlockHashUnavailable`](#coordinator-error-blockhashunavailable).
|
|
451
|
+
|
|
452
|
+
#### <a id="coordinator-fn-getproofcontext"></a>`getProofContext`
|
|
453
|
+
|
|
454
|
+
```solidity
|
|
455
|
+
function getProofContext(uint256 requestId) external view returns (uint256 seed, uint64 deadline, bool fulfilled, bool refunded)
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Selector `0xcf14de9d` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 380–386
|
|
459
|
+
|
|
460
|
+
`requestSeed` together with `deadline`, `fulfilled` and `refunded`. It reverts `NotReady` like `requestSeed`, so it is not a status read for waiting requests; use `getRequest`.
|
|
461
|
+
|
|
462
|
+
**Errors:** [`UnknownRequest`](#coordinator-error-unknownrequest), [`NotReady`](#coordinator-error-notready), [`BlockHashUnavailable`](#coordinator-error-blockhashunavailable).
|
|
463
|
+
|
|
464
|
+
#### <a id="coordinator-fn-getpendingrequestids"></a>`getPendingRequestIds`
|
|
465
|
+
|
|
466
|
+
```solidity
|
|
467
|
+
function getPendingRequestIds(uint256 fromId, uint256 limit) external view returns (uint256[] ids, uint256 nextCursor)
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
Selector `0xfdfe72e6` · Caller: Anyone (view) · Source: `D20VRFCoordinator.sol` lines 309–328
|
|
471
|
+
|
|
472
|
+
Scans `limit` (1 to 256) request IDs from `fromId` (at least 1) and returns those not fulfilled, not refunded and not past their deadline, with the ID to continue from. Continue with `nextCursor` until it equals `nextRequestId()`. The answer can be stale by the time a transaction lands.
|
|
473
|
+
|
|
474
|
+
**Errors:** [`InvalidScan`](#coordinator-error-invalidscan).
|
|
475
|
+
|
|
476
|
+
### <a id="coordinator-keeper-key-and-configuration-reads"></a>Keeper, key and configuration reads
|
|
477
|
+
|
|
478
|
+
Views, callable by anyone. Nothing here has a setter except through an upgrade.
|
|
479
|
+
|
|
480
|
+
| Function | Selector | Meaning | Source |
|
|
481
|
+
| --- | --- | --- | --- |
|
|
482
|
+
| <a id="coordinator-fn-lastservedrequestid"></a>`lastServedRequestId() returns (uint256)` | `0xef54e226` | ID of the most recently accepted request; 0 before the first. | lines 52, 424 |
|
|
483
|
+
| <a id="coordinator-fn-lastservedindex"></a>`lastServedIndex() returns (uint256)` | `0x7e176eed` | Number of accepted requests so far: the `serveIndex` of the latest `RequestServed`. | lines 53, 425 |
|
|
484
|
+
| <a id="coordinator-fn-servedrequestat"></a>`servedRequestAt(uint256) returns (uint256)` | `0xf9a4acc6` | Request ID accepted at a serve index (from 1); 0 for an index not used yet. | lines 54, 425 |
|
|
485
|
+
| <a id="coordinator-fn-keyhash"></a>`keyHash() returns (bytes32)` | `0x61728f39` | `keccak256(abi.encode(publicKey))` of the VRF key; indexed in `RandomnessRequested` and `ProofVerified`. | lines 36, 179 |
|
|
486
|
+
| <a id="coordinator-fn-publickeyx"></a>`publicKeyX() returns (uint256)` | `0xfa6df55d` | x coordinate of the VRF public key. | line 34 |
|
|
487
|
+
| <a id="coordinator-fn-publickeyy"></a>`publicKeyY() returns (uint256)` | `0xd7a6f6e8` | y coordinate of the VRF public key. | line 35 |
|
|
488
|
+
| <a id="coordinator-fn-confirmationblocks"></a>`confirmationBlocks() returns (uint16)` | `0x460a58aa` | Blocks after the target block before the seed and proofs become available (1 to 64, set at initialization). | lines 44, 555 |
|
|
489
|
+
| <a id="coordinator-fn-epochregistry"></a>`epochRegistry() returns (address)` | `0x2b12cb69` | The `EpochEntropy` proxy that supplies epochs and the keeper-share recipient. | line 32 |
|
|
490
|
+
| <a id="coordinator-fn-protocolconfigurationhash"></a>`protocolConfigurationHash() returns (bytes32)` | `0x155cf49b` | Hash of the initialized configuration (public key, initial fee recipient, initial minimum fee, confirmations, registry, initial catalog hash, first epoch start, epoch length 200) under `CONFIG_DOMAIN`. Bound into every transcript hash. | lines 31, 189 |
|
|
491
|
+
| <a id="coordinator-fn-initialfeerecipient"></a>`initialFeeRecipient() returns (address)` | `0x308c2d6b` | Fee recipient given to `initialize`, used by replay. The live payout address is `feeRecipient()`. | lines 38, 181 |
|
|
492
|
+
| <a id="coordinator-fn-initialminfee"></a>`initialMinFee() returns (uint256)` | `0xb3839295` | Minimum fee given to `initialize`, used by replay. The live minimum is `minFee()`. | lines 104, 184 |
|
|
493
|
+
|
|
494
|
+
### <a id="coordinator-owner-administration"></a>Owner administration
|
|
495
|
+
|
|
496
|
+
Owner-only functions revert `OwnableUnauthorizedAccount` for anyone else. No setter can change an existing request, the VRF key, the registry or the confirmations.
|
|
497
|
+
|
|
498
|
+
#### <a id="coordinator-fn-setpricing"></a>`setPricing`
|
|
499
|
+
|
|
500
|
+
```solidity
|
|
501
|
+
function setPricing(uint256 nextMinFee, uint16 multiplier, uint32 overhead) external
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
Selector `0x4c729ce6` · Caller: Owner · Source: `D20VRFCoordinator.sol` lines 204–209
|
|
505
|
+
|
|
506
|
+
Sets `minFee` (at most `MAX_MIN_FEE`, 10 USDC), `feeMultiplier` (at most `MAX_FEE_MULTIPLIER`, 20) and `fulfillGasOverhead` (`MIN_FULFILL_GAS_OVERHEAD` to `MAX_FULFILL_GAS_OVERHEAD`, 100,000 to 2,000,000 gas). Affects requests created afterwards; open requests keep their escrowed fee.
|
|
507
|
+
|
|
508
|
+
**Emits:** [`PricingChanged`](#coordinator-event-pricingchanged).
|
|
509
|
+
|
|
510
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#coordinator-error-ownableunauthorizedaccount), [`InvalidConfig`](#coordinator-error-invalidconfig).
|
|
511
|
+
|
|
512
|
+
#### <a id="coordinator-fn-setrefundbps"></a>`setRefundBps`
|
|
513
|
+
|
|
514
|
+
```solidity
|
|
515
|
+
function setRefundBps(uint16 next) external
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
Selector `0x55a94d1b` · Caller: Owner · Source: `D20VRFCoordinator.sol` lines 213–217
|
|
519
|
+
|
|
520
|
+
Sets the refund ratio for requests created afterwards, `MIN_REFUND_BPS` (5000) to 10000.
|
|
521
|
+
|
|
522
|
+
**Emits:** [`RefundBpsChanged`](#coordinator-event-refundbpschanged).
|
|
523
|
+
|
|
524
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#coordinator-error-ownableunauthorizedaccount), [`InvalidConfig`](#coordinator-error-invalidconfig).
|
|
525
|
+
|
|
526
|
+
#### <a id="coordinator-fn-setkeeperfeebps"></a>`setKeeperFeeBps`
|
|
527
|
+
|
|
528
|
+
```solidity
|
|
529
|
+
function setKeeperFeeBps(uint16 next) external
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
Selector `0xe140f0ca` · Caller: Owner · Source: `D20VRFCoordinator.sol` lines 200–203
|
|
533
|
+
|
|
534
|
+
Sets the keeper share, 0 to 10000 basis points. Read at each acceptance, so it also applies to open requests accepted later.
|
|
535
|
+
|
|
536
|
+
**Emits:** [`KeeperFeeBpsChanged`](#coordinator-event-keeperfeebpschanged).
|
|
537
|
+
|
|
538
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#coordinator-error-ownableunauthorizedaccount), [`InvalidConfig`](#coordinator-error-invalidconfig).
|
|
539
|
+
|
|
540
|
+
#### <a id="coordinator-fn-setfeerecipient"></a>`setFeeRecipient`
|
|
541
|
+
|
|
542
|
+
```solidity
|
|
543
|
+
function setFeeRecipient(address next) external
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
Selector `0xe74b981b` · Caller: Owner · Source: `D20VRFCoordinator.sol` lines 196–199
|
|
547
|
+
|
|
548
|
+
Sets the address allowed to withdraw `earnedFees`, including fees earned before the change. The zero address is rejected.
|
|
549
|
+
|
|
550
|
+
**Emits:** [`FeeRecipientChanged`](#coordinator-event-feerecipientchanged).
|
|
551
|
+
|
|
552
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#coordinator-error-ownableunauthorizedaccount), [`InvalidConfig`](#coordinator-error-invalidconfig).
|
|
553
|
+
|
|
554
|
+
#### <a id="coordinator-fn-owner"></a>`owner`
|
|
555
|
+
|
|
556
|
+
```solidity
|
|
557
|
+
function owner() external view returns (address)
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
Selector `0x8da5cb5b` · Caller: Anyone (view)
|
|
561
|
+
|
|
562
|
+
Current owner: upgrade authority and the only account that can call the setters.
|
|
563
|
+
|
|
564
|
+
#### <a id="coordinator-fn-pendingowner"></a>`pendingOwner`
|
|
565
|
+
|
|
566
|
+
```solidity
|
|
567
|
+
function pendingOwner() external view returns (address)
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
Selector `0xe30c3978` · Caller: Anyone (view)
|
|
571
|
+
|
|
572
|
+
Account nominated by `transferOwnership` that has not accepted yet; zero when none.
|
|
573
|
+
|
|
574
|
+
#### <a id="coordinator-fn-transferownership"></a>`transferOwnership`
|
|
575
|
+
|
|
576
|
+
```solidity
|
|
577
|
+
function transferOwnership(address newOwner) external
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
Selector `0xf2fde38b` · Caller: Owner
|
|
581
|
+
|
|
582
|
+
Starts a two-step transfer by nominating `newOwner`; ownership moves only when that account calls `acceptOwnership`. A new call replaces the nomination, and the zero address cancels it.
|
|
583
|
+
|
|
584
|
+
**Emits:** [`OwnershipTransferStarted`](#coordinator-event-ownershiptransferstarted).
|
|
585
|
+
|
|
586
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#coordinator-error-ownableunauthorizedaccount).
|
|
587
|
+
|
|
588
|
+
#### <a id="coordinator-fn-acceptownership"></a>`acceptOwnership`
|
|
589
|
+
|
|
590
|
+
```solidity
|
|
591
|
+
function acceptOwnership() external
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
Selector `0x79ba5097` · Caller: Pending owner
|
|
595
|
+
|
|
596
|
+
Completes the transfer to the caller and clears the nomination.
|
|
597
|
+
|
|
598
|
+
**Emits:** [`OwnershipTransferred`](#coordinator-event-ownershiptransferred).
|
|
599
|
+
|
|
600
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#coordinator-error-ownableunauthorizedaccount).
|
|
601
|
+
|
|
602
|
+
#### <a id="coordinator-fn-renounceownership"></a>`renounceOwnership`
|
|
603
|
+
|
|
604
|
+
```solidity
|
|
605
|
+
function renounceOwnership() external view
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
Selector `0x715018a6` · Caller: Owner · Source: `D20VRFCoordinator.sol` lines 193–194
|
|
609
|
+
|
|
610
|
+
Disabled and declared `view`: the owner gets `RenounceDisabled` and anyone else `OwnableUnauthorizedAccount`, so the contract always has an owner and upgrade authority can only move through an accepted transfer.
|
|
611
|
+
|
|
612
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#coordinator-error-ownableunauthorizedaccount), [`RenounceDisabled`](#coordinator-error-renouncedisabled).
|
|
613
|
+
|
|
614
|
+
#### <a id="coordinator-fn-upgradetoandcall"></a>`upgradeToAndCall`
|
|
615
|
+
|
|
616
|
+
```solidity
|
|
617
|
+
function upgradeToAndCall(address newImplementation, bytes data) external payable
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
Selector `0x4f1ef286` · Caller: Owner, through the proxy
|
|
621
|
+
|
|
622
|
+
UUPS upgrade: points the proxy at `newImplementation`, which must report the ERC-1967 slot from `proxiableUUID`, and delegatecalls `data` when it is non-empty. An upgrade can change any behavior described here. Integrators check the implementation when they integrate and again whenever a proxy emits `Upgraded` or the deployment manifest records an upgrade (README [Security and trust](README.md#security-and-trust)).
|
|
623
|
+
|
|
624
|
+
**Emits:** [`Upgraded`](#coordinator-event-upgraded).
|
|
625
|
+
|
|
626
|
+
**Errors:** [`UUPSUnauthorizedCallContext`](#coordinator-error-uupsunauthorizedcallcontext), [`OwnableUnauthorizedAccount`](#coordinator-error-ownableunauthorizedaccount), [`ERC1967InvalidImplementation`](#coordinator-error-erc1967invalidimplementation), [`UUPSUnsupportedProxiableUUID`](#coordinator-error-uupsunsupportedproxiableuuid), [`ERC1967NonPayable`](#coordinator-error-erc1967nonpayable), [`AddressEmptyCode`](#coordinator-error-addressemptycode), [`FailedCall`](#coordinator-error-failedcall).
|
|
627
|
+
|
|
628
|
+
#### <a id="coordinator-fn-proxiableuuid"></a>`proxiableUUID`
|
|
629
|
+
|
|
630
|
+
```solidity
|
|
631
|
+
function proxiableUUID() external view returns (bytes32)
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
Selector `0x52d1902d` · Caller: Anyone (view)
|
|
635
|
+
|
|
636
|
+
ERC-1822 check used by `upgradeToAndCall`. Returns the ERC-1967 implementation slot when called on an implementation contract directly and reverts through the proxy.
|
|
637
|
+
|
|
638
|
+
**Errors:** [`UUPSUnauthorizedCallContext`](#coordinator-error-uupsunauthorizedcallcontext).
|
|
639
|
+
|
|
640
|
+
#### <a id="coordinator-fn-initialize"></a>`initialize`
|
|
641
|
+
|
|
642
|
+
```solidity
|
|
643
|
+
function initialize(uint256[2] publicKey, address initialOwner, address recipient, uint256 fee, uint16 confirmations, address registry, uint16 keeperBps) external
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
Selector `0x56b95b47` · Caller: Once, by `D20Proxy` at deployment · Source: `D20VRFCoordinator.sol` lines 169–190
|
|
647
|
+
|
|
648
|
+
Sets owner, VRF public key, fee recipient, minimum fee, confirmations, registry and keeper share, with `feeMultiplier` 5, `fulfillGasOverhead` 300,000 and `refundBps` 10000. A public key that is not on the curve can also revert with an `Error(string)` from the verifier.
|
|
649
|
+
|
|
650
|
+
**Emits:** [`OwnershipTransferred`](#coordinator-event-ownershiptransferred), [`Initialized`](#coordinator-event-initialized).
|
|
651
|
+
|
|
652
|
+
**Errors:** [`InvalidInitialization`](#coordinator-error-invalidinitialization), [`OwnableInvalidOwner`](#coordinator-error-ownableinvalidowner), [`InvalidConfig`](#coordinator-error-invalidconfig), [`InvalidPublicKey`](#coordinator-error-invalidpublickey).
|
|
653
|
+
|
|
654
|
+
### <a id="coordinator-constants"></a>Constants
|
|
655
|
+
|
|
656
|
+
Views returning values fixed in the implementation code.
|
|
657
|
+
|
|
658
|
+
| Constant | Returns | Value | Selector | Meaning |
|
|
659
|
+
| --- | --- | --- | --- | --- |
|
|
660
|
+
| <a id="coordinator-fn-min_callback_gas"></a>`MIN_CALLBACK_GAS` | `uint32` | `30_000` | `0x4374e10c` | Lowest `callbackGasLimit` and `retryCallback` gas limit. |
|
|
661
|
+
| <a id="coordinator-fn-max_callback_gas"></a>`MAX_CALLBACK_GAS` | `uint32` | `1_000_000` | `0x6d9809a0` | Highest callback or notification gas limit. |
|
|
662
|
+
| <a id="coordinator-fn-response_timeout"></a>`RESPONSE_TIMEOUT` | `uint64` | `60 seconds` | `0x11e219d7` | Seconds from the request block timestamp to `deadline`. |
|
|
663
|
+
| <a id="coordinator-fn-refund_callback_gas"></a>`REFUND_CALLBACK_GAS` | `uint32` | `100_000` | `0x8a8ae284` | Gas for the first `onRefund` notification, and the lowest `retryRefundCallback` gas limit. |
|
|
664
|
+
| <a id="coordinator-fn-max_fulfill_batch"></a>`MAX_FULFILL_BATCH` | `uint256` | `16` | `0x1d7e0cc4` | Most requests per `fulfillRandomnessBatch`. |
|
|
665
|
+
| <a id="coordinator-fn-max_evidence_packet_bytes"></a>`MAX_EVIDENCE_PACKET_BYTES` | `uint256` | `512` | `0x7fcf2f33` | Upper bound on the `FulfillmentEvidence` packet (actual size 416 bytes). |
|
|
666
|
+
| <a id="coordinator-fn-max_min_fee"></a>`MAX_MIN_FEE` | `uint256` | `10e18` | `0x8483d43e` | Highest `minFee`: 10 USDC in 18-decimal native units. |
|
|
667
|
+
| <a id="coordinator-fn-max_fee_multiplier"></a>`MAX_FEE_MULTIPLIER` | `uint16` | `20` | `0xb6994144` | Highest `feeMultiplier`. |
|
|
668
|
+
| <a id="coordinator-fn-min_fulfill_gas_overhead"></a>`MIN_FULFILL_GAS_OVERHEAD` | `uint32` | `100_000` | `0x35ccd0b4` | Lowest `fulfillGasOverhead`. |
|
|
669
|
+
| <a id="coordinator-fn-max_fulfill_gas_overhead"></a>`MAX_FULFILL_GAS_OVERHEAD` | `uint32` | `2_000_000` | `0x2a06b47d` | Highest `fulfillGasOverhead`. |
|
|
670
|
+
| <a id="coordinator-fn-min_refund_bps"></a>`MIN_REFUND_BPS` | `uint16` | `5000` | `0xaf7718f1` | Lowest `refundBps` (50%). |
|
|
671
|
+
| <a id="coordinator-fn-seed_domain"></a>`SEED_DOMAIN` | `bytes32` | `keccak256("D20_VRF_SEED")` | `0x6000054d` | Domain tag of `requestSeed`. |
|
|
672
|
+
| <a id="coordinator-fn-transcript_domain"></a>`TRANSCRIPT_DOMAIN` | `bytes32` | `keccak256("D20_VRF_TRANSCRIPT")` | `0xab2fde00` | Domain tag of the transcript hash. |
|
|
673
|
+
| <a id="coordinator-fn-config_domain"></a>`CONFIG_DOMAIN` | `bytes32` | `keccak256("D20_VRF_CONFIG")` | `0x3624ffed` | Domain tag of `protocolConfigurationHash`. |
|
|
674
|
+
| <a id="coordinator-fn-upgrade_interface_version"></a>`UPGRADE_INTERFACE_VERSION` | `string` | `"5.0.0"` | `0xad3cb1cc` | OpenZeppelin UUPS interface version: upgrades go through `upgradeToAndCall` only. |
|
|
675
|
+
|
|
676
|
+
### <a id="coordinator-events"></a>Events
|
|
677
|
+
|
|
678
|
+
**Request lifecycle**
|
|
679
|
+
|
|
680
|
+
#### <a id="coordinator-event-randomnessrequested"></a>`RandomnessRequested`
|
|
681
|
+
|
|
682
|
+
```solidity
|
|
683
|
+
event RandomnessRequested(uint256 indexed requestId, address indexed consumer, bytes32 indexed keyHash, bytes32 clientSeed, uint64 requestBlock, uint32 callbackGasLimit, uint256 feePaid, address refundAddress, uint64 deadline)
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
Topic 0 `0xaf91b17376114a36689aa115062983bda7b43263a891fb8de0cc69d30d4240ad` · Emitted by: [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness) · Source: `D20VRFCoordinator.sol` lines 138–142, 283–284
|
|
687
|
+
|
|
688
|
+
A request was created. `feePaid` is the escrowed fee, not `msg.value`; `deadline` is the block timestamp plus 60 seconds. Read `requestId` from this log in the request receipt, filtering by the coordinator address and event name: with an overpayment, `FeeOverpaymentCredited` comes first.
|
|
689
|
+
|
|
690
|
+
#### <a id="coordinator-event-mappingrequested"></a>`MappingRequested`
|
|
691
|
+
|
|
692
|
+
```solidity
|
|
693
|
+
event MappingRequested(uint256 indexed requestId, bytes32 indexed mappingHash, RandomnessMapping.Spec spec)
|
|
694
|
+
```
|
|
695
|
+
|
|
696
|
+
Topic 0 `0xbe1c93f40bd74ff9acd22dc40818e36d04e0b8a49b8238d0537c63219c2336dd` · Emitted by: [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness) · Source: `D20VRFCoordinator.sol` lines 157, 285
|
|
697
|
+
|
|
698
|
+
Emitted right after `RandomnessRequested` with the stored spec (all zero for a raw request) and its hash.
|
|
699
|
+
|
|
700
|
+
#### <a id="coordinator-event-feeoverpaymentcredited"></a>`FeeOverpaymentCredited`
|
|
701
|
+
|
|
702
|
+
```solidity
|
|
703
|
+
event FeeOverpaymentCredited(uint256 indexed requestId, address indexed refundAddress, uint256 amount)
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
Topic 0 `0x8ae693db98f043f48e8f427375449ed5576aba97575e4f7f93ff2c1f6c75dcb5` · Emitted by: [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness) · Source: `D20VRFCoordinator.sol` lines 151, 277–282
|
|
707
|
+
|
|
708
|
+
`msg.value` exceeded the fee and `amount` was added to `refundCredits(refundAddress)`, independently of what happens to the request. Emitted before `RandomnessRequested`.
|
|
709
|
+
|
|
710
|
+
#### <a id="coordinator-event-blockhashstored"></a>`BlockHashStored`
|
|
711
|
+
|
|
712
|
+
```solidity
|
|
713
|
+
event BlockHashStored(uint256 indexed requestId, uint64 targetBlock, bytes32 blockHash)
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
Topic 0 `0x81bc3b4ec75af0fb9ed3521d7c766d8f995d04b0735c17d61ff9d468b0f04911` · Emitted by: [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch), [`storeBlockHash`](#coordinator-fn-storeblockhash) · Source: `D20VRFCoordinator.sol` lines 143, 561–568
|
|
717
|
+
|
|
718
|
+
The target block hash of the request was stored. Emitted once per request: by `storeBlockHash`, or by fulfillment if the hash was not stored before.
|
|
719
|
+
|
|
720
|
+
#### <a id="coordinator-event-requestserved"></a>`RequestServed`
|
|
721
|
+
|
|
722
|
+
```solidity
|
|
723
|
+
event RequestServed(uint256 indexed requestId, uint256 indexed serveIndex)
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
Topic 0 `0x2012511e6cebd578bcabff1ef3346edb032cbab8622e9f23d9f15d7d1037267f` · Emitted by: [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch) · Source: `D20VRFCoordinator.sol` lines 159, 424–426
|
|
727
|
+
|
|
728
|
+
A proof was accepted. `serveIndex` counts accepted requests from 1 (`lastServedIndex`, `servedRequestAt`).
|
|
729
|
+
|
|
730
|
+
#### <a id="coordinator-event-proofverified"></a>`ProofVerified`
|
|
731
|
+
|
|
732
|
+
```solidity
|
|
733
|
+
event ProofVerified(uint256 indexed requestId, bytes32 indexed keyHash, uint256 seed, bytes32 proofHash)
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
Topic 0 `0x55bb25be3ecd9f68ceae7cdabf4eabe2e0940bd8fc1c26c0d68ad5f7c5d08d22` · Emitted by: [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch) · Source: `D20VRFCoordinator.sol` lines 158, 427
|
|
737
|
+
|
|
738
|
+
Seed and hash of the accepted proof.
|
|
739
|
+
|
|
740
|
+
#### <a id="coordinator-event-randomnessfulfilled"></a>`RandomnessFulfilled`
|
|
741
|
+
|
|
742
|
+
```solidity
|
|
743
|
+
event RandomnessFulfilled(uint256 indexed requestId, bytes32 randomness, address indexed submitter)
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
Topic 0 `0x9c82683ee7932041c254d206bcce4241d66a811d53ee7191799cc120777b2b87` · Emitted by: [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch) · Source: `D20VRFCoordinator.sol` lines 144, 428
|
|
747
|
+
|
|
748
|
+
A proof was accepted and `randomness` is final. `submitter` sent the transaction and is not paid for it.
|
|
749
|
+
|
|
750
|
+
#### <a id="coordinator-event-fulfillmentevidence"></a>`FulfillmentEvidence`
|
|
751
|
+
|
|
752
|
+
```solidity
|
|
753
|
+
event FulfillmentEvidence(uint256 indexed requestId, bytes32 indexed transcriptHash, bytes packet)
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
Topic 0 `0xa121bbea897439460dfb08c3e6d6af064bc1f31e9477471828a87c5596b92e77` · Emitted by: [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch) · Source: `D20VRFCoordinator.sol` lines 162–163, 439–443
|
|
757
|
+
|
|
758
|
+
The accepted proof as a 416-byte ABI-encoded packet, indexed by `transcriptHash`. Decode it with `decodeEvidencePacket`; take evidence from this log, not from calldata, since a batch carries several proofs.
|
|
759
|
+
|
|
760
|
+
#### <a id="coordinator-event-callbackattempted"></a>`CallbackAttempted`
|
|
761
|
+
|
|
762
|
+
```solidity
|
|
763
|
+
event CallbackAttempted(uint256 indexed requestId, bool success, uint32 gasLimit)
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
Topic 0 `0x70f64c0739e827900ae6f2e1317601653f4080bc857f423671fc58d5822f1f4a` · Emitted by: [`retryCallback`](#coordinator-fn-retrycallback), [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch) · Source: `D20VRFCoordinator.sol` lines 145, 602–619
|
|
767
|
+
|
|
768
|
+
Result of calling `rawFulfillRandomness` with `gasLimit` gas, at fulfillment and at each `retryCallback`. `success` false means the consumer reverted, ran out of gas or has no code; the word is accepted either way.
|
|
769
|
+
|
|
770
|
+
#### <a id="coordinator-event-keeperfeepaid"></a>`KeeperFeePaid`
|
|
771
|
+
|
|
772
|
+
```solidity
|
|
773
|
+
event KeeperFeePaid(uint256 indexed requestId, address indexed keeper, uint256 amount, bool paid)
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
Topic 0 `0x7605929b04963e0365f647d9ab12e7ac4aeba5474bb80f1e1554fccad0584683` · Emitted by: [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch) · Source: `D20VRFCoordinator.sol` lines 152, 431–436
|
|
777
|
+
|
|
778
|
+
At acceptance, when the keeper share is non-zero: `amount` went to `keeper`, the registry committer, by a 30,000-gas transfer (`paid` true) or was added to `keeperCredits(keeper)` (`paid` false). Emitted after `CallbackAttempted`.
|
|
779
|
+
|
|
780
|
+
#### <a id="coordinator-event-fulfillmentskipped"></a>`FulfillmentSkipped`
|
|
781
|
+
|
|
782
|
+
```solidity
|
|
783
|
+
event FulfillmentSkipped(uint256 indexed requestId, uint8 reason)
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
Topic 0 `0x45d96bda73a91db41bdeab56114e5d7b9f42c9f38add9e2d2c6d6f5761203ca3` · Emitted by: [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch) · Source: `D20VRFCoordinator.sol` lines 160–161, 406–407
|
|
787
|
+
|
|
788
|
+
A batch member was left untouched: `reason` 1 already fulfilled, 2 refunded, 3 past its deadline.
|
|
789
|
+
|
|
790
|
+
#### <a id="coordinator-event-requestrefundedto"></a>`RequestRefundedTo`
|
|
791
|
+
|
|
792
|
+
```solidity
|
|
793
|
+
event RequestRefundedTo(uint256 indexed requestId, address indexed refundAddress, uint256 amount, bool paid)
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
Topic 0 `0x0f6107d218fea62a20553f3700dba7c94dcf653bd2027c0bf1ebe0832f42a506` · Emitted by: [`refundRequest`](#coordinator-fn-refundrequest) · Source: `D20VRFCoordinator.sol` lines 154, 477
|
|
797
|
+
|
|
798
|
+
An expired request was refunded: `amount` (`feePaid × requestRefundBps / 10000`) was sent to `refundAddress` (`paid` true) or added to its refund credit (`paid` false).
|
|
799
|
+
|
|
800
|
+
#### <a id="coordinator-event-refundcallbackattempted"></a>`RefundCallbackAttempted`
|
|
801
|
+
|
|
802
|
+
```solidity
|
|
803
|
+
event RefundCallbackAttempted(uint256 indexed requestId, address indexed consumer, bool success, uint32 gasLimit)
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
Topic 0 `0x88448c9fbcfc67f28f0266e82766e402ccd28115fbb84edb6e5b2597effe83d8` · Emitted by: [`refundRequest`](#coordinator-fn-refundrequest), [`retryRefundCallback`](#coordinator-fn-retryrefundcallback) · Source: `D20VRFCoordinator.sol` lines 156, 491–502
|
|
807
|
+
|
|
808
|
+
Result of calling `onRefund(requestId)` on `consumer` with `gasLimit` gas: 100,000 at `refundRequest`, the caller's limit at `retryRefundCallback`.
|
|
809
|
+
|
|
810
|
+
**Credits and withdrawals**
|
|
811
|
+
|
|
812
|
+
#### <a id="coordinator-event-refundcreditwithdrawn"></a>`RefundCreditWithdrawn`
|
|
813
|
+
|
|
814
|
+
```solidity
|
|
815
|
+
event RefundCreditWithdrawn(address indexed owner, address indexed recipient, uint256 amount)
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
Topic 0 `0x9d520065b24fda0469128acd3f3078de7e43d70ab762aeea8c741bde25070192` · Emitted by: [`withdrawRefundCredit`](#coordinator-fn-withdrawrefundcredit) · Source: `D20VRFCoordinator.sol` lines 155, 513
|
|
819
|
+
|
|
820
|
+
`owner`, the credit holder (not the contract owner), withdrew `amount` of refund credit to `recipient`.
|
|
821
|
+
|
|
822
|
+
#### <a id="coordinator-event-keepercreditwithdrawn"></a>`KeeperCreditWithdrawn`
|
|
823
|
+
|
|
824
|
+
```solidity
|
|
825
|
+
event KeeperCreditWithdrawn(address indexed keeper, address indexed recipient, uint256 amount)
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
Topic 0 `0x22f05c41968705c032a86a65f8fda7e64483ea5e6b6b27a920d1fbfab94267ba` · Emitted by: [`withdrawKeeperCredit`](#coordinator-fn-withdrawkeepercredit) · Source: `D20VRFCoordinator.sol` lines 153, 535
|
|
829
|
+
|
|
830
|
+
`keeper` withdrew `amount` of keeper credit to `recipient`.
|
|
831
|
+
|
|
832
|
+
#### <a id="coordinator-event-feeswithdrawn"></a>`FeesWithdrawn`
|
|
833
|
+
|
|
834
|
+
```solidity
|
|
835
|
+
event FeesWithdrawn(address indexed recipient, uint256 amount)
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
Topic 0 `0xc0819c13be868895eb93e40eaceb96de976442fa1d404e5c55f14bb65a8c489a` · Emitted by: [`withdrawFees`](#coordinator-fn-withdrawfees) · Source: `D20VRFCoordinator.sol` lines 146, 524
|
|
839
|
+
|
|
840
|
+
The fee recipient withdrew `amount` of earned fees to `recipient`.
|
|
841
|
+
|
|
842
|
+
**Administration and upgrades**
|
|
843
|
+
|
|
844
|
+
#### <a id="coordinator-event-pricingchanged"></a>`PricingChanged`
|
|
845
|
+
|
|
846
|
+
```solidity
|
|
847
|
+
event PricingChanged(uint256 minFee, uint16 feeMultiplier, uint32 fulfillGasOverhead)
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
Topic 0 `0x32806eb5e21ac2f5fb7d11f898c2995e19fdf203c8a5aeed8b824506cd0d44ff` · Emitted by: [`setPricing`](#coordinator-fn-setpricing) · Source: `D20VRFCoordinator.sol` lines 149, 208
|
|
851
|
+
|
|
852
|
+
New `minFee`, `feeMultiplier` and `fulfillGasOverhead` for requests created afterwards.
|
|
853
|
+
|
|
854
|
+
#### <a id="coordinator-event-refundbpschanged"></a>`RefundBpsChanged`
|
|
855
|
+
|
|
856
|
+
```solidity
|
|
857
|
+
event RefundBpsChanged(uint16 previousBps, uint16 newBps)
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
Topic 0 `0x21e3c4cf3007c4ee385a3936593ff4cfa23fc17bca1175b6350c546f9810e0d8` · Emitted by: [`setRefundBps`](#coordinator-fn-setrefundbps) · Source: `D20VRFCoordinator.sol` lines 150, 216
|
|
861
|
+
|
|
862
|
+
New refund ratio for requests created afterwards.
|
|
863
|
+
|
|
864
|
+
#### <a id="coordinator-event-keeperfeebpschanged"></a>`KeeperFeeBpsChanged`
|
|
865
|
+
|
|
866
|
+
```solidity
|
|
867
|
+
event KeeperFeeBpsChanged(uint16 previousBps, uint16 newBps)
|
|
868
|
+
```
|
|
869
|
+
|
|
870
|
+
Topic 0 `0xa648a60f1d22511c1cc898ca69b633d1a1114079e83734b9ab9a13e0e28c68b7` · Emitted by: [`setKeeperFeeBps`](#coordinator-fn-setkeeperfeebps) · Source: `D20VRFCoordinator.sol` lines 148, 202
|
|
871
|
+
|
|
872
|
+
New keeper share, applied at later acceptances, including of requests already open.
|
|
873
|
+
|
|
874
|
+
#### <a id="coordinator-event-feerecipientchanged"></a>`FeeRecipientChanged`
|
|
875
|
+
|
|
876
|
+
```solidity
|
|
877
|
+
event FeeRecipientChanged(address indexed previousRecipient, address indexed newRecipient)
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
Topic 0 `0x0bc21fe5c3ab742ff1d15b5c4477ffbacf1167e618228078fa625edebe7f331d` · Emitted by: [`setFeeRecipient`](#coordinator-fn-setfeerecipient) · Source: `D20VRFCoordinator.sol` lines 147, 198
|
|
881
|
+
|
|
882
|
+
New address allowed to withdraw earned fees.
|
|
883
|
+
|
|
884
|
+
#### <a id="coordinator-event-ownershiptransferstarted"></a>`OwnershipTransferStarted`
|
|
885
|
+
|
|
886
|
+
```solidity
|
|
887
|
+
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner)
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
Topic 0 `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` · Emitted by: [`transferOwnership`](#coordinator-fn-transferownership)
|
|
891
|
+
|
|
892
|
+
`transferOwnership` nominated `newOwner`; the zero address means a nomination was cancelled.
|
|
893
|
+
|
|
894
|
+
#### <a id="coordinator-event-ownershiptransferred"></a>`OwnershipTransferred`
|
|
895
|
+
|
|
896
|
+
```solidity
|
|
897
|
+
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
Topic 0 `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` · Emitted by: [`acceptOwnership`](#coordinator-fn-acceptownership), [`initialize`](#coordinator-fn-initialize)
|
|
901
|
+
|
|
902
|
+
Ownership moved: from the zero address at initialization, and at each `acceptOwnership`.
|
|
903
|
+
|
|
904
|
+
#### <a id="coordinator-event-upgraded"></a>`Upgraded`
|
|
905
|
+
|
|
906
|
+
```solidity
|
|
907
|
+
event Upgraded(address indexed implementation)
|
|
908
|
+
```
|
|
909
|
+
|
|
910
|
+
Topic 0 `0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b` · Emitted by: [`upgradeToAndCall`](#coordinator-fn-upgradetoandcall), proxy deployment
|
|
911
|
+
|
|
912
|
+
The proxy now runs `implementation`. Emitted by the proxy at deployment and at every `upgradeToAndCall`. Compare the address with the deployment manifest; an implementation you have not reviewed means stop and review before sending more requests.
|
|
913
|
+
|
|
914
|
+
#### <a id="coordinator-event-initialized"></a>`Initialized`
|
|
915
|
+
|
|
916
|
+
```solidity
|
|
917
|
+
event Initialized(uint64 version)
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
Topic 0 `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` · Emitted by: [`initialize`](#coordinator-fn-initialize)
|
|
921
|
+
|
|
922
|
+
`initialize` ran on the proxy (`version` 1). Each implementation contract also emitted it once at construction with `version` 2^64 − 1, which locks the implementation against initialization.
|
|
923
|
+
|
|
924
|
+
### <a id="coordinator-errors"></a>Errors
|
|
925
|
+
|
|
926
|
+
**Requesting**
|
|
927
|
+
|
|
928
|
+
#### <a id="coordinator-error-contractconsumerrequired"></a>`ContractConsumerRequired`
|
|
929
|
+
|
|
930
|
+
`error ContractConsumerRequired()` · Selector `0x2b99db1e` · Source: `D20VRFCoordinator.sol` lines 110, 250
|
|
931
|
+
|
|
932
|
+
**Raised by:** [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness).
|
|
933
|
+
|
|
934
|
+
The caller of a request function has no code: an externally owned account, or a contract still running its constructor.
|
|
935
|
+
|
|
936
|
+
**What to do:** Send the request through a deployed consumer contract (README [Integrate a consumer](README.md#integrate-a-consumer)), and not from its constructor.
|
|
937
|
+
|
|
938
|
+
#### <a id="coordinator-error-invalidrefundaddress"></a>`InvalidRefundAddress`
|
|
939
|
+
|
|
940
|
+
`error InvalidRefundAddress()` · Selector `0xe2fe2726` · Source: `D20VRFCoordinator.sol` lines 124, 251, 506
|
|
941
|
+
|
|
942
|
+
**Raised by:** [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness), [`withdrawRefundCredit`](#coordinator-fn-withdrawrefundcredit).
|
|
943
|
+
|
|
944
|
+
A request named the zero address as refund address, or `withdrawRefundCredit` named the zero address as recipient.
|
|
945
|
+
|
|
946
|
+
**What to do:** Pass a non-zero address that can receive a plain native transfer or call `withdrawRefundCredit`.
|
|
947
|
+
|
|
948
|
+
#### <a id="coordinator-error-invalidcallbackgas"></a>`InvalidCallbackGas`
|
|
949
|
+
|
|
950
|
+
`error InvalidCallbackGas()` · Selector `0x35883c54` · Source: `D20VRFCoordinator.sol` lines 112, 451, 487, 598–600
|
|
951
|
+
|
|
952
|
+
**Raised by:** [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness), [`retryCallback`](#coordinator-fn-retrycallback), [`retryRefundCallback`](#coordinator-fn-retryrefundcallback).
|
|
953
|
+
|
|
954
|
+
A gas limit is out of range: a request `callbackGasLimit` outside 30,000 to 1,000,000; a `retryCallback` limit outside that range or below the request's `callbackGasLimit`; a `retryRefundCallback` limit outside 100,000 to 1,000,000.
|
|
955
|
+
|
|
956
|
+
**What to do:** Use a limit inside the range; retry with at least the original limit.
|
|
957
|
+
|
|
958
|
+
#### <a id="coordinator-error-incorrectfee"></a>`IncorrectFee`
|
|
959
|
+
|
|
960
|
+
`error IncorrectFee(uint256 expected, uint256 actual)` · Selector `0xdcf6afcb` · Source: `D20VRFCoordinator.sol` lines 111, 254
|
|
961
|
+
|
|
962
|
+
**Raised by:** [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness).
|
|
963
|
+
|
|
964
|
+
`actual` (`msg.value`) is below `expected`, the fee computed in the request transaction. No request was created.
|
|
965
|
+
|
|
966
|
+
**What to do:** Quote again with `quoteFeeAt(callbackGasLimit, latestBlock.baseFeePerGas)` plus a buffer (`quoteRequestFee`) and resend. A contract paying in the same transaction sends `quoteFee(callbackGasLimit)`. Never quote with `quoteFee` through `eth_call`.
|
|
967
|
+
|
|
968
|
+
#### <a id="coordinator-error-feeoverflow"></a>`FeeOverflow`
|
|
969
|
+
|
|
970
|
+
`error FeeOverflow()` · Selector `0x8181adca` · Source: `D20VRFCoordinator.sol` lines 135, 224
|
|
971
|
+
|
|
972
|
+
**Raised by:** [`quoteFee`](#coordinator-fn-quotefee), [`quoteFeeAt`](#coordinator-fn-quotefeeat), [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness).
|
|
973
|
+
|
|
974
|
+
The dynamic fee exceeds the uint96 escrow limit. Within the pricing bounds that needs a base fee above about 1.3e21 wei.
|
|
975
|
+
|
|
976
|
+
**What to do:** Not expected on a live chain. For `quoteFeeAt`, check that `baseFee` is in wei.
|
|
977
|
+
|
|
978
|
+
#### <a id="coordinator-error-invalidmapping"></a>`InvalidMapping`
|
|
979
|
+
|
|
980
|
+
`error InvalidMapping()` · Selector `0x07a966e0` · Source: `libraries/RandomnessMapping.sol` lines 19, 21–39
|
|
981
|
+
|
|
982
|
+
**Raised by:** [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness), [`mapRandomness`](#coordinator-fn-maprandomness).
|
|
983
|
+
|
|
984
|
+
The spec breaks the rules for its operation (README [Randomness options](README.md#randomness-options)). Declared in `RandomnessMapping`.
|
|
985
|
+
|
|
986
|
+
**What to do:** Build specs with the `D20VRFRequests` helpers or TypeScript `builtins`, which enforce the same bounds.
|
|
987
|
+
|
|
988
|
+
#### <a id="coordinator-error-epochunavailable"></a>`EpochUnavailable`
|
|
989
|
+
|
|
990
|
+
`error EpochUnavailable()` · Selector `0x0b3487b8` · Source: `D20VRFCoordinator.sol` lines 108, 258
|
|
991
|
+
|
|
992
|
+
**Raised by:** [`requestRandomness`](#coordinator-fn-requestrandomness), [`requestMappedRandomness`](#coordinator-fn-requestmappedrandomness).
|
|
993
|
+
|
|
994
|
+
The request block is before the registry's first epoch: `epochForBlock(block.number)` is 0.
|
|
995
|
+
|
|
996
|
+
**What to do:** Not expected on the Arc deployments, whose epochs have started. Check that you call the coordinator proxy for your chain; on a new deployment, wait for `firstEpochStart`.
|
|
997
|
+
|
|
998
|
+
**Reading and recovery**
|
|
999
|
+
|
|
1000
|
+
#### <a id="coordinator-error-unknownrequest"></a>`UnknownRequest`
|
|
1001
|
+
|
|
1002
|
+
`error UnknownRequest()` · Selector `0x6d080297` · Source: `D20VRFCoordinator.sol` lines 113, 538–541
|
|
1003
|
+
|
|
1004
|
+
**Raised by:** [`getRequest`](#coordinator-fn-getrequest), [`getMapping`](#coordinator-fn-getmapping), [`getMappedResult`](#coordinator-fn-getmappedresult), [`requestFeePaid`](#coordinator-fn-requestfeepaid), [`requestRefundBps`](#coordinator-fn-requestrefundbps), [`refundRequest`](#coordinator-fn-refundrequest), [`retryCallback`](#coordinator-fn-retrycallback), [`retryRefundCallback`](#coordinator-fn-retryrefundcallback), [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch), [`storeBlockHash`](#coordinator-fn-storeblockhash), [`verifyRequestProof`](#coordinator-fn-verifyrequestproof), [`requestSeed`](#coordinator-fn-requestseed), [`getProofContext`](#coordinator-fn-getproofcontext).
|
|
1005
|
+
|
|
1006
|
+
No request has this ID: 0, or not below `nextRequestId()`. An unknown ID also reverts a whole `fulfillRandomnessBatch`.
|
|
1007
|
+
|
|
1008
|
+
**What to do:** Take `requestId` from the `RandomnessRequested` log of the request receipt, and read from the same chain and coordinator proxy.
|
|
1009
|
+
|
|
1010
|
+
#### <a id="coordinator-error-notfulfilled"></a>`NotFulfilled`
|
|
1011
|
+
|
|
1012
|
+
`error NotFulfilled()` · Selector `0x07bc6c3e` · Source: `D20VRFCoordinator.sol` lines 117, 346, 448
|
|
1013
|
+
|
|
1014
|
+
**Raised by:** [`getMappedResult`](#coordinator-fn-getmappedresult), [`retryCallback`](#coordinator-fn-retrycallback).
|
|
1015
|
+
|
|
1016
|
+
`getMappedResult` or `retryCallback` on a request without an accepted proof, including an expired or refunded one.
|
|
1017
|
+
|
|
1018
|
+
**What to do:** Poll `getRequest(requestId)` until `fulfilled`. Once a block timestamp is after `deadline` without fulfillment, the request has expired and only `refundRequest` applies.
|
|
1019
|
+
|
|
1020
|
+
#### <a id="coordinator-error-alreadydelivered"></a>`AlreadyDelivered`
|
|
1021
|
+
|
|
1022
|
+
`error AlreadyDelivered()` · Selector `0xb9f79653` · Source: `D20VRFCoordinator.sol` lines 118, 449
|
|
1023
|
+
|
|
1024
|
+
**Raised by:** [`retryCallback`](#coordinator-fn-retrycallback).
|
|
1025
|
+
|
|
1026
|
+
`retryCallback` on a request whose callback already succeeded.
|
|
1027
|
+
|
|
1028
|
+
**What to do:** Nothing to retry.
|
|
1029
|
+
|
|
1030
|
+
#### <a id="coordinator-error-refundnotavailable"></a>`RefundNotAvailable`
|
|
1031
|
+
|
|
1032
|
+
`error RefundNotAvailable()` · Selector `0x0b4d6981` · Source: `D20VRFCoordinator.sol` lines 127, 460
|
|
1033
|
+
|
|
1034
|
+
**Raised by:** [`refundRequest`](#coordinator-fn-refundrequest).
|
|
1035
|
+
|
|
1036
|
+
`refundRequest` on a request that is fulfilled, already refunded, or not yet past its deadline (the block timestamp must be greater than `deadline`).
|
|
1037
|
+
|
|
1038
|
+
**What to do:** Read `getRequest`: use the result if `fulfilled`, stop if `refunded`, otherwise retry after a block with a later timestamp than `deadline`.
|
|
1039
|
+
|
|
1040
|
+
#### <a id="coordinator-error-notrefunded"></a>`NotRefunded`
|
|
1041
|
+
|
|
1042
|
+
`error NotRefunded()` · Selector `0xfae7079c` · Source: `D20VRFCoordinator.sol` lines 130, 484
|
|
1043
|
+
|
|
1044
|
+
**Raised by:** [`retryRefundCallback`](#coordinator-fn-retryrefundcallback).
|
|
1045
|
+
|
|
1046
|
+
`retryRefundCallback` on a request that has not been refunded.
|
|
1047
|
+
|
|
1048
|
+
**What to do:** Call `refundRequest` after the deadline first.
|
|
1049
|
+
|
|
1050
|
+
#### <a id="coordinator-error-refundcallbackalreadydelivered"></a>`RefundCallbackAlreadyDelivered`
|
|
1051
|
+
|
|
1052
|
+
`error RefundCallbackAlreadyDelivered()` · Selector `0x6502f8ae` · Source: `D20VRFCoordinator.sol` lines 131, 485
|
|
1053
|
+
|
|
1054
|
+
**Raised by:** [`retryRefundCallback`](#coordinator-fn-retryrefundcallback).
|
|
1055
|
+
|
|
1056
|
+
`retryRefundCallback` after an `onRefund` notification already succeeded (`refundCallbackDelivered`).
|
|
1057
|
+
|
|
1058
|
+
**What to do:** Nothing to retry.
|
|
1059
|
+
|
|
1060
|
+
#### <a id="coordinator-error-insufficientcallbackgas"></a>`InsufficientCallbackGas`
|
|
1061
|
+
|
|
1062
|
+
`error InsufficientCallbackGas()` · Selector `0xa2c23f0d` · Source: `D20VRFCoordinator.sol` lines 121, 469, 494, 610–611
|
|
1063
|
+
|
|
1064
|
+
**Raised by:** [`refundRequest`](#coordinator-fn-refundrequest), [`retryCallback`](#coordinator-fn-retrycallback), [`retryRefundCallback`](#coordinator-fn-retryrefundcallback), [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch).
|
|
1065
|
+
|
|
1066
|
+
Too little gas remained to forward the full callback budget and keep the coordinator's reserve: `gasLimit + gasLimit/63 + 140,000` before a fulfillment callback, `100,000 + 100,000/63 + 140,000` after refund settlement, `gasLimit + gasLimit/63 + 50,000` before a refund notification. The coordinator reverts instead of forwarding less.
|
|
1067
|
+
|
|
1068
|
+
**What to do:** Raise the transaction gas limit: 400,000 for `refundRequest`, `gasLimit + 250,000` for `retryCallback`, `gasLimit + 150,000` for `retryRefundCallback` (README [Gas for refund and retry calls](README.md#gas-for-refund-and-retry-calls)). `eth_estimateGas` finds the minimum.
|
|
1069
|
+
|
|
1070
|
+
**Credits and withdrawals**
|
|
1071
|
+
|
|
1072
|
+
#### <a id="coordinator-error-norefundcredit"></a>`NoRefundCredit`
|
|
1073
|
+
|
|
1074
|
+
`error NoRefundCredit()` · Selector `0x1d59da8e` · Source: `D20VRFCoordinator.sol` lines 128, 508
|
|
1075
|
+
|
|
1076
|
+
**Raised by:** [`withdrawRefundCredit`](#coordinator-fn-withdrawrefundcredit).
|
|
1077
|
+
|
|
1078
|
+
`withdrawRefundCredit` from an address without refund credit. Credit is keyed by the refund address, which must be `msg.sender`.
|
|
1079
|
+
|
|
1080
|
+
**What to do:** Call from the refund address; `refundCredits(address)` shows the balance.
|
|
1081
|
+
|
|
1082
|
+
#### <a id="coordinator-error-transferfailed"></a>`TransferFailed`
|
|
1083
|
+
|
|
1084
|
+
`error TransferFailed()` · Selector `0x90b8ec18` · Source: `D20VRFCoordinator.sol` lines 123, 512, 523, 534
|
|
1085
|
+
|
|
1086
|
+
**Raised by:** [`withdrawRefundCredit`](#coordinator-fn-withdrawrefundcredit), [`withdrawFees`](#coordinator-fn-withdrawfees), [`withdrawKeeperCredit`](#coordinator-fn-withdrawkeepercredit).
|
|
1087
|
+
|
|
1088
|
+
The `recipient` of `withdrawRefundCredit`, `withdrawFees` or `withdrawKeeperCredit` rejected the native transfer. Balances are unchanged.
|
|
1089
|
+
|
|
1090
|
+
**What to do:** Choose a recipient that accepts plain native transfers.
|
|
1091
|
+
|
|
1092
|
+
#### <a id="coordinator-error-onlyfeerecipient"></a>`OnlyFeeRecipient`
|
|
1093
|
+
|
|
1094
|
+
`error OnlyFeeRecipient()` · Selector `0x07d8ed3d` · Source: `D20VRFCoordinator.sol` lines 122, 518
|
|
1095
|
+
|
|
1096
|
+
**Raised by:** [`withdrawFees`](#coordinator-fn-withdrawfees).
|
|
1097
|
+
|
|
1098
|
+
`withdrawFees` from an address other than `feeRecipient()`.
|
|
1099
|
+
|
|
1100
|
+
**What to do:** Only the fee recipient withdraws protocol fees.
|
|
1101
|
+
|
|
1102
|
+
#### <a id="coordinator-error-nokeepercredit"></a>`NoKeeperCredit`
|
|
1103
|
+
|
|
1104
|
+
`error NoKeeperCredit()` · Selector `0x0d106640` · Source: `D20VRFCoordinator.sol` lines 129, 530
|
|
1105
|
+
|
|
1106
|
+
**Raised by:** [`withdrawKeeperCredit`](#coordinator-fn-withdrawkeepercredit).
|
|
1107
|
+
|
|
1108
|
+
`withdrawKeeperCredit` from an address without keeper credit.
|
|
1109
|
+
|
|
1110
|
+
**What to do:** `keeperCredits(address)` shows the balance.
|
|
1111
|
+
|
|
1112
|
+
**Proofs and keepers**
|
|
1113
|
+
|
|
1114
|
+
#### <a id="coordinator-error-notready"></a>`NotReady`
|
|
1115
|
+
|
|
1116
|
+
`error NotReady()` · Selector `0x9488aaa6` · Source: `D20VRFCoordinator.sol` lines 114, 555
|
|
1117
|
+
|
|
1118
|
+
**Raised by:** [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch), [`storeBlockHash`](#coordinator-fn-storeblockhash), [`verifyRequestProof`](#coordinator-fn-verifyrequestproof), [`requestSeed`](#coordinator-fn-requestseed), [`getProofContext`](#coordinator-fn-getproofcontext).
|
|
1119
|
+
|
|
1120
|
+
The request cannot be proven yet: its epoch packet is not published, or `block.number` is below `targetBlock + confirmationBlocks`.
|
|
1121
|
+
|
|
1122
|
+
**What to do:** For a consumer this only means the request is still waiting. Keepers retry after publication and confirmations.
|
|
1123
|
+
|
|
1124
|
+
#### <a id="coordinator-error-blockhashunavailable"></a>`BlockHashUnavailable`
|
|
1125
|
+
|
|
1126
|
+
`error BlockHashUnavailable()` · Selector `0xbfc9f0d3` · Source: `D20VRFCoordinator.sol` lines 115, 558
|
|
1127
|
+
|
|
1128
|
+
**Raised by:** [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch), [`storeBlockHash`](#coordinator-fn-storeblockhash), [`verifyRequestProof`](#coordinator-fn-verifyrequestproof), [`requestSeed`](#coordinator-fn-requestseed), [`getProofContext`](#coordinator-fn-getproofcontext).
|
|
1129
|
+
|
|
1130
|
+
The target block hash was never stored and is outside the 256-block `BLOCKHASH` window. The request can no longer be fulfilled.
|
|
1131
|
+
|
|
1132
|
+
**What to do:** Call `refundRequest` after the deadline. Keepers call `storeBlockHash` before the window closes.
|
|
1133
|
+
|
|
1134
|
+
#### <a id="coordinator-error-alreadyfulfilled"></a>`AlreadyFulfilled`
|
|
1135
|
+
|
|
1136
|
+
`error AlreadyFulfilled()` · Selector `0x4a4117f9` · Source: `D20VRFCoordinator.sol` lines 116, 392
|
|
1137
|
+
|
|
1138
|
+
**Raised by:** [`fulfillRandomness`](#coordinator-fn-fulfillrandomness).
|
|
1139
|
+
|
|
1140
|
+
`fulfillRandomness` on a fulfilled request.
|
|
1141
|
+
|
|
1142
|
+
**What to do:** Nothing to do; read the result.
|
|
1143
|
+
|
|
1144
|
+
#### <a id="coordinator-error-requestrefunded"></a>`RequestRefunded`
|
|
1145
|
+
|
|
1146
|
+
`error RequestRefunded()` · Selector `0xe0dec416` · Source: `D20VRFCoordinator.sol` lines 126, 393
|
|
1147
|
+
|
|
1148
|
+
**Raised by:** [`fulfillRandomness`](#coordinator-fn-fulfillrandomness).
|
|
1149
|
+
|
|
1150
|
+
`fulfillRandomness` on a refunded request.
|
|
1151
|
+
|
|
1152
|
+
**What to do:** The request is settled and will never have a result.
|
|
1153
|
+
|
|
1154
|
+
#### <a id="coordinator-error-requestexpired"></a>`RequestExpired`
|
|
1155
|
+
|
|
1156
|
+
`error RequestExpired()` · Selector `0xfef01cd2` · Source: `D20VRFCoordinator.sol` lines 125, 394
|
|
1157
|
+
|
|
1158
|
+
**Raised by:** [`fulfillRandomness`](#coordinator-fn-fulfillrandomness).
|
|
1159
|
+
|
|
1160
|
+
`fulfillRandomness` in a block whose timestamp is after the request's deadline.
|
|
1161
|
+
|
|
1162
|
+
**What to do:** The request can only be refunded with `refundRequest`.
|
|
1163
|
+
|
|
1164
|
+
#### <a id="coordinator-error-wrongpublickey"></a>`WrongPublicKey`
|
|
1165
|
+
|
|
1166
|
+
`error WrongPublicKey()` · Selector `0x2b0bb68e` · Source: `D20VRFCoordinator.sol` lines 119, 583
|
|
1167
|
+
|
|
1168
|
+
**Raised by:** [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch), [`verifyRequestProof`](#coordinator-fn-verifyrequestproof).
|
|
1169
|
+
|
|
1170
|
+
The proof's `pk` is not the coordinator's VRF key.
|
|
1171
|
+
|
|
1172
|
+
**What to do:** Only proofs from the configured key are accepted.
|
|
1173
|
+
|
|
1174
|
+
#### <a id="coordinator-error-wrongseed"></a>`WrongSeed`
|
|
1175
|
+
|
|
1176
|
+
`error WrongSeed()` · Selector `0xf36cbea4` · Source: `D20VRFCoordinator.sol` lines 120, 585
|
|
1177
|
+
|
|
1178
|
+
**Raised by:** [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch), [`verifyRequestProof`](#coordinator-fn-verifyrequestproof).
|
|
1179
|
+
|
|
1180
|
+
The proof's `seed` differs from `requestSeed(requestId)`.
|
|
1181
|
+
|
|
1182
|
+
**What to do:** Prove the stored seed; it cannot change.
|
|
1183
|
+
|
|
1184
|
+
#### <a id="coordinator-error-evidencepackettoolarge"></a>`EvidencePacketTooLarge`
|
|
1185
|
+
|
|
1186
|
+
`error EvidencePacketTooLarge()` · Selector `0xcfbc3ebf` · Source: `D20VRFCoordinator.sol` lines 133, 441
|
|
1187
|
+
|
|
1188
|
+
**Raised by:** [`fulfillRandomness`](#coordinator-fn-fulfillrandomness), [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch).
|
|
1189
|
+
|
|
1190
|
+
The encoded proof exceeds `MAX_EVIDENCE_PACKET_BYTES`. A proof always encodes to 416 bytes, so valid calls never reach this bound.
|
|
1191
|
+
|
|
1192
|
+
**What to do:** None expected.
|
|
1193
|
+
|
|
1194
|
+
#### <a id="coordinator-error-invalidbatch"></a>`InvalidBatch`
|
|
1195
|
+
|
|
1196
|
+
`error InvalidBatch()` · Selector `0x33b094a1` · Source: `D20VRFCoordinator.sol` lines 136, 403
|
|
1197
|
+
|
|
1198
|
+
**Raised by:** [`fulfillRandomnessBatch`](#coordinator-fn-fulfillrandomnessbatch).
|
|
1199
|
+
|
|
1200
|
+
`fulfillRandomnessBatch` with no IDs, more than 16, or a different number of proofs.
|
|
1201
|
+
|
|
1202
|
+
**What to do:** Send 1 to 16 IDs with one proof each.
|
|
1203
|
+
|
|
1204
|
+
#### <a id="coordinator-error-invalidscan"></a>`InvalidScan`
|
|
1205
|
+
|
|
1206
|
+
`error InvalidScan()` · Selector `0x3e6249a2` · Source: `D20VRFCoordinator.sol` lines 132, 315
|
|
1207
|
+
|
|
1208
|
+
**Raised by:** [`getPendingRequestIds`](#coordinator-fn-getpendingrequestids).
|
|
1209
|
+
|
|
1210
|
+
`getPendingRequestIds` with `fromId` 0, `limit` 0 or `limit` above 256.
|
|
1211
|
+
|
|
1212
|
+
**What to do:** Start at 1 and page with at most 256.
|
|
1213
|
+
|
|
1214
|
+
**Administration, initialization and upgrades**
|
|
1215
|
+
|
|
1216
|
+
#### <a id="coordinator-error-invalidconfig"></a>`InvalidConfig`
|
|
1217
|
+
|
|
1218
|
+
`error InvalidConfig()` · Selector `0x35be3ac8` · Source: `D20VRFCoordinator.sol` lines 107, 173–174, 197, 201, 206, 215, 519, 528
|
|
1219
|
+
|
|
1220
|
+
**Raised by:** [`withdrawFees`](#coordinator-fn-withdrawfees), [`withdrawKeeperCredit`](#coordinator-fn-withdrawkeepercredit), [`setPricing`](#coordinator-fn-setpricing), [`setRefundBps`](#coordinator-fn-setrefundbps), [`setKeeperFeeBps`](#coordinator-fn-setkeeperfeebps), [`setFeeRecipient`](#coordinator-fn-setfeerecipient), [`initialize`](#coordinator-fn-initialize).
|
|
1221
|
+
|
|
1222
|
+
A value is out of bounds: in `initialize` (zero fee recipient, confirmations 0 or above 64, keeper share above 10000, minimum fee above 10 USDC, registry without code), `setFeeRecipient` with zero, `setKeeperFeeBps` above 10000, `setPricing` outside its bounds, `setRefundBps` outside 5000 to 10000, or a zero `recipient` for `withdrawFees` or `withdrawKeeperCredit`.
|
|
1223
|
+
|
|
1224
|
+
**What to do:** Use values within the bounds given for each function.
|
|
1225
|
+
|
|
1226
|
+
#### <a id="coordinator-error-invalidpublickey"></a>`InvalidPublicKey`
|
|
1227
|
+
|
|
1228
|
+
`error InvalidPublicKey()` · Selector `0xa2d0fee8` · Source: `D20VRFCoordinator.sol` lines 109, 176
|
|
1229
|
+
|
|
1230
|
+
**Raised by:** [`initialize`](#coordinator-fn-initialize).
|
|
1231
|
+
|
|
1232
|
+
`initialize` with a VRF public key that is not on secp256k1.
|
|
1233
|
+
|
|
1234
|
+
**What to do:** Deployment-time only.
|
|
1235
|
+
|
|
1236
|
+
#### <a id="coordinator-error-reentrancyguardreentrantcall"></a>`ReentrancyGuardReentrantCall`
|
|
1237
|
+
|
|
1238
|
+
`error ReentrancyGuardReentrantCall()` · Selector `0x3ee5aeb5`
|
|
1239
|
+
|
|
1240
|
+
**Raised by:** any `nonReentrant` function entered from a callback or transfer.
|
|
1241
|
+
|
|
1242
|
+
A `nonReentrant` coordinator function (a request, `storeBlockHash`, a fulfillment, a retry, `refundRequest` or a withdrawal) was entered while another was running, for example a request made inside `rawFulfillRandomness` or `onRefund`. Inside a callback the coordinator catches it and records the callback as failed.
|
|
1243
|
+
|
|
1244
|
+
**What to do:** Do not call coordinator state-changing functions from callbacks; request again in a separate transaction.
|
|
1245
|
+
|
|
1246
|
+
#### <a id="coordinator-error-ownableunauthorizedaccount"></a>`OwnableUnauthorizedAccount`
|
|
1247
|
+
|
|
1248
|
+
`error OwnableUnauthorizedAccount(address account)` · Selector `0x118cdaa7`
|
|
1249
|
+
|
|
1250
|
+
**Raised by:** [`setPricing`](#coordinator-fn-setpricing), [`setRefundBps`](#coordinator-fn-setrefundbps), [`setKeeperFeeBps`](#coordinator-fn-setkeeperfeebps), [`setFeeRecipient`](#coordinator-fn-setfeerecipient), [`transferOwnership`](#coordinator-fn-transferownership), [`acceptOwnership`](#coordinator-fn-acceptownership), [`renounceOwnership`](#coordinator-fn-renounceownership), [`upgradeToAndCall`](#coordinator-fn-upgradetoandcall).
|
|
1251
|
+
|
|
1252
|
+
`account` is not the owner (owner-only functions) or not the pending owner (`acceptOwnership`).
|
|
1253
|
+
|
|
1254
|
+
**What to do:** Only the owner can administer or upgrade the contract; on Arc Mainnet that is the DAO treasury Safe recorded in the deployment manifest.
|
|
1255
|
+
|
|
1256
|
+
#### <a id="coordinator-error-ownableinvalidowner"></a>`OwnableInvalidOwner`
|
|
1257
|
+
|
|
1258
|
+
`error OwnableInvalidOwner(address owner)` · Selector `0x1e4fbdf7`
|
|
1259
|
+
|
|
1260
|
+
**Raised by:** [`initialize`](#coordinator-fn-initialize).
|
|
1261
|
+
|
|
1262
|
+
`initialize` was given the zero address as owner.
|
|
1263
|
+
|
|
1264
|
+
**What to do:** Deployment-time only.
|
|
1265
|
+
|
|
1266
|
+
#### <a id="coordinator-error-renouncedisabled"></a>`RenounceDisabled`
|
|
1267
|
+
|
|
1268
|
+
`error RenounceDisabled()` · Selector `0x89051165` · Source: `D20VRFCoordinator.sol` lines 134, 194
|
|
1269
|
+
|
|
1270
|
+
**Raised by:** [`renounceOwnership`](#coordinator-fn-renounceownership).
|
|
1271
|
+
|
|
1272
|
+
The owner called `renounceOwnership`, which is disabled.
|
|
1273
|
+
|
|
1274
|
+
**What to do:** Move ownership with `transferOwnership` and `acceptOwnership`.
|
|
1275
|
+
|
|
1276
|
+
#### <a id="coordinator-error-invalidinitialization"></a>`InvalidInitialization`
|
|
1277
|
+
|
|
1278
|
+
`error InvalidInitialization()` · Selector `0xf92ee8a9`
|
|
1279
|
+
|
|
1280
|
+
**Raised by:** [`initialize`](#coordinator-fn-initialize).
|
|
1281
|
+
|
|
1282
|
+
`initialize` on a proxy that is already initialized, or on an implementation contract, whose initializers are disabled at construction.
|
|
1283
|
+
|
|
1284
|
+
**What to do:** None: initialization happens once, atomically, when `D20Proxy` is deployed.
|
|
1285
|
+
|
|
1286
|
+
#### <a id="coordinator-error-notinitializing"></a>`NotInitializing`
|
|
1287
|
+
|
|
1288
|
+
`error NotInitializing()` · Selector `0xd7e6bcf8`
|
|
1289
|
+
|
|
1290
|
+
**Raised by:** no public function (declared by OpenZeppelin `Initializable`).
|
|
1291
|
+
|
|
1292
|
+
Declared by the OpenZeppelin initializer helpers. No public function of this contract can reach it.
|
|
1293
|
+
|
|
1294
|
+
**What to do:** None.
|
|
1295
|
+
|
|
1296
|
+
#### <a id="coordinator-error-uupsunauthorizedcallcontext"></a>`UUPSUnauthorizedCallContext`
|
|
1297
|
+
|
|
1298
|
+
`error UUPSUnauthorizedCallContext()` · Selector `0xe07c8dba`
|
|
1299
|
+
|
|
1300
|
+
**Raised by:** [`upgradeToAndCall`](#coordinator-fn-upgradetoandcall), [`proxiableUUID`](#coordinator-fn-proxiableuuid).
|
|
1301
|
+
|
|
1302
|
+
`upgradeToAndCall` called on the implementation instead of through the proxy, or `proxiableUUID` called through the proxy.
|
|
1303
|
+
|
|
1304
|
+
**What to do:** Owner upgrade procedure only.
|
|
1305
|
+
|
|
1306
|
+
#### <a id="coordinator-error-uupsunsupportedproxiableuuid"></a>`UUPSUnsupportedProxiableUUID`
|
|
1307
|
+
|
|
1308
|
+
`error UUPSUnsupportedProxiableUUID(bytes32 slot)` · Selector `0xaa1d49a4`
|
|
1309
|
+
|
|
1310
|
+
**Raised by:** [`upgradeToAndCall`](#coordinator-fn-upgradetoandcall).
|
|
1311
|
+
|
|
1312
|
+
The new implementation reports a `proxiableUUID` other than the ERC-1967 implementation slot.
|
|
1313
|
+
|
|
1314
|
+
**What to do:** Owner upgrade procedure only.
|
|
1315
|
+
|
|
1316
|
+
#### <a id="coordinator-error-erc1967invalidimplementation"></a>`ERC1967InvalidImplementation`
|
|
1317
|
+
|
|
1318
|
+
`error ERC1967InvalidImplementation(address implementation)` · Selector `0x4c9c8ce3`
|
|
1319
|
+
|
|
1320
|
+
**Raised by:** [`upgradeToAndCall`](#coordinator-fn-upgradetoandcall).
|
|
1321
|
+
|
|
1322
|
+
The new implementation has no code or no `proxiableUUID`.
|
|
1323
|
+
|
|
1324
|
+
**What to do:** Owner upgrade procedure only.
|
|
1325
|
+
|
|
1326
|
+
#### <a id="coordinator-error-erc1967nonpayable"></a>`ERC1967NonPayable`
|
|
1327
|
+
|
|
1328
|
+
`error ERC1967NonPayable()` · Selector `0xb398979f`
|
|
1329
|
+
|
|
1330
|
+
**Raised by:** [`upgradeToAndCall`](#coordinator-fn-upgradetoandcall).
|
|
1331
|
+
|
|
1332
|
+
`upgradeToAndCall` was sent value with empty `data`.
|
|
1333
|
+
|
|
1334
|
+
**What to do:** Owner upgrade procedure only.
|
|
1335
|
+
|
|
1336
|
+
#### <a id="coordinator-error-addressemptycode"></a>`AddressEmptyCode`
|
|
1337
|
+
|
|
1338
|
+
`error AddressEmptyCode(address target)` · Selector `0x9996b315`
|
|
1339
|
+
|
|
1340
|
+
**Raised by:** [`upgradeToAndCall`](#coordinator-fn-upgradetoandcall).
|
|
1341
|
+
|
|
1342
|
+
Declared by OpenZeppelin `Address` for the delegatecall in `upgradeToAndCall`. Not reachable in practice, because the new implementation must already have code.
|
|
1343
|
+
|
|
1344
|
+
**What to do:** None.
|
|
1345
|
+
|
|
1346
|
+
#### <a id="coordinator-error-failedcall"></a>`FailedCall`
|
|
1347
|
+
|
|
1348
|
+
`error FailedCall()` · Selector `0xd6bda275`
|
|
1349
|
+
|
|
1350
|
+
**Raised by:** [`upgradeToAndCall`](#coordinator-fn-upgradetoandcall).
|
|
1351
|
+
|
|
1352
|
+
The initialization call made by `upgradeToAndCall` reverted without revert data.
|
|
1353
|
+
|
|
1354
|
+
**What to do:** Owner upgrade procedure only.
|
|
1355
|
+
|
|
1356
|
+
## <a id="registry"></a>EpochEntropy
|
|
1357
|
+
|
|
1358
|
+
The epoch registry. A consumer never needs to call it: a request fixes its epoch automatically, and the coordinator reads the registry for targets and for the keeper-share recipient. The first group and the events matter to consumers and verifiers (README [Replay and verification](README.md#replay-and-verification)); publication and administration are listed for completeness.
|
|
1359
|
+
|
|
1360
|
+
### <a id="registry-types"></a>Types
|
|
1361
|
+
|
|
1362
|
+
#### <a id="registry-type-epochentropy-epoch"></a>`EpochEntropy.Epoch`
|
|
1363
|
+
|
|
1364
|
+
Returned by `getEpoch`; all zero until the epoch is published.
|
|
1365
|
+
|
|
1366
|
+
Source: `EpochEntropy.sol` lines 30–33
|
|
1367
|
+
|
|
1368
|
+
| Field | Type | Meaning |
|
|
1369
|
+
| --- | --- | --- |
|
|
1370
|
+
| `epochHash` | `bytes32` | Epoch commitment: `keccak256(abi.encode(EPOCH_DOMAIN, chainId, registry, catalogHash, epochId, epochStart, anchorHash, source, queryHash, dataHash, attestationHash))`. |
|
|
1371
|
+
| `catalogHash` | `bytes32` | Signer catalog in force for the epoch at publication. |
|
|
1372
|
+
| `anchorHash` | `bytes32` | Hash of block `epochStart - 1`, which selects the source. |
|
|
1373
|
+
| `source` | `uint8` | Committed source slot, 0 to 3: the selected slot or a fallback. |
|
|
1374
|
+
| `queryHash` | `bytes32` | `keccak256` of the canonical request string of the slot. |
|
|
1375
|
+
| `dataHash` | `bytes32` | `keccak256` of the signed response data. |
|
|
1376
|
+
| `attestationHash` | `bytes32` | `keccak256(abi.encode(queryHash, timestamp, dataHash, keccak256(signature)))`. |
|
|
1377
|
+
| `signedAt` | `uint256` | Attestation timestamp in Unix seconds. |
|
|
1378
|
+
| `committedBlock` | `uint64` | Publication block. Requests of the epoch target `max(requestBlock, committedBlock + 1)`. |
|
|
1379
|
+
|
|
1380
|
+
#### <a id="registry-type-epochentropy-selection"></a>`EpochEntropy.Selection`
|
|
1381
|
+
|
|
1382
|
+
Returned by `getEpochSelection` and `getEpochFallbackSelection`.
|
|
1383
|
+
|
|
1384
|
+
Source: `EpochEntropy.sol` lines 29, 121–133
|
|
1385
|
+
|
|
1386
|
+
| Field | Type | Meaning |
|
|
1387
|
+
| --- | --- | --- |
|
|
1388
|
+
| `source` | `uint8` | Source slot 0 to 3: Hyperliquid BTC volume, ANU, TickerLayer BTCUSD, TickerLayer ETHUSD. |
|
|
1389
|
+
| `airnode` | `address` | Signer of that slot in the catalog in force for the epoch. |
|
|
1390
|
+
| `selector` | `bytes32` | `keccak256(abi.encode(SELECT_DOMAIN, catalogHash, epochId, anchor))`; the slot is `(selector mod 4 + attempt) mod 4`. |
|
|
1391
|
+
| `queryHash` | `bytes32` | `keccak256` of `canonicalRequest`. |
|
|
1392
|
+
| `canonicalRequest` | `string` | Fixed request string of the slot. |
|
|
1393
|
+
|
|
1394
|
+
#### <a id="registry-type-epochentropy-attestation"></a>`EpochEntropy.Attestation`
|
|
1395
|
+
|
|
1396
|
+
Signed source response passed to `commitEpoch` and `commitEpochFallback`.
|
|
1397
|
+
|
|
1398
|
+
Source: `EpochEntropy.sol` lines 28, 140–159
|
|
1399
|
+
|
|
1400
|
+
| Field | Type | Meaning |
|
|
1401
|
+
| --- | --- | --- |
|
|
1402
|
+
| `timestamp` | `uint256` | Signing time in Unix seconds; not in the future and at most `MAX_ATTESTATION_AGE` old at publication. |
|
|
1403
|
+
| `data` | `bytes` | Signed response bytes, 1 to 128 bytes, in the fixed format of the slot. |
|
|
1404
|
+
| `signature` | `bytes` | Signature over `toEthSignedMessageHash(keccak256(abi.encodePacked(queryHash, timestamp, data)))`. |
|
|
1405
|
+
|
|
1406
|
+
### <a id="registry-epoch-state-for-consumers-and-verifiers"></a>Epoch state for consumers and verifiers
|
|
1407
|
+
|
|
1408
|
+
Views, callable by anyone. Epoch IDs start at 1; each epoch lasts `EPOCH_LENGTH` (200) blocks.
|
|
1409
|
+
|
|
1410
|
+
#### <a id="registry-fn-epochforblock"></a>`epochForBlock`
|
|
1411
|
+
|
|
1412
|
+
```solidity
|
|
1413
|
+
function epochForBlock(uint256 number) external view returns (uint64)
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
Selector `0x7018ebb1` · Caller: Anyone (view) · Source: `EpochEntropy.sol` lines 91–93
|
|
1417
|
+
|
|
1418
|
+
Epoch containing a block: 0 before `firstEpochStart`, otherwise `1 + (number - firstEpochStart) / 200`. A request belongs to `epochForBlock(requestBlock)`.
|
|
1419
|
+
|
|
1420
|
+
#### <a id="registry-fn-epochstart"></a>`epochStart`
|
|
1421
|
+
|
|
1422
|
+
```solidity
|
|
1423
|
+
function epochStart(uint64 epochId) external view returns (uint64)
|
|
1424
|
+
```
|
|
1425
|
+
|
|
1426
|
+
Selector `0xa1587509` · Caller: Anyone (view) · Source: `EpochEntropy.sol` lines 87–90
|
|
1427
|
+
|
|
1428
|
+
First block of an epoch: `firstEpochStart + (epochId - 1) × 200`.
|
|
1429
|
+
|
|
1430
|
+
**Errors:** [`InvalidEpoch`](#registry-error-invalidepoch).
|
|
1431
|
+
|
|
1432
|
+
#### <a id="registry-fn-getepoch"></a>`getEpoch`
|
|
1433
|
+
|
|
1434
|
+
```solidity
|
|
1435
|
+
function getEpoch(uint64 epochId) external view returns (EpochEntropy.Epoch)
|
|
1436
|
+
```
|
|
1437
|
+
|
|
1438
|
+
Selector `0x12a02c82` · Caller: Anyone (view) · Source: `EpochEntropy.sol` line 108
|
|
1439
|
+
|
|
1440
|
+
The published [`EpochEntropy.Epoch`](#registry-type-epochentropy-epoch) record, or all zero while unpublished; it never reverts. A non-zero `epochHash` means published.
|
|
1441
|
+
|
|
1442
|
+
#### <a id="registry-fn-cataloghashat"></a>`catalogHashAt`
|
|
1443
|
+
|
|
1444
|
+
```solidity
|
|
1445
|
+
function catalogHashAt(uint64 epochId) external view returns (bytes32 hash)
|
|
1446
|
+
```
|
|
1447
|
+
|
|
1448
|
+
Selector `0xab3ee735` · Caller: Anyone (view) · Source: `EpochEntropy.sol` lines 78, 80–86
|
|
1449
|
+
|
|
1450
|
+
Catalog hash in force for an epoch: the latest scheduled version whose `fromEpoch` is at or below `epochId`, otherwise the initial catalog.
|
|
1451
|
+
|
|
1452
|
+
#### <a id="registry-fn-signersat"></a>`signersAt`
|
|
1453
|
+
|
|
1454
|
+
```solidity
|
|
1455
|
+
function signersAt(uint64 epochId) external view returns (address[4] signers)
|
|
1456
|
+
```
|
|
1457
|
+
|
|
1458
|
+
Selector `0xe788e413` · Caller: Anyone (view) · Source: `EpochEntropy.sol` lines 79, 80–86
|
|
1459
|
+
|
|
1460
|
+
Signers in force for an epoch, in slot order. Replay needs these, not the initial slot getters.
|
|
1461
|
+
|
|
1462
|
+
### <a id="registry-registry-reads"></a>Registry reads
|
|
1463
|
+
|
|
1464
|
+
Views, callable by anyone.
|
|
1465
|
+
|
|
1466
|
+
| Function | Selector | Meaning | Source |
|
|
1467
|
+
| --- | --- | --- | --- |
|
|
1468
|
+
| <a id="registry-fn-firstepochstart"></a>`firstEpochStart() returns (uint64)` | `0x219f2428` | First block of epoch 1: the initialization block plus 200. | lines 26, 55 |
|
|
1469
|
+
| <a id="registry-fn-committer"></a>`committer() returns (address)` | `0x5bc8e8f9` | Address allowed to publish epochs. The coordinator also pays the keeper share to it at each acceptance. | lines 25, 141 |
|
|
1470
|
+
| <a id="registry-fn-cataloghash"></a>`catalogHash() returns (bytes32)` | `0x830c083a` | Initial signer catalog hash, bound into `protocolConfigurationHash`. Never changes; `catalogHashAt` gives the catalog of an epoch. | lines 27, 56 |
|
|
1471
|
+
| <a id="registry-fn-epochanchors"></a>`epochAnchors(uint64) returns (bytes32)` | `0x48a030fb` | Checkpointed anchor of an epoch (hash of block `epochStart - 1`); zero until a request, `checkpointEpoch` or publication stores it. | lines 36, 97–100 |
|
|
1472
|
+
| <a id="registry-fn-hyperliquidsigner"></a>`hyperliquidSigner() returns (address)` | `0xf2a12563` | Initial signer of slot 0 (Hyperliquid BTC volume). Never changes; see `signersAt`. | line 21 |
|
|
1473
|
+
| <a id="registry-fn-anusigner"></a>`anuSigner() returns (address)` | `0xc6dbfa46` | Initial signer of slot 1 (ANU). Never changes; see `signersAt`. | line 22 |
|
|
1474
|
+
| <a id="registry-fn-btctradesigner"></a>`btcTradeSigner() returns (address)` | `0xb3b9cbb0` | Initial signer of slot 2 (TickerLayer BTCUSD). Never changes; see `signersAt`. | line 23 |
|
|
1475
|
+
| <a id="registry-fn-ethtradesigner"></a>`ethTradeSigner() returns (address)` | `0x3a700168` | Initial signer of slot 3 (TickerLayer ETHUSD). Never changes; see `signersAt`. | line 24 |
|
|
1476
|
+
|
|
1477
|
+
### <a id="registry-source-selection-and-publication"></a>Source selection and publication
|
|
1478
|
+
|
|
1479
|
+
Used by the keeper. Publication is restricted to the committer; the selection views and `checkpointEpoch` are open to anyone.
|
|
1480
|
+
|
|
1481
|
+
#### <a id="registry-fn-getepochselection"></a>`getEpochSelection`
|
|
1482
|
+
|
|
1483
|
+
```solidity
|
|
1484
|
+
function getEpochSelection(uint64 epochId) external view returns (EpochEntropy.Selection s)
|
|
1485
|
+
```
|
|
1486
|
+
|
|
1487
|
+
Selector `0xec4960ad` · Caller: Anyone (view) · Source: `EpochEntropy.sol` lines 109, 121–133
|
|
1488
|
+
|
|
1489
|
+
The selected source of an epoch, attempt 0, as an [`EpochEntropy.Selection`](#registry-type-epochentropy-selection).
|
|
1490
|
+
|
|
1491
|
+
**Errors:** [`InvalidEpoch`](#registry-error-invalidepoch), [`PreparationClosed`](#registry-error-preparationclosed), [`AnchorUnavailable`](#registry-error-anchorunavailable).
|
|
1492
|
+
|
|
1493
|
+
#### <a id="registry-fn-getepochfallbackselection"></a>`getEpochFallbackSelection`
|
|
1494
|
+
|
|
1495
|
+
```solidity
|
|
1496
|
+
function getEpochFallbackSelection(uint64 epochId, uint8 attempt) external view returns (EpochEntropy.Selection s)
|
|
1497
|
+
```
|
|
1498
|
+
|
|
1499
|
+
Selector `0x0e5a0e02` · Caller: Anyone (view) · Source: `EpochEntropy.sol` lines 110–114, 121–133
|
|
1500
|
+
|
|
1501
|
+
The source for attempt 0 to `MAX_FALLBACK_ATTEMPT` (3); attempt n uses the slot n positions after the selected one.
|
|
1502
|
+
|
|
1503
|
+
**Errors:** [`InvalidFallback`](#registry-error-invalidfallback), [`InvalidEpoch`](#registry-error-invalidepoch), [`PreparationClosed`](#registry-error-preparationclosed), [`AnchorUnavailable`](#registry-error-anchorunavailable).
|
|
1504
|
+
|
|
1505
|
+
#### <a id="registry-fn-fallbackopensat"></a>`fallbackOpensAt`
|
|
1506
|
+
|
|
1507
|
+
```solidity
|
|
1508
|
+
function fallbackOpensAt(uint64 epochId, uint8 attempt) external view returns (uint64)
|
|
1509
|
+
```
|
|
1510
|
+
|
|
1511
|
+
Selector `0x98208050` · Caller: Anyone (view) · Source: `EpochEntropy.sol` lines 115–119
|
|
1512
|
+
|
|
1513
|
+
First block at which an attempt may be published: `epochStart + attempt × FALLBACK_DELAY_BLOCKS` (20).
|
|
1514
|
+
|
|
1515
|
+
**Errors:** [`InvalidFallback`](#registry-error-invalidfallback), [`InvalidEpoch`](#registry-error-invalidepoch).
|
|
1516
|
+
|
|
1517
|
+
#### <a id="registry-fn-nextepochtoprepare"></a>`nextEpochToPrepare`
|
|
1518
|
+
|
|
1519
|
+
```solidity
|
|
1520
|
+
function nextEpochToPrepare(uint256 number) external view returns (uint64)
|
|
1521
|
+
```
|
|
1522
|
+
|
|
1523
|
+
Selector `0xc78fafe2` · Caller: Anyone (view) · Source: `EpochEntropy.sol` line 94
|
|
1524
|
+
|
|
1525
|
+
Same value as `epochForBlock(number)`.
|
|
1526
|
+
|
|
1527
|
+
#### <a id="registry-fn-checkpointepoch"></a>`checkpointEpoch`
|
|
1528
|
+
|
|
1529
|
+
```solidity
|
|
1530
|
+
function checkpointEpoch(uint64 epochId) external returns (bytes32 anchor)
|
|
1531
|
+
```
|
|
1532
|
+
|
|
1533
|
+
Selector `0x16de78cb` · Caller: Anyone · Source: `EpochEntropy.sol` lines 95–100, 101–107
|
|
1534
|
+
|
|
1535
|
+
Stores the anchor of a started epoch (hash of block `epochStart - 1`) if not stored yet, and returns it. The coordinator calls it on every request, so the anchor of an epoch with requests survives the 256-block `BLOCKHASH` window.
|
|
1536
|
+
|
|
1537
|
+
**Errors:** [`InvalidEpoch`](#registry-error-invalidepoch), [`PreparationClosed`](#registry-error-preparationclosed), [`AnchorUnavailable`](#registry-error-anchorunavailable).
|
|
1538
|
+
|
|
1539
|
+
#### <a id="registry-fn-commitepoch"></a>`commitEpoch`
|
|
1540
|
+
|
|
1541
|
+
```solidity
|
|
1542
|
+
function commitEpoch(uint64 epochId, EpochEntropy.Attestation a) external
|
|
1543
|
+
```
|
|
1544
|
+
|
|
1545
|
+
Selector `0xb1580277` · Caller: Committer · Source: `EpochEntropy.sol` lines 134, 140–159
|
|
1546
|
+
|
|
1547
|
+
Publishes the packet of the selected source once per epoch, from the epoch start: checks that the attestation is not future-dated and at most 240 seconds old, that its data has the fixed format of the slot, and that the slot's signer in the epoch's catalog signed it. Stores the record and emits the packet.
|
|
1548
|
+
|
|
1549
|
+
**Emits:** [`EpochCommitted`](#registry-event-epochcommitted).
|
|
1550
|
+
|
|
1551
|
+
**Errors:** [`OnlyCommitter`](#registry-error-onlycommitter), [`AlreadyCommitted`](#registry-error-alreadycommitted), [`InvalidEpoch`](#registry-error-invalidepoch), [`FallbackNotOpen`](#registry-error-fallbacknotopen), [`AnchorUnavailable`](#registry-error-anchorunavailable), [`InvalidTime`](#registry-error-invalidtime), [`InvalidData`](#registry-error-invaliddata), [`ECDSAInvalidSignatureLength`](#registry-error-ecdsainvalidsignaturelength), [`ECDSAInvalidSignatureS`](#registry-error-ecdsainvalidsignatures), [`ECDSAInvalidSignature`](#registry-error-ecdsainvalidsignature), [`InvalidSigner`](#registry-error-invalidsigner), [`PacketTooLarge`](#registry-error-packettoolarge).
|
|
1552
|
+
|
|
1553
|
+
#### <a id="registry-fn-commitepochfallback"></a>`commitEpochFallback`
|
|
1554
|
+
|
|
1555
|
+
```solidity
|
|
1556
|
+
function commitEpochFallback(uint64 epochId, uint8 attempt, EpochEntropy.Attestation a) external
|
|
1557
|
+
```
|
|
1558
|
+
|
|
1559
|
+
Selector `0x5768d9a1` · Caller: Committer · Source: `EpochEntropy.sol` lines 135–139, 140–159
|
|
1560
|
+
|
|
1561
|
+
Publishes fallback attempt 1 to 3, using the slot `attempt` positions after the selected source, once `fallbackOpensAt(epochId, attempt)` is reached. Same checks as `commitEpoch`.
|
|
1562
|
+
|
|
1563
|
+
**Emits:** [`EpochCommitted`](#registry-event-epochcommitted).
|
|
1564
|
+
|
|
1565
|
+
**Errors:** [`InvalidFallback`](#registry-error-invalidfallback), [`OnlyCommitter`](#registry-error-onlycommitter), [`AlreadyCommitted`](#registry-error-alreadycommitted), [`InvalidEpoch`](#registry-error-invalidepoch), [`FallbackNotOpen`](#registry-error-fallbacknotopen), [`AnchorUnavailable`](#registry-error-anchorunavailable), [`InvalidTime`](#registry-error-invalidtime), [`InvalidData`](#registry-error-invaliddata), [`ECDSAInvalidSignatureLength`](#registry-error-ecdsainvalidsignaturelength), [`ECDSAInvalidSignatureS`](#registry-error-ecdsainvalidsignatures), [`ECDSAInvalidSignature`](#registry-error-ecdsainvalidsignature), [`InvalidSigner`](#registry-error-invalidsigner), [`PacketTooLarge`](#registry-error-packettoolarge).
|
|
1566
|
+
|
|
1567
|
+
### <a id="registry-owner-administration"></a>Owner administration
|
|
1568
|
+
|
|
1569
|
+
Owner-only functions revert `OwnableUnauthorizedAccount` for anyone else. No setter can change a published epoch.
|
|
1570
|
+
|
|
1571
|
+
#### <a id="registry-fn-setcommitter"></a>`setCommitter`
|
|
1572
|
+
|
|
1573
|
+
```solidity
|
|
1574
|
+
function setCommitter(address next) external
|
|
1575
|
+
```
|
|
1576
|
+
|
|
1577
|
+
Selector `0xdd51ce22` · Caller: Owner · Source: `EpochEntropy.sol` lines 62–65
|
|
1578
|
+
|
|
1579
|
+
Changes the publishing address, which is also the keeper-share recipient the coordinator reads at each acceptance.
|
|
1580
|
+
|
|
1581
|
+
**Emits:** [`CommitterChanged`](#registry-event-committerchanged).
|
|
1582
|
+
|
|
1583
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#registry-error-ownableunauthorizedaccount), [`InvalidConfig`](#registry-error-invalidconfig).
|
|
1584
|
+
|
|
1585
|
+
#### <a id="registry-fn-schedulecatalog"></a>`scheduleCatalog`
|
|
1586
|
+
|
|
1587
|
+
```solidity
|
|
1588
|
+
function scheduleCatalog(address[4] signers, uint64 fromEpoch) external
|
|
1589
|
+
```
|
|
1590
|
+
|
|
1591
|
+
Selector `0x7ad3b7ef` · Caller: Owner · Source: `EpochEntropy.sol` lines 66–77
|
|
1592
|
+
|
|
1593
|
+
Schedules four signers for epochs from `fromEpoch`, which must be at least two epochs after the current one. If the latest scheduled version has not taken effect yet (its `fromEpoch` is after the current epoch) it is replaced, so that version never applies; this can return the next epoch to the previous catalog. The current epoch keeps its catalog.
|
|
1594
|
+
|
|
1595
|
+
**Emits:** [`CatalogScheduled`](#registry-event-catalogscheduled).
|
|
1596
|
+
|
|
1597
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#registry-error-ownableunauthorizedaccount), [`InvalidConfig`](#registry-error-invalidconfig), [`InvalidEpoch`](#registry-error-invalidepoch).
|
|
1598
|
+
|
|
1599
|
+
#### <a id="registry-fn-owner"></a>`owner`
|
|
1600
|
+
|
|
1601
|
+
```solidity
|
|
1602
|
+
function owner() external view returns (address)
|
|
1603
|
+
```
|
|
1604
|
+
|
|
1605
|
+
Selector `0x8da5cb5b` · Caller: Anyone (view)
|
|
1606
|
+
|
|
1607
|
+
Current owner: upgrade authority and the only account that can call the setters.
|
|
1608
|
+
|
|
1609
|
+
#### <a id="registry-fn-pendingowner"></a>`pendingOwner`
|
|
1610
|
+
|
|
1611
|
+
```solidity
|
|
1612
|
+
function pendingOwner() external view returns (address)
|
|
1613
|
+
```
|
|
1614
|
+
|
|
1615
|
+
Selector `0xe30c3978` · Caller: Anyone (view)
|
|
1616
|
+
|
|
1617
|
+
Account nominated by `transferOwnership` that has not accepted yet; zero when none.
|
|
1618
|
+
|
|
1619
|
+
#### <a id="registry-fn-transferownership"></a>`transferOwnership`
|
|
1620
|
+
|
|
1621
|
+
```solidity
|
|
1622
|
+
function transferOwnership(address newOwner) external
|
|
1623
|
+
```
|
|
1624
|
+
|
|
1625
|
+
Selector `0xf2fde38b` · Caller: Owner
|
|
1626
|
+
|
|
1627
|
+
Starts a two-step transfer by nominating `newOwner`; ownership moves only when that account calls `acceptOwnership`. A new call replaces the nomination, and the zero address cancels it.
|
|
1628
|
+
|
|
1629
|
+
**Emits:** [`OwnershipTransferStarted`](#registry-event-ownershiptransferstarted).
|
|
1630
|
+
|
|
1631
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#registry-error-ownableunauthorizedaccount).
|
|
1632
|
+
|
|
1633
|
+
#### <a id="registry-fn-acceptownership"></a>`acceptOwnership`
|
|
1634
|
+
|
|
1635
|
+
```solidity
|
|
1636
|
+
function acceptOwnership() external
|
|
1637
|
+
```
|
|
1638
|
+
|
|
1639
|
+
Selector `0x79ba5097` · Caller: Pending owner
|
|
1640
|
+
|
|
1641
|
+
Completes the transfer to the caller and clears the nomination.
|
|
1642
|
+
|
|
1643
|
+
**Emits:** [`OwnershipTransferred`](#registry-event-ownershiptransferred).
|
|
1644
|
+
|
|
1645
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#registry-error-ownableunauthorizedaccount).
|
|
1646
|
+
|
|
1647
|
+
#### <a id="registry-fn-renounceownership"></a>`renounceOwnership`
|
|
1648
|
+
|
|
1649
|
+
```solidity
|
|
1650
|
+
function renounceOwnership() external view
|
|
1651
|
+
```
|
|
1652
|
+
|
|
1653
|
+
Selector `0x715018a6` · Caller: Owner · Source: `EpochEntropy.sol` lines 59–60
|
|
1654
|
+
|
|
1655
|
+
Disabled and declared `view`: the owner gets `RenounceDisabled` and anyone else `OwnableUnauthorizedAccount`, so the contract always has an owner and upgrade authority can only move through an accepted transfer.
|
|
1656
|
+
|
|
1657
|
+
**Errors:** [`OwnableUnauthorizedAccount`](#registry-error-ownableunauthorizedaccount), [`RenounceDisabled`](#registry-error-renouncedisabled).
|
|
1658
|
+
|
|
1659
|
+
#### <a id="registry-fn-upgradetoandcall"></a>`upgradeToAndCall`
|
|
1660
|
+
|
|
1661
|
+
```solidity
|
|
1662
|
+
function upgradeToAndCall(address newImplementation, bytes data) external payable
|
|
1663
|
+
```
|
|
1664
|
+
|
|
1665
|
+
Selector `0x4f1ef286` · Caller: Owner, through the proxy
|
|
1666
|
+
|
|
1667
|
+
UUPS upgrade: points the proxy at `newImplementation`, which must report the ERC-1967 slot from `proxiableUUID`, and delegatecalls `data` when it is non-empty. An upgrade can change any behavior described here. Integrators check the implementation when they integrate and again whenever a proxy emits `Upgraded` or the deployment manifest records an upgrade (README [Security and trust](README.md#security-and-trust)).
|
|
1668
|
+
|
|
1669
|
+
**Emits:** [`Upgraded`](#registry-event-upgraded).
|
|
1670
|
+
|
|
1671
|
+
**Errors:** [`UUPSUnauthorizedCallContext`](#registry-error-uupsunauthorizedcallcontext), [`OwnableUnauthorizedAccount`](#registry-error-ownableunauthorizedaccount), [`ERC1967InvalidImplementation`](#registry-error-erc1967invalidimplementation), [`UUPSUnsupportedProxiableUUID`](#registry-error-uupsunsupportedproxiableuuid), [`ERC1967NonPayable`](#registry-error-erc1967nonpayable), [`AddressEmptyCode`](#registry-error-addressemptycode), [`FailedCall`](#registry-error-failedcall).
|
|
1672
|
+
|
|
1673
|
+
#### <a id="registry-fn-proxiableuuid"></a>`proxiableUUID`
|
|
1674
|
+
|
|
1675
|
+
```solidity
|
|
1676
|
+
function proxiableUUID() external view returns (bytes32)
|
|
1677
|
+
```
|
|
1678
|
+
|
|
1679
|
+
Selector `0x52d1902d` · Caller: Anyone (view)
|
|
1680
|
+
|
|
1681
|
+
ERC-1822 check used by `upgradeToAndCall`. Returns the ERC-1967 implementation slot when called on an implementation contract directly and reverts through the proxy.
|
|
1682
|
+
|
|
1683
|
+
**Errors:** [`UUPSUnauthorizedCallContext`](#registry-error-uupsunauthorizedcallcontext).
|
|
1684
|
+
|
|
1685
|
+
#### <a id="registry-fn-initialize"></a>`initialize`
|
|
1686
|
+
|
|
1687
|
+
```solidity
|
|
1688
|
+
function initialize(address[4] signers, address initialOwner, address initialCommitter) external
|
|
1689
|
+
```
|
|
1690
|
+
|
|
1691
|
+
Selector `0xfda9f5ca` · Caller: Once, by `D20Proxy` at deployment · Source: `EpochEntropy.sol` lines 50–57
|
|
1692
|
+
|
|
1693
|
+
Sets the four initial signers, owner and committer. Epoch 1 starts 200 blocks after the initialization block.
|
|
1694
|
+
|
|
1695
|
+
**Emits:** [`OwnershipTransferred`](#registry-event-ownershiptransferred), [`Initialized`](#registry-event-initialized).
|
|
1696
|
+
|
|
1697
|
+
**Errors:** [`InvalidInitialization`](#registry-error-invalidinitialization), [`OwnableInvalidOwner`](#registry-error-ownableinvalidowner), [`InvalidConfig`](#registry-error-invalidconfig).
|
|
1698
|
+
|
|
1699
|
+
### <a id="registry-constants"></a>Constants
|
|
1700
|
+
|
|
1701
|
+
Views returning values fixed in the implementation code.
|
|
1702
|
+
|
|
1703
|
+
| Constant | Returns | Value | Selector | Meaning |
|
|
1704
|
+
| --- | --- | --- | --- | --- |
|
|
1705
|
+
| <a id="registry-fn-epoch_length"></a>`EPOCH_LENGTH` | `uint64` | `200` | `0xac4746ab` | Blocks per epoch. |
|
|
1706
|
+
| <a id="registry-fn-max_attestation_age"></a>`MAX_ATTESTATION_AGE` | `uint256` | `240 seconds` | `0xb9f7bb8d` | Oldest attestation accepted at publication, in seconds; also exported by `@d20dao/vrf-sdk/epoch`. |
|
|
1707
|
+
| <a id="registry-fn-max_packet_bytes"></a>`MAX_PACKET_BYTES` | `uint256` | `2048` | `0x48cad11b` | Upper bound on the `EpochCommitted` packet. |
|
|
1708
|
+
| <a id="registry-fn-fallback_delay_blocks"></a>`FALLBACK_DELAY_BLOCKS` | `uint64` | `20` | `0x0a48a95d` | Blocks between fallback windows. |
|
|
1709
|
+
| <a id="registry-fn-max_fallback_attempt"></a>`MAX_FALLBACK_ATTEMPT` | `uint8` | `3` | `0x59981a9f` | Highest fallback attempt. |
|
|
1710
|
+
| <a id="registry-fn-recipe_domain"></a>`RECIPE_DOMAIN` | `bytes32` | `keccak256("D20_EPOCH_RECIPES")` | `0xacea73c8` | Domain tag of catalog hashes. |
|
|
1711
|
+
| <a id="registry-fn-select_domain"></a>`SELECT_DOMAIN` | `bytes32` | `keccak256("D20_EPOCH_SELECT")` | `0x10181587` | Domain tag of the source selector. |
|
|
1712
|
+
| <a id="registry-fn-epoch_domain"></a>`EPOCH_DOMAIN` | `bytes32` | `keccak256("D20_EPOCH")` | `0xbece738c` | Domain tag of the epoch commitment. |
|
|
1713
|
+
| <a id="registry-fn-upgrade_interface_version"></a>`UPGRADE_INTERFACE_VERSION` | `string` | `"5.0.0"` | `0xad3cb1cc` | OpenZeppelin UUPS interface version: upgrades go through `upgradeToAndCall` only. |
|
|
1714
|
+
|
|
1715
|
+
### <a id="registry-events"></a>Events
|
|
1716
|
+
|
|
1717
|
+
**Epochs**
|
|
1718
|
+
|
|
1719
|
+
#### <a id="registry-event-epochcommitted"></a>`EpochCommitted`
|
|
1720
|
+
|
|
1721
|
+
```solidity
|
|
1722
|
+
event EpochCommitted(uint64 indexed epochId, bytes32 indexed epochHash, bytes packet)
|
|
1723
|
+
```
|
|
1724
|
+
|
|
1725
|
+
Topic 0 `0xc9db8d1389570196eda0f2c6c4e2f78429c2f812db30b6b1022b5e0b5162ef72` · Emitted by: [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback) · Source: `EpochEntropy.sol` lines 45, 156–158
|
|
1726
|
+
|
|
1727
|
+
An epoch was published. `packet` is `abi.encode(canonicalRequest, attestation)`: decode it with `decodeEpochEvidencePacket` and verify with `replayEpochCommitment`. Requests of the epoch now have a target block.
|
|
1728
|
+
|
|
1729
|
+
#### <a id="registry-event-catalogscheduled"></a>`CatalogScheduled`
|
|
1730
|
+
|
|
1731
|
+
```solidity
|
|
1732
|
+
event CatalogScheduled(uint64 indexed fromEpoch, bytes32 indexed catalogHash, address[4] signers)
|
|
1733
|
+
```
|
|
1734
|
+
|
|
1735
|
+
Topic 0 `0xcf1bfe9243f85512c4c62a40dac0bdb9ca6b01cf9bddd6b86f061d0e3685d26a` · Emitted by: [`scheduleCatalog`](#registry-fn-schedulecatalog) · Source: `EpochEntropy.sol` lines 47, 76
|
|
1736
|
+
|
|
1737
|
+
Signers scheduled for epochs from `fromEpoch`. A later `CatalogScheduled` emitted while this version has not taken effect replaces it, so when rebuilding catalogs from history drop replaced versions, or read `signersAt(epochId)`.
|
|
1738
|
+
|
|
1739
|
+
**Administration and upgrades**
|
|
1740
|
+
|
|
1741
|
+
#### <a id="registry-event-committerchanged"></a>`CommitterChanged`
|
|
1742
|
+
|
|
1743
|
+
```solidity
|
|
1744
|
+
event CommitterChanged(address indexed previousCommitter, address indexed newCommitter)
|
|
1745
|
+
```
|
|
1746
|
+
|
|
1747
|
+
Topic 0 `0x3f67cc70f736070aaac75db90cef1ab4047521b73e8a38d02852e8bf1a91e7e0` · Emitted by: [`setCommitter`](#registry-fn-setcommitter) · Source: `EpochEntropy.sol` lines 46, 64
|
|
1748
|
+
|
|
1749
|
+
New publishing address and keeper-share recipient.
|
|
1750
|
+
|
|
1751
|
+
#### <a id="registry-event-ownershiptransferstarted"></a>`OwnershipTransferStarted`
|
|
1752
|
+
|
|
1753
|
+
```solidity
|
|
1754
|
+
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner)
|
|
1755
|
+
```
|
|
1756
|
+
|
|
1757
|
+
Topic 0 `0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700` · Emitted by: [`transferOwnership`](#registry-fn-transferownership)
|
|
1758
|
+
|
|
1759
|
+
`transferOwnership` nominated `newOwner`; the zero address means a nomination was cancelled.
|
|
1760
|
+
|
|
1761
|
+
#### <a id="registry-event-ownershiptransferred"></a>`OwnershipTransferred`
|
|
1762
|
+
|
|
1763
|
+
```solidity
|
|
1764
|
+
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
|
|
1765
|
+
```
|
|
1766
|
+
|
|
1767
|
+
Topic 0 `0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0` · Emitted by: [`acceptOwnership`](#registry-fn-acceptownership), [`initialize`](#registry-fn-initialize)
|
|
1768
|
+
|
|
1769
|
+
Ownership moved: from the zero address at initialization, and at each `acceptOwnership`.
|
|
1770
|
+
|
|
1771
|
+
#### <a id="registry-event-upgraded"></a>`Upgraded`
|
|
1772
|
+
|
|
1773
|
+
```solidity
|
|
1774
|
+
event Upgraded(address indexed implementation)
|
|
1775
|
+
```
|
|
1776
|
+
|
|
1777
|
+
Topic 0 `0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b` · Emitted by: [`upgradeToAndCall`](#registry-fn-upgradetoandcall), proxy deployment
|
|
1778
|
+
|
|
1779
|
+
The proxy now runs `implementation`. Emitted by the proxy at deployment and at every `upgradeToAndCall`. Compare the address with the deployment manifest; an implementation you have not reviewed means stop and review before sending more requests.
|
|
1780
|
+
|
|
1781
|
+
#### <a id="registry-event-initialized"></a>`Initialized`
|
|
1782
|
+
|
|
1783
|
+
```solidity
|
|
1784
|
+
event Initialized(uint64 version)
|
|
1785
|
+
```
|
|
1786
|
+
|
|
1787
|
+
Topic 0 `0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2` · Emitted by: [`initialize`](#registry-fn-initialize)
|
|
1788
|
+
|
|
1789
|
+
`initialize` ran on the proxy (`version` 1). Each implementation contract also emitted it once at construction with `version` 2^64 − 1, which locks the implementation against initialization.
|
|
1790
|
+
|
|
1791
|
+
### <a id="registry-errors"></a>Errors
|
|
1792
|
+
|
|
1793
|
+
**Epoch reads**
|
|
1794
|
+
|
|
1795
|
+
#### <a id="registry-error-invalidepoch"></a>`InvalidEpoch`
|
|
1796
|
+
|
|
1797
|
+
`error InvalidEpoch()` · Selector `0xd5b25b63` · Source: `EpochEntropy.sol` lines 41, 71, 88
|
|
1798
|
+
|
|
1799
|
+
**Raised by:** [`epochStart`](#registry-fn-epochstart), [`getEpochSelection`](#registry-fn-getepochselection), [`getEpochFallbackSelection`](#registry-fn-getepochfallbackselection), [`fallbackOpensAt`](#registry-fn-fallbackopensat), [`checkpointEpoch`](#registry-fn-checkpointepoch), [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback), [`scheduleCatalog`](#registry-fn-schedulecatalog).
|
|
1800
|
+
|
|
1801
|
+
Epoch 0 was passed to `epochStart`, `fallbackOpensAt`, a selection view, `checkpointEpoch` or a commit, or `scheduleCatalog` got a `fromEpoch` less than two epochs after the current one.
|
|
1802
|
+
|
|
1803
|
+
**What to do:** Epoch IDs start at 1; schedule at least two epochs ahead.
|
|
1804
|
+
|
|
1805
|
+
#### <a id="registry-error-preparationclosed"></a>`PreparationClosed`
|
|
1806
|
+
|
|
1807
|
+
`error PreparationClosed()` · Selector `0x8e2a3c7d` · Source: `EpochEntropy.sol` lines 41, 103
|
|
1808
|
+
|
|
1809
|
+
**Raised by:** [`getEpochSelection`](#registry-fn-getepochselection), [`getEpochFallbackSelection`](#registry-fn-getepochfallbackselection), [`checkpointEpoch`](#registry-fn-checkpointepoch).
|
|
1810
|
+
|
|
1811
|
+
The epoch has not started (`block.number` is below `epochStart(epochId)`), so its anchor block hash does not exist yet.
|
|
1812
|
+
|
|
1813
|
+
**What to do:** Wait for the epoch to start.
|
|
1814
|
+
|
|
1815
|
+
#### <a id="registry-error-anchorunavailable"></a>`AnchorUnavailable`
|
|
1816
|
+
|
|
1817
|
+
`error AnchorUnavailable()` · Selector `0x60776ed3` · Source: `EpochEntropy.sol` lines 41, 106
|
|
1818
|
+
|
|
1819
|
+
**Raised by:** [`getEpochSelection`](#registry-fn-getepochselection), [`getEpochFallbackSelection`](#registry-fn-getepochfallbackselection), [`checkpointEpoch`](#registry-fn-checkpointepoch), [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1820
|
+
|
|
1821
|
+
The anchor (hash of block `epochStart - 1`) was never checkpointed and is outside the 256-block `BLOCKHASH` window.
|
|
1822
|
+
|
|
1823
|
+
**What to do:** The epoch can no longer be selected or published. Every request checkpoints its epoch's anchor, so an epoch with requests is not affected.
|
|
1824
|
+
|
|
1825
|
+
**Publication**
|
|
1826
|
+
|
|
1827
|
+
#### <a id="registry-error-onlycommitter"></a>`OnlyCommitter`
|
|
1828
|
+
|
|
1829
|
+
`error OnlyCommitter()` · Selector `0xfffe5af3` · Source: `EpochEntropy.sol` lines 42, 141
|
|
1830
|
+
|
|
1831
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1832
|
+
|
|
1833
|
+
A commit from an address other than `committer()`.
|
|
1834
|
+
|
|
1835
|
+
**What to do:** Only the committer publishes.
|
|
1836
|
+
|
|
1837
|
+
#### <a id="registry-error-alreadycommitted"></a>`AlreadyCommitted`
|
|
1838
|
+
|
|
1839
|
+
`error AlreadyCommitted()` · Selector `0xbfec5558` · Source: `EpochEntropy.sol` lines 42, 142
|
|
1840
|
+
|
|
1841
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1842
|
+
|
|
1843
|
+
The epoch already has a published packet.
|
|
1844
|
+
|
|
1845
|
+
**What to do:** Nothing to publish; read `getEpoch`.
|
|
1846
|
+
|
|
1847
|
+
#### <a id="registry-error-fallbacknotopen"></a>`FallbackNotOpen`
|
|
1848
|
+
|
|
1849
|
+
`error FallbackNotOpen()` · Selector `0xf8635228` · Source: `EpochEntropy.sol` lines 44, 143
|
|
1850
|
+
|
|
1851
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1852
|
+
|
|
1853
|
+
`block.number` is below `fallbackOpensAt(epochId, attempt)`; for attempt 0, before the epoch start.
|
|
1854
|
+
|
|
1855
|
+
**What to do:** Wait for the window.
|
|
1856
|
+
|
|
1857
|
+
#### <a id="registry-error-invalidfallback"></a>`InvalidFallback`
|
|
1858
|
+
|
|
1859
|
+
`error InvalidFallback()` · Selector `0x5a93724d` · Source: `EpochEntropy.sol` lines 44, 112, 117, 137
|
|
1860
|
+
|
|
1861
|
+
**Raised by:** [`getEpochFallbackSelection`](#registry-fn-getepochfallbackselection), [`fallbackOpensAt`](#registry-fn-fallbackopensat), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1862
|
+
|
|
1863
|
+
An attempt above `MAX_FALLBACK_ATTEMPT`, or attempt 0 passed to `commitEpochFallback`.
|
|
1864
|
+
|
|
1865
|
+
**What to do:** Use attempts 1 to 3 for fallbacks.
|
|
1866
|
+
|
|
1867
|
+
#### <a id="registry-error-invalidtime"></a>`InvalidTime`
|
|
1868
|
+
|
|
1869
|
+
`error InvalidTime()` · Selector `0x6f7eac26` · Source: `EpochEntropy.sol` lines 42, 145
|
|
1870
|
+
|
|
1871
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1872
|
+
|
|
1873
|
+
The attestation timestamp is in the future or more than `MAX_ATTESTATION_AGE` (240 seconds) before the publication block.
|
|
1874
|
+
|
|
1875
|
+
**What to do:** A saved packet is never refreshed; its requests expire and are refunded.
|
|
1876
|
+
|
|
1877
|
+
#### <a id="registry-error-invaliddata"></a>`InvalidData`
|
|
1878
|
+
|
|
1879
|
+
`error InvalidData()` · Selector `0x5cb045db` · Source: `EpochEntropy.sol` lines 42, 160–204
|
|
1880
|
+
|
|
1881
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1882
|
+
|
|
1883
|
+
The signed data is empty, longer than 128 bytes, or not in the fixed format of the slot.
|
|
1884
|
+
|
|
1885
|
+
**What to do:** Publish only a validated response for the selected slot.
|
|
1886
|
+
|
|
1887
|
+
#### <a id="registry-error-invalidsigner"></a>`InvalidSigner`
|
|
1888
|
+
|
|
1889
|
+
`error InvalidSigner()` · Selector `0x815e1d64` · Source: `EpochEntropy.sol` lines 42, 148
|
|
1890
|
+
|
|
1891
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1892
|
+
|
|
1893
|
+
The signature does not recover to the slot's signer in the epoch's catalog.
|
|
1894
|
+
|
|
1895
|
+
**What to do:** Use `signersAt(epochId)` for the expected signer.
|
|
1896
|
+
|
|
1897
|
+
#### <a id="registry-error-ecdsainvalidsignature"></a>`ECDSAInvalidSignature`
|
|
1898
|
+
|
|
1899
|
+
`error ECDSAInvalidSignature()` · Selector `0xf645eedf`
|
|
1900
|
+
|
|
1901
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1902
|
+
|
|
1903
|
+
The signature does not recover to any address (OpenZeppelin `ECDSA`).
|
|
1904
|
+
|
|
1905
|
+
**What to do:** Publish the exact signature from the response.
|
|
1906
|
+
|
|
1907
|
+
#### <a id="registry-error-ecdsainvalidsignaturelength"></a>`ECDSAInvalidSignatureLength`
|
|
1908
|
+
|
|
1909
|
+
`error ECDSAInvalidSignatureLength(uint256 length)` · Selector `0xfce698f7`
|
|
1910
|
+
|
|
1911
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1912
|
+
|
|
1913
|
+
The signature is not 65 bytes (OpenZeppelin `ECDSA`).
|
|
1914
|
+
|
|
1915
|
+
**What to do:** Publish the exact signature from the response.
|
|
1916
|
+
|
|
1917
|
+
#### <a id="registry-error-ecdsainvalidsignatures"></a>`ECDSAInvalidSignatureS`
|
|
1918
|
+
|
|
1919
|
+
`error ECDSAInvalidSignatureS(bytes32 s)` · Selector `0xd78bce0c`
|
|
1920
|
+
|
|
1921
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1922
|
+
|
|
1923
|
+
The signature has a high `s` value (OpenZeppelin `ECDSA`).
|
|
1924
|
+
|
|
1925
|
+
**What to do:** Publish the exact signature from the response.
|
|
1926
|
+
|
|
1927
|
+
#### <a id="registry-error-packettoolarge"></a>`PacketTooLarge`
|
|
1928
|
+
|
|
1929
|
+
`error PacketTooLarge()` · Selector `0xda85e8a5` · Source: `EpochEntropy.sol` lines 43, 157
|
|
1930
|
+
|
|
1931
|
+
**Raised by:** [`commitEpoch`](#registry-fn-commitepoch), [`commitEpochFallback`](#registry-fn-commitepochfallback).
|
|
1932
|
+
|
|
1933
|
+
The encoded packet exceeds `MAX_PACKET_BYTES` (2048).
|
|
1934
|
+
|
|
1935
|
+
**What to do:** Not reachable with data of at most 128 bytes and a 65-byte signature.
|
|
1936
|
+
|
|
1937
|
+
**Administration, initialization and upgrades**
|
|
1938
|
+
|
|
1939
|
+
#### <a id="registry-error-invalidconfig"></a>`InvalidConfig`
|
|
1940
|
+
|
|
1941
|
+
`error InvalidConfig()` · Selector `0x35be3ac8` · Source: `EpochEntropy.sol` lines 41, 53, 63, 69
|
|
1942
|
+
|
|
1943
|
+
**Raised by:** [`setCommitter`](#registry-fn-setcommitter), [`scheduleCatalog`](#registry-fn-schedulecatalog), [`initialize`](#registry-fn-initialize).
|
|
1944
|
+
|
|
1945
|
+
A zero signer or committer in `initialize`, a zero address in `setCommitter`, or a zero signer in `scheduleCatalog`.
|
|
1946
|
+
|
|
1947
|
+
**What to do:** Use non-zero addresses.
|
|
1948
|
+
|
|
1949
|
+
#### <a id="registry-error-ownableunauthorizedaccount"></a>`OwnableUnauthorizedAccount`
|
|
1950
|
+
|
|
1951
|
+
`error OwnableUnauthorizedAccount(address account)` · Selector `0x118cdaa7`
|
|
1952
|
+
|
|
1953
|
+
**Raised by:** [`setCommitter`](#registry-fn-setcommitter), [`scheduleCatalog`](#registry-fn-schedulecatalog), [`transferOwnership`](#registry-fn-transferownership), [`acceptOwnership`](#registry-fn-acceptownership), [`renounceOwnership`](#registry-fn-renounceownership), [`upgradeToAndCall`](#registry-fn-upgradetoandcall).
|
|
1954
|
+
|
|
1955
|
+
`account` is not the owner (owner-only functions) or not the pending owner (`acceptOwnership`).
|
|
1956
|
+
|
|
1957
|
+
**What to do:** Only the owner can administer or upgrade the contract; on Arc Mainnet that is the DAO treasury Safe recorded in the deployment manifest.
|
|
1958
|
+
|
|
1959
|
+
#### <a id="registry-error-ownableinvalidowner"></a>`OwnableInvalidOwner`
|
|
1960
|
+
|
|
1961
|
+
`error OwnableInvalidOwner(address owner)` · Selector `0x1e4fbdf7`
|
|
1962
|
+
|
|
1963
|
+
**Raised by:** [`initialize`](#registry-fn-initialize).
|
|
1964
|
+
|
|
1965
|
+
`initialize` was given the zero address as owner.
|
|
1966
|
+
|
|
1967
|
+
**What to do:** Deployment-time only.
|
|
1968
|
+
|
|
1969
|
+
#### <a id="registry-error-renouncedisabled"></a>`RenounceDisabled`
|
|
1970
|
+
|
|
1971
|
+
`error RenounceDisabled()` · Selector `0x89051165` · Source: `EpochEntropy.sol` lines 43, 60
|
|
1972
|
+
|
|
1973
|
+
**Raised by:** [`renounceOwnership`](#registry-fn-renounceownership).
|
|
1974
|
+
|
|
1975
|
+
The owner called `renounceOwnership`, which is disabled.
|
|
1976
|
+
|
|
1977
|
+
**What to do:** Move ownership with `transferOwnership` and `acceptOwnership`.
|
|
1978
|
+
|
|
1979
|
+
#### <a id="registry-error-invalidinitialization"></a>`InvalidInitialization`
|
|
1980
|
+
|
|
1981
|
+
`error InvalidInitialization()` · Selector `0xf92ee8a9`
|
|
1982
|
+
|
|
1983
|
+
**Raised by:** [`initialize`](#registry-fn-initialize).
|
|
1984
|
+
|
|
1985
|
+
`initialize` on a proxy that is already initialized, or on an implementation contract, whose initializers are disabled at construction.
|
|
1986
|
+
|
|
1987
|
+
**What to do:** None: initialization happens once, atomically, when `D20Proxy` is deployed.
|
|
1988
|
+
|
|
1989
|
+
#### <a id="registry-error-notinitializing"></a>`NotInitializing`
|
|
1990
|
+
|
|
1991
|
+
`error NotInitializing()` · Selector `0xd7e6bcf8`
|
|
1992
|
+
|
|
1993
|
+
**Raised by:** no public function (declared by OpenZeppelin `Initializable`).
|
|
1994
|
+
|
|
1995
|
+
Declared by the OpenZeppelin initializer helpers. No public function of this contract can reach it.
|
|
1996
|
+
|
|
1997
|
+
**What to do:** None.
|
|
1998
|
+
|
|
1999
|
+
#### <a id="registry-error-uupsunauthorizedcallcontext"></a>`UUPSUnauthorizedCallContext`
|
|
2000
|
+
|
|
2001
|
+
`error UUPSUnauthorizedCallContext()` · Selector `0xe07c8dba`
|
|
2002
|
+
|
|
2003
|
+
**Raised by:** [`upgradeToAndCall`](#registry-fn-upgradetoandcall), [`proxiableUUID`](#registry-fn-proxiableuuid).
|
|
2004
|
+
|
|
2005
|
+
`upgradeToAndCall` called on the implementation instead of through the proxy, or `proxiableUUID` called through the proxy.
|
|
2006
|
+
|
|
2007
|
+
**What to do:** Owner upgrade procedure only.
|
|
2008
|
+
|
|
2009
|
+
#### <a id="registry-error-uupsunsupportedproxiableuuid"></a>`UUPSUnsupportedProxiableUUID`
|
|
2010
|
+
|
|
2011
|
+
`error UUPSUnsupportedProxiableUUID(bytes32 slot)` · Selector `0xaa1d49a4`
|
|
2012
|
+
|
|
2013
|
+
**Raised by:** [`upgradeToAndCall`](#registry-fn-upgradetoandcall).
|
|
2014
|
+
|
|
2015
|
+
The new implementation reports a `proxiableUUID` other than the ERC-1967 implementation slot.
|
|
2016
|
+
|
|
2017
|
+
**What to do:** Owner upgrade procedure only.
|
|
2018
|
+
|
|
2019
|
+
#### <a id="registry-error-erc1967invalidimplementation"></a>`ERC1967InvalidImplementation`
|
|
2020
|
+
|
|
2021
|
+
`error ERC1967InvalidImplementation(address implementation)` · Selector `0x4c9c8ce3`
|
|
2022
|
+
|
|
2023
|
+
**Raised by:** [`upgradeToAndCall`](#registry-fn-upgradetoandcall).
|
|
2024
|
+
|
|
2025
|
+
The new implementation has no code or no `proxiableUUID`.
|
|
2026
|
+
|
|
2027
|
+
**What to do:** Owner upgrade procedure only.
|
|
2028
|
+
|
|
2029
|
+
#### <a id="registry-error-erc1967nonpayable"></a>`ERC1967NonPayable`
|
|
2030
|
+
|
|
2031
|
+
`error ERC1967NonPayable()` · Selector `0xb398979f`
|
|
2032
|
+
|
|
2033
|
+
**Raised by:** [`upgradeToAndCall`](#registry-fn-upgradetoandcall).
|
|
2034
|
+
|
|
2035
|
+
`upgradeToAndCall` was sent value with empty `data`.
|
|
2036
|
+
|
|
2037
|
+
**What to do:** Owner upgrade procedure only.
|
|
2038
|
+
|
|
2039
|
+
#### <a id="registry-error-addressemptycode"></a>`AddressEmptyCode`
|
|
2040
|
+
|
|
2041
|
+
`error AddressEmptyCode(address target)` · Selector `0x9996b315`
|
|
2042
|
+
|
|
2043
|
+
**Raised by:** [`upgradeToAndCall`](#registry-fn-upgradetoandcall).
|
|
2044
|
+
|
|
2045
|
+
Declared by OpenZeppelin `Address` for the delegatecall in `upgradeToAndCall`. Not reachable in practice, because the new implementation must already have code.
|
|
2046
|
+
|
|
2047
|
+
**What to do:** None.
|
|
2048
|
+
|
|
2049
|
+
#### <a id="registry-error-failedcall"></a>`FailedCall`
|
|
2050
|
+
|
|
2051
|
+
`error FailedCall()` · Selector `0xd6bda275`
|
|
2052
|
+
|
|
2053
|
+
**Raised by:** [`upgradeToAndCall`](#registry-fn-upgradetoandcall).
|
|
2054
|
+
|
|
2055
|
+
The initialization call made by `upgradeToAndCall` reverted without revert data.
|
|
2056
|
+
|
|
2057
|
+
**What to do:** Owner upgrade procedure only.
|