GEY-10: Function Comment Inconsistency
thegostep opened this issue · comments
type | severity | location |
---|---|---|
Inconsistency | Medium | https://github.com/ampleforth/token-geyser-v2/blob/c970676aaecb08e942fe1088a4b1ddcb26655fe6/contracts/Geyser.sol%23L856 |
Inconsistency | Medium | https://github.com/ampleforth/token-geyser-v2/blob/c970676aaecb08e942fe1088a4b1ddcb26655fe6/contracts/Geyser.sol%23L887-L889 |
Description:
The stake function comments denote that the totalStakeUnits should be adjusted when a stake occurs. However, the implementation of stake adjusts the units only before submitting the new stake and does not update the totalStakeUnits after, as unstakeAndClaim does.
Recommendation:
We advise that this discrepancy is investigated and properly remediated to ensure the accounting mechanisms of the Geyser operate correctly.
This is expected behavior as modifying totalStakeUnits in the stake
function after the initial update would be a noop given no time has elapsed.
The comment mentioning increase _geyser.totalStakeUnits
is meant to represent the modification made by the _updateTotalStakeUnits()
call exclusively.
Please let me know if this explanation addresses the concern sufficiently.