Feat/restriction#833
Open
nafsonig wants to merge 11 commits into
Open
Conversation
|
@nafsonig is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@nafsonig Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
yusuftomilola
approved these changes
May 31, 2026
yusuftomilola
requested changes
May 31, 2026
Collaborator
yusuftomilola
left a comment
There was a problem hiding this comment.
Kindly resolve conflicts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I changed
Added new crate with whitelist implementation:
Wired the crate into the workspace:
Integrated opsce whitelist into assetsup:
opsce::whitelist.validate_transfer()to respect per-asset whitelist enforcement and, when enabled, require both sender and recipient be whitelisted.add_to_whitelist(env, asset_id, admin, address)(admin/tokenizer required)remove_from_whitelist(env, asset_id, admin, address)(admin/tokenizer required)set_whitelist_enabled(env, asset_id, admin, enabled)(admin/tokenizer required)is_whitelistedandget_whitelist(read-only)Updated tests to use the new admin wrappers and added enforcement toggle test:
Notes and assumptions
tokenizer(the same field used elsewhere). The public wrappers inAssetUpContractenforceadmin.require_auth()and check tokenizer equality; the underlyingopsceAPIs perform storage without auth so they can be reused across crates.(String, String, u64)namespace (("opsce","whitelist",asset_id)) to avoid coupling withassetsup'sTokenDataKeyenum serialization.env.mock_all_auths()is used in tests to satisfyrequire_auth().How you can run tests locally
Would you like me to run the test suite here (it will take some time), or commit these changes and open a PR?
Created 18 todos
Made changes.
Closes #823
Closes #818