-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Labels
Description
We have discovered an issue with account creation in both pallet_currency_swap and precompile_currency_swap in that they can both lead to the loss of funds when the amount swapped is smaller that the To currency existential deposit.
Currently, the account gets dusted before it is created.
We should change is the following ways:
- Use
try_mutate_accountif possible (maybe we can't though). - Handle the case where the value swapped is less than the existential deposit of the currency, and fail the swap operation. In substrate this is done usually at the pallet call level, so we should do the same: add the check to the
pallet_currency_swapandprecompile_currency_swapcalls.
Reactions are currently unavailable