DYAD - xiao's results

The first capital efficient overcollateralized stablecoin.

General Information

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

DYAD

Findings Distribution

Researcher Performance

Rank: 133/183

Findings: 1

Award: $4.87

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

4.8719 USDC - $4.87

Labels

bug
2 (Med Risk)
satisfactory
sufficient quality report
:robot:_11_group
duplicate-175

External Links

Lines of code

https://github.com/code-423n4/2024-04-dyad/blob/main/src/core/VaultManagerV2.sol#L156-L169

Vulnerability details

Impact

mintDyad allows casting any small value. In the case of liquidation, small debts are not interesting to the liquidator because the gas costs will be greater than the potential benefits of liquidation.

Proof of Concept

https://github.com/code-423n4/2024-04-dyad/blob/main/src/core/VaultManagerV2.sol#L156-L169

  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 mintDyad function allows any address to mint any amount of dyad stablecoins. It only checks getNonKeroseneValue and collatRatio, but does not limit the minimum value of minting. This will cause a problem. Currently, the liquidator receives 10% of the liquidation debt, and transactions on the mainnet do not not cheap. So, in order to make liquidation attractive to liquidators, the gas fee should be less than the liquidation proceeds, if a lot of people make 10 $dyad (and then provide 20 $collateral) and those positions will drop, then the tx cost may be higher than 1$ profit. As a result, liquidators will ignore accounts that will generate bad debts, stable coins will no longer be fully supported and will eventually decouple.

Tools Used

Manual review

A potential fix could be to only allow users to mint dyad if their collateral value is past a certain threshold.

Assessed type

Other

#0 - c4-pre-sort

2024-04-29T05:50:26Z

JustDravee marked the issue as duplicate of #1258

#1 - c4-pre-sort

2024-04-29T09:20:51Z

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:16Z

koolexcrypto marked the issue as grade-c

#4 - c4-judge

2024-05-22T14:26:06Z

This previously downgraded issue has been upgraded by koolexcrypto

#5 - c4-judge

2024-05-28T16:52:21Z

koolexcrypto marked the issue as satisfactory

#6 - c4-judge

2024-05-28T20:06:30Z

koolexcrypto marked the issue as duplicate of #175

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter