Assessment reports>SSI Protocol>Threat Model>addRedeemRequest

Function: addRedeemRequest(uint256 assetID, OrderInfo orderInfo, uint256 maxIssueFee)

The function creates a redeem request for the given asset and the given order. The in-token set of the order is checked to match the token set of the asset. If successful, the asset-token amount of the participant is transferred to the contract.

Inputs

  • assetID

    • Control: Fully controlled by the caller.

    • Constraints: The sender is checked to be a participant of the asset.

    • Impact: A non-participant cannot create a redeem request.

  • orderInfo

    • Control: Fully controlled by the caller.

    • Constraints: The order should not have been used before for the asset swap. The order hash should match the hash computed over the order structure. The signature of the order is verified to have been made by the order maker.

    • Impact: Prevents invalid order from being passed or replayed to the same swap.

  • maxIssueFee

    • Control: Fully controlled by the caller.

    • Constraints: The max fee is checked to be greater than the issue fee.

    • Impact: Prevents using an invalid fee.

Branches and code coverage

Intended branches

  • A redeem request is successfully created for a valid order and maximum fee. The token balances are updated correctly.

Negative behavior

  • A redeem request should revert when the sender is not a participant.

  • A redeem request should revert when the order is invalid.

  • A redeem request should revert when the order was already used for the same swap.

  • A redeem request should revert when the token sets mismatch.

  • A redeem request should revert when the chains in the order, in the factory, or in the token sets do not match.

  • A redeem request should revert when the balance of the in-token set is too low.

  • A redeem request should revert when some tokens are not whitelisted.

Zellic © 2025Back to top ↑