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

difftreelog

source

js-packages/evm-abi/api/CollectionHelpers.sol8.4 KiBsourcehistory
1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7interface Dummy {89}1011interface ERC165 is Dummy {12	function supportsInterface(bytes4 interfaceID) external view returns (bool);13}1415/// @dev inlined interface16interface CollectionHelpersEvents {17	event CollectionCreated(address indexed owner, address indexed collectionId);18	event CollectionDestroyed(address indexed collectionId);19	event CollectionChanged(address indexed collectionId);20}2122/// @title Contract, which allows users to operate with collections23/// @dev the ERC-165 identifier for this interface is 0x94e5af0d24interface CollectionHelpers is Dummy, ERC165, CollectionHelpersEvents {25	/// Create a collection26	/// @return address Address of the newly created collection27	/// @dev EVM selector for this function is: 0x72b5bea7,28	///  or in textual repr: createCollection((string,string,string,uint8,uint8,(string,bytes)[],(string,(uint8,bool)[])[],(address,uint256)[],(bool,bool,address[]),(uint8,uint256)[],(address,uint256),uint8))29	function createCollection(CreateCollectionData memory data) external payable returns (address);3031	/// Create an NFT collection32	/// @param name Name of the collection33	/// @param description Informative description of the collection34	/// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications35	/// @return address Address of the newly created collection36	/// @dev EVM selector for this function is: 0x844af658,37	///  or in textual repr: createNFTCollection(string,string,string)38	function createNFTCollection(39		string memory name,40		string memory description,41		string memory tokenPrefix42	) external payable returns (address);4344	// /// Create an NFT collection45	// /// @param name Name of the collection46	// /// @param description Informative description of the collection47	// /// @param tokenPrefix Token prefix to represent the collection tokens in UI and user applications48	// /// @return address Address of the newly created collection49	// /// @dev EVM selector for this function is: 0xe34a6844,50	// ///  or in textual repr: createNonfungibleCollection(string,string,string)51	// function createNonfungibleCollection(string memory name, string memory description, string memory tokenPrefix) external payable returns (address);5253	/// @dev EVM selector for this function is: 0xab173450,54	///  or in textual repr: createRFTCollection(string,string,string)55	function createRFTCollection(56		string memory name,57		string memory description,58		string memory tokenPrefix59	) external payable returns (address);6061	/// @dev EVM selector for this function is: 0x7335b79f,62	///  or in textual repr: createFTCollection(string,uint8,string,string)63	function createFTCollection(64		string memory name,65		uint8 decimals,66		string memory description,67		string memory tokenPrefix68	) external payable returns (address);6970	/// @dev EVM selector for this function is: 0x85624258,71	///  or in textual repr: makeCollectionERC721MetadataCompatible(address,string)72	function makeCollectionERC721MetadataCompatible(address collection, string memory baseUri) external;7374	/// @dev EVM selector for this function is: 0x564e321f,75	///  or in textual repr: destroyCollection(address)76	function destroyCollection(address collectionAddress) external;7778	/// Check if a collection exists79	/// @param collectionAddress Address of the collection in question80	/// @return bool Does the collection exist?81	/// @dev EVM selector for this function is: 0xc3de1494,82	///  or in textual repr: isCollectionExist(address)83	function isCollectionExist(address collectionAddress) external view returns (bool);8485	/// @dev EVM selector for this function is: 0xd23a7ab1,86	///  or in textual repr: collectionCreationFee()87	function collectionCreationFee() external view returns (uint256);8889	/// Returns address of a collection.90	/// @param collectionId  - CollectionId  of the collection91	/// @return eth mirror address of the collection92	/// @dev EVM selector for this function is: 0x2e716683,93	///  or in textual repr: collectionAddress(uint32)94	function collectionAddress(uint32 collectionId) external view returns (address);9596	/// Returns collectionId of a collection.97	/// @param collectionAddress  - Eth address of the collection98	/// @return collectionId of the collection99	/// @dev EVM selector for this function is: 0xb5cb7498,100	///  or in textual repr: collectionId(address)101	function collectionId(address collectionAddress) external view returns (uint32);102}103104/// Collection properties105struct CreateCollectionData {106	/// Collection name107	string name;108	/// Collection description109	string description;110	/// Token prefix111	string token_prefix;112	/// Token type (NFT, FT or RFT)113	CollectionMode mode;114	/// Fungible token precision115	uint8 decimals;116	/// Custom Properties117	Property[] properties;118	/// Permissions for token properties119	TokenPropertyPermission[] token_property_permissions;120	/// Collection admins121	CrossAddress[] admin_list;122	/// Nesting settings123	CollectionNestingAndPermission nesting_settings;124	/// Collection limits125	CollectionLimitValue[] limits;126	/// Collection sponsor127	CrossAddress pending_sponsor;128	/// Extra collection flags129	CollectionFlags flags;130}131132type CollectionFlags is uint8;133134library CollectionFlagsLib {135	/// A collection of foreign assets136	CollectionFlags constant foreignField = CollectionFlags.wrap(128);137	/// Supports ERC721Metadata138	CollectionFlags constant erc721metadataField = CollectionFlags.wrap(64);139	/// External collections can't be managed using `unique` api140	CollectionFlags constant externalField = CollectionFlags.wrap(1);141142	/// Reserved flags143	function reservedField(uint8 value) public pure returns (CollectionFlags) {144		require(value < 1 << 5, "out of bound value");145		return CollectionFlags.wrap(value << 1);146	}147}148149/// Cross account struct150struct CrossAddress {151	address eth;152	uint256 sub;153}154155/// [`CollectionLimits`](up_data_structs::CollectionLimits) field representation for EVM.156struct CollectionLimitValue {157	CollectionLimitField field;158	uint256 value;159}160161/// [`CollectionLimits`](up_data_structs::CollectionLimits) fields representation for EVM.162enum CollectionLimitField {163	/// How many tokens can a user have on one account.164	AccountTokenOwnership,165	/// How many bytes of data are available for sponsorship.166	SponsoredDataSize,167	/// In any case, chain default: [`SponsoringRateLimit::SponsoringDisabled`]168	SponsoredDataRateLimit,169	/// How many tokens can be mined into this collection.170	TokenLimit,171	/// Timeouts for transfer sponsoring.172	SponsorTransferTimeout,173	/// Timeout for sponsoring an approval in passed blocks.174	SponsorApproveTimeout,175	/// Whether the collection owner of the collection can send tokens (which belong to other users).176	OwnerCanTransfer,177	/// Can the collection owner burn other people's tokens.178	OwnerCanDestroy,179	/// Is it possible to send tokens from this collection between users.180	TransferEnabled181}182183/// Nested collections and permissions184struct CollectionNestingAndPermission {185	/// Owner of token can nest tokens under it.186	bool token_owner;187	/// Admin of token collection can nest tokens under token.188	bool collection_admin;189	/// If set - only tokens from specified collections can be nested.190	address[] restricted;191}192193/// Ethereum representation of Token Property Permissions.194struct TokenPropertyPermission {195	/// Token property key.196	string key;197	/// Token property permissions.198	PropertyPermission[] permissions;199}200201/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) as an key and value.202struct PropertyPermission {203	/// TokenPermission field.204	TokenPermissionField code;205	/// TokenPermission value.206	bool value;207}208209/// Ethereum representation of TokenPermissions (see [`up_data_structs::PropertyPermission`]) fields as an enumeration.210enum TokenPermissionField {211	/// Permission to change the property and property permission. See [`up_data_structs::PropertyPermission::mutable`]212	Mutable,213	/// Change permission for the collection administrator. See [`up_data_structs::PropertyPermission::token_owner`]214	TokenOwner,215	/// Permission to change the property for the owner of the token. See [`up_data_structs::PropertyPermission::collection_admin`]216	CollectionAdmin217}218219/// Ethereum representation of collection [`PropertyKey`](up_data_structs::PropertyKey) and [`PropertyValue`](up_data_structs::PropertyValue).220struct Property {221	string key;222	bytes value;223}224225/// Type of tokens in collection226enum CollectionMode {227	/// Nonfungible228	Nonfungible,229	/// Fungible230	Fungible,231	/// Refungible232	Refungible233}