I am using an ICRC2 ledger and want to ensure that only specific principals from my whitelist are allowed to receive my ICRC2 tokens. However, I don’t want these restrictions to apply only within my dApp—I want them to be enforced across all platforms, including ICP Swap and NNS.
Is it possible to implement such a restriction? If so, how can it be achieved?
Can you be more specific? The code I gave you in the other thread gives you an allow list your app canister can manage and only the people on that list can move tokens around via transfer or approve.
If you want your dapp to be gated by a balance on that ledger you would just use balance of. If the code is not clear or you would like to adapt the strategy, please ask a question and I’ll be happy to help.
Thank you for the clarification! What I’m asking is whether this code will also enforce my restriction outside of my dApp (like in nns if I send my token there)—preventing people from receiving tokens unless they are on the whitelist—or if the restriction only applies within my dApp.
The code is for a token canister. The canister will only transfer and approve to accounts on the whitelist. Your dapp can trade those tokens but only if they are on the whitelist. Other apps can only trade those if they are on the whitelist,