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

Eresident only assets #410

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Eresident only assets #410

merged 2 commits into from
Nov 22, 2024

Conversation

kacperzuk-neti
Copy link
Collaborator

@kacperzuk-neti kacperzuk-neti commented Sep 27, 2024

First commit contains just vendoring-in pallet-assets, second commit contains actual changes.
DEX Liquidity Pool accounts are exempt from the eresidency restriction regardless the asset parameters set.

Known caveats:

  1. If eresident owns restricted assets and puts them in dex, he can transfer liquidity tokens to non-eresidents. These non-eresidents won't be able to withdraw the liquidity to get actual restricted assets though.
  2. Swaps on DEX can be triggered by non-eresidents as long as they set the immediate recipient of swap to valid eresident.

Sample guide on how to test:

  1. Alice (citizen) - assets.create
  2. Alice - assets.setParameters - eresidencyRequired: true
  3. Alice - assets.mint to Alice
  4. Alice - assets.transfer to Bob (citizen)
  5. Alice - assets.transfer to Ferdie (non-citizen, should fail with TokenBlocked)
  6. Alice - assetConversion.createPool with native
  7. Alice - assetConversion.addLiquidity
  8. Alice - assetConversion.swapTokensForExactTokens, swap Native to asset, should succeed
  9. Ferdie - assetConversion.swapTokensForExactTokens, swap Native to asset, should fail with TokenBlocked

@kacperzuk-neti kacperzuk-neti self-assigned this Sep 27, 2024
@kacperzuk-neti kacperzuk-neti force-pushed the eresident-only-assets branch 11 times, most recently from f760195 to e909984 Compare September 27, 2024 16:02
@kacperzuk-neti kacperzuk-neti marked this pull request as ready for review September 27, 2024 20:35
@DorianSternVukotic DorianSternVukotic force-pushed the eresident-only-assets branch 2 times, most recently from 35adf74 to d599765 Compare November 22, 2024 14:31
@DorianSternVukotic DorianSternVukotic merged commit 5219e5f into develop Nov 22, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants