Trait elrond_wasm_module_features::FeaturesModule [−][src]
pub trait FeaturesModule: ContractBase {
fn get_feature_flag(&self, feature_name: FeatureName<'_>) -> u8;
fn set_feature_flag(&self, feature_name: FeatureName<'_>, value: u8);
fn check_feature_on(&self, feature_name: &'static [u8], default: bool) { ... }
fn set_feature_flag_endpoint(
&self,
feature_name: Vec<u8, Global>,
value: bool
) -> SCResult<(), StaticSCError> { ... }
}
Expand description
This is a standard smart contract module, that when added to a smart contract offers feature flag capabilities.
It offers:
- an endpoint where the owner can turn features on/off
- a method to check if feature is on or not
- a macro to make calling this method even more compact