The getLockedBalance function in the veRAACToken contract incorrectly references the locks mapping instead of the _lockState.locks mapping, leading to inaccurate balance readings for locked tokens.
The function getLockedBalance is designed to return the amount of RAAC tokens locked by a specific account.
However, it retrieves this data from the locks mapping, which is unused in the contract. The correct data source should be the _lockState.locks mapping, which contains the actual lock state. This discrepancy causes the function to return stale or zero values, even when valid locks exist in _lockState.
This bug can lead to incorrect reporting of locked balances. Users may be unable to verify their locked balances correctly, leading to confusion and potential loss of trust in the protocol.
Manual review
Update the function to reference _lockState.locks instead of locks:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.