difftreelog
chore fix formatting
in: master
2 files changed
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -15,7 +15,7 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
//! # Nonfungible Pallet EVM API
-//!
+//!
//! Provides ERC-721 standart support implementation and EVM API for unique extensions for Nonfungible Pallet.
//! Method implementations are mostly doing parameter conversion and calling Nonfungible Pallet methods.
@@ -46,7 +46,7 @@
};
/// @title A contract that allows to set and delete token properties and change token property permissions.
-///
+///
#[solidity_interface(name = "TokenProperties")]
impl<T: Config> NonfungibleHandle<T> {
/// @notice Set permissions for token property.
@@ -212,9 +212,9 @@
}
/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
- /// @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC
- /// 3986. The URI may point to a JSON file that conforms to the "ERC721
- /// Metadata JSON Schema".
+ /// @dev Throws if `tokenId` is not a valid NFT. URIs are defined in RFC
+ /// 3986. The URI may point to a JSON file that conforms to the "ERC721
+ /// Metadata JSON Schema".
/// @return token's const_metadata
#[solidity(rename_selector = "tokenURI")]
fn token_uri(&self, token_id: uint256) -> Result<string> {
@@ -241,9 +241,9 @@
#[solidity_interface(name = "ERC721Enumerable")]
impl<T: Config> NonfungibleHandle<T> {
/// @notice Enumerate valid NFTs
- /// @param index A counter less than `totalSupply()`
- /// @return The token identifier for the `index`th NFT,
- /// (sort order not specified)
+ /// @param index A counter less than `totalSupply()`
+ /// @return The token identifier for the `index`th NFT,
+ /// (sort order not specified)
fn token_by_index(&self, index: uint256) -> Result<uint256> {
Ok(index)
}
@@ -255,8 +255,8 @@
}
/// @notice Count NFTs tracked by this contract
- /// @return A count of valid NFTs tracked by this contract, where each one of
- /// them has an assigned and queryable owner not equal to the zero address
+ /// @return A count of valid NFTs tracked by this contract, where each one of
+ /// them has an assigned and queryable owner not equal to the zero address
fn total_supply(&self) -> Result<uint256> {
self.consume_store_reads(1)?;
Ok(<Pallet<T>>::total_supply(self).into())
pallets/nonfungible/src/lib.rsdiffbeforeafterboth48//!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 from50//! 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 inhereting53//! 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 in54//! 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 are57//! 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//! ## Assumptions88//!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 }370370371 /// 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 }402402403 /// 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 }425425426 /// 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.burn570 #[transactional]570 #[transactional]571 pub fn burn_recursively(571 pub fn burn_recursively(607 }607 }608608609 /// Batch operation to add, edit or remove properties for the token609 /// Batch operation to add, edit or remove properties for the token610 /// 610 ///611 /// All affected properties should have mutable permission and sender should have611 /// All affected properties should have mutable permission and sender should have612 /// 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 }709709710 /// Batch operation to add or edit properties for the token710 /// Batch operation to add or edit properties for the token711 /// 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 properties713 /// 713 ///714 /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties714 /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties715 pub fn set_token_properties(715 pub fn set_token_properties(716 collection: &NonfungibleHandle<T>,716 collection: &NonfungibleHandle<T>,731 }731 }732732733 /// Add or edit single property for the token733 /// Add or edit single property for the token734 /// 734 ///735 /// Calls [`set_token_properties`] internally735 /// Calls [`set_token_properties`] internally736 /// 736 ///737 /// [`set_token_properties`]: struct.Pallet.html#method.set_token_properties737 /// [`set_token_properties`]: struct.Pallet.html#method.set_token_properties738 pub fn set_token_property(738 pub fn set_token_property(739 collection: &NonfungibleHandle<T>,739 collection: &NonfungibleHandle<T>,755 }755 }756756757 /// Batch operation to remove properties from the token757 /// Batch operation to remove properties from the token758 /// 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 properties760 /// 760 ///761 /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties761 /// [`modify_token_properties`]: struct.Pallet.html#method.modify_token_properties762 pub fn delete_token_properties(762 pub fn delete_token_properties(763 collection: &NonfungibleHandle<T>,763 collection: &NonfungibleHandle<T>,779 }779 }780780781 /// Remove single property from the token781 /// Remove single property from the token782 /// 782 ///783 /// Calls [`delete_token_properties`] internally783 /// Calls [`delete_token_properties`] internally784 /// 784 ///785 /// [`delete_token_properties`]: struct.Pallet.html#method.delete_token_properties785 /// [`delete_token_properties`]: struct.Pallet.html#method.delete_token_properties786 pub fn delete_token_property(786 pub fn delete_token_property(787 collection: &NonfungibleHandle<T>,787 collection: &NonfungibleHandle<T>,818 }818 }819819820 /// 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 }830830831 /// 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 }125112511252 /// 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 }132213221323 /// 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