git.delta.rocks / unique-network / refs/commits / ce4a2a5245a8

difftreelog

chore fix formatting

Grigoriy Simonov2022-07-21parent: #069b0ad.patch.diff
in: master

2 files changed

modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
1616
17//! # Nonfungible Pallet EVM API17//! # Nonfungible Pallet EVM API
18//! 18//!
19//! Provides ERC-721 standart support implementation and EVM API for unique extensions for Nonfungible Pallet.19//! Provides ERC-721 standart support implementation and EVM API for unique extensions for Nonfungible Pallet.
20//! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods.20//! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods.
2121
46};46};
4747
48/// @title A contract that allows to set and delete token properties and change token property permissions.48/// @title A contract that allows to set and delete token properties and change token property permissions.
49/// 49///
50#[solidity_interface(name = "TokenProperties")]50#[solidity_interface(name = "TokenProperties")]
51impl<T: Config> NonfungibleHandle<T> {51impl<T: Config> NonfungibleHandle<T> {
52 /// @notice Set permissions for token property.52 /// @notice Set permissions for token property.
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
48//!48//!
49//! - **Burning:** The process of “deleting” a token from a collection and from49//! - **Burning:** The process of “deleting” a token from a collection and from
50//! an account balance of the owner.50//! an account balance of the owner.
51//! 51//!
52//! - **Nesting:** Setting up parent-child relationship between tokens. Nested tokens are inhereting52//! - **Nesting:** Setting up parent-child relationship between tokens. Nested tokens are inhereting
53//! owner from their parent. There could be multiple levels of nesting. Token couldn't be nested in53//! owner from their parent. There could be multiple levels of nesting. Token couldn't be nested in
54//! it's child token i.e. parent-child relationship graph shouldn't have cycles.54//! it's child token i.e. parent-child relationship graph shouldn't have cycles.
55//! 55//!
56//! - **Properties:** Key-Values pairs. Token properties are attached to a token. Collection properties are56//! - **Properties:** Key-Values pairs. Token properties are attached to a token. Collection properties are
57//! attached to a collection. Set of permissions could be defined for each property.57//! attached to a collection. Set of permissions could be defined for each property.
58//!58//!
83//! - `delete_collection_properties` - Remove properties from the collection.83//! - `delete_collection_properties` - Remove properties from the collection.
84//! - `set_property_permission` - Set collection property permission.84//! - `set_property_permission` - Set collection property permission.
85//! - `set_token_property_permissions` - Set token property permissions.85//! - `set_token_property_permissions` - Set token property permissions.
86//! 86//!
87//! ## Assumptions87//! ## Assumptions
88//!88//!
89//! * Total number of tokens of all types shouldn't be greater than `up_data_structs::MAX_TOKEN_PREFIX_LENGTH`.89//! * Total number of tokens of all types shouldn't be greater than `up_data_structs::MAX_TOKEN_PREFIX_LENGTH`.
369 }369 }
370370
371 /// Set the token property with the scope.371 /// Set the token property with the scope.
372 /// 372 ///
373 /// - `property`: Contains key-value pair.373 /// - `property`: Contains key-value pair.
374 pub fn set_scoped_token_property(374 pub fn set_scoped_token_property(
375 collection_id: CollectionId,375 collection_id: CollectionId,
401 }401 }
402402
403 /// Add or edit auxiliary data for the property.403 /// Add or edit auxiliary data for the property.
404 /// 404 ///
405 /// - `f`: function that adds or edits auxiliary data.405 /// - `f`: function that adds or edits auxiliary data.
406 pub fn try_mutate_token_aux_property<R, E>(406 pub fn try_mutate_token_aux_property<R, E>(
407 collection_id: CollectionId,407 collection_id: CollectionId,
424 }424 }
425425
426 /// Get all auxiliary data in a given scope.426 /// Get all auxiliary data in a given scope.
427 /// 427 ///
428 /// Returns iterator over Property Key - Data pairs.428 /// Returns iterator over Property Key - Data pairs.
429 pub fn iterate_token_aux_properties(429 pub fn iterate_token_aux_properties(
430 collection_id: CollectionId,430 collection_id: CollectionId,
565 ///565 ///
566 /// - `self_budget`: Limit for searching children in depth.566 /// - `self_budget`: Limit for searching children in depth.
567 /// - `breadth_budget`: Limit of breadth of searching children.567 /// - `breadth_budget`: Limit of breadth of searching children.
568 /// 568 ///
569 /// [`burn`]: struct.Pallet.html#method.burn569 /// [`burn`]: struct.Pallet.html#method.burn
570 #[transactional]570 #[transactional]
571 pub fn burn_recursively(571 pub fn burn_recursively(
607 }607 }
608608
609 /// Batch operation to add, edit or remove properties for the token609 /// Batch operation to add, edit or remove properties for the token
610 /// 610 ///
611 /// All affected properties should have mutable permission and sender should have611 /// All affected properties should have mutable permission and sender should have
612 /// permission to edit those properties. 612 /// permission to edit those properties.
613 /// 613 ///
614 /// - `nesting_budget`: Limit for searching parents in depth to check ownership.614 /// - `nesting_budget`: Limit for searching parents in depth to check ownership.
615 /// - `is_token_create`: Indicates that method is called during token initialization.615 /// - `is_token_create`: Indicates that method is called during token initialization.
616 /// Allows to bypass ownership check.616 /// Allows to bypass ownership check.
708 }708 }
709709
710 /// Batch operation to add or edit properties for the token710 /// Batch operation to add or edit properties for the token
711 /// 711 ///
712 /// Same as [`modify_token_properties`] but doesn't allow to remove properties712 /// Same as [`modify_token_properties`] but doesn't allow to remove properties
713 /// 713 ///
714 /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties714 /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties
715 pub fn set_token_properties(715 pub fn set_token_properties(
716 collection: &NonfungibleHandle<T>,716 collection: &NonfungibleHandle<T>,
731 }731 }
732732
733 /// Add or edit single property for the token733 /// Add or edit single property for the token
734 /// 734 ///
735 /// Calls [`set_token_properties`] internally735 /// Calls [`set_token_properties`] internally
736 /// 736 ///
737 /// [`set_token_properties`]: struct.Pallet.html#method.set_token_properties737 /// [`set_token_properties`]: struct.Pallet.html#method.set_token_properties
738 pub fn set_token_property(738 pub fn set_token_property(
739 collection: &NonfungibleHandle<T>,739 collection: &NonfungibleHandle<T>,
755 }755 }
756756
757 /// Batch operation to remove properties from the token757 /// Batch operation to remove properties from the token
758 /// 758 ///
759 /// Same as [`modify_token_properties`] but doesn't allow to add or edit properties759 /// Same as [`modify_token_properties`] but doesn't allow to add or edit properties
760 /// 760 ///
761 /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties761 /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties
762 pub fn delete_token_properties(762 pub fn delete_token_properties(
763 collection: &NonfungibleHandle<T>,763 collection: &NonfungibleHandle<T>,
779 }779 }
780780
781 /// Remove single property from the token781 /// Remove single property from the token
782 /// 782 ///
783 /// Calls [`delete_token_properties`] internally783 /// Calls [`delete_token_properties`] internally
784 /// 784 ///
785 /// [`delete_token_properties`]: struct.Pallet.html#method.delete_token_properties785 /// [`delete_token_properties`]: struct.Pallet.html#method.delete_token_properties
786 pub fn delete_token_property(786 pub fn delete_token_property(
787 collection: &NonfungibleHandle<T>,787 collection: &NonfungibleHandle<T>,
818 }818 }
819819
820 /// Set property permissions for the token.820 /// Set property permissions for the token.
821 /// 821 ///
822 /// Sender should be the owner or admin of token's collection.822 /// Sender should be the owner or admin of token's collection.
823 pub fn set_token_property_permissions(823 pub fn set_token_property_permissions(
824 collection: &CollectionHandle<T>,824 collection: &CollectionHandle<T>,
829 }829 }
830830
831 /// Set property permissions for the collection.831 /// Set property permissions for the collection.
832 /// 832 ///
833 /// Sender should be the owner or admin of the collection.833 /// Sender should be the owner or admin of the collection.
834 pub fn set_property_permission(834 pub fn set_property_permission(
835 collection: &CollectionHandle<T>,835 collection: &CollectionHandle<T>,
1250 }1250 }
12511251
1252 /// Check that `from` token could be nested in `under` token.1252 /// Check that `from` token could be nested in `under` token.
1253 /// 1253 ///
1254 pub fn check_nesting(1254 pub fn check_nesting(
1255 handle: &NonfungibleHandle<T>,1255 handle: &NonfungibleHandle<T>,
1256 sender: T::CrossAccountId,1256 sender: T::CrossAccountId,
1321 }1321 }
13221322
1323 /// Mint single NFT token.1323 /// Mint single NFT token.
1324 /// 1324 ///
1325 /// Delegated to [`create_multiple_items`]1325 /// Delegated to [`create_multiple_items`]
1326 ///1326 ///
1327 /// [`create_multiple_items`]: struct.Pallet.html#method.create_multiple_items1327 /// [`create_multiple_items`]: struct.Pallet.html#method.create_multiple_items