Submitted by 0xRobocop, also found by josephdara, Kenshin, gs8nrv, caventa, smaul, RedTiger, and RedTiger
https://github.com/code-423n4/2023-06-lybra/blob/26915a826c90eeb829863ec3851c3c785800594b/contracts/lybra/configuration/LybraConfigurator.sol#L127 https://github.com/code-423n4/2023-06-lybra/blob/26915a826c90eeb829863ec3851c3c785800594b/contracts/lybra/configuration/LybraConfigurator.sol#L202
The documentation states that:
Hence, it is important to maintain the invariance between the relation of the safe collateral ratio (SCR) and the bad collateral ratio (BCR). Both functions setSafeCollateralRatio and setBadCollateralRatio at the LybraConfigurator contract run checks to ensure that the relation always holds.
The former is coded as:
The latter is coded as:
We take only the logic clause related to the relationship between the BCR and SCR:
We can see that the relationship is not coded correctly, we want the SCR always to be at least 10% higher than the BCR, so the correct check should be:
There is a path of actions that can lead to an SCR and a BCR that do not meet the requirement stated previously. For example:
Manual Review
Change:
to:
Invalid Validation
LybraFinance confirmed
For this audit, 42 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by 0xnev received the top score from the judge.
The following wardens also submitted reports: halden, D_Auditor, bart1e, RedOneN, MrPotatoMagic, solsaver, squeaky_cactus, hals, 0xnacho, 0xRobocop, kutugu, bytes032, RedTiger, Sathish9098, HE1M, Rolezn, naman1778, devival, seth_lawson, SanketKogekar, nonseodion, m_Rassska, Toshii, 0xkazim, 3agle, codetilda, Iurii3, CrypticShepherd, 0xbrett8571, yudan, ABAIKUNANBAEV, DelerRH, Kaysoft, Co0nan, Bauchibred, Timenov, y51r, Vagner, 8olidity, zaevlad, and totomanov.
