Assessment reports>Cloak V1>Threat Model>claimFastWithdraw

Function: claimFastWithdraw(address l1Token, address to, uint256 amount, byte[32] messageHash, bytes signature)

A user submits a withdrawal request on Cloak, sets the contract FastWithdrawVault as the target address, and provides the actual recipient address in the payload. The Cloak sequencer checks if the transaction is valid. If the checks are passed, the user can fast-withdraw tokens through this function with the signature provided by the sequencer.

Inputs

  • l1Token

    • Control: Fully controlled by the caller.

    • Constraints: Must equal the l1Token encoded in the signed message.

    • Impact: The address of the token to be withdrawn.

  • to

    • Control: Fully controlled by the caller.

    • Constraints: Must equal the to encoded in the signed message.

    • Impact: The address of the recipient.

  • amount

    • Control: Fully controlled by the caller.

    • Constraints: Must equal the amount encoded in the signed message.

    • Impact: The amount of tokens to withdraw.

  • messageHash

    • Control: Fully controlled by the caller.

    • Constraints: Must equal the messageHash encoded in the signed message.

    • Impact: The corresponding withdraw-message hash on Cloak.

  • signature

    • Control: Fully controlled by the caller.

    • Constraints: Must be a valid EIP-712 signature over (l1Token, l2Token, to, amount, messageHash).

    • Impact: The signature of the message from the sequencer.

Branches and code coverage

Intended branches

  • This function emits the event Withdraw.

  • The user receives the token as expected.

  • The amount of the corresponding token held by the contract decreases.

Negative behavior

  • Reverts if the signer does not have SEQUENCER_ROLE.

  • Reverts if the signature is invalid.

  • Reverts if the fast withdraw is already processed.

Zellic © 2025Back to top ↑