Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hybrid Inflation Model #1077

Merged
merged 15 commits into from
Nov 17, 2023
73 changes: 46 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-modu
# Astar pallets & modules
# (wasm)
pallet-block-reward = { path = "./pallets/block-reward", default-features = false }
pallet-block-rewards-hybrid = { path = "./pallets/block-rewards-hybrid", default-features = false }
pallet-collator-selection = { path = "./pallets/collator-selection", default-features = false }
pallet-dapps-staking = { path = "./pallets/dapps-staking", default-features = false }
pallet-xc-asset-config = { path = "./pallets/xc-asset-config", default-features = false }
Expand Down
8 changes: 4 additions & 4 deletions bin/collator/src/local/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use local_runtime::{
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, BalancesConfig, BlockRewardConfig,
CouncilConfig, DemocracyConfig, EVMConfig, GenesisConfig, GrandpaConfig, GrandpaId,
Precompiles, Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TreasuryConfig,
VestingConfig,
Precompiles, RewardDistributionConfig, Signature, SudoConfig, SystemConfig,
TechnicalCommitteeConfig, TreasuryConfig, VestingConfig,
};
use sc_service::ChainType;
use sp_core::{crypto::Ss58Codec, sr25519, Pair, Public};
Expand Down Expand Up @@ -117,8 +117,8 @@ fn testnet_genesis(
},
block_reward: BlockRewardConfig {
// Make sure sum is 100
reward_config: pallet_block_reward::RewardDistributionConfig {
base_treasury_percent: Perbill::from_percent(25),
reward_config: RewardDistributionConfig {
treasury_percent: Perbill::from_percent(25),
base_staker_percent: Perbill::from_percent(30),
dapps_percent: Perbill::from_percent(20),
collators_percent: Perbill::zero(),
Expand Down
9 changes: 5 additions & 4 deletions bin/collator/src/parachain/chain_spec/shibuya.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ use sc_service::ChainType;
use shibuya_runtime::{
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, Balance, BalancesConfig, BlockRewardConfig,
CollatorSelectionConfig, CouncilConfig, DemocracyConfig, EVMChainIdConfig, EVMConfig,
GenesisConfig, ParachainInfoConfig, Precompiles, SessionConfig, SessionKeys, Signature,
SudoConfig, SystemConfig, TechnicalCommitteeConfig, TreasuryConfig, VestingConfig, SBY,
GenesisConfig, ParachainInfoConfig, Precompiles, RewardDistributionConfig, SessionConfig,
SessionKeys, Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TreasuryConfig,
VestingConfig, SBY,
};
use sp_core::{sr25519, Pair, Public};

Expand Down Expand Up @@ -115,8 +116,8 @@ fn make_genesis(
balances: BalancesConfig { balances },
block_reward: BlockRewardConfig {
// Make sure sum is 100
reward_config: pallet_block_reward::RewardDistributionConfig {
base_treasury_percent: Perbill::from_percent(10),
reward_config: RewardDistributionConfig {
treasury_percent: Perbill::from_percent(10),
base_staker_percent: Perbill::from_percent(20),
dapps_percent: Perbill::from_percent(20),
collators_percent: Perbill::from_percent(5),
Expand Down
51 changes: 51 additions & 0 deletions pallets/block-rewards-hybrid/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[package]
name = "pallet-block-rewards-hybrid"
version = "0.1.0"
license = "Apache-2.0"
description = "FRAME pallet for managing block reward issuance & distribution"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
repository.workspace = true

[dependencies]
parity-scale-codec = { workspace = true }
serde = { workspace = true }

astar-primitives = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
scale-info = { workspace = true }
sp-arithmetic = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

frame-benchmarking = { workspace = true, optional = true }

[dev-dependencies]
pallet-balances = { workspace = true }
pallet-timestamp = { workspace = true }
sp-core = { workspace = true }

[features]
default = ["std"]
std = [
"parity-scale-codec/std",
"sp-core/std",
"scale-info/std",
"sp-std/std",
"serde/std",
"frame-support/std",
"frame-system/std",
"pallet-timestamp/std",
"pallet-balances/std",
"astar-primitives/std",
]
runtime-benchmarks = [
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"astar-primitives/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime"]
Loading
Loading