Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,135 changes: 1,216 additions & 1,919 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub mod devnet {
pub fn development_config() -> DevnetChainSpec {
// Give your base currency a unit name and decimal places
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "MQTY".into());
properties.insert("tokenSymbol".into(), "KEN".into());
properties.insert("tokenDecimals".into(), 18.into());
properties.insert("ss58Format".into(), 666.into());

Expand Down Expand Up @@ -132,7 +132,7 @@ pub mod devnet {
pub fn local_testnet_config() -> DevnetChainSpec {
// Give your base currency a unit name and decimal places
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "MQTY".into());
properties.insert("tokenSymbol".into(), "KEN".into());
properties.insert("tokenDecimals".into(), 18.into());
properties.insert("ss58Format".into(), 666.into());

Expand Down Expand Up @@ -275,7 +275,7 @@ pub mod mainnet {
pub fn development_config() -> MainChainSpec {
// Give your base currency a unit name and decimal places
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "MQTY".into());
properties.insert("tokenSymbol".into(), "KEN".into());
properties.insert("tokenDecimals".into(), 18.into());
properties.insert("ss58Format".into(), 666.into());

Expand Down Expand Up @@ -332,7 +332,7 @@ pub mod mainnet {
pub fn local_testnet_config() -> MainChainSpec {
// Give your base currency a unit name and decimal places
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "MQTY".into());
properties.insert("tokenSymbol".into(), "KEN".into());
properties.insert("tokenDecimals".into(), 18.into());
properties.insert("ss58Format".into(), 666.into());

Expand Down
20 changes: 9 additions & 11 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {

impl SubstrateCli for Cli {
fn impl_name() -> String {
"Metaquity Network".into()
"Phyken Network".into()
}

fn impl_version() -> String {
Expand All @@ -98,12 +98,11 @@ impl SubstrateCli for Cli {

fn description() -> String {
format!(
"Parachain Collator Template\n\nThe command-line arguments provided first will be \
passed to the parachain node, while the arguments provided after -- will be passed \
to the relay chain node.\n\n\
{} <parachain-args> -- <relay-chain-args>",
Self::executable_name()
"Phyken Network is an app-chain and DeFi protocol, building an RWA asset
fractionalization protocol,particularly emphasizing GRWA: renewable
energies and solar power on the blockchain."
)
.into()
}

// @khssnv: ToDo: merge this from the `extended-parachain-template` with above
Expand Down Expand Up @@ -145,12 +144,11 @@ impl SubstrateCli for RelayChainCli {

fn description() -> String {
format!(
"Parachain Collator Template\n\nThe command-line arguments provided first will be \
passed to the parachain node, while the arguments provided after -- will be passed \
to the relay chain node.\n\n\
{} <parachain-args> -- <relay-chain-args>",
Self::executable_name()
"Phyken Network is an app-chain and DeFi protocol, building an RWA asset
fractionalization protocol,particularly emphasizing GRWA: renewable
energies and solar power on the blockchain."
)
.into()
}

fn author() -> String {
Expand Down
2 changes: 1 addition & 1 deletion node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::sync::Arc;
use runtime_common::{AccountId, Balance, Block, Nonce};

use sc_client_api::AuxStore;
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
pub use sc_rpc::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
use sp_api::{CallApiAt, ProvideRuntimeApi};
use sp_block_builder::BlockBuilder;
Expand Down
46 changes: 23 additions & 23 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub type Executive = frame_executive::Executive<

// SBP-M2 review: duplicate module implementations, move to runtime/common to standardise across devnet/mainnet
pub mod fee {
use super::{Balance, ExtrinsicBaseWeight, MILLIMQTY};
use super::{Balance, ExtrinsicBaseWeight, MILLIKEN};
use frame_support::weights::{
FeePolynomial, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients,
WeightToFeePolynomial,
Expand Down Expand Up @@ -154,9 +154,9 @@ pub mod fee {
impl WeightToFeePolynomial for RefTimeToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIMQTY:
// in our template, we map to 1/10 of that, or 1/10 MILLIMQTY
let p = MILLIMQTY / 10;
// in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIKEN:
// in our template, we map to 1/10 of that, or 1/10 MILLIKEN
let p = MILLIKEN / 10;
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
smallvec![WeightToFeeCoefficient {
degree: 1,
Expand All @@ -173,7 +173,7 @@ pub mod fee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// Map 10kb proof to 1 CENT.
let p = MILLIMQTY / 10;
let p = MILLIKEN / 10;
let q = 10_000;

smallvec![WeightToFeeCoefficient {
Expand Down Expand Up @@ -221,15 +221,15 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
};

// SBP-M2 review: move duplicate constants to runtime/common to standardise across devnet/mainnet
pub const MICROMQTY: Balance = 1_000_000_000_000;
pub const MILLIMQTY: Balance = 1_000 * MICROMQTY;
pub const MQTY: Balance = 1_000 * MILLIMQTY;
pub const MICROKEN: Balance = 1_000_000_000_000;
pub const MILLIKEN: Balance = 1_000 * MICROKEN;
pub const KEN: Balance = 1_000 * MILLIKEN;

pub const EXISTENTIAL_DEPOSIT: Balance = MILLIMQTY;
pub const EXISTENTIAL_DEPOSIT: Balance = MILLIKEN;

// SBP-M2 review: move to runtime/common to standardise across devnet/mainnet
pub const fn deposit(items: u32, bytes: u32) -> Balance {
(items as Balance * 20 * MQTY + (bytes as Balance) * 100 * MICROMQTY) / 100
(items as Balance * 20 * KEN + (bytes as Balance) * 100 * MICROKEN) / 100
}

/// The version information used to identify this runtime when compiled natively.
Expand Down Expand Up @@ -365,7 +365,7 @@ impl pallet_balances::Config for Runtime {

// SBP-M2 review: move duplicate constants to runtime/common to standardise across devnet/mainnet
parameter_types! {
pub const AssetDeposit: Balance = 10 * MQTY;
pub const AssetDeposit: Balance = 10 * KEN;
pub const StringLimit: u32 = 50;
}

Expand All @@ -377,10 +377,10 @@ impl pallet_assets::Config for Runtime {
type AssetIdParameter = parity_scale_codec::Compact<u32>;
type Currency = Balances;
// SBP-M1 review: consider whether anyone should be able to permissionlessly create an asset -
// should probably be set to MQTY admin origin only.
// should probably be set to KEN admin origin only.
// TODO (@khssnv): consider Asset originator or Verifier origin only
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
// SBP-M1 review: may need to be root or MQTY admin origin to allow force_set_metadata for
// SBP-M1 review: may need to be root or KEN admin origin to allow force_set_metadata for
// fractionalised assets - see EitherOf<L, R>.
// TODO (@khssnv): consider Verifier origin
type ForceOrigin = EnsureRoot<AccountId>;
Expand All @@ -401,7 +401,7 @@ impl pallet_assets::Config for Runtime {
// SBP-M2 review: move duplicate constants to runtime/common to standardise across devnet/mainnet
parameter_types! {
/// Relay Chain `TransactionByteFee` / 10
pub const TransactionByteFee: Balance = 10 * MICROMQTY;
pub const TransactionByteFee: Balance = 10 * MICROKEN;
}

impl pallet_transaction_payment::Config for Runtime {
Expand Down Expand Up @@ -635,7 +635,7 @@ impl pallet_identity::Config for Runtime {
type MaxRegistrars = ConstU32<20>;
type Slashed = Treasury;
type ForceOrigin = EnsureRoot<AccountId>;
// SBP-M1 review: should be EnsureRoot or MQTY admin origin to maintain registrar integrity
// SBP-M1 review: should be EnsureRoot or KEN admin origin to maintain registrar integrity
// TODO (@khssnv): consider Verifier origin
type RegistrarOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
Expand All @@ -651,14 +651,14 @@ impl pallet_nfts::Config for Runtime {
type ItemId = u32;
type Currency = Balances;
type ForceOrigin = EnsureRoot<AccountId>;
type CollectionDeposit = ConstU128<{ 100 * MQTY }>;
type ItemDeposit = ConstU128<{ 1 * MQTY }>;
type CollectionDeposit = ConstU128<{ 100 * KEN }>;
type ItemDeposit = ConstU128<{ 1 * KEN }>;
// SBP-M1 review: provide justification as to how 10 is determined.
// TODO (@khssnv): reconsider
type MetadataDepositBase = ConstU128<{ 10 * MQTY }>;
type MetadataDepositBase = ConstU128<{ 10 * KEN }>;
// SBP-M1 review: provide justification as to how 10 is determined.
// TODO (@khssnv): reconsider
type AttributeDepositBase = ConstU128<{ 10 * MQTY }>;
type AttributeDepositBase = ConstU128<{ 10 * KEN }>;
type DepositPerByte = ConstU128<{ deposit(0, 1) }>;
type StringLimit = ConstU32<256>;
type KeyLimit = ConstU32<64>;
Expand All @@ -677,7 +677,7 @@ impl pallet_nfts::Config for Runtime {
// SBP-M1 review: consider whether any user with access to public chain should be able to
// permissionlessly create collections, which is currently the case here. The use-case/UI
// screenshots imply that asset verification is required, so assume the onchain creation of
// collections should only be carried out by MQTY admin (e.g. configure CreateOrigin as MQTY
// collections should only be carried out by KEN admin (e.g. configure CreateOrigin as KEN
// admin) and then assets (NFTs) minted by the collection admin once verified.
// TODO (@khssnv): consider Asset originator or Verifier origin only
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
Expand Down Expand Up @@ -721,12 +721,12 @@ impl pallet_nft_fractionalization::Config for Runtime {
// SBP-M2 review: move duplicate constants to runtime/common to standardise across devnet/mainnet
parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const ProposalBondMinimum: Balance = 1 * MQTY;
pub const ProposalBondMinimum: Balance = 1 * KEN;
pub const SpendPeriod: BlockNumber = 1 * DAYS;
pub const Burn: Permill = Permill::from_percent(50);
pub const TipCountdown: BlockNumber = 1 * DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: Balance = 1 * MQTY;
pub const TipReportDepositBase: Balance = 1 * KEN;
pub const DataDepositPerByte: Balance = deposit(0, 1);
pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry");
pub const MaximumReasonLength: u32 = 300;
Expand Down Expand Up @@ -768,7 +768,7 @@ impl pallet_vesting::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = ConstU128<{ 1 * MQTY }>;
type MinVestedTransfer = ConstU128<{ 1 * KEN }>;
type WeightInfo = pallet_vesting::weights::SubstrateWeight<Runtime>;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
// `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the
Expand Down
1 change: 0 additions & 1 deletion runtime/devnet/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ pub mod rocksdb_weights;

pub use block_weights::constants::BlockExecutionWeight;
pub use extrinsic_weights::constants::ExtrinsicBaseWeight;
pub use paritydb_weights::constants::ParityDbWeight;
pub use rocksdb_weights::constants::RocksDbWeight;
46 changes: 23 additions & 23 deletions runtime/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub type Executive = frame_executive::Executive<

// SBP-M2 review: duplicate module implementations, move to runtime/common to standardise across devnet/mainnet
pub mod fee {
use super::{Balance, ExtrinsicBaseWeight, MILLIMQTY};
use super::{Balance, ExtrinsicBaseWeight, MILLIKEN};
use frame_support::weights::{
FeePolynomial, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients,
WeightToFeePolynomial,
Expand Down Expand Up @@ -154,9 +154,9 @@ pub mod fee {
impl WeightToFeePolynomial for RefTimeToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIMQTY:
// in our template, we map to 1/10 of that, or 1/10 MILLIMQTY
let p = MILLIMQTY / 10;
// in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIKEN:
// in our template, we map to 1/10 of that, or 1/10 MILLIKEN
let p = MILLIKEN / 10;
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
smallvec![WeightToFeeCoefficient {
degree: 1,
Expand All @@ -173,7 +173,7 @@ pub mod fee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// Map 10kb proof to 1 CENT.
let p = MILLIMQTY / 10;
let p = MILLIKEN / 10;
let q = 10_000;

smallvec![WeightToFeeCoefficient {
Expand Down Expand Up @@ -221,15 +221,15 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
};

// SBP-M2 review: move duplicate constants to runtime/common to standardise across devnet/mainnet
pub const MICROMQTY: Balance = 1_000_000_000_000;
pub const MILLIMQTY: Balance = 1_000 * MICROMQTY;
pub const MQTY: Balance = 1_000 * MILLIMQTY;
pub const MICROKEN: Balance = 1_000_000_000_000;
pub const MILLIKEN: Balance = 1_000 * MICROKEN;
pub const KEN: Balance = 1_000 * MILLIKEN;

pub const EXISTENTIAL_DEPOSIT: Balance = MILLIMQTY;
pub const EXISTENTIAL_DEPOSIT: Balance = MILLIKEN;

// SBP-M2 review: move to runtime/common to standardise across devnet/mainnet
pub const fn deposit(items: u32, bytes: u32) -> Balance {
(items as Balance * 20 * MQTY + (bytes as Balance) * 100 * MICROMQTY) / 100
(items as Balance * 20 * KEN + (bytes as Balance) * 100 * MICROKEN) / 100
}

/// The version information used to identify this runtime when compiled natively.
Expand Down Expand Up @@ -365,7 +365,7 @@ impl pallet_balances::Config for Runtime {

// SBP-M2 review: move duplicate constants to runtime/common to standardise across devnet/mainnet
parameter_types! {
pub const AssetDeposit: Balance = 10 * MQTY;
pub const AssetDeposit: Balance = 10 * KEN;
pub const StringLimit: u32 = 50;
}

Expand All @@ -377,10 +377,10 @@ impl pallet_assets::Config for Runtime {
type AssetIdParameter = parity_scale_codec::Compact<u32>;
type Currency = Balances;
// SBP-M1 review: consider whether anyone should be able to permissionlessly create an asset -
// should probably be set to MQTY admin origin only.
// should probably be set to KEN admin origin only.
// TODO (@khssnv): consider Asset originator or Verifier origin only
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
// SBP-M1 review: may need to be root or MQTY admin origin to allow force_set_metadata for
// SBP-M1 review: may need to be root or KEN admin origin to allow force_set_metadata for
// fractionalised assets - see EitherOf<L, R>.
// TODO (@khssnv): consider Verifier origin
type ForceOrigin = EnsureRoot<AccountId>;
Expand All @@ -401,7 +401,7 @@ impl pallet_assets::Config for Runtime {
// SBP-M2 review: move duplicate constants to runtime/common to standardise across devnet/mainnet
parameter_types! {
/// Relay Chain `TransactionByteFee` / 10
pub const TransactionByteFee: Balance = 10 * MICROMQTY;
pub const TransactionByteFee: Balance = 10 * MICROKEN;
}

impl pallet_transaction_payment::Config for Runtime {
Expand Down Expand Up @@ -635,7 +635,7 @@ impl pallet_identity::Config for Runtime {
type MaxRegistrars = ConstU32<20>;
type Slashed = Treasury;
type ForceOrigin = EnsureRoot<AccountId>;
// SBP-M1 review: should be EnsureRoot or MQTY admin origin to maintain registrar integrity
// SBP-M1 review: should be EnsureRoot or KEN admin origin to maintain registrar integrity
// TODO (@khssnv): consider Verifier origin
type RegistrarOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
Expand All @@ -651,14 +651,14 @@ impl pallet_nfts::Config for Runtime {
type ItemId = u32;
type Currency = Balances;
type ForceOrigin = EnsureRoot<AccountId>;
type CollectionDeposit = ConstU128<{ 100 * MQTY }>;
type ItemDeposit = ConstU128<{ 1 * MQTY }>;
type CollectionDeposit = ConstU128<{ 100 * KEN }>;
type ItemDeposit = ConstU128<{ 1 * KEN }>;
// SBP-M1 review: provide justification as to how 10 is determined.
// TODO (@khssnv): reconsider
type MetadataDepositBase = ConstU128<{ 10 * MQTY }>;
type MetadataDepositBase = ConstU128<{ 10 * KEN }>;
// SBP-M1 review: provide justification as to how 10 is determined.
// TODO (@khssnv): reconsider
type AttributeDepositBase = ConstU128<{ 10 * MQTY }>;
type AttributeDepositBase = ConstU128<{ 10 * KEN }>;
type DepositPerByte = ConstU128<{ deposit(0, 1) }>;
type StringLimit = ConstU32<256>;
type KeyLimit = ConstU32<64>;
Expand All @@ -677,7 +677,7 @@ impl pallet_nfts::Config for Runtime {
// SBP-M1 review: consider whether any user with access to public chain should be able to
// permissionlessly create collections, which is currently the case here. The use-case/UI
// screenshots imply that asset verification is required, so assume the onchain creation of
// collections should only be carried out by MQTY admin (e.g. configure CreateOrigin as MQTY
// collections should only be carried out by KEN admin (e.g. configure CreateOrigin as KEN
// admin) and then assets (NFTs) minted by the collection admin once verified.
// TODO (@khssnv): consider Asset originator or Verifier origin only
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
Expand Down Expand Up @@ -722,15 +722,15 @@ impl pallet_nft_fractionalization::Config for Runtime {
// SBP-M2 review: appears to be copied from the Substrate kitchensink-runtime without much further consideration
parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const ProposalBondMinimum: Balance = 1 * MQTY;
pub const ProposalBondMinimum: Balance = 1 * KEN;
pub const SpendPeriod: BlockNumber = 1 * DAYS;
pub const Burn: Permill = Permill::from_percent(50);
// SBP-M2 review: not used (same in devnet runtime)
pub const TipCountdown: BlockNumber = 1 * DAYS;
// SBP-M2 review: not used (same in devnet runtime)
pub const TipFindersFee: Percent = Percent::from_percent(20);
// SBP-M2 review: not used (same in devnet runtime)
pub const TipReportDepositBase: Balance = 1 * MQTY;
pub const TipReportDepositBase: Balance = 1 * KEN;
// SBP-M2 review: not used (same in devnet runtime)
pub const DataDepositPerByte: Balance = deposit(0, 1);
pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry");
Expand Down Expand Up @@ -775,7 +775,7 @@ impl pallet_vesting::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = ConstU128<{ 1 * MQTY }>;
type MinVestedTransfer = ConstU128<{ 1 * KEN }>;
type WeightInfo = pallet_vesting::weights::SubstrateWeight<Runtime>;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
// `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the
Expand Down
1 change: 0 additions & 1 deletion runtime/mainnet/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ pub mod rocksdb_weights;

pub use block_weights::constants::BlockExecutionWeight;
pub use extrinsic_weights::constants::ExtrinsicBaseWeight;
pub use paritydb_weights::constants::ParityDbWeight;
pub use rocksdb_weights::constants::RocksDbWeight;