How Comvex works
The rule
A cutoff policy is a pair: one Chainlink feed on Robinhood Chain and one maximum age in seconds. The age of a price is block.timestamp - updatedAt of the feed's latest round. The rule accepts while age <= maxAge and refuses when age > maxAge. So with 60 seconds, a round 60 seconds old is still accepted and one 61 seconds old is refused. Off-by-one mistakes live exactly there, which is why the boundary is tested at maxAge - 1, maxAge and maxAge + 1.
A round stamped later than the block (updatedAt > block.timestamp), a round with updatedAt == 0, and a non-positive answer are refused as well. The site reads 63 feeds; most of them publish on a 0.5% move or once every 24 hours, so a short maximum age refuses most of the time. The feeds page shows how often.
The generated guard
The policy page writes two files in your browser: src/<Name>Cutoff.sol with a library (the feed, the limit and the decimals as constants, freshPrice(), custom errors StalePrice, FutureRound, EmptyRound, NonPositiveAnswer) and a small guard contract, and test/<Name>Cutoff.t.sol, a Foundry test of the three cases plus a fuzz test. On any chain the test puts a stand-in feed at the real address with vm.etch; on a Robinhood Chain fork it uses the real feed and its real round and only moves the clock with vm.warp.
The repository keeps one output of the generator (ETH / USD, 60 s) under contracts/src/generated and contracts/test/generated; forge test compiles and runs it, and npm test checks the generator still writes exactly those bytes.
The boundary run
The boundary page (and POST /api/boundary) pins the head block, reads the feed's latest round and the target's code at that block, then sends one batch of eth_call requests at the same block. Each case sets the block time with the fourth parameter of eth_call (block overrides) to updatedAt + offset; a tiny clock contract in the same batch returns TIMESTAMP, and the run is rejected if the node did not apply the override. The live case runs without an override.
- Reference gate:
ComvexPriceGate.readFresh(feed, maxAge). Until it is deployed, its runtime code is placed at 0x000000000000000000000000000000000000c0de with a state override for the call only. - Deployed contract: any address on Robinhood Chain with your call data. Mode 0 counts a revert as refused; mode 1 reads a returned bool.
- Candidate bytecode: runtime code placed at 0x000000000000000000000000000000000000ca4d for the call only. Its report is recorded as candidate code under its code hash.
The answer contains the report (canonical JSON, keys sorted), its keccak256 hash, and the exact JSON-RPC requests. Send them to any Robinhood Chain endpoint that supports block overrides and you get the same answers for that block.
The registry
ComvexCutoffRegistry (not deployed yet) keeps policies and reports. It has no owner, admin, fee, pause or upgrade and holds no funds; records cannot be changed. When a report is submitted the contract itself:
- computes the expected verdict of every case from the policy's maximum age;
- checks that the feed knows the round (getRoundData) and stores the round's real updatedAt;
- for a deployed target, checks that its code hash is the one in the report and runs the live case in the same transaction (capped gas, bounded return data);
- stores the L2 block number from ArbSys, the reporter and the report hash.
The case results themselves (which offsets were accepted) are the reporter's statement, tied to the report hash: a contract cannot move its own clock. Anyone can repeat them from the requests, and a report whose results differ from the rule is recorded and shown as differing. checkPolicy and checkReport return the reasons a write would be refused, and every page shows them before a wallet opens.
What is not claimed
- A passing boundary says the code under test treats age correctly at those offsets for that round. It says nothing about the price itself, other checks, or other code paths.
- Block-time overrides depend on the RPC node; the run refuses to judge when the clock probe shows the override was ignored.
- Feed heartbeats shown as documented come from Chainlink's directory; measured rhythm covers only the rounds read.
- Comvex is not affiliated with Robinhood or Chainlink.
HTTP API
GET /api/feeds: every feed with age and rhythm of the last 8 rounds.?address=0x…&depth=48for one feed.POST /api/boundarywith{"feed":"0x…","maxAge":60,"offsets":[59,60,61],"target":{"kind":"gate"}}. Targets:{"kind":"address","address","callData","mode"}or{"kind":"bytecode","runtime","callData","mode"}.GET /api/registry(policies + newest reports),?report=<n>for one.GET /api/abifor both ABIs.GET /api/proofandGET /api/health; llms.txt for a plain summary.
Every route is rate limited per network; the boundary run allows a few runs per minute.
Wallet and RPC
Writes go from your own wallet; the site adds Robinhood Chain (chain 4663) when you connect, estimates gas with a 30% margin, sets EIP-1559 fees and checks your ETH balance before the wallet opens. If a wallet shows no activity 60 seconds after you sign, set its Robinhood Chain RPC to https://rpc.mainnet.chain.robinhood.com and try again.