Function: lock(address _account, uint256 _amount, uint256 _weeks)

Deposit tokens into the contract to create a new lock.

Inputs

  • _account

    • Control: Controlled by the user.

    • Constraints: N/A.

    • Impact: Address to create a new lock for.

  • _amount

    • Control: Controlled by the user.

    • Constraints: Must be a positive value.

    • Impact: Amount of tokens to lock.

  • _weeks

    • Control: Controlled by the user.

    • Constraints: Must be greater than zero and not exceed MAX_LOCK_WEEKS.

    • Impact: The number of weeks for the lock.

Branches and code coverage (including function calls)

Intended branches

  • Successfully create a new lock.

Function call analysis

  • lock -> lockToken.transferToLocker(msg.sender, _amount * lockToTokenRatio)

    • What is controllable? _amount * lockToTokenRatio.

    • If return value controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters, or does other unusual control flow? N/A.

Zellic © 2025Back to top ↑