Differing percentage denominators causes confusion and potentially brick claims #53
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-03-joyn/blob/main/splits/contracts/Splitter.sol#L14
https://github.com/code-423n4/2022-03-joyn/blob/main/splits/contracts/Splitter.sol#L103
Vulnerability details
Details & Impact
There is a
PERCENTAGE_SCALE = 10e5
defined, but the actual denominator used is10000
. This is aggravated by the following factors:PERCENTAGE_SCALE
instead of10000
.Thus, if an incorrect denominator is used, the calculated claimable amount could exceed the actual available funds in the contract, causing claims to fail and funds to be permanently locked.
Recommended Mitigation Steps
Remove
PERCENTAGE_SCALE
because it is unused, or replace its value with10_000
and use that instead.P.S: there is an issue with the example scaled percentage given for platform fees
(5% = 200)
. Should be500
instead of200
.The text was updated successfully, but these errors were encountered: