Delegation
Taking offers on behalf of another address
Approve or Permit
A Taker Order on Mangrove can be sent on behalf of a taker, in which case the delegate taker needs to be approved or permitted to draw the required inbound tokens from the taker.
Alternatively, Mangrove allows the taker to permit a delegate taker to act on their behalf.
function permit(
address outbound_tkn,
address inbound_tkn,
address owner,
address spender,
uint value,
uint deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;(outbound_tkn, inbound_tkn)the outbound and inbound token of the offer list on which the Delegate Taker will be permitted to operate.ownerthe address of the taker providing the inbound tokens for the Delegate Taker.spenderthe address of the Delegate Taker.valuethe maximal amount of inbound tokens the Delegate Taker is permitted to use.deadlinethe block number beyond which the delegator's signature can no longer be used to obtain permission.(v,r,s)thesecp256k1signature identifying theownerof the delegated funds.
Delegated Order Taking
Once a Delegate Taker is approved or permitted by a taker, she can use the delegated Taker Orders variants marketOrderFor and snipesFor which work similarly to marketOrder and snipes but require an additional taker address.
// Delegated Market Order
function marketOrderFor(
address outbound_tkn,
address inbound_tkn,
uint takerWants,
uint takerGives,
bool fillWants,
address taker
) external returns (uint takerGot, uint takerGave);
// Delegated snipes
function snipesFor(
address outbound_tkn,
address inbound_tkn,
uint[4][] memory targets,
bool fillWants,
address taker
)
external
returns (
uint successes,
uint takerGot,
uint takerGave
);
Last updated