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: 129/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/main/src/core/VaultManagerV2.sol#L156-L169
Collateral is a requirement before minting DYAD. The collateral should pass the collateral ratio when the time the minting of DYAD happened. When the collateral value is already below required collateral ratio, the user should give additional collateral in order to maintain the solvency of the account. If the user failed to give additional funds, his account is subject for liquidation.
function mintDyad( uint id, uint amount, address to ) external isDNftOwner(id) { uint newDyadMinted = dyad.mintedDyad(address(this), id) + amount; if (getNonKeroseneValue(id) < newDyadMinted) revert NotEnoughExoCollat(); dyad.mint(id, to, amount); if (collatRatio(id) < MIN_COLLATERIZATION_RATIO) revert CrTooLow(); emit MintDyad(id, amount, to); }
The problem with this, is a certain user (i.e. well funded adversary) can deliberately create a lot of small loan accounts via minting NFTs and cause insolvency to the protocol. The process is the user will let the accounts to be below collateral ratio and let the liquidation happened.
However, the liquidation might not happen because of loss of incentives or profit from the undertaking. The collateral of these small loan accounts can't cover the cost of gas transaction making it unprofitable to the liquidator. If the liquidation won't happen, this will result to bad debt to protocol.
Small loan accounts can't be liquidated that can cause losses to protocol.
Let's illustrate the scenario here.
Manual Review
Implement a minimum amount for minting DYAD that is profitable enough to be liquidated.
Other
#0 - c4-pre-sort
2024-04-27T17:33:16Z
JustDravee marked the issue as duplicate of #1258
#1 - c4-pre-sort
2024-04-29T09:16:44Z
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:33:10Z
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:52:14Z
koolexcrypto marked the issue as satisfactory
#6 - c4-judge
2024-05-28T20:06:28Z
koolexcrypto marked the issue as duplicate of #175