Function: unlock(address token, uint256 amount, address user, string hash, uint256 fee, bytes[] _signatures)

This function unlocks the tokens.

Inputs

  • token

    • Control: Fully controlled by the caller.

    • Constraints: Must be whitelisted.

    • Impact: Address of the token to unlock.

  • amount

    • Control: Fully controlled by the caller.

    • Constraints: Must be less than or equal to maxAmount and greater than or equal to minAmount.

    • Impact: Amount to unlock.

  • user

    • Control: Fully controlled by the caller.

    • Constraints: Must be signed with the ECDSA.

    • Impact: Address to transfer to.

  • hash

    • Control: Fully controlled by the caller.

    • Constraints: Must be signed with the ECDSA.

    • Impact: String for the unlockHash.

  • fee

    • Control: Fully controlled by the caller.

    • Constraints: Must be signed with the ECDSA.

    • Impact: Amount to take as a fee.

  • _signatures

    • Control: Fully controlled by the caller.

    • Constraints: Must be a valid signature.

    • Impact: Signature to check the signer.

Branches and code coverage

Intended branches

  • Check the signer.

  • Transfer the token or Ether to a given user address.

Negative behavior

  • Revert when the hash has been already used.

  • Revert when the signer is not the validator.

  • Revert when the token balance is not enough.

Zellic © 2025Back to top ↑