pub trait FeaturesModule: ContractBase + Sized {
fn feature_flag(
&self,
feature_name: &FeatureName<Self::Api>
) -> SingleValueMapper<Self::Api, u8>;
fn check_feature_on(&self, feature_name: &'static [u8], default: bool) { ... }
fn set_feature_flag_endpoint(
&self,
feature_name: ManagedBuffer<Self::Api>,
value: bool
) { ... }
}
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