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
Our current implementation of CalcJoinPoolShares checks to make sure the number of denoms sent in for an all-asset join is correct (here), but has no check for whether those assets are actually the correct denoms. This makes it so that entirely invalid inputs (i.e. correct number of input tokens but incorrect denoms) successfully make it through the entire set of all-asset join calculations until they are incidentally caught in the tail-end single-asset join section in a check in updateIntermediaryPoolAssetsLiquidity.
I suggest we add an additional check to the input tokens that makes sure they are of the correct denoms so that the function never assumes invalid inputs are correct for calculating all-asset joins.
Suggested Design
Add a check here that makes sure that the denoms are equivalent as well (simplest way is probably just to use DenomSubsetOf to ensure both are denom subsets of each other)
Acceptance Criteria
All existing and new tests should pass
The text was updated successfully, but these errors were encountered:
AlpinYukseloglu
changed the title
Add check for correct input asset denoms to CalcJoinPoolShares
x/gamm: Add check for correct input asset denoms to CalcJoinPoolShares
Jun 30, 2022
Background
Our current implementation of
CalcJoinPoolShares
checks to make sure the number of denoms sent in for an all-asset join is correct (here), but has no check for whether those assets are actually the correct denoms. This makes it so that entirely invalid inputs (i.e. correct number of input tokens but incorrect denoms) successfully make it through the entire set of all-asset join calculations until they are incidentally caught in the tail-end single-asset join section in a check inupdateIntermediaryPoolAssetsLiquidity
.I suggest we add an additional check to the input tokens that makes sure they are of the correct denoms so that the function never assumes invalid inputs are correct for calculating all-asset joins.
Suggested Design
Acceptance Criteria
The text was updated successfully, but these errors were encountered: