Incorrectly checking for decimal1
with decimal0
.
#32
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-17
🤖_09_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2024-07-basin/blob/main/src/functions/Stable2.sol#L317
Vulnerability details
In the
Stable2.sol
contract thedecodeWellData
function responsible for decoding and validating token decimals from input data. And the function is intended to decode token decimals from the provided data and set default values if they are zero. However the function mistakenly checkeddecimal0
twice, which could lead to incorrect handling ofdecimal1
if it is set to 0.Impact
decimal1
might incorrectly set to 0 instead of 18.Proof of Concept
https://github.com/code-423n4/2024-07-basin/blob/main/src/functions/Stable2.sol#L317
Tools Used
Manual review.
Recommended Mitigation Steps
Consider replace
decimal0
todecimal1
in below function.Assessed type
Decimal
The text was updated successfully, but these errors were encountered: