Totally possible. The reward paid our per era is provided to staking as type EraPayout
, which can be anything that implements trait EraPayout
. You can have an implementation for this trait that ignores all the inputs and provides a constant value at each era.
A substrate-idiomatic way of doing that would be:
// Assuming this balance type.
type Balance = u128;
pub struct FixedEraPayout<P: Get<Balance>>(sp_std::marker::PhantomData<P>);
impl<P: Get<Balance>> EraPayout<Balance> for FixedEraPayout<P> {
fn era_payout(
_total_staked: Balance,
_total_issuance: Balance,
_era_duration_millis: u64,
) -> (Balance, Balance) {
(P::get(), 0)
}
}
Then you can reuse e.g. FixedEraPayout<ConstU128<100_000>>
in different runtimes.