Docs

How a job purse works.

One contract, NevfourJobPurse, on Elysium (99901). Not deployed yet.

The rule

cap        = reward − minMargin            (fixed at open, can only be lowered)
headroom   = cap − spent
accept     = estimate ≤ headroom
net        = rewardPaid + rewardDeclared − spent

Funding is limited to the cap minus what was already spent and withdrawn, so the escrow can never hold more than the agent may use. The accept check is a read; it does not reserve anything.

Roles and powers

CallWhoEffect
openJobanyone (becomes operator)Creates the job, optional first funding, agent and up to 16 providers.
fundoperatorAdds escrow, never above the cap.
withdrawoperatorTakes unspent escrow back at any time, open or closed.
setAgent / setProvideroperatorChanges or revokes the agent key; edits the allow-list.
lowerCapoperatorLowers the cap, never below what is spent.
closeoperatorSucceeded / Failed / Cancelled, declared reward, result hash; refunds the rest.
spendagent keyPays an allow-listed provider, or records a held spend.
payRewardanyoneForwards the reward to the operator and records it.

No owner, admin, pause, fee or upgrade. Nobody but the operator can move a job's escrow anywhere except to its allowed providers through the agent key.

Reason bits

Returned by checkSpend and spend. Limit bits (provider, cap, escrow, per-spend) make a spend held; the others make it revert with SpendRefused.

BitMeaningEffect
1no such jobreverts
2the job is closedreverts
4the job's deadline has passedreverts
8this address is not the job's agent keyreverts
16the provider is not on the job's allow-listheld
32the amount is zeroreverts
64it would pass the spending capheld
128the escrow holds less than the amountheld
256it is above the per-spend limitheld

Events

JobOpened(jobId, operator, agent, token, reward, minMargin, cap, maxPerSpend, deadline, specHash)A job and its cap exist.
JobFunded(jobId, amount, balance)Escrow added (only the operator, never above the cap).
AgentSet(jobId, agent)Agent key set; zero address = revoked.
ProviderSet(jobId, provider, allowed)Allow-list changed.
CapLowered(jobId, oldCap, newCap)Cap went down. It cannot go up.
Spent(jobId, provider, agent, kind, amount, memo, spentTotal, headroom)A provider was paid from the escrow.
SpendHeld(jobId, provider, agent, kind, amount, memo, reasons)A spend hit a limit; nothing moved.
Withdrawn(jobId, amount, balance)The operator took unspent funds back.
RewardPaid(jobId, payer, amount)Someone paid the reward; it went straight to the operator.
JobClosedOut(jobId, status, spent, rewardPaid, rewardDeclared, refunded, resultHash)Outcome recorded, remainder refunded.

jobId is indexed (topic1), so one job's ledger is a single eth_getLogs call. This site reads it that way.

Assets and limits

  • HYPE (native) or an ERC-20 per job. The open-job form offers HYPE and USDC; a USDC job is two transactions (approve the purse for exactly the funding amount, then openJob pulls it). Other tokens go through the SDK call. Tokens that take a fee on transfer are refused; tokens that return nothing are accepted; rebasing tokens are not supported.
  • A provider that rejects HYPE makes the spend revert, so nothing is lost or stuck.
  • The reward is only known on-chain when paid through payReward. A reward declared at close is the operator's statement and is labelled that way.
  • An estimate is the operator's or agent's number. NEV4 does not predict costs, prices or earnings.
  • Nothing is priced in USD: Elysium has no price feed this site trusts.

Check a deployment against this build: /api/proof · status: /api/health · agents: SDK