Assessment reports>Prisma Finance>Threat Models>registerAccountWeight

Function: registerAccountWeight(address account, uint256 minWeeks)

Record the current lock weights for account, which can then be used to vote.

Inputs

  • account

    • Control: Controlled by the user.

    • Constraints: N/A.

    • Impact: The voting power of this account is registered.

  • minWeeks

    • Control: Controlled by the user.

    • Constraints: Must be a nonnegative integer.

    • Impact: The minimum number of weeks-to-unlock to record weights for.

Branches and code coverage (including function calls)

Intended branches

  • Successful with recording for an account.

Negative behavior

  • Test with an account that has no active locks.

Function call analysis

  • registerAccountWeight -> _registerAccountWeight -> tokenLocker.getAccountActiveLocks(account,minWeeks)

    • What is controllable? account and minWeeks.

    • If return value controllable, how is it used and how can it go wrong? These variables are subsequently used to adjust the state of accountData. If the return values are manipulated, the state of accountData could be set improperly. For instance, if the return value for frozen is manipulated to a high value, the frozenWeight in accountData may be set to an unjustifiably high value.

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

Zellic © 2025Back to top ↑