code-423n4 / 2024-04-dyad-findings

8 stars 6 forks source link

Upgraded Q -> 2 from #1121 [1715338217668] #1304

Closed c4-judge closed 4 months ago

c4-judge commented 4 months ago

Judge has assessed an item in Issue #1121 as 2 risk. The relevant finding follows:

[L-04] Funding Exogenous vaults manipulate kerosine price kerosine value should represent degree of DYAD’s overcollateralization. as its value is determined using the total DYAD minted and the total value Locked.

Vault.kerosine.unbounded.sol#L60-L65

function assetPrice() ... returns (uint) { ... for (uint i = 0; i < numberOfVaults; i++) { Vault vault = Vault(vaults[i]); <@ tvl += vault.asset().balanceOf(address(vault))

If we donate the vaults, the donated funds will not be collateral funds, as they will be locked inside the Vault contract (can not be used to mint DYAD). This will make kerosine price deviate from the correct value it should represent (over-collateralization ratio), where the token price (kerosine) will increase thinking that there are a lot of collaterals for the stablecoin (DYAD), but in reality, these funds are locked in vaults and do not represent DYAD collaterals.

Recommendations It can be left as it is, as there are no impacts that can occur for that in my opinion. However, if the developers are interested in mitigation, they can track the balance internally.

c4-judge commented 4 months ago

This auto-generated issue was withdrawn by koolexcrypto

c4-judge commented 4 months ago

koolexcrypto marked the issue as grade-c