You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some multi asset pods cannot be used by some users as the required deposit amounts are of extremely disproportionate values thus preventing (small) users from using the POD
The problem is that certain pods will not allow users to bond asset in them due to dispropotionated value of assets needed to do the bonding as described in details below
Cosnsider a pod created with 3 asset and respective weights as shown below
A user trying to bond asset and wrap into the pod token will be required to be well funded in the asset with the least weight as described in detail in the Root Cause section.
Impact
This can lead to a DOS for some users as they will not be able to use certain PODs
PoC
Check Root Cause section
Mitigation
A trivial solution cannot be recommended for this.
The text was updated successfully, but these errors were encountered:
Bent Beige Dachshund
High
Some users may not be able to use some multi pods
Summary
Some multi asset pods cannot be used by some users as the required deposit amounts are of extremely disproportionate values thus preventing (small) users from using the POD
https://github.com/sherlock-audit/2025-01-peapods-finance/blob/main/contracts/contracts/WeightedIndex.sol#L139-L171
Root Cause
The problem is that certain pods will not allow users to bond asset in them due to dispropotionated value of assets needed to do the bonding as described in details below
Cosnsider a pod created with 3 asset and respective weights as shown below
indexTokens[0].token
= DAI,indexTokens[0].weighting
= 40indexTokens[1].token
= ETH,indexTokens[1].weighting
= 20indexTokens[2].token
= USDC,indexTokens[2].weighting
= 40From the above,
_xX96
is evaluted asindexTokens[0].q1
is evaluated asindexTokens[1].q1
is evaluated asindexTokens[2].q1
is evaluated asAssuming
totalSupply == 0
(i.e)_firstIn
andbond()
is called with_token
= DAI_amount
= 1000e18_tokenAmtSupplyRatioX96
. =FixedPoint96.Q96
The loop on L161 is used to calculate the amount of each
indexTokens
that the depositor needs to deposit_sourceTokenIdx
= DAI and_sourceAmount
= 1000e18,i
= 0indexTokens[_targetTokenIdx].weighting
= 40indexTokens[_sourceTokenIdx].weighting
= 40_targetToken
= DAIi
= 1indexTokens[_targetTokenIdx].weighting
= 20indexTokens[_sourceTokenIdx].weighting
= 40_targetToken
= ETHi
= 2indexTokens[_targetTokenIdx].weighting
= 40indexTokens[_sourceTokenIdx].weighting
= 40_targetToken
= USDCAs you can see from the calculations above, notice that for minting about1000e18 pTKNs the user needed to provide
If you increase these numbers by a factor of 10 say 10K DAI, the amount of ETH become 14million too and so on.
This can render the POD useless except for well funded users if there exist susch that are wiling to take execute such bonds.
Internal Pre-conditions
NIL
External Pre-conditions
NIL
Attack Path
Cosnsider a pod created with 3 asset and respective weights as shown below
indexTokens[0].token
= DAI,indexTokens[0].weighting
= 40indexTokens[1].token
= ETH,indexTokens[1].weighting
= 20indexTokens[2].token
= USDC,indexTokens[2].weighting
= 40A user trying to bond asset and wrap into the pod token will be required to be well funded in the asset with the least weight as described in detail in the Root Cause section.
Impact
This can lead to a DOS for some users as they will not be able to use certain PODs
PoC
Check Root Cause section
Mitigation
A trivial solution cannot be recommended for this.
The text was updated successfully, but these errors were encountered: