diff --git a/Cargo.lock b/Cargo.lock index da5b1e54d..724f6ca9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -342,29 +342,11 @@ dependencies = [ "crypto-common", ] -[[package]] -name = "distribution" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-scenario", -] - -[[package]] -name = "distribution-abi" -version = "0.0.0" -dependencies = [ - "distribution", - "multiversx-sc-meta-lib", -] - [[package]] name = "distribution-tests" version = "0.0.0" dependencies = [ "common_structs", - "distribution", "energy-factory", "farm", "fees-collector", @@ -1094,6 +1076,23 @@ dependencies = [ "multiversx-sc-meta-lib", ] +[[package]] +name = "locked-asset-distribution" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-scenario", +] + +[[package]] +name = "locked-asset-distribution-abi" +version = "0.0.0" +dependencies = [ + "locked-asset-distribution", + "multiversx-sc-meta-lib", +] + [[package]] name = "locked-token-wrapper" version = "0.0.0" diff --git a/Cargo.toml b/Cargo.toml index 5bd6e64d9..81e48c99e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,10 +57,10 @@ members = [ "legacy-contracts/price-discovery-v1/meta", "legacy-contracts/price-discovery-v2", "legacy-contracts/price-discovery-v2/meta", + "legacy-contracts/locked-asset-distribution", + "legacy-contracts/locked-asset-distribution/meta", "locked-asset/", - "locked-asset/distribution", - "locked-asset/distribution/meta", "locked-asset/proxy_dex", "locked-asset/proxy_dex/meta", "locked-asset/lkmex-transfer", diff --git a/locked-asset/distribution/.gitignore b/legacy-contracts/locked-asset-distribution/.gitignore similarity index 100% rename from locked-asset/distribution/.gitignore rename to legacy-contracts/locked-asset-distribution/.gitignore diff --git a/locked-asset/distribution/Cargo.toml b/legacy-contracts/locked-asset-distribution/Cargo.toml similarity index 90% rename from locked-asset/distribution/Cargo.toml rename to legacy-contracts/locked-asset-distribution/Cargo.toml index 6944b562b..6e81aa03a 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/legacy-contracts/locked-asset-distribution/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2021" -name = "distribution" +name = "locked-asset-distribution" publish = false version = "0.0.0" diff --git a/locked-asset/distribution/README.md b/legacy-contracts/locked-asset-distribution/README.md similarity index 100% rename from locked-asset/distribution/README.md rename to legacy-contracts/locked-asset-distribution/README.md diff --git a/locked-asset/distribution/meta/Cargo.toml b/legacy-contracts/locked-asset-distribution/meta/Cargo.toml similarity index 72% rename from locked-asset/distribution/meta/Cargo.toml rename to legacy-contracts/locked-asset-distribution/meta/Cargo.toml index 973e79b00..800a737f6 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/legacy-contracts/locked-asset-distribution/meta/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "distribution-abi" +name = "locked-asset-distribution-abi" version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false -[dependencies.distribution] +[dependencies.locked-asset-distribution] path = ".." [dependencies.multiversx-sc-meta-lib] diff --git a/legacy-contracts/locked-asset-distribution/meta/src/main.rs b/legacy-contracts/locked-asset-distribution/meta/src/main.rs new file mode 100644 index 000000000..6b03650e9 --- /dev/null +++ b/legacy-contracts/locked-asset-distribution/meta/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + multiversx_sc_meta_lib::cli_main::(); +} diff --git a/locked-asset/distribution/multiversx.json b/legacy-contracts/locked-asset-distribution/multiversx.json similarity index 100% rename from locked-asset/distribution/multiversx.json rename to legacy-contracts/locked-asset-distribution/multiversx.json diff --git a/legacy-contracts/locked-asset-distribution/src/lib.rs b/legacy-contracts/locked-asset-distribution/src/lib.rs new file mode 100644 index 000000000..0103fbf09 --- /dev/null +++ b/legacy-contracts/locked-asset-distribution/src/lib.rs @@ -0,0 +1,92 @@ +#![no_std] +#![allow(clippy::type_complexity)] + +use common_structs::UnlockPeriod; + +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +#[derive(ManagedVecItem)] +pub struct BigUintEpochPair { + pub biguint: BigUint, + pub epoch: u64, +} + +#[derive(ManagedVecItem, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, TypeAbi)] +pub struct UserLockedAssetKey { + pub caller: ManagedAddress, + pub spread_epoch: u64, +} + +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, TypeAbi, Clone)] +pub struct CommunityDistribution { + pub total_amount: BigUint, + pub spread_epoch: u64, + pub after_planning_amount: BigUint, +} + +#[multiversx_sc::contract] +pub trait Distribution { + #[init] + fn init(&self) {} + + #[upgrade] + fn upgrade(&self) {} + + #[endpoint(clearSingleValueMappers)] + fn clear_single_value_mappers(&self) { + self.unlock_period().clear(); + self.locked_asset_factory_address().clear(); + self.asset_token_id().clear(); + self.global_op_is_ongoing().clear(); + } + + // Returns the number of entries deleted and entries remaining in the storage. + #[endpoint(clearCommunityDistributionList)] + fn clear_community_distribution_list(&self, entries_to_delete: u64) -> (u64, usize) { + let mut counter = 0; + for node in self.community_distribution_list().iter() { + if counter >= entries_to_delete { + break; + } + self.community_distribution_list().remove_node(&node); + counter += 1; + } + (counter, self.community_distribution_list().len()) + } + + // Returns the number of entries deleted and entries remaining in the storage. + #[endpoint(clearUserLockedAssetMap)] + fn clear_user_locked_asset_map(&self, entries_to_delete: u64) -> (u64, usize) { + let mut counter = 0; + for key in self.user_locked_asset_map().keys() { + if counter >= entries_to_delete { + break; + } + self.user_locked_asset_map().remove(&key); + counter += 1; + } + (counter, self.user_locked_asset_map().len()) + } + + #[view(getUnlockPeriod)] + #[storage_mapper("unlock_period")] + fn unlock_period(&self) -> SingleValueMapper>; + + #[view(getCommunityDistributionList)] + #[storage_mapper("community_distribution_list")] + fn community_distribution_list(&self) -> LinkedListMapper>; + + #[storage_mapper("user_locked_asset_map")] + fn user_locked_asset_map(&self) -> MapMapper, BigUint>; + + #[storage_mapper("locked_asset_factory_address")] + fn locked_asset_factory_address(&self) -> SingleValueMapper; + + #[view(getAssetTokenId)] + #[storage_mapper("asset_token_id")] + fn asset_token_id(&self) -> SingleValueMapper; + + #[storage_mapper("global_operation_ongoing")] + fn global_op_is_ongoing(&self) -> SingleValueMapper; +} diff --git a/locked-asset/distribution/wasm/Cargo.lock b/legacy-contracts/locked-asset-distribution/wasm/Cargo.lock similarity index 98% rename from locked-asset/distribution/wasm/Cargo.lock rename to legacy-contracts/locked-asset-distribution/wasm/Cargo.lock index 4dc646fe8..47a5d2e4b 100644 --- a/locked-asset/distribution/wasm/Cargo.lock +++ b/legacy-contracts/locked-asset-distribution/wasm/Cargo.lock @@ -31,22 +31,6 @@ dependencies = [ "unwrappable", ] -[[package]] -name = "distribution" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "distribution-wasm" -version = "0.0.0" -dependencies = [ - "distribution", - "multiversx-sc-wasm-adapter", -] - [[package]] name = "endian-type" version = "0.1.2" @@ -72,6 +56,22 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "locked-asset-distribution" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "locked-asset-distribution-wasm" +version = "0.0.0" +dependencies = [ + "locked-asset-distribution", + "multiversx-sc-wasm-adapter", +] + [[package]] name = "math" version = "0.0.0" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/legacy-contracts/locked-asset-distribution/wasm/Cargo.toml similarity index 87% rename from locked-asset/distribution/wasm/Cargo.toml rename to legacy-contracts/locked-asset-distribution/wasm/Cargo.toml index 5012013d1..0a3916d83 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/legacy-contracts/locked-asset-distribution/wasm/Cargo.toml @@ -5,7 +5,7 @@ # ########################################## [package] -name = "distribution-wasm" +name = "locked-asset-distribution-wasm" version = "0.0.0" edition = "2021" publish = false @@ -24,7 +24,7 @@ overflow-checks = false [profile.dev] panic = "abort" -[dependencies.distribution] +[dependencies.locked-asset-distribution] path = ".." [dependencies.multiversx-sc-wasm-adapter] diff --git a/legacy-contracts/locked-asset-distribution/wasm/src/lib.rs b/legacy-contracts/locked-asset-distribution/wasm/src/lib.rs new file mode 100644 index 000000000..b0bc90188 --- /dev/null +++ b/legacy-contracts/locked-asset-distribution/wasm/src/lib.rs @@ -0,0 +1,32 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Upgrade: 1 +// Endpoints: 6 +// Async Callback (empty): 1 +// Total number of exported functions: 9 + +#![no_std] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::endpoints! { + locked_asset_distribution + ( + init => init + upgrade => upgrade + clearSingleValueMappers => clear_single_value_mappers + clearCommunityDistributionList => clear_community_distribution_list + clearUserLockedAssetMap => clear_user_locked_asset_map + getUnlockPeriod => unlock_period + getCommunityDistributionList => community_distribution_list + getAssetTokenId => asset_token_id + ) +} + +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 3ce7eaaa2..b8c2b5512 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -17,9 +17,6 @@ path = "../dex/pair" [dependencies.router] path = "../dex/router" -[dependencies.distribution] -path = "distribution" - [dependencies.simple-lock] path = "simple-lock" diff --git a/locked-asset/distribution/elrond.json b/locked-asset/distribution/elrond.json deleted file mode 100644 index 736553962..000000000 --- a/locked-asset/distribution/elrond.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "language": "rust" -} \ No newline at end of file diff --git a/locked-asset/distribution/meta/src/main.rs b/locked-asset/distribution/meta/src/main.rs deleted file mode 100644 index 40a5fd883..000000000 --- a/locked-asset/distribution/meta/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - multiversx_sc_meta_lib::cli_main::(); -} diff --git a/locked-asset/distribution/src/global_op.rs b/locked-asset/distribution/src/global_op.rs deleted file mode 100644 index 619b88550..000000000 --- a/locked-asset/distribution/src/global_op.rs +++ /dev/null @@ -1,42 +0,0 @@ -multiversx_sc::imports!(); -multiversx_sc::derive_imports!(); - -#[multiversx_sc::module] -pub trait GlobalOperationModule { - #[only_owner] - #[endpoint(startGlobalOperation)] - fn global_op_start(&self) { - require!( - !self.global_op_is_ongoing().get(), - "Global operation already ongoing" - ); - self.global_op_is_ongoing().set(true); - } - - #[only_owner] - #[endpoint(endGlobalOperation)] - fn global_op_stop(&self) { - require!( - self.global_op_is_ongoing().get(), - "Global operation not ongoing" - ); - self.global_op_is_ongoing().set(false); - } - - #[storage_mapper("global_operation_ongoing")] - fn global_op_is_ongoing(&self) -> SingleValueMapper; - - fn require_global_op_not_ongoing(&self) { - require!( - !self.global_op_is_ongoing().get(), - "Global operation ongoing" - ); - } - - fn require_global_op_ongoing(&self) { - require!( - self.global_op_is_ongoing().get(), - "Global operation not ongoing" - ); - } -} diff --git a/locked-asset/distribution/src/lib.rs b/locked-asset/distribution/src/lib.rs deleted file mode 100644 index 9a72c2326..000000000 --- a/locked-asset/distribution/src/lib.rs +++ /dev/null @@ -1,363 +0,0 @@ -#![no_std] -#![allow(clippy::type_complexity)] - -use common_structs::{UnlockMilestone, UnlockPeriod}; - -multiversx_sc::imports!(); -multiversx_sc::derive_imports!(); - -mod global_op; - -const GAS_THRESHOLD: u64 = 100_000; -const MAX_CLAIMABLE_DISTRIBUTION_ROUNDS: usize = 4; - -#[derive(ManagedVecItem)] -pub struct BigUintEpochPair { - pub biguint: BigUint, - pub epoch: u64, -} - -#[derive(ManagedVecItem, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, TypeAbi)] -pub struct UserLockedAssetKey { - pub caller: ManagedAddress, - pub spread_epoch: u64, -} - -#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, TypeAbi, Clone)] -pub struct CommunityDistribution { - pub total_amount: BigUint, - pub spread_epoch: u64, - pub after_planning_amount: BigUint, -} - -#[multiversx_sc::contract] -pub trait Distribution: global_op::GlobalOperationModule { - // #[proxy] - // fn locked_asset_factory_proxy(&self, to: ManagedAddress) -> factory::Proxy; - - #[init] - fn init(&self, asset_token_id: TokenIdentifier, locked_asset_factory_address: ManagedAddress) { - require!( - asset_token_id.is_valid_esdt_identifier(), - "Asset token ID is not a valid esdt identifier" - ); - - self.asset_token_id().set_if_empty(&asset_token_id); - self.locked_asset_factory_address() - .set_if_empty(&locked_asset_factory_address); - } - - #[upgrade] - fn upgrade(&self) {} - - #[only_owner] - #[endpoint(setCommunityDistribution)] - fn set_community_distribution(&self, total_amount: BigUint, spread_epoch: u64) { - self.require_global_op_ongoing(); - require!(total_amount > 0, "Zero amount"); - require!( - spread_epoch >= self.blockchain().get_block_epoch(), - "Spread epoch in the past" - ); - require!( - self.community_distribution_list() - .front() - .map(|community_distrib| community_distrib.get_value_as_ref().spread_epoch) - .unwrap_or_default() - < spread_epoch, - "Community distribution should be added in chronological order" - ); - - let distrib = CommunityDistribution { - total_amount: total_amount.clone(), - spread_epoch, - after_planning_amount: total_amount, - }; - self.community_distribution_list().push_front(distrib); - } - - #[only_owner] - #[endpoint(setPerUserDistributedLockedAssets)] - fn set_per_user_distributed_locked_assets( - &self, - spread_epoch: u64, - user_locked_assets: MultiValueEncoded>, - ) { - self.require_global_op_ongoing(); - self.require_community_distribution_list_not_empty(); - - require!(!user_locked_assets.is_empty(), "Empty assets vec"); - self.add_all_user_assets_to_map(spread_epoch, user_locked_assets) - } - - // #[endpoint(claimLockedAssets)] - // fn claim_locked_assets(&self) -> BigUint { - // self.require_global_op_not_ongoing(); - // self.require_unlock_period_not_empty(); - // self.require_community_distribution_list_not_empty(); - - // let caller = self.blockchain().get_caller(); - // let mut cummulated_amount = BigUint::zero(); - - // let locked_assets = self.calculate_user_locked_assets(&caller, true); - // if locked_assets.is_empty() { - // return cummulated_amount; - // } - - // let to = self.locked_asset_factory_address().get(); - // let gas_limit_per_execute = - // self.blockchain().get_gas_left() / (locked_assets.len() as u64 + 1); - - // let unlock_period = self.unlock_period().get(); - // for elem in locked_assets.iter() { - // let amount = elem.biguint; - // let spread_epoch = elem.epoch; - // let _: IgnoreValue = self - // .locked_asset_factory_proxy(to.clone()) - // .create_and_forward_custom_period( - // amount.clone(), - // caller.clone(), - // spread_epoch, - // unlock_period.clone(),cargo - // ) - // .with_gas_limit(gas_limit_per_execute) - // .execute_on_dest_context(); - - // cummulated_amount += amount; - // } - - // cummulated_amount - // } - - #[endpoint(clearUnclaimableAssets)] - fn clear_unclaimable_assets(&self) -> usize { - let biggest_unclaimable_asset_epoch = self.get_biggest_unclaimable_asset_epoch(); - self.undo_user_assets_between_epochs(0, biggest_unclaimable_asset_epoch) - } - - #[only_owner] - #[endpoint(undoLastCommunityDistribution)] - fn undo_last_community_distrib(&self) { - self.require_global_op_ongoing(); - self.require_community_distribution_list_not_empty(); - self.community_distribution_list().pop_front(); - } - - #[only_owner] - #[endpoint(undoUserDistributedAssetsBetweenEpochs)] - fn undo_user_assets_between_epochs(&self, lower: u64, higher: u64) -> usize { - self.require_global_op_ongoing(); - self.require_community_distribution_list_not_empty(); - require!(lower <= higher, "Bad input values"); - self.remove_asset_entries_between_epochs(lower, higher) - } - - #[only_owner] - #[endpoint(setUnlockPeriod)] - fn set_unlock_period(&self, milestones: MultiValueEncoded) { - let unlock_milestones = milestones.to_vec(); - self.validate_unlock_milestones(&unlock_milestones); - self.unlock_period() - .set(&UnlockPeriod { unlock_milestones }); - } - - #[view(calculateLockedAssets)] - fn calculate_locked_assets_view(&self, address: ManagedAddress) -> BigUint { - self.require_global_op_not_ongoing(); - self.require_community_distribution_list_not_empty(); - let locked_assets = self.calculate_user_locked_assets(&address, false); - - let mut cummulated_amount = BigUint::zero(); - for elem in locked_assets.iter() { - cummulated_amount += elem.biguint; - } - cummulated_amount - } - - fn validate_unlock_milestones(&self, unlock_milestones: &ManagedVec) { - require!(!unlock_milestones.is_empty(), "Empty param"); - - let mut percents_sum: u8 = 0; - let mut last_milestone_unlock_epoch: u64 = 0; - - for milestone in unlock_milestones.into_iter() { - require!( - milestone.unlock_epoch >= last_milestone_unlock_epoch, - "Unlock epochs not in order" - ); - require!( - milestone.unlock_percent <= 100, - "Unlock percent more than 100" - ); - last_milestone_unlock_epoch = milestone.unlock_epoch; - percents_sum += milestone.unlock_percent; - } - - require!(percents_sum == 100, "Percents do not sum up to 100"); - } - - fn add_all_user_assets_to_map( - &self, - spread_epoch: u64, - user_assets: MultiValueEncoded>, - ) { - let mut last_community_distrib = self - .community_distribution_list() - .front() - .unwrap() - .get_value_cloned(); - require!( - spread_epoch == last_community_distrib.spread_epoch, - "Bad spread epoch" - ); - - for user_asset_multiarg in user_assets.into_iter() { - let (caller, asset_amount) = user_asset_multiarg.into_tuple(); - require!(asset_amount > 0, "Zero amount"); - require!( - last_community_distrib.after_planning_amount >= asset_amount, - "User assets sums above community total assets" - ); - last_community_distrib.after_planning_amount -= &asset_amount; - self.add_user_locked_asset_entry(caller, asset_amount, spread_epoch); - } - - self.community_distribution_list().pop_front(); - self.community_distribution_list() - .push_front(last_community_distrib); - } - - fn add_user_locked_asset_entry( - &self, - caller: ManagedAddress, - asset_amount: BigUint, - spread_epoch: u64, - ) { - let key = UserLockedAssetKey { - caller, - spread_epoch, - }; - require!( - !self.user_locked_asset_map().contains_key(&key), - "Vector has duplicates" - ); - self.user_locked_asset_map().insert(key, asset_amount); - } - - fn calculate_user_locked_assets( - &self, - address: &ManagedAddress, - delete_after_visit: bool, - ) -> ManagedVec> { - let current_epoch = self.blockchain().get_block_epoch(); - let mut locked_assets = ManagedVec::new(); - - for community_distrib in self - .community_distribution_list() - .iter() - .take(MAX_CLAIMABLE_DISTRIBUTION_ROUNDS) - .filter(|x| x.get_value_as_ref().spread_epoch <= current_epoch) - { - let user_asset_key = UserLockedAssetKey { - caller: address.clone(), - spread_epoch: community_distrib.get_value_as_ref().spread_epoch, - }; - - if let Some(asset_amount) = self.user_locked_asset_map().get(&user_asset_key) { - locked_assets.push(BigUintEpochPair { - biguint: asset_amount, - epoch: user_asset_key.spread_epoch, - }); - - if delete_after_visit { - self.user_locked_asset_map().remove(&user_asset_key); - } - } - } - locked_assets - } - - fn get_biggest_unclaimable_asset_epoch(&self) -> u64 { - self.community_distribution_list() - .iter() - .nth(MAX_CLAIMABLE_DISTRIBUTION_ROUNDS) - .map(|community_distrib| community_distrib.get_value_as_ref().spread_epoch) - .unwrap_or_default() - } - - fn remove_asset_entries_between_epochs(&self, lower: u64, higher: u64) -> usize { - if higher == 0 { - return 0; - } - - if higher < lower { - return 0; - } - - let mut to_remove_keys = ManagedVec::>::new(); - let search_gas_limit = self.blockchain().get_gas_left() / 2; - for user_asset_key in self.user_locked_asset_map().keys() { - if self.blockchain().get_gas_left() < search_gas_limit { - break; - } - - if lower <= user_asset_key.spread_epoch && user_asset_key.spread_epoch <= higher { - to_remove_keys.push(user_asset_key); - } - } - - let map_len_before = self.user_locked_asset_map().len(); - for key in to_remove_keys.iter() { - if self.blockchain().get_gas_left() < GAS_THRESHOLD { - break; - } - - self.user_locked_asset_map().remove(&key); - } - map_len_before - self.user_locked_asset_map().len() - } - - fn require_community_distribution_list_not_empty(&self) { - require!( - !self.community_distribution_list().is_empty(), - "Empty community assets list" - ); - } - - fn require_unlock_period_not_empty(&self) { - require!(!self.unlock_period().is_empty(), "Empty unlock schedule"); - } - - #[only_owner] - #[endpoint(deleteUserDistributedLockedAssets)] - fn delete_user_distributed_locked_assets(&self, spread_epoch: u64, address: ManagedAddress) { - self.require_global_op_ongoing(); - self.user_locked_asset_map().remove(&UserLockedAssetKey { - caller: address, - spread_epoch, - }); - } - - #[view(getUsersDistributedLockedAssetsLength)] - fn get_users_distributed_locked_assets_length(&self) -> usize { - self.user_locked_asset_map().len() - } - - #[view(getUnlockPeriod)] - #[storage_mapper("unlock_period")] - fn unlock_period(&self) -> SingleValueMapper>; - - #[view(getCommunityDistributionList)] - #[storage_mapper("community_distribution_list")] - fn community_distribution_list(&self) -> LinkedListMapper>; - - #[storage_mapper("user_locked_asset_map")] - fn user_locked_asset_map(&self) -> MapMapper, BigUint>; - - #[storage_mapper("locked_asset_factory_address")] - fn locked_asset_factory_address(&self) -> SingleValueMapper; - - #[view(getAssetTokenId)] - #[storage_mapper("asset_token_id")] - fn asset_token_id(&self) -> SingleValueMapper; -} diff --git a/locked-asset/distribution/wasm/src/lib.rs b/locked-asset/distribution/wasm/src/lib.rs deleted file mode 100644 index c038597b3..000000000 --- a/locked-asset/distribution/wasm/src/lib.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by the multiversx-sc build system. DO NOT EDIT. - -//////////////////////////////////////////////////// -////////////////// AUTO-GENERATED ////////////////// -//////////////////////////////////////////////////// - -// Init: 1 -// Upgrade: 1 -// Endpoints: 14 -// Async Callback (empty): 1 -// Total number of exported functions: 17 - -#![no_std] - -multiversx_sc_wasm_adapter::allocator!(); -multiversx_sc_wasm_adapter::panic_handler!(); - -multiversx_sc_wasm_adapter::endpoints! { - distribution - ( - init => init - upgrade => upgrade - setCommunityDistribution => set_community_distribution - setPerUserDistributedLockedAssets => set_per_user_distributed_locked_assets - clearUnclaimableAssets => clear_unclaimable_assets - undoLastCommunityDistribution => undo_last_community_distrib - undoUserDistributedAssetsBetweenEpochs => undo_user_assets_between_epochs - setUnlockPeriod => set_unlock_period - calculateLockedAssets => calculate_locked_assets_view - deleteUserDistributedLockedAssets => delete_user_distributed_locked_assets - getUsersDistributedLockedAssetsLength => get_users_distributed_locked_assets_length - getUnlockPeriod => unlock_period - getCommunityDistributionList => community_distribution_list - getAssetTokenId => asset_token_id - startGlobalOperation => global_op_start - endGlobalOperation => global_op_stop - ) -} - -multiversx_sc_wasm_adapter::async_callback_empty! {}