sherlock-audit / 2024-06-velocimeter-judging

11 stars 7 forks source link

Funny Merlot Yeti - Public checkpoint function from VotingEscrow performs state changes #707

Closed sherlock-admin4 closed 3 months ago

sherlock-admin4 commented 3 months ago

Funny Merlot Yeti

Low/Info

Public checkpoint function from VotingEscrow performs state changes

Summary

The checkpoint external function calls the _checkpoint internal function, which performs various internal state updates.

Vulnerability Detail

The external function named checkpoint does not have any access modifier, which means any entity can call it freely. The function calls the internal implementation _checkpoint, which records a new checkpoint by updating point_history, user_point_history and slope_changes

Looking at the reference contract, it seems that the _checkpoint function was not meant to be called by external actors.

Impact

Low impact;

Code Snippet

N/A

Tool used

Manual Review

Recommendation

Decide whether the checkpoint() external function is really needed. If it is needed, at least consider adding nonReentrant to it