-
Notifications
You must be signed in to change notification settings - Fork 16
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
Private token policy #195
Merged
Merged
Private token policy #195
Conversation
This file contains 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
Closed
wooglie
requested review from
jermaine150 and
ggobugi27
and removed request for
jermaine150
April 9, 2024 10:36
jermaine150
approved these changes
Apr 9, 2024
The failing test should be resolved with this PR #197 |
ggobugi27
requested changes
May 16, 2024
examples/policies/private-token-policy/private-token-policy-v1.pact
Outdated
Show resolved
Hide resolved
ggobugi27
approved these changes
May 16, 2024
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.
Private token policy
Private token policy allows creators to make an airdrop without revealing the metadata of the token beforehand. The token URI can be revealed at any time, making the metadata known to all.
Requirements:
Concrete policy
guard-policy
must be used in conjunction withprivate-token-policy
to make sure only an authorized account can update the token URI.While creating a token, the URI should be the hash of the actual URI. This can be calculated using a local call to the node so there is no trace recorded on the chain.
Note: token URI can still be updated by the
uri-guard
but only after revealing the initial URI.Specification, tables, capabilities, events:
Schemas:
revealed-tokens-schema
is a schema that stores which tokens have been revealedrevealed
: shows if the URI has been revealed.Tables:
revealed-tokens
table stores which tokens have been revealed.id
: the id of the tokenCapabilities:
GOVERNANCE
: enforces access control of contract upgrades.Events:
TOKEN_REVEALED (token-id uri)
: Emitted when the token URI has been revealed.Policy Functions
enforce-init
: Enforced duringmarmalade-v2.ledger.create-token
, and will ensure the concreteguard-policy
is present along with the URI guard.enforce-mint
: Enabled without limitation.enforce-burn
: Enabled without limitation.enforce-offer
: Enabled without limitation.enforce-buy
: Enabled without limitation.enforce-withdraw
: Enabled without limitation.enforce-transfer
: Enabled without limitation.enforce-update-uri
: Enforced duringmarmalade-v2.ledger.update-uri
, and will allow updating only if the token has been revealed before.reveal-uri
: Will make sure that the saved hash of the URI matches the hashed new URI and will invokemarmalade-v2.ledger.update-uri
.is-revealed
: Check if the URI has been revealed.