Concepts
Eggs
The signed order and every field of it.
| Field | Meaning |
|---|---|
owner | Who signs, and whose escrow pays. |
target | The contract to call (a curve, a router, anything). |
value | ETH sent with the call, taken from the owner's escrow. |
data | The calldata. It is hashed in the signature, so a keeper cannot change it. Put your own address as the recipient inside it. |
notBefore, notAfter | The window, in the chain's block numbers (see The clock). |
maxReward | The most a keeper can earn, paid from escrow. Zero is allowed (keepers then have no reason to race). |
nonce | Any unused number. Random is best. Burning it cancels the egg. |
The signature
EIP-712, domain { name: "Cuckoo", version: "1", chainId, verifyingContract }, type Egg(address owner, address target, uint256 value, bytes32 dataHash, uint64 notBefore, uint64 notAfter, uint256 maxReward, uint256 nonce). Changing any field gives another digest and the signature fails.
Escrow only, ETH only
The contract never touches your wallet. It only spends what you deposited. Today an egg can spend ETH (value and the reward). Token sells and approvals are not part of this version, on purpose: they would need allowances that outlive the egg.
Good shapes
- Buy at a block:
target = curve,data = buy(quote, minOut, you). Put a realminOut. - Open window:
notAftera few blocks afternotBefore, so one early refusal can still land. - Small reward, wide field: the reward only has to beat a keeper's gas; the curve decides who is first.