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:
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.
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:
Alice (citizen) - assets.create
Alice - assets.setParameters - eresidencyRequired: true
Alice - assets.mint to Alice
Alice - assets.transfer to Bob (citizen)
Alice - assets.transfer to Ferdie (non-citizen, should fail with TokenBlocked)
Alice - assetConversion.createPool with native
Alice - assetConversion.addLiquidity
Alice - assetConversion.swapTokensForExactTokens, swap Native to asset, should succeed
Ferdie - assetConversion.swapTokensForExactTokens, swap Native to asset, should fail with TokenBlocked
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:
Sample guide on how to test: