Assessment reports>Anzen and protocol-v2>Threat Model>Function: increaseLockPosition(uint128 additionalAmountToLock, uint128 newExpiry)

Function: increaseLockPosition(uint128 additionalAmountToLock, uint128 newExpiry)

The function increases the lock position of a user by adjusting both the amount locked and the expiration time.

Inputs

  • additionalAmountToLock

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: The parameter specifies how much additional Anzen is to be locked.

  • newExpiry

    • Control: Arbitrary.

    • Constraints: Must be a valid week start and within the allowed lock duration.

    • Impact: The parameter sets a new expiry date for the lock.

Branches and code coverage

Intended branches

  • Transfer additional Anzen from the user to the contract if additionalAmountToLock is greater than zero.

  • Call _increasePosition to internally update the user's locked position, the total supply, and the user's balance history.

Negative behavior

  • Revert if newExpiry results in an invalid lock duration or is otherwise inappropriate relative to the current time or lock policy.

Zellic © 2025Back to top ↑