Platform: Code4rena
Start Date: 18/04/2024
Pot Size: $36,500 USDC
Total HM: 19
Participants: 183
Period: 7 days
Judge: Koolex
Id: 367
League: ETH
Rank: 128/183
Findings: 1
Award: $4.87
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: dimulski
Also found by: 0xleadwizard, 0xlemon, Aamir, Al-Qa-qa, AvantGard, Bauchibred, Cryptor, DarkTower, Egis_Security, Giorgio, Maroutis, MrPotatoMagic, OMEN, Ocean_Sky, Ryonen, SBSecurity, Sabit, SpicyMeatball, Stefanov, T1MOH, Tigerfrake, WildSniper, atoko, bhilare_, darksnow, fandonov, grearlake, iamandreiski, igdbase, pontifex, web3km, xiao
4.8719 USDC - $4.87
https://github.com/code-423n4/2024-04-dyad/blob/cd48c684a58158de444b24854ffd8f07d046c31b/src/core/VaultManagerV2.sol#L156-L169 https://github.com/code-423n4/2024-04-dyad/blob/cd48c684a58158de444b24854ffd8f07d046c31b/src/core/VaultManagerV2.sol#L205-L228
In the contract VaultManagerV2.sol
in function VaultManagerV2.sol::mintDyad
, there is no minimum mint value check. This can lead to bad debt for the liquidator.
uint public constant MIN_COLLATERIZATION_RATIO = 1.5e18; // 150% uint public constant LIQUIDATION_REWARD = 0.2e18; // 20%
For example lets say that the user deposits 500, for that amount he can get around 333.33 worth of stable coins. If we calculate the reward fee the liquidator gets it will be around 33. No liquidator will want to do this because the gas fees of transactions like this can be a lot higher depending on the state of the network, in this situation the liquidator can have bad debt.
With a MIN_COLLATERIZATION_RATIO of 150% if the user deposits 500, he gets 333.33 worth of stable coins.
After the VaultManagerV2.sol::burnDyad
function happens.
The LIQUIDATION_REWARD is 20% which will be around 33 in this situation.
When the network becomes highly congested, the price of gas can skyrocket to incredible levels. Which will lead to very high gas prices.
Manual review
Consider putting a MIN_MINT_VALUE check.
Context
#0 - c4-pre-sort
2024-04-28T03:28:57Z
JustDravee marked the issue as duplicate of #1258
#1 - c4-pre-sort
2024-04-29T09:21:09Z
JustDravee marked the issue as sufficient quality report
#2 - c4-judge
2024-05-03T14:07:47Z
koolexcrypto changed the severity to QA (Quality Assurance)
#3 - c4-judge
2024-05-12T09:32:52Z
koolexcrypto marked the issue as grade-c
#4 - c4-judge
2024-05-22T14:26:07Z
This previously downgraded issue has been upgraded by koolexcrypto
#5 - c4-judge
2024-05-28T16:51:53Z
koolexcrypto marked the issue as satisfactory
#6 - c4-judge
2024-05-28T20:06:10Z
koolexcrypto marked the issue as duplicate of #175