Platform: Code4rena
Start Date: 19/10/2021
Pot Size: $30,000 ETH
Total HM: 5
Participants: 13
Period: 3 days
Judge: GalloDaSballo
Total Solo HM: 4
Id: 43
League: ETH
Rank: 9/13
Findings: 2
Award: $235.53
🌟 Selected for report: 0
🚀 Solo Findings: 0
pauliax
Functions that are never called by the contract itself and are meant to be invoked only from the outside, do not need to be 'public' and could be marked as 'external'.
#0 - kitti-katy
2021-10-21T21:36:26Z
duplicate of #2
#1 - GalloDaSballo
2021-11-01T16:35:18Z
Duplicate of #2
pauliax
function addValidator should validate that commissionRate < divider. As seen in setValidatorCommissionRate, commissionRate cannot exceed 100% (divider), however this is not ensured in function addValidator.
require(commissionRate < divider, "Rate must be less than 100%");
#0 - kitti-katy
2021-10-21T21:37:21Z
duplicate of #20
#1 - GalloDaSballo
2021-11-02T00:52:18Z
Duplicate of #20
pauliax
Using the unchecked keyword to avoid redundant arithmetic checks and save gas when an underflow/overflow cannot happen. E.g. 'unchecked' can be applied in the following lines of code since there are require statements before to ensure the arithmetic operations would not cause an integer underflow or overflow: require(rewardsLocked >= amount, "Amount is greater than available"); rewardsLocked -= amount; or
uint128 commissionLeftOver = amount < v.commissionAvailableToRedeem ? v.commissionAvailableToRedeem - amount : 0;
Consider if you want to apply this keyword and then carefully select where it is safe to do this.
#0 - kitti-katy
2021-10-21T21:49:39Z
duplicate of #52
#1 - GalloDaSballo
2021-11-01T16:35:52Z
Duplicate of #52