github PolymeshAssociation/Polymesh v5.3.0
Polymesh v5.3.0

latest releases: v6.3.4, v6.3.3, v6.3.2...
18 months ago

Adds a basic pallet for non-fungible tokens. Users should be able to create collections, issue and redeem NFTs. The settlement and portfolio pallets have also been changed to allow transferring NFTs and moving them between portfolios.

changelog

new features

  • Adds the NFT Pallet:
    • create_nft_collection extrinsic
    • issue_nft extrinsic
    • redeem_nft extirinsic
  • Enhances the Settlement pallet to allow NFTs transfer:
    • add_instruction_with_memo_v2extrinsic
    • add_and_affirm_instruction_with_memo_v2 extrinsic
    • affirm_instruction_v2 extrinsic
    • withdraw_affirmation_v2 extrinsic
    • reject_instruction_v2 extrinsic
  • Enhances the Portfolio pallet to allow moving NFTs between portfolios:
    • move_portfolio_funds_v2 extrinsic
  • Adds nft_validateNFTTransfer rpc call

modified API

  • The following events have been added to the Settlement pallet:
    • InstructionV2Created
  • The following errors have been added to the Settlement pallet:
    • DuplicatedNFTId, InvalidLegAsset, MaxNumberOfNFTsExceeded, MaxNumberOfNFTsPerLegExceeded, NumberOfTransferredNFTsUnderestimated, DeprecatedCallOnV2Instruction, ReceiptForNonFungibleAsset
  • The following events have been added to the Portfolio pallet:
    • NFTsMovedBetweenPortfolios, FungibleTokensMovedBetweenPortfolios
  • The following errors have been added to the Portfolio pallet:
    • NFTNotFoundInPortfolio, NFTAlreadyLocked, NFTNotLocked, InvalidTransferNFTNotOwned, InvalidTransferNFTIsLocked
  • Adds the following error variants to the asset pallet:
    • UnexpectedNonFungibleToken, IncompatibleAssetTypeUpdate;
  • Adds NonFungible(NonFungibleType) to AssetType:
  • Adds remove_local_metadata_key to remove (non-locked) local metadata keys
  • Adds remove_metadata_value for managing metadata
  • Adds the InvalidNFTTransferCountOverflow, InvalidNFTTransferInsufficientCount, MaxNumberOfNFTsPerLegExceeded, ZeroCount, DuplicatedNFTId error variants to the NFT pallet;
  • Removes the InvalidNFTTransferBalanceOverflow, InvalidNFTTransferNoBalance, error variants from the NFT pallet;
  • Removes DuplicatedNFTId error variant from the setlement pallet
  • Adds execute_scheduled_instruction_v2 extrinsic

modified logic

  • delete_portfolio will also check for NFTs. If there are NFTs when trying to delete a portfolio, the function will return a PortfolioNotEmpty error.
  • base_update_asset_type fails updating a fungible asset to a non-fungible one, and the other way around.
  • unsafe_transfer, _mint, base_make_divisible, and base_redeem return an error for non-fungible tokens.
  • Adds the weight of executing the instruction to add_and_affirm_instruction_with_memo_v2 and add_instruction_with_memo_v2.
  • Throw error InvestorUniquenessNotAllowed if Asset.create_asset is called with disable_iu: false.

Don't miss a new Polymesh release

NewReleases is sending notifications on new releases.