-
Notifications
You must be signed in to change notification settings - Fork 277
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
feat!: Separate fungible and non-fungible assets #5308
Open
dima74
wants to merge
4
commits into
hyperledger-iroha:main
Choose a base branch
from
dima74:diralik/separate-store-assets
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat!: Separate fungible and non-fungible assets #5308
dima74
wants to merge
4
commits into
hyperledger-iroha:main
from
dima74:diralik/separate-store-assets
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
Signed-off-by: Dmitry Murzin <[email protected]>
s8sato
reviewed
Feb 10, 2025
s8sato
reviewed
Feb 10, 2025
)+}; | ||
} | ||
|
||
impl_froms_and_validate_grant_revoke!(CanUnregisterNft, CanTransferNft, CanModifyNftMetadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think NFT contents are meant to be modified by owners after registration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we should have the following rules, what do you think?
- Owner of
nft.domain
can unregister, transfer and modify NFT - Owner of NFT can only transfer NFT
Signed-off-by: Dmitry Murzin <[email protected]>
Signed-off-by: Dmitry Murzin <[email protected]>
Signed-off-by: Dmitry Murzin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
api-changes
Changes in the API for client libraries
config-changes
Changes in configuration and start up of the Iroha
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.
Context
Currently, there are two asset types:
Numeric
andStore
. Because they are quite different entities, it is proposed to separate them. See #4087 for details.AssetType
inconsistencies #4087Solution
This PR removes
Store
asset type and instead introduces newNft
entity.Nft
is similar toAssetDefinition
(from implementation point of view), see #4672 (comment) for types visualization.Naming:
nft$domain
asset#domain#account@domain
orasset##account@domain
ISI changes:
Register<Asset>
/Unregister<Asset>
Mint<Numeric, Asset>
/Burn<Numeric, Asset>
Transfer<Asset, Numeric, Account>
Transfer<Asset, Metadata, Account>
Metadata
argument is ignored. Also looks like we have bug in implementation, and asset is not moved, but copiedSetKeyValue<Asset>
RemoveKeyValue<ASset>
Mint<Numeric, Asset>
instead of register, andBurn<Numeric, Asset>
to zero value instead of unregister.Mint<Numeric, Asset>
/Burn<Numeric, Asset>
Transfer<Asset, Numeric, Account>
Register<Nft>
/Unregister<Nft>
Transfer<Account, NftId, Account>
SetKeyValue<Nft>
RemoveKeyValue<Nft>
Queries changes:
FindNfts
Permission changes:
CanRegisterAsset
/CanUnregisterAsset
CanModifyAssetMetadata
CanRegisterNft
/CanUnregisterNft
CanTransferNft
CanModifyNftMetadata
Migration Guide
AssetDefinition::store
,AssetType::Store
,AssetValue::Store
. UseNft
insteadRegister<Asset>
/Unregister<Asset>
ISI for numeric assets. UseMint<Numeric, Asset>
instead of register, andBurn<Numeric, Asset>
to zero value instead of unregister.Solution
sectionReview notes
Files with important changes:
crates/iroha_data_model/src/nft.rs
- New structsNft
andNftId
crates/iroha_data_model/src/asset.rs
- Changes toAsset
andAssetDefinition
crates/iroha_core/src/smartcontracts/isi/nft.rs
- ISI and Queries implementation for NFTcrates/iroha_executor/src/default/mod.rs
- default executorvisit_*
methods for NFTcrates/iroha_cli/src/main.rs
- CLI changesTodo:
Checklist
CONTRIBUTING.md
.