From 62aded7e250e84f0bc94b49cc741f56f66f10d13 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Mon, 21 Apr 2025 18:49:15 +0700 Subject: [PATCH 1/2] feat: token config presets --- .../token_configuration/v0/mod.rs | 281 +++++++++++------- .../token_keeps_history_rules/v0/mod.rs | 13 + .../authorized_action_takers.rs | 2 +- 3 files changed, 195 insertions(+), 101 deletions(-) diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs index 52bd41a2344..7c17df6d973 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_configuration/v0/mod.rs @@ -7,6 +7,8 @@ use crate::data_contract::associated_token::token_distribution_rules::v0::TokenD use crate::data_contract::associated_token::token_distribution_rules::TokenDistributionRules; use crate::data_contract::associated_token::token_keeps_history_rules::v0::TokenKeepsHistoryRulesV0; use crate::data_contract::associated_token::token_keeps_history_rules::TokenKeepsHistoryRules; +use crate::data_contract::associated_token::token_perpetual_distribution::TokenPerpetualDistribution; +use crate::data_contract::associated_token::token_pre_programmed_distribution::TokenPreProgrammedDistribution; use crate::data_contract::change_control_rules::authorized_action_takers::AuthorizedActionTakers; use crate::data_contract::change_control_rules::v0::ChangeControlRulesV0; use crate::data_contract::change_control_rules::ChangeControlRules; @@ -31,7 +33,7 @@ pub struct TokenConfigurationV0 { /// The rules for keeping history. #[serde(default = "default_token_keeps_history_rules")] pub keeps_history: TokenKeepsHistoryRules, - /// Do we start off as paused, meaning that we can not transfer till we unpause. + /// True if we start off as paused, meaning that we can not transfer till we unpause. #[serde(default = "default_starts_as_paused")] pub start_as_paused: bool, /// Allow to transfer and mint tokens to frozen identity token balances @@ -173,133 +175,212 @@ impl fmt::Display for TokenConfigurationV0 { } } -impl TokenConfigurationV0 { - pub fn default_most_restrictive() -> Self { - Self { - conventions: TokenConfigurationConvention::V0(TokenConfigurationConventionV0 { - localizations: Default::default(), - decimals: 8, - }), - conventions_change_rules: ChangeControlRulesV0 { +#[derive(Serialize, Deserialize, Decode, Encode, Debug, Clone, Copy, PartialEq, Eq, PartialOrd)] +pub enum TokenConfigurationPresetFeatures { + /// Nothing can be changed once it is set + MostRestrictive, + /// The action taker can not mint or burn tokens, or any advanced action. + /// They can pause the token if needed. + WithOnlyEmergencyAction, + WithMintingAndBurningActions, + /// The action taker can do advanced actions like freezing + WithAllAdvancedActions, + /// The action taker is a god, he can do everything, even taking away his own power. + WithExtremeActions, +} + +#[derive(Serialize, Deserialize, Decode, Encode, Debug, Clone, PartialEq, Eq, PartialOrd)] +pub struct TokenConfigurationPreset { + features: TokenConfigurationPresetFeatures, + action_taker: AuthorizedActionTakers, +} + +impl TokenConfigurationPreset { + pub fn default_main_control_group_can_be_modified(&self) -> AuthorizedActionTakers { + match self.features { + TokenConfigurationPresetFeatures::MostRestrictive + | TokenConfigurationPresetFeatures::WithOnlyEmergencyAction + | TokenConfigurationPresetFeatures::WithMintingAndBurningActions + | TokenConfigurationPresetFeatures::WithAllAdvancedActions => { + AuthorizedActionTakers::NoOne + } + TokenConfigurationPresetFeatures::WithExtremeActions => self.action_taker, + } + } + pub fn default_basic_change_control_rules_v0(&self) -> ChangeControlRulesV0 { + match self.features { + TokenConfigurationPresetFeatures::MostRestrictive + | TokenConfigurationPresetFeatures::WithOnlyEmergencyAction => ChangeControlRulesV0 { authorized_to_make_change: AuthorizedActionTakers::NoOne, admin_action_takers: AuthorizedActionTakers::NoOne, changing_authorized_action_takers_to_no_one_allowed: false, changing_admin_action_takers_to_no_one_allowed: false, self_changing_admin_action_takers_allowed: false, - } - .into(), - base_supply: 100000, - max_supply: None, - keeps_history: TokenKeepsHistoryRules::V0(TokenKeepsHistoryRulesV0 { - keeps_transfer_history: true, - keeps_freezing_history: true, - keeps_minting_history: true, - keeps_burning_history: true, - keeps_direct_pricing_history: true, - keeps_direct_purchase_history: true, - }), - start_as_paused: false, - allow_transfer_to_frozen_balance: true, - max_supply_change_rules: ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, + }, + TokenConfigurationPresetFeatures::WithMintingAndBurningActions + | TokenConfigurationPresetFeatures::WithAllAdvancedActions => ChangeControlRulesV0 { + authorized_to_make_change: self.action_taker, + admin_action_takers: self.action_taker, changing_authorized_action_takers_to_no_one_allowed: false, changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - } - .into(), - distribution_rules: TokenDistributionRules::V0(TokenDistributionRulesV0 { - perpetual_distribution: None, - perpetual_distribution_rules: ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, - changing_authorized_action_takers_to_no_one_allowed: false, - changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - } - .into(), - pre_programmed_distribution: None, - new_tokens_destination_identity: None, - new_tokens_destination_identity_rules: ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, - changing_authorized_action_takers_to_no_one_allowed: false, - changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - } - .into(), - minting_allow_choosing_destination: true, - minting_allow_choosing_destination_rules: ChangeControlRulesV0 { + self_changing_admin_action_takers_allowed: true, + }, + TokenConfigurationPresetFeatures::WithExtremeActions => ChangeControlRulesV0 { + authorized_to_make_change: self.action_taker, + admin_action_takers: self.action_taker, + changing_authorized_action_takers_to_no_one_allowed: true, + changing_admin_action_takers_to_no_one_allowed: true, + self_changing_admin_action_takers_allowed: true, + }, + } + } + + pub fn default_advanced_change_control_rules_v0(&self) -> ChangeControlRulesV0 { + match self.features { + TokenConfigurationPresetFeatures::MostRestrictive + | TokenConfigurationPresetFeatures::WithOnlyEmergencyAction + | TokenConfigurationPresetFeatures::WithMintingAndBurningActions => { + ChangeControlRulesV0 { authorized_to_make_change: AuthorizedActionTakers::NoOne, admin_action_takers: AuthorizedActionTakers::NoOne, changing_authorized_action_takers_to_no_one_allowed: false, changing_admin_action_takers_to_no_one_allowed: false, self_changing_admin_action_takers_allowed: false, } - .into(), - change_direct_purchase_pricing_rules: ChangeControlRules::V0( - ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, - changing_authorized_action_takers_to_no_one_allowed: false, - changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - }, - ), - }), - manual_minting_rules: ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, - changing_authorized_action_takers_to_no_one_allowed: false, - changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, } - .into(), - manual_burning_rules: ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, + TokenConfigurationPresetFeatures::WithAllAdvancedActions => ChangeControlRulesV0 { + authorized_to_make_change: self.action_taker, + admin_action_takers: self.action_taker, changing_authorized_action_takers_to_no_one_allowed: false, changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - } - .into(), - freeze_rules: ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, - changing_authorized_action_takers_to_no_one_allowed: false, - changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - } - .into(), - unfreeze_rules: ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, - changing_authorized_action_takers_to_no_one_allowed: false, - changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - } - .into(), - destroy_frozen_funds_rules: ChangeControlRulesV0 { + self_changing_admin_action_takers_allowed: true, + }, + TokenConfigurationPresetFeatures::WithExtremeActions => ChangeControlRulesV0 { + authorized_to_make_change: self.action_taker, + admin_action_takers: self.action_taker, + changing_authorized_action_takers_to_no_one_allowed: true, + changing_admin_action_takers_to_no_one_allowed: true, + self_changing_admin_action_takers_allowed: true, + }, + } + } + + pub fn default_emergency_action_change_control_rules_v0(&self) -> ChangeControlRulesV0 { + match self.features { + TokenConfigurationPresetFeatures::MostRestrictive => ChangeControlRulesV0 { authorized_to_make_change: AuthorizedActionTakers::NoOne, admin_action_takers: AuthorizedActionTakers::NoOne, changing_authorized_action_takers_to_no_one_allowed: false, changing_admin_action_takers_to_no_one_allowed: false, self_changing_admin_action_takers_allowed: false, - } - .into(), - emergency_action_rules: ChangeControlRulesV0 { - authorized_to_make_change: AuthorizedActionTakers::NoOne, - admin_action_takers: AuthorizedActionTakers::NoOne, + }, + TokenConfigurationPresetFeatures::WithAllAdvancedActions + | TokenConfigurationPresetFeatures::WithMintingAndBurningActions + | TokenConfigurationPresetFeatures::WithOnlyEmergencyAction => ChangeControlRulesV0 { + authorized_to_make_change: self.action_taker, + admin_action_takers: self.action_taker, changing_authorized_action_takers_to_no_one_allowed: false, changing_admin_action_takers_to_no_one_allowed: false, - self_changing_admin_action_takers_allowed: false, - } + self_changing_admin_action_takers_allowed: true, + }, + TokenConfigurationPresetFeatures::WithExtremeActions => ChangeControlRulesV0 { + authorized_to_make_change: self.action_taker, + admin_action_takers: self.action_taker, + changing_authorized_action_takers_to_no_one_allowed: true, + changing_admin_action_takers_to_no_one_allowed: true, + self_changing_admin_action_takers_allowed: true, + }, + } + } + + pub fn default_distribution_rules_v0( + &self, + perpetual_distribution: Option, + pre_programmed_distribution: Option, + with_direct_pricing: bool, + ) -> TokenDistributionRulesV0 { + TokenDistributionRulesV0 { + perpetual_distribution, + perpetual_distribution_rules: self.default_advanced_change_control_rules_v0().into(), + pre_programmed_distribution, + new_tokens_destination_identity: None, + new_tokens_destination_identity_rules: self + .default_basic_change_control_rules_v0() + .into(), + minting_allow_choosing_destination: true, + minting_allow_choosing_destination_rules: self + .default_basic_change_control_rules_v0() + .into(), + change_direct_purchase_pricing_rules: if with_direct_pricing { + self.default_basic_change_control_rules_v0().into() + } else { + ChangeControlRulesV0 { + authorized_to_make_change: AuthorizedActionTakers::NoOne, + admin_action_takers: AuthorizedActionTakers::NoOne, + changing_authorized_action_takers_to_no_one_allowed: false, + changing_admin_action_takers_to_no_one_allowed: false, + self_changing_admin_action_takers_allowed: false, + } + .into() + }, + } + } + + pub fn token_configuration_v0( + &self, + conventions: TokenConfigurationConvention, + base_supply: TokenAmount, + max_supply: Option, + keeps_all_history: bool, + with_direct_pricing: bool, + ) -> TokenConfigurationV0 { + TokenConfigurationV0 { + conventions, + conventions_change_rules: self.default_basic_change_control_rules_v0().into(), + base_supply, + max_supply, + keeps_history: TokenKeepsHistoryRulesV0::default_for_keeping_all_history( + keeps_all_history, + ) .into(), + start_as_paused: false, + allow_transfer_to_frozen_balance: true, + max_supply_change_rules: self.default_advanced_change_control_rules_v0().into(), + distribution_rules: self + .default_distribution_rules_v0(None, None, with_direct_pricing) + .into(), + manual_minting_rules: self.default_basic_change_control_rules_v0().into(), + manual_burning_rules: self.default_basic_change_control_rules_v0().into(), + freeze_rules: self.default_advanced_change_control_rules_v0().into(), + unfreeze_rules: self.default_advanced_change_control_rules_v0().into(), + destroy_frozen_funds_rules: self.default_advanced_change_control_rules_v0().into(), + emergency_action_rules: self + .default_emergency_action_change_control_rules_v0() + .into(), main_control_group: None, - main_control_group_can_be_modified: AuthorizedActionTakers::NoOne, + main_control_group_can_be_modified: self.default_main_control_group_can_be_modified(), description: None, } } +} + +impl TokenConfigurationV0 { + pub fn default_most_restrictive() -> Self { + TokenConfigurationPreset { + features: TokenConfigurationPresetFeatures::MostRestrictive, + action_taker: AuthorizedActionTakers::NoOne, + } + .token_configuration_v0( + TokenConfigurationConvention::V0(TokenConfigurationConventionV0 { + localizations: Default::default(), + decimals: 8, + }), + 100000, + None, + true, + false, + ) + } pub fn with_base_supply(mut self, base_supply: TokenAmount) -> Self { self.base_supply = base_supply; diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs index dce3ce0f0f6..a72154cf43a 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_keeps_history_rules/v0/mod.rs @@ -35,6 +35,19 @@ pub struct TokenKeepsHistoryRulesV0 { pub keeps_direct_purchase_history: bool, } +impl TokenKeepsHistoryRulesV0 { + pub fn default_for_keeping_all_history(keeps_all_history: bool) -> TokenKeepsHistoryRulesV0 { + TokenKeepsHistoryRulesV0 { + keeps_transfer_history: keeps_all_history, + keeps_freezing_history: keeps_all_history, + keeps_minting_history: keeps_all_history, + keeps_burning_history: keeps_all_history, + keeps_direct_pricing_history: keeps_all_history, + keeps_direct_purchase_history: keeps_all_history, + } + } +} + impl Default for TokenKeepsHistoryRulesV0 { fn default() -> Self { TokenKeepsHistoryRulesV0 { diff --git a/packages/rs-dpp/src/data_contract/change_control_rules/authorized_action_takers.rs b/packages/rs-dpp/src/data_contract/change_control_rules/authorized_action_takers.rs index fc5c531bec2..9d7d7bc1ac3 100644 --- a/packages/rs-dpp/src/data_contract/change_control_rules/authorized_action_takers.rs +++ b/packages/rs-dpp/src/data_contract/change_control_rules/authorized_action_takers.rs @@ -9,7 +9,7 @@ use std::collections::BTreeMap; use std::fmt; #[derive( - Serialize, Deserialize, Decode, Encode, Debug, Clone, PartialEq, Eq, PartialOrd, Default, + Serialize, Deserialize, Decode, Encode, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Default, )] pub enum AuthorizedActionTakers { #[default] From c1a628b3c4c9637b9648cf50083c96f290ed4cfb Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Mon, 21 Apr 2025 19:37:06 +0700 Subject: [PATCH 2/2] clippy fixes --- .../v0/mod.rs | 101 ++++++++---------- .../state_v0/mod.rs | 8 +- 2 files changed, 46 insertions(+), 63 deletions(-) diff --git a/packages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/authorized_action_takers_for_configuration_item/v0/mod.rs b/packages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/authorized_action_takers_for_configuration_item/v0/mod.rs index 3549db93b15..351bb51d13d 100644 --- a/packages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/authorized_action_takers_for_configuration_item/v0/mod.rs +++ b/packages/rs-dpp/src/data_contract/associated_token/token_configuration/methods/authorized_action_takers_for_configuration_item/v0/mod.rs @@ -18,108 +18,91 @@ impl TokenConfigurationV0 { TokenConfigurationChangeItem::TokenConfigurationNoChange => { AuthorizedActionTakers::NoOne } - TokenConfigurationChangeItem::Conventions(_) => self + TokenConfigurationChangeItem::Conventions(_) => *self .conventions_change_rules - .authorized_to_make_change_action_takers() - .clone(), + .authorized_to_make_change_action_takers(), TokenConfigurationChangeItem::ConventionsControlGroup(_) => { - self.conventions_change_rules.admin_action_takers().clone() + *self.conventions_change_rules.admin_action_takers() } TokenConfigurationChangeItem::ConventionsAdminGroup(_) => { - self.conventions_change_rules.admin_action_takers().clone() + *self.conventions_change_rules.admin_action_takers() } - TokenConfigurationChangeItem::MaxSupply(_) => self + TokenConfigurationChangeItem::MaxSupply(_) => *self .max_supply_change_rules - .authorized_to_make_change_action_takers() - .clone(), + .authorized_to_make_change_action_takers(), TokenConfigurationChangeItem::MaxSupplyControlGroup(_) => { - self.max_supply_change_rules.admin_action_takers().clone() + *self.max_supply_change_rules.admin_action_takers() } TokenConfigurationChangeItem::MaxSupplyAdminGroup(_) => { - self.max_supply_change_rules.admin_action_takers().clone() + *self.max_supply_change_rules.admin_action_takers() } - TokenConfigurationChangeItem::PerpetualDistribution(_) => self + TokenConfigurationChangeItem::PerpetualDistribution(_) => *self .distribution_rules .perpetual_distribution_rules() - .authorized_to_make_change_action_takers() - .clone(), - TokenConfigurationChangeItem::PerpetualDistributionControlGroup(_) => self + .authorized_to_make_change_action_takers(), + TokenConfigurationChangeItem::PerpetualDistributionControlGroup(_) => *self .distribution_rules .perpetual_distribution_rules() - .admin_action_takers() - .clone(), - TokenConfigurationChangeItem::PerpetualDistributionAdminGroup(_) => self + .admin_action_takers(), + TokenConfigurationChangeItem::PerpetualDistributionAdminGroup(_) => *self .distribution_rules .perpetual_distribution_rules() - .admin_action_takers() - .clone(), - TokenConfigurationChangeItem::NewTokensDestinationIdentity(_) => self + .admin_action_takers(), + TokenConfigurationChangeItem::NewTokensDestinationIdentity(_) => *self .distribution_rules .new_tokens_destination_identity_rules() - .authorized_to_make_change_action_takers() - .clone(), - TokenConfigurationChangeItem::NewTokensDestinationIdentityControlGroup(_) => self + .authorized_to_make_change_action_takers(), + TokenConfigurationChangeItem::NewTokensDestinationIdentityControlGroup(_) => *self .distribution_rules .new_tokens_destination_identity_rules() - .admin_action_takers() - .clone(), - TokenConfigurationChangeItem::NewTokensDestinationIdentityAdminGroup(_) => self + .admin_action_takers(), + TokenConfigurationChangeItem::NewTokensDestinationIdentityAdminGroup(_) => *self .distribution_rules .new_tokens_destination_identity_rules() - .admin_action_takers() - .clone(), - TokenConfigurationChangeItem::MintingAllowChoosingDestination(_) => self + .admin_action_takers(), + TokenConfigurationChangeItem::MintingAllowChoosingDestination(_) => *self .distribution_rules .minting_allow_choosing_destination_rules() - .authorized_to_make_change_action_takers() - .clone(), - TokenConfigurationChangeItem::MintingAllowChoosingDestinationControlGroup(_) => self + .authorized_to_make_change_action_takers(), + TokenConfigurationChangeItem::MintingAllowChoosingDestinationControlGroup(_) => *self .distribution_rules .minting_allow_choosing_destination_rules() - .admin_action_takers() - .clone(), - TokenConfigurationChangeItem::MintingAllowChoosingDestinationAdminGroup(_) => self + .admin_action_takers(), + TokenConfigurationChangeItem::MintingAllowChoosingDestinationAdminGroup(_) => *self .distribution_rules .minting_allow_choosing_destination_rules() - .admin_action_takers() - .clone(), + .admin_action_takers(), TokenConfigurationChangeItem::ManualMinting(_) => { - self.manual_minting_rules.admin_action_takers().clone() + *self.manual_minting_rules.admin_action_takers() } TokenConfigurationChangeItem::ManualMintingAdminGroup(_) => { - self.manual_minting_rules.admin_action_takers().clone() + *self.manual_minting_rules.admin_action_takers() } TokenConfigurationChangeItem::ManualBurning(_) => { - self.manual_burning_rules.admin_action_takers().clone() + *self.manual_burning_rules.admin_action_takers() } TokenConfigurationChangeItem::ManualBurningAdminGroup(_) => { - self.manual_burning_rules.admin_action_takers().clone() - } - TokenConfigurationChangeItem::Freeze(_) => { - self.freeze_rules.admin_action_takers().clone() + *self.manual_burning_rules.admin_action_takers() } + TokenConfigurationChangeItem::Freeze(_) => *self.freeze_rules.admin_action_takers(), TokenConfigurationChangeItem::FreezeAdminGroup(_) => { - self.freeze_rules.admin_action_takers().clone() - } - TokenConfigurationChangeItem::Unfreeze(_) => { - self.unfreeze_rules.admin_action_takers().clone() + *self.freeze_rules.admin_action_takers() } + TokenConfigurationChangeItem::Unfreeze(_) => *self.unfreeze_rules.admin_action_takers(), TokenConfigurationChangeItem::UnfreezeAdminGroup(_) => { - self.unfreeze_rules.admin_action_takers().clone() + *self.unfreeze_rules.admin_action_takers() + } + TokenConfigurationChangeItem::DestroyFrozenFunds(_) => { + *self.destroy_frozen_funds_rules.admin_action_takers() + } + TokenConfigurationChangeItem::DestroyFrozenFundsAdminGroup(_) => { + *self.destroy_frozen_funds_rules.admin_action_takers() } - TokenConfigurationChangeItem::DestroyFrozenFunds(_) => self - .destroy_frozen_funds_rules - .admin_action_takers() - .clone(), - TokenConfigurationChangeItem::DestroyFrozenFundsAdminGroup(_) => self - .destroy_frozen_funds_rules - .admin_action_takers() - .clone(), TokenConfigurationChangeItem::EmergencyAction(_) => { - self.emergency_action_rules.admin_action_takers().clone() + *self.emergency_action_rules.admin_action_takers() } TokenConfigurationChangeItem::EmergencyActionAdminGroup(_) => { - self.emergency_action_rules.admin_action_takers().clone() + *self.emergency_action_rules.admin_action_takers() } TokenConfigurationChangeItem::MainControlGroup(_) => AuthorizedActionTakers::NoOne, } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_base_transition_action/state_v0/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_base_transition_action/state_v0/mod.rs index 6114f082b94..0a755bb43e4 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_base_transition_action/state_v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/action_validation/token/token_base_transition_action/state_v0/mod.rs @@ -111,7 +111,7 @@ impl TokenBaseTransitionActionStateValidationV0 for TokenBaseTransitionAction { self.token_id(), owner_id, action_type_string, - rules.authorized_to_make_change_action_takers().clone(), + *rules.authorized_to_make_change_action_takers(), ), )), )) @@ -130,7 +130,7 @@ impl TokenBaseTransitionActionStateValidationV0 for TokenBaseTransitionAction { self.token_id(), owner_id, action_type_string, - rules.authorized_to_make_change_action_takers().clone(), + *rules.authorized_to_make_change_action_takers(), ), ), ), @@ -146,7 +146,7 @@ impl TokenBaseTransitionActionStateValidationV0 for TokenBaseTransitionAction { self.token_id(), owner_id, action_type_string, - rules.authorized_to_make_change_action_takers().clone(), + *rules.authorized_to_make_change_action_takers(), ), )), )); @@ -166,7 +166,7 @@ impl TokenBaseTransitionActionStateValidationV0 for TokenBaseTransitionAction { self.token_id(), owner_id, action_type_string, - rules.authorized_to_make_change_action_takers().clone(), + *rules.authorized_to_make_change_action_takers(), ), )), ));