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: 148/183
Findings: 1
Award: $3.82
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xAlix2
Also found by: 0x486776, 0xabhay, 0xlucky, 0xtankr, Abdessamed, Circolors, CodeWasp, DarkTower, Egis_Security, Giorgio, Infect3d, Krace, KupiaSec, Limbooo, Maroutis, NentoR, Ryonen, SpicyMeatball, T1MOH, TheFabled, TheSavageTeddy, TheSchnilch, VAD37, XDZIBECX, btk, carrotsmuggler, cu5t0mpeo, dimulski, gumgumzum, iamandreiski, imare, itsabinashb, ke1caM, kennedy1030, lian886, n4nika, oakcobalt, sashik_eth, shaflow2, steadyman, web3km, windhustler, zhaojohnson
3.8221 USDC - $3.82
As mentioned in docs migration is going to happen from vaultManager to vaultManagerv2 , So during migration as mentioned in Deploy.V2.s.sol new WETH vault and new wSTETH vault will be deployed. And in that deploy script dyad is not deployed again. So considering that it can cause underflow in assetPrice and it will revert the function as in that numerator is calculated using above two values.
Also in observation 6.4 is mentioned that while calulating tvl, kerosene
vaults should not be consider. so only weth steth are remained.
"uint numerator = tvl - dyad.totalSupply();
here tvl will be totalvalue locked of vaults ( WETH and wSTETH ) which is calculated by balanceOf(address(vault)) , which will be very less when new vaults will be deployed of above 2 vaults.
But dyad contract address will be old only, dyad.totalSupply() would be very large.
And new deployed vaults would not be able to cope up with dyad totalsupply, so it will be less and underflow will occur and function will always revert, so we will not be to get assetprice from vault.kerosine.unbounded.sol .
Manual Review
So instead of getting value of number of token from balanceOf(addres(vault)) , it should be mantained via state variable (internal accounting), so that value can be maintained while migrating too.
Under/Overflow
#0 - c4-pre-sort
2024-04-27T18:17:29Z
JustDravee marked the issue as duplicate of #958
#1 - c4-pre-sort
2024-04-29T08:39:36Z
JustDravee marked the issue as sufficient quality report
#2 - c4-judge
2024-05-05T13:48:49Z
koolexcrypto marked the issue as duplicate of #308
#3 - c4-judge
2024-05-11T20:10:13Z
koolexcrypto marked the issue as satisfactory