Assessment reports>Session Token>Threat Model>Function: updateRewardsBalance()

Function: updateRewardsBalance()

The function updates the rewards balance for a given recipient based on a verified BLS signature from the network.

Inputs

  • recipientAddress

    • Validation: recipientAddress must not be zero.

    • Impact: The address of the wallet that will receive the rewards.

  • recipientRewards

    • Validation: recipientRewards must be greater than the rewards that the recipientAddress has already received.

    • Impact: Token rewards of amount recipientRewards are given to recipientAddress.

  • blsSignature

    • Validation N/A.

    • Impact A parameter necessary to verify the encodedMessage generated in updateRewardsBalance.

  • ids

    • Validation The length of ids must not exceed 1/3 of the total number of signers, and under no circumstances can the length of ids exceed 300, which can be adjusted by setBLSNonSignerThresholdMax.

    • Impact The IDs of the signers to be excluded from the BLS public-key aggregation.

Branches and code coverage (including function calls)

Intended branches

Negative behavior

Function call analysis

  • validateSignatureOrRevert(ids, blsSignature, Hm) -> Pairing.pairing2(BN256G1.P1(), signature, BN256G1.negate(pubkey), hashToVerify)

    • External/Internal? Internal.

    • Argument control: ids, blsSignature, and Hm.

    • Impact: Aggregates the excluded signers (ids), updates the verification key, and verifies the encodedMessage (Hm) with the blsSignature.

Zellic © 2024Back to top ↑