Function: settle(IERC20[] tokens, uint256[] clearingPrices, Trade[] trades, Action[][Literal(value=3, unit=None)] actions)
This function is a decentralized batch-settlement system where the authorized solver submits the optimal batch-settlement solution.
Inputs
tokensControl: Full control.
Constraints: None.
Impact: An array of ERC-20 tokens to be traded in the settlement.
clearingPricesControl: Full control.
Constraints: The length must be the same as the length of the
tokensarray, and the price value cannot be0(which will cause a division-by-zero error).Impact: An array of token-clearing prices.
tradesControl: Full control.
Constraints: Each trade must have a valid user signature,
tokenInIndexandtokenOutIndexmust be within the range of thetokensarray,validTomust be greater than or equal toblock.timestamp,feeAmountmust be less thanamountIn, the order cannot have been filled or canceled, and the actual output amount must be greater than or equal tominAmountOut.Impact: Structure representing a trade to be executed in a settlement.
actionsControl: Full control.
Constraints:
action.targetcannot be aVAULT_RELAYERaddress.Impact: Structure representing an action to be executed during settlement.
Branches and code coverage
Intended branches
Negative behavior