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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

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 10 times, most recently from f908817 to f760195 Compare September 27, 2024 16:01
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.

1 participant