cuckoo

Concepts

Eggs

The signed order and every field of it.

FieldMeaning
ownerWho signs, and whose escrow pays.
targetThe contract to call (a curve, a router, anything).
valueETH sent with the call, taken from the owner's escrow.
dataThe calldata. It is hashed in the signature, so a keeper cannot change it. Put your own address as the recipient inside it.
notBefore, notAfterThe window, in the chain's block numbers (see The clock).
maxRewardThe most a keeper can earn, paid from escrow. Zero is allowed (keepers then have no reason to race).
nonceAny 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 real minOut.
  • Open window: notAfter a few blocks after notBefore, 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.