Brilliant Cotton Puma
High
Whenever a user swaps stablecoins, through swap
or defiToStablecoinSwap
the number of tokens that need to be burned may be set to a new value:
if (fBalance - iBalance != 0) ss.oAmount = fBalance - iBalance;
This, however, is an issue as if the oAmount
of tokens changes, the tAmount
of tokens that will get minted stays the same. Thus, the wallet of the user will either receive more or fewer tokens than it should, depending on how oAmount
is updated.
In the swap
and defiToStablecoinSwap
functions of AmirX the oAmount
of the origin token may increase/decrease, however, the tAmount
of the target token stays the same. This issue cannot be prevented by the Swapper, as the tAmount
will be calculated based on the initial oAmount
, even if it later changes.
No response
No response
- Swapper initiates a swap with
oAmount = 1e18
andtAmount = 2e18
- The
oAmount
is set to 0.5e18 in theswap
function, however,tAmount
stays the same - Thus, the wallet will be minted two times the number of target tokens that they should have
A wallet may receive more/fewer tokens than intended, which is detrimental to the protocol.
No response
Make sure that tAmount
is recalculated if oAmount
has been updated.