diff --git a/templates/digital-asset-template/move/sources/launchpad.move b/templates/digital-asset-template/move/sources/launchpad.move index 50152f8f..c80c1962 100644 --- a/templates/digital-asset-template/move/sources/launchpad.move +++ b/templates/digital-asset-template/move/sources/launchpad.move @@ -94,14 +94,14 @@ module launchpad_addr::launchpad { /// We need this object to own the collection object instead of contract directly owns the collection object /// This helps us avoid address collision when we create multiple collections with same name struct CollectionOwnerObjConfig has key { - /// Only thing it stores is the link to collection object + // Only thing it stores is the link to collection object collection_obj: Object, extend_ref: object::ExtendRef, } /// Unique per collection struct CollectionConfig has key { - /// Key is stage, value is mint fee denomination + // Key is stage, value is mint fee denomination mint_fee_per_nft_by_stages: SimpleMap, collection_owner_obj: Object, } @@ -121,7 +121,7 @@ module launchpad_addr::launchpad { mint_fee_collector_addr: address, } - //. If you deploy the module under an object, sender is the object's signer + /// If you deploy the module under an object, sender is the object's signer /// If you deploy the module under your own account, sender is your account's signer fun init_module(sender: &signer) { move_to(sender, Registry { @@ -178,21 +178,21 @@ module launchpad_addr::launchpad { uri: String, max_supply: u64, royalty_percentage: Option, - /// Pre mint amount to creator + // Pre mint amount to creator pre_mint_amount: Option, - /// Allowlist of addresses that can mint NFTs in allowlist stage + // Allowlist of addresses that can mint NFTs in allowlist stage allowlist: Option>, allowlist_start_time: Option, allowlist_end_time: Option, - /// Allowlist mint limit per address + // Allowlist mint limit per address allowlist_mint_limit_per_addr: Option, - /// Allowlist mint fee per NFT denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) + // Allowlist mint fee per NFT denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) allowlist_mint_fee_per_nft: Option, public_mint_start_time: Option, public_mint_end_time: Option, - /// Public mint limit per address + // Public mint limit per address public_mint_limit_per_addr: Option, - /// Public mint fee per NFT denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) + // Public mint fee per NFT denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) public_mint_fee_per_nft: Option, ) acquires Registry, Config, CollectionConfig, CollectionOwnerObjConfig { let sender_addr = signer::address_of(sender); @@ -333,43 +333,43 @@ module launchpad_addr::launchpad { // ================================= View ================================= // - /// Get creator, creator is the address that is allowed to create collections #[view] + /// Get creator, creator is the address that is allowed to create collections public fun get_creator(): address acquires Config { let config = borrow_global(@launchpad_addr); config.creator_addr } - /// Get contract admin #[view] + /// Get contract admin public fun get_admin(): address acquires Config { let config = borrow_global(@launchpad_addr); config.admin_addr } - /// Get contract pending admin #[view] + /// Get contract pending admin public fun get_pendingadmin(): Option
acquires Config { let config = borrow_global(@launchpad_addr); config.pending_admin_addr } - /// Get mint fee collector address #[view] + /// Get mint fee collector address public fun get_mint_fee_collector(): address acquires Config { let config = borrow_global(@launchpad_addr); config.mint_fee_collector_addr } - /// Get all collections created using this contract #[view] + /// Get all collections created using this contract public fun get_registry(): vector> acquires Registry { let registry = borrow_global(@launchpad_addr); registry.collection_objects } - /// Get mint fee for a specific stage, denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) #[view] + /// Get mint fee for a specific stage, denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) public fun get_mint_fee( collection_obj: Object, stage_name: String, @@ -380,8 +380,8 @@ module launchpad_addr::launchpad { amount * fee } - /// Get the name of the current active mint stage or the next mint stage if there is no active mint stage #[view] + /// Get the name of the current active mint stage or the next mint stage if there is no active mint stage public fun get_active_or_next_mint_stage(collection_obj: Object): Option { let active_stage_idx = mint_stage::ccurent_active_stage(collection_obj); if (option::is_some(&active_stage_idx)) { @@ -401,8 +401,8 @@ module launchpad_addr::launchpad { } } - /// Get the start and end time of a mint stage #[view] + /// Get the start and end time of a mint stage public fun get_mint_stage_start_and_end_time(collection_obj: Object, stage_name: String): (u64, u64) { let stage_idx = mint_stage::find_mint_stage_index_by_name(collection_obj, stage_name); let stage_obj = mint_stage::find_mint_stage_by_index(collection_obj, stage_idx); diff --git a/templates/fungible-asset-template/move/sources/launchpad.move b/templates/fungible-asset-template/move/sources/launchpad.move index 8e7cfa92..90691c96 100644 --- a/templates/fungible-asset-template/move/sources/launchpad.move +++ b/templates/fungible-asset-template/move/sources/launchpad.move @@ -29,7 +29,7 @@ module launchpad_addr::launchpad { /// Default to mint 0 amount to creator when creating FA const DEFAULT_PRE_MINT_AMOUNT: u64 = 0; - // Default mint fee per smallest unit of FA denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) + /// Default mint fee per smallest unit of FA denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) const DEFAULT_mint_fee_per_smallest_unit_of_fa: u64 = 0; #[event] @@ -60,7 +60,7 @@ module launchpad_addr::launchpad { /// We need this object to own the FA object instead of contract directly owns the FA object /// This helps us avoid address collision when we create multiple FAs with same name struct FAOwnerObjConfig has key { - /// Only thing it stores is the link to FA object + // Only thing it stores is the link to FA object fa_obj: Object } @@ -79,7 +79,7 @@ module launchpad_addr::launchpad { /// Unique per FA struct FAConfig has key { - /// Mint fee per FA denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) + // Mint fee per FA denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) mint_fee_per_smallest_unit_of_fa: u64, mint_limit: Option, fa_owner_obj: Object, @@ -155,15 +155,15 @@ module launchpad_addr::launchpad { max_supply: Option, name: String, symbol: String, - /// Number of decimal places, i.e. APT has 8 decimal places, so decimals = 8, 1 APT = 1e-8 oapt + // Number of decimal places, i.e. APT has 8 decimal places, so decimals = 8, 1 APT = 1e-8 oapt decimals: u8, icon_uri: String, project_uri: String, - /// Mint fee per smallest unit of FA denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) + // Mint fee per smallest unit of FA denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) mint_fee_per_smallest_unit_of_fa: Option, - /// Amount in smallest unit of FA + // Amount in smallest unit of FA pre_mint_amount: Option, - /// Limit of minting per address in smallest unit of FA + // Limit of minting per address in smallest unit of FA mint_limit_per_addr: Option, ) acquires Registry, Config, FAController { let sender_addr = signer::address_of(sender); @@ -253,43 +253,43 @@ module launchpad_addr::launchpad { // ================================= View Functions ================================== // - /// Get creator, creator is the address that is allowed to create FAs #[view] + /// Get creator, creator is the address that is allowed to create FAs public fun get_creator(): address acquires Config { let config = borrow_global(@launchpad_addr); config.creator_addr } - /// Get contract admin #[view] + /// Get contract admin public fun get_admin(): address acquires Config { let config = borrow_global(@launchpad_addr); config.admin_addr } - /// Get contract pending admin #[view] + /// Get contract pending admin public fun get_pendingadmin(): Option
acquires Config { let config = borrow_global(@launchpad_addr); config.pending_admin_addr } - /// Get mint fee collector address #[view] + /// Get mint fee collector address public fun get_mint_fee_collector(): address acquires Config { let config = borrow_global(@launchpad_addr); config.mint_fee_collector_addr } - /// Get all fungible assets created using this contract #[view] + /// Get all fungible assets created using this contract public fun get_registry(): vector> acquires Registry { let registry = borrow_global(@launchpad_addr); registry.fa_objects } - /// Get fungible asset metadata #[view] + /// Get fungible asset metadata public fun get_fa_objects_metadatas( collection_obj: Object ): (String, String, u8) { @@ -299,8 +299,8 @@ module launchpad_addr::launchpad { (symbol, name, decimals) } - /// Get mint limit per address #[view] + /// Get mint limit per address public fun get_mint_limit( fa_obj: Object, ): Option acquires FAConfig { @@ -312,8 +312,8 @@ module launchpad_addr::launchpad { } } - /// Get current minted amount by an address #[view] + /// Get current minted amount by an address public fun get_current_minted_amount( fa_obj: Object, addr: address @@ -325,8 +325,8 @@ module launchpad_addr::launchpad { *table::borrow_with_default(mint_tracker, addr, &0) } - /// Get mint fee denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) #[view] + /// Get mint fee denominated in oapt (smallest unit of APT, i.e. 1e-8 APT) public fun get_mint_fee( fa_obj: Object, // Amount in smallest unit of FA