Skip to main content

Module chain

Module chain 

Source
Expand description

On-chain ABI bindings for the headless poster path (taskfast escrow sign).

Mirrors the JS wagmi bindings in assets/js/escrow_sign.js on the platform side. The two must stay byte-compatible: the Rust CLI pre-computes an escrowId that Solidity’s TaskEscrow.computeEscrowId re-derives post transfer — any drift and the signature the poster pre-signed becomes unusable.

§Fee-on-transfer caveat

TaskEscrow.open computes its on-chain escrowId using actualDeposit (the post-transfer balance delta, not the supplied deposit). For a standard ERC-20 the two are equal, so the prediction matches. A fee-on-transfer token would diverge — callers rely on the platform’s allowedTokens allowlist (fee-on-transfer excluded) to keep this safe.

§Why a separate module (not folded into signing.rs)

signing.rs is the EIP-712 typed-data surface (hash + sign primitives). These bindings are non-712: plain ABI sol! contract definitions used to encode calldata for approve/open. Keeping them separate keeps the signing module’s scope tight and avoids pulling ERC-20 view calls into a crate section that shouldn’t care about them.

Modules§

IERC20
Minimal ERC-20 surface needed to pre-flight the escrow deposit. Only approve, allowance, and balanceOf are bound; transfer is handled through the existing ERC-20 transfer helper in tempo_rpc.
TaskBond
TaskBond contract surface used by the auction-task operator bond flow (taskfast bond post, gh#95). Only post is bound. The server verifies the resulting BondPosted event by matching contract/token/taskRef/ amount — it does not pin salt, so any salt is accepted.
TaskEscrow
TaskEscrow contract surface used by the poster flow. Only the mutating functions needed for open / openWithMemo are bound — full surface lives in the platform’s Solidity source.

Structs§

EscrowIdParams
Inputs to compute_escrow_id — one named field per preimage element.

Constants§

ESCROW_STATE_DISPUTED
EscrowState::Disputed in ArbitratedEscrow.sol.

Functions§

compute_escrow_id
Predict the escrowId that ArbitratedEscrow.open will assign to a new escrow.
compute_task_ref
Derive the bytes32 taskRef that TaskBond.post binds for a given task.
decode_escrow_state
Decode the raw EscrowState byte (0 None … 5 Disputed) out of a getEscrow return.
decode_u256
Decode a single uint256 return (disputedAt, DISPUTE_TIMEOUT).
dispute_calldata
Calldata for ArbitratedEscrow.dispute(escrowId) (poster- or worker-signed dispute of a held escrow). The caller sends it from its own wallet.
dispute_timeout_calldata
Calldata for the view DISPUTE_TIMEOUT(); decode with decode_u256.
disputed_at_calldata
Calldata for the view disputedAt(escrowId); decode with decode_u256.
get_escrow_calldata
Calldata for the view getEscrow(escrowId); decode with decode_escrow_state.
timeout_resolve_calldata
Calldata for ArbitratedEscrow.timeoutResolveDispute(escrowId). Anyone may send it once disputedAt + DISPUTE_TIMEOUT has passed on a Disputed escrow.