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, andbalanceOfare bound;transferis handled through the existing ERC-20 transfer helper intempo_rpc. - Task
Bond - TaskBond contract surface used by the auction-task operator bond flow
(
taskfast bond post, gh#95). Onlypostis bound. The server verifies the resultingBondPostedevent by matching contract/token/taskRef/ amount — it does not pinsalt, so any salt is accepted. - Task
Escrow - TaskEscrow contract surface used by the poster flow. Only the mutating
functions needed for
open/openWithMemoare bound — full surface lives in the platform’s Solidity source.
Structs§
- Escrow
IdParams - Inputs to
compute_escrow_id— one named field per preimage element.
Constants§
- ESCROW_
STATE_ DISPUTED EscrowState::DisputedinArbitratedEscrow.sol.
Functions§
- compute_
escrow_ id - Predict the
escrowIdthatArbitratedEscrow.openwill assign to a new escrow. - compute_
task_ ref - Derive the
bytes32 taskRefthatTaskBond.postbinds for a given task. - decode_
escrow_ state - Decode the raw
EscrowStatebyte (0 None … 5 Disputed) out of agetEscrowreturn. - decode_
u256 - Decode a single
uint256return (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 withdecode_u256. - disputed_
at_ calldata - Calldata for the view
disputedAt(escrowId); decode withdecode_u256. - get_
escrow_ calldata - Calldata for the view
getEscrow(escrowId); decode withdecode_escrow_state. - timeout_
resolve_ calldata - Calldata for
ArbitratedEscrow.timeoutResolveDispute(escrowId). Anyone may send it oncedisputedAt + DISPUTE_TIMEOUThas passed on aDisputedescrow.