ERC-8492 Task Escrow Settlement Deduction Standard (Settlement Deductions for Task Escrows)

Draft · Vaults & DeFi · created 2026-11-09

A standard that lets an escrow paying out task compensation withhold third-party shares, such as taxes, referral fees, or loan repayments, at every payout, while ensuring that the deduction logic itself can never block the payout.

Why it is needed

Current on-chain escrows offer only two options: pay the full task amount to the payee and leave the entire third-party share, such as taxes, referral fees, or loan repayments, to the payee's goodwill, or charge a single fee set by an administrator. A per-task hook set by the requester can be removed by the requester, and if it reverts it blocks the task itself by design. As a result, existing approaches cannot provide a tax that neither the requester nor the payee can switch off, a repayment guarantee a lender can trust enough to advance funds, or an assurance that the payee still gets paid even if the deduction logic breaks.

What to implement

In depth

Separation of roles between the escrow and the policy

The escrow is responsible only for when and how safely to call the policy; the policy decides how much to withhold and to whom. The escrow calls onTaskCreated once at task creation to notify the policy of the asset and expected payout size, and calls deductions before every payout, receiving back only a single number, the deducted amount d. An approach that returns the full list of recipients was rejected, because it shifts the policy's bookkeeping burden onto every escrow. Thanks to this structure, escrow code shrinks to a few dozen lines, and the escrow never needs to be modified when a new kind of deduction is introduced.

Calling deductions before every payout, with a fixed payee

On every payout path except refunds (including the default and timeout paths), the escrow must call deductions(taskId, settlementId, payee, amount) before paying out, and settlementId must be unique within the task. The function that processes the payout cannot take payee as an argument, and the payee must already be fixed in escrow state before the payout. This prevents a payer from bypassing an assignment, when that assignment is bound to a specific address, by paying the same person at a new address.

The fixed gas budget G and starvation prevention

The escrow must apply a constant gas limit G to the policy call across the entire escrow, and before the call it must verify that gasleft() exceeds G*64/63 plus the cost of the call itself. Under EIP-150's 63/64 rule, without this check a caller could send just enough gas to make the policy call fail, turning the payout into a full-amount payout and skipping deductions such as a lender's share. With this check in place, a failure within the budget can only be interpreted as a genuine policy error.

Failed or invalid responses are treated as full payout

A response is valid only if the policy call succeeds, returns exactly 32 bytes, and the returned value d is at most amount. If it is invalid (the call fails, there is no code, the return is out of range, etc.), the escrow must pay the full amount to the payee and emit a DeductionsSkipped event. Under no circumstances can a policy failure or bug block a payout, preventing a single policy defect from freezing payouts across the entire escrow.

The credit ledger and four events

The amount d withheld by the policy is not delivered immediately; it accrues as the policy's credit in the task's vault and can only be withdrawn via withdrawCredit, callable by anyone. During settlement, no deduction recipient, such as a tax collector, referrer, or lender, is ever called, so none of them can block settlement or trigger reentrancy. Every payout leaves a PayoutSettled record, a rejected transfer leaves a PayoutCredited record, and a withdrawal leaves a PayoutWithdrawn record, letting a third party reconstruct the ledger without any escrow-specific events.

Constraints the policy must observe

The deductions function cannot CALL, CALLCODE, or STATICCALL any account other than a precompile, cannot create an account or SELFDESTRUCT, and cannot write to a storage slot that was previously empty (only updating pre-allocated slots is allowed). This is because, under a gas schedule like EIP-8037 that prices storage creation separately from execution gas, a policy creating a new slot would break the guarantee of the fixed gas budget G. onTaskCreated and deductions must only be callable by their own escrow.

Reference policy profile (optional)

The standard optionally presents a reference implementation. Taxes are read once from ITaxSchedule at task creation and locked to that task, so a later rate change does not affect tasks already created. Referral fees and loan repayments can only be assigned to a payee's own payout via assignPayment, cannot be revoked, and can only be released by that recipient via release. The sum of all deductions cannot exceed the cap set by maxDeductionBps, and tax is deducted first, followed by assignments in the order they were made.

A proposal still in Draft stage

This proposal is in Draft status, written in November 2026, and is still undergoing community discussion and implementation review. Interface identifiers or detailed requirements may change in future discussion, or the proposal itself may stall.

Things to watch out for

Original ERC · ← ERCs