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 therecipientAddress
has already received.Impact: Token rewards of amount
recipientRewards
are given torecipientAddress
.
blsSignature
Validation N/A.
Impact A parameter necessary to verify the
encodedMessage
generated inupdateRewardsBalance
.
ids
Validation The length of
ids
must not exceed 1/3 of the total number of signers, and under no circumstances can the length ofids
exceed 300, which can be adjusted bysetBLSNonSignerThresholdMax
.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
, andHm
.Impact: Aggregates the excluded signers (
ids
), updates the verification key, and verifies theencodedMessage
(Hm
) with theblsSignature
.