Assessment reports>Metavest>Threat Model>repurchaseTokens

Function: repurchaseTokens(uint256 _amount)

This function is used to repurchase the tokens from the grantee by authority.

Inputs

  • _amount

    • Control: Arbitrary.

    • Constraints: Nonzero and less than repurchasable tokens.

    • Impact: Amount of tokens to repurchase.

Branches and code coverage

Intended branches

  • Calculate the repurchase amount using the provided _amount.

  • Transfer the payment token repurchase amount from the authority to the contract.

  • Transfer allocated tokens from the contract to the authority.

  • Update tokensRepurchased.

Negative behavior

  • Revert if the caller is not the authority.

  • Revert if this function is reentered.

  • Revert if this allocation is not terminated.

  • Revert if the amount is zero.

  • Revert if the amount is more than the repurchasable tokens.

Zellic © 2024Back to top ↑