Assessment reports>Alkimiya>Threat Model>setBalance

Function: setBalance(uint256 oldBalance, uint256 newBalance, uint256 balanceChange, bytes signature)

This function is used to set the balance accumulated by the shares.

Inputs

  • oldBalance

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Value of the old balance.

  • newBalance

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Value of the new balance.

  • balanceChange

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Value of the balance change.

  • signature

    • Control: Arbitrary.

    • Constraints: None.

    • Impact: Bytes signature.

Branches and code coverage

Intended branches

  • Updates the balance.

Negative behavior

  • Reverts if the caller is not a publisher.

  • Reverts if the old balance is not equal to the new balance.

  • Reverts if the balance change is not equal to the difference between the old and new balance.

  • Reverts if the signature is invalid; signer is not the calculator role.

Zellic © 2024Back to top ↑