How one budget is shared, and who can touch it.
The rule in one example
A task has a 60 s budget. Attempt 1 starts with an allowance of 60 s and fails after 25 s. Attempt 2 starts with 35 s and fails after 20 s. Attempt 3 starts with 15 s. If it is still running at 15 s it is stopped and the task ends with its whole budget used; if it succeeds earlier, the task ends there and what was held for the unused seconds goes back to the manager. Per-session caps would have allowed 60 + 60 + 60 s.
This is the arithmetic of the rule; forge test test_SharedBudget_60s_25_20_then15 runs exactly these numbers against the contract.
How time is measured
- In this browser: Pyodide (CPython compiled to WebAssembly, served by this site) runs in a Web Worker. The clock starts when the script is handed to the loaded interpreter and stops when it ends; loading the interpreter is not counted. A timer equal to the allowance terminates the worker: that is the hard stop. It is wall-clock time on your device.
- With the CLI: the script runs as a python3 process on the agent's machine, killed at the allowance. Time runs from spawning the process to its exit, so Python's start-up is included. That machine is not a sandbox.
- On chain: the contract cannot observe either. It records what the named runner reports, cuts anything above the allowance, and keeps the order and the totals. A runner you do not trust can over-report up to the allowance; the cap is the most it can ever bill.
Roles and every power they have
| Who | Can | Cannot |
|---|---|---|
| Manager (opens the task) | set budget, price and runner at opening; change the runner or add budget while nothing runs; close the task (over a running attempt only after allowance + 1 h); withdraw refunds | lower the budget or price, take back what a finished attempt cost, report attempts (unless it named itself runner) |
| Runner (named by the manager) | start the next attempt, report its duration, status and output hash, sign those reports for anyone to submit, withdraw earnings | bill more than the allowance, report twice, change budget, price or runner, touch held ETH |
| Anyone | read every task, attempt and balance; submit a runner's signed report; re-hash an output file | anything else |
| Owner / admin | does not exist: no owner, admin, fee, pause or upgrade | — |
Limits the contract enforces
- Budget per task
- 0.1 s to 7 days (100 to 604,800,000 ms); the manager may add more, never take it back
- Price
- 0 to 1 ETH per second, fixed when the task opens
- ETH held
- holdFor = budget × price ÷ 1000, rounded up; exactly this value must be sent
- Cost of an attempt
- billed ms × price ÷ 1000, rounded down (so the costs always fit in what was held)
- Attempts
- one at a time, up to 1,000 per task
- Allowance of an attempt
- everything left when it starts; a report above it is cut to it and ends the task
- Grace before a manager may close over a running attempt
- the attempt's allowance (rounded up to seconds) + 1 hour
- Label
- up to 64 bytes, kept in the TaskOpened event only
- Signed reports
- EIP-712, domain NoctiqRetryBudget / 1 / chain id / contract; EOA keys, low-s only; a start signature carries a deadline
Refusal reasons
Every refusal is Rejected(bits). The check…() views return the same bits before anything is signed; the site shows them in plain words.
| Bit | Name | Meaning |
|---|---|---|
| 0 | R_NO_TASK | No task with this number |
| 1 | R_NOT_OPEN | The task has ended |
| 2 | R_NOT_RUNNER | Only the task's named runner can report attempts |
| 3 | R_NOT_MANAGER | Only the task's manager can do this |
| 4 | R_IN_FLIGHT | An attempt is still running |
| 5 | R_NO_BUDGET | No budget left |
| 6 | R_NOT_RUNNING | That attempt is not the one running |
| 7 | R_BAD_STATUS | Status must be failed, succeeded or stopped |
| 8 | R_ZERO_RUNNER | A runner address is required |
| 9 | R_BUDGET_RANGE | Budget must be between 0.1 s and 7 days |
| 10 | R_PRICE_HIGH | Price above 1 ETH per second |
| 11 | R_WRONG_VALUE | The ETH sent must equal the amount to hold exactly |
| 12 | R_LABEL_LONG | Label longer than 64 bytes |
| 13 | R_TOO_SOON | The running attempt still has time to report |
| 14 | R_EXPIRED | The signed start has expired |
| 15 | R_BAD_SIG | The signature is not a valid runner signature |
| 16 | R_TOO_MANY | The task reached 1,000 attempts |
| 17 | R_NOTHING_OWED | Nothing to withdraw |
Money
Native ETH only, and only when the price is above 0. Held ETH sits in the contract per task. A finished attempt moves its cost to the runner's balance; when the task ends (success, budget used up, or closed) the rest moves to the manager's balance. Balances leave only through withdraw(), to the account they belong to, guarded against re-entry. A balance that cannot be received (a contract that refuses ETH) stays claimable. Plain ETH transfers to the contract are refused.
The contract
NoctiqRetryBudget on Robinhood Chain: not deployed yet. Check that an address runs this exact build with npm run verify-deployment. Machine-readable: /api/proof, /api/abi. Agents: SDK and CLI.