The Contract
View Contract Code
View Contract Code
How It Works
transferFrom authenticates the spender
UserPublicKey. The owner and to are explicit
parameters — they are targets of the operation, not authorities.
Why this resists impersonation
_spendAllowance(owner, spender, amount) requires that the inner map
_allowances[owner][spender] already holds at least amount. Because the
allowance was written by owner against a specific spender public key, and
because spender here was just derived from the caller’s witness secret, the
caller must actually hold the spender’s secret. An attacker with no secret
cannot synthesise a passing proof, no matter what they read from the chain.
Infinite approval
MAX_UINT128, treat it as unlimited and skip
the decrement. Useful for long-lived integrations (e.g. a DEX).
Partial spending
Privacy Note
What’s Next
Token Approval
Back to granting approvals
ERC20 Token
Complete token implementation