Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dex swap will kill the account #2834

Open
zjb0807 opened this issue Dec 9, 2024 · 1 comment
Open

Dex swap will kill the account #2834

zjb0807 opened this issue Dec 9, 2024 · 1 comment

Comments

@zjb0807
Copy link
Member

zjb0807 commented Dec 9, 2024

In a swap transaction, in comes from the sender and out goes to the sender, so the sender should keep alive

Case 1:
When a user has ACA tokens and has bound their EVM address, swapping all ACA for DOT will result in the user being automatically unbound from the EVM address, and the nonce will be reset.
Solution: The FE should keep the ED when swapping all ACA

Case 2:
When a user holds ACA and 0.011 DOT (0.01 ED), and uses all ACA to exchange for ERC20 tokens, the following scenarios occur:

  • ACA is used to pay the transaction handling fee
  • DOT is used to pay the EVM storage fee
  • If the total funds do not meet the existential deposit (ED) requirements:
@xlc
Copy link
Member

xlc commented Dec 9, 2024

One solution is when account balances dropped to ED, put it to a queue instead of kill the account immediately. Then at end of the block (maybe on_idle), kill the account if the balances is still below ED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants