code-423n4 / 2022-05-vetoken-findings

1 stars 1 forks source link

QA Report #268

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago
GalloDaSballo commented 2 years ago

No need to use SafeMath with Solidity version >0.8:

Valid Refactor

contract VoterProxy does not explicitly implement IStaker interface. It causes some confusion, e.g. the declaration of interface and implementation contracts differ:

Valid Refactor

 setOwner could be a 2-step (propose-accept) process to avoid accidental errors.

NC

In VoterProxy when an operator deposits a new token, it is added to the list of protectedTokens.

I must disagree in lack of further details over this refactoring, removing protectedTokens is a rug vector

You can make event parameters 'indexed' to allow for filtering, e.g. hash in VoteSet:

For this event, valid NC

function voteGaugeWeight could validate that the lengths of _tokenVote and _weight are equal.

Valid R (reverts on failure)

You can use built-in time keywords, e.g. here:

Valid R

safeApprove is deprecated, see: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol#L39-L44

Valid NC for this codebase

The protocol does not support fee on transfer and other weird tokens, e.g.:

Valid Low (may bump based on other findings)

Functions are not protected from re-entrancy. Some of them do not follow the Check-Effects-Interactions pattern, thus can be exploited if the call target contains the transfer hook. For example, here it first transfers the token and only then updates the supply:

Valid Low

totalWeight might be 0, because updateveAssetWeight does not enforce minimum total weight, thus it is possible that rewardClaimed function will revert in runtime here making the users not being able to get their rewards:

Valid Low (may bump based on other findings)

Good report, short and sweet, would benefit by having better formatted headlines (the dotted list looks odd as you can see above)

GalloDaSballo commented 2 years ago

3L 4R 3NC

GalloDaSballo commented 2 years ago

TODO - Raise:

The protocol does not support fee on transfer and other weird tokens, e.g.: - > M-25

New Score: 2L 4R 3NC