Delegation
Last updated
Last updated
Takers may provide allowances on specific offer lists, so other addresses (called "delegate takers") can execute market orders in their name. Allowance may be set using the approve
function, or through an permit using the permit
function.
Allowances are set on a token pair (A, B) without specifying tickSpacing
, meaning "delegate taker has the right to trade token A against token B at any tickSpacing
".
To set allowance, use either the permit
or approve
function:
Signature
permit()
(outbound_tkn, inbound_tkn)
the outbound and inbound tokens of the offer lists on which the Delegate Taker will be permitted to execute market orders.
owner
the address of the taker providing the permit.
spender
the address of the Delegate Taker.
value
the maximal amount of inbound tokens the Delegate Taker is permitted to spend.
deadline
the block number beyond which the delegator's signature can no longer be used to obtain permission.
approve()
(outbound_tkn, inbound_tkn)
the outbound and inbound tokens of the offer lists on which the Delegate Taker will be permitted to execute market orders.
spender
the address of the Delegate Taker.
value
the maximal amount of inbound tokens the Delegate Taker is permitted to spend.
msg.sender
is the taker who is approving spender
.
Once a Delegate Taker has an allowance from a taker, she can use the delegated market order variants marketOrderFor*
which work identically to the standard market order functions but require an additional taker
address:
(v,r,s)
the secp256k1
identifying the owner
.