1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#![cfg_attr(not(feature = "std"), no_std)]
pub mod adapter;
pub mod locked_balance;
pub mod weights;
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{
parameter_types, traits::LockIdentifier, weights::constants::WEIGHT_PER_MICROS, weights::Pays, PalletId,
RuntimeDebug,
};
pub use pallet_transaction_payment::Multiplier;
use polkadot_xcm::prelude::Here;
use polkadot_xcm::v1::MultiLocation;
pub use primitives::constants::{chain::*, currency::*, time::*};
pub use primitives::{Amount, AssetId, Balance};
use scale_info::TypeInfo;
use sp_runtime::{
generic,
traits::{BlakeTwo256, IdentifyAccount, Verify},
FixedPointNumber, MultiSignature, Perbill, Percent, Permill, Perquintill,
};
pub type BlockNumber = u32;
pub type Signature = MultiSignature;
pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;
pub type AccountIndex = u32;
pub type Index = u32;
pub type Hash = sp_core::H256;
pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_perthousand(25);
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct AssetLocation(pub MultiLocation);
impl Default for AssetLocation {
fn default() -> Self {
AssetLocation(MultiLocation::here())
}
}
pub const RELAY_CHAIN_ASSET_LOCATION: AssetLocation = AssetLocation(MultiLocation {
parents: 1,
interior: Here,
});
parameter_types! {
pub const BlockHashCount: BlockNumber = 250;
pub BlockLength: frame_system::limits::BlockLength =
frame_system::limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
pub const SS58Prefix: u16 = 10041;
pub const BasiliskExtrinsicBaseWeight: Weight = Weight::from_ref_time(200 * WEIGHT_PER_MICROS.ref_time());
}
parameter_types! {
pub const MinimumPeriod: u64 = SLOT_DURATION / 2;
pub const NativeAssetId : AssetId = CORE_ASSET_ID;
}
parameter_types! {
pub const NativeExistentialDeposit: u128 = NATIVE_EXISTENTIAL_DEPOSIT;
pub const MaxLocks: u32 = 50;
pub const MaxReserves: u32 = 50;
}
parameter_types! {
pub const MaxAuthorities: u32 = 50;
}
parameter_types! {
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(6, 100_000);
pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000u128);
pub const MultiPaymentCurrencySetFee: Pays = Pays::Yes;
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo)]
pub enum ProxyType {
Any,
CancelProxy,
Governance,
Exchange,
Transfer,
}
impl Default for ProxyType {
fn default() -> Self {
Self::Any
}
}
parameter_types! {
pub ProxyDepositBase: Balance = 4 * DOLLARS + 480 * MILLICENTS;
pub ProxyDepositFactor: Balance = 1_980 * MILLICENTS;
pub const MaxProxies: u16 = 32;
pub AnnouncementDepositBase: Balance = 4 * DOLLARS + 480 * MILLICENTS;
pub AnnouncementDepositFactor: Balance = 3_960 * MILLICENTS;
pub const MaxPending: u16 = 32;
}
parameter_types! {
pub ExchangeFee: (u32, u32) = (3, 1_000);
pub const MinTradingLimit: Balance = MIN_TRADING_LIMIT;
pub const MinPoolLiquidity: Balance = MIN_POOL_LIQUIDITY;
pub const MaxInRatio: u128 = MAX_IN_RATIO;
pub const MaxOutRatio: u128 = MAX_OUT_RATIO;
pub const RegistryStrLimit: u32 = 32;
pub const DiscountedFee: (u32, u32) = DISCOUNTED_FEE;
}
parameter_types! {
pub const DustingReward: u128 = 0;
}
parameter_types! {
pub LBPExchangeFee: (u32, u32) = (2, 1_000);
}
parameter_types! {
pub const LaunchPeriod: BlockNumber = 3 * DAYS;
pub const VotingPeriod: BlockNumber = 3 * DAYS;
pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS;
pub const MinimumDeposit: Balance = 1000 * DOLLARS;
pub const EnactmentPeriod: BlockNumber = 12 * HOURS;
pub const VoteLockingPeriod: BlockNumber = 6 * DAYS;
pub const CooloffPeriod: BlockNumber = 7 * DAYS;
pub const PreimageByteDeposit: Balance = 10 * MILLICENTS;
pub const InstantAllowed: bool = true;
pub const MaxVotes: u32 = 100;
pub const MaxProposals: u32 = 100;
}
parameter_types! {
pub const CandidacyBond: Balance = 5 * DOLLARS;
pub const VotingBondBase: Balance = CENTS;
pub const VotingBondFactor: Balance = CENTS;
pub const TermDuration: BlockNumber = 7 * DAYS;
pub const DesiredMembers: u32 = 7;
pub const DesiredRunnersUp: u32 = 9;
pub const ElectionsPhragmenPalletId: LockIdentifier = *b"phrelect";
pub const MaxElectionCandidates: u32 = 1_000;
pub const MaxElectionVoters: u32 = 10_000;
}
parameter_types! {
pub const CouncilMotionDuration: BlockNumber = 5 * DAYS;
pub const CouncilMaxProposals: u32 = 13;
pub const CouncilMaxMembers: u32 = 7;
}
parameter_types! {
pub const TechnicalMotionDuration: BlockNumber = 5 * DAYS;
pub const TechnicalMaxProposals: u32 = 20;
pub const TechnicalMaxMembers: u32 = 10;
}
parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(3);
pub const ProposalBondMinimum: Balance = 100 * DOLLARS;
pub const ProposalBondMaximum: Balance = 500 * DOLLARS;
pub const SpendPeriod: BlockNumber = 3 * DAYS;
pub const Burn: Permill = Permill::from_percent(0);
pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry");
pub const MaxApprovals: u32 = 100;
}
parameter_types! {
pub const UncleGenerations: u32 = 0;
}
parameter_types! {
pub const DataDepositPerByte: Balance = CENTS;
pub const TipCountdown: BlockNumber = 2 * HOURS;
pub const TipFindersFee: Percent = Percent::from_percent(1);
pub const TipReportDepositBase: Balance = 10 * DOLLARS;
pub const TipReportDepositPerByte: Balance = CENTS;
pub const MaximumReasonLength: u32 = 1024;
}
parameter_types! {
pub const PotId: PalletId = PalletId(*b"PotStake");
pub const MaxCandidates: u32 = 20;
pub const MinCandidates: u32 = 4;
pub const MaxInvulnerables: u32 = 50;
}
parameter_types! {
pub const Period: u32 = 4 * HOURS;
pub const Offset: u32 = 0;
}
parameter_types! {
pub MinVestedTransfer: Balance = 100_000;
pub const MaxVestingSchedules: u32 = 15;
pub const VestingPalletId: PalletId = PalletId(*b"py/vstng");
}
parameter_types! {
pub const LMPalletId: PalletId = PalletId(*b"LiqMinId");
pub const LiquidityMiningNftCollectionId: primitives::CollectionId = 1;
}
parameter_types! {
pub const WarehouseLMPalletId: PalletId = PalletId(*b"WhouseLm");
pub const MaxEntriesPerDeposit: u8 = 5; pub const MaxYieldFarmsPerGlobalFarm: u8 = 50; pub const MinPlannedYieldingPeriods: BlockNumber = 100_800; pub const MinTotalFarmRewards: Balance = NATIVE_EXISTENTIAL_DEPOSIT * 100; }
parameter_types! {
pub const BasicDeposit: Balance = 5 * DOLLARS;
pub const FieldDeposit: Balance = DOLLARS;
pub const SubAccountDeposit: Balance = 5 * DOLLARS;
pub const MaxSubAccounts: u32 = 100;
pub const MaxAdditionalFields: u32 = 100;
pub const MaxRegistrars: u32 = 20;
pub const SequentialIdOffset: u32 = 1_000_000;
}
parameter_types! {
pub DepositBase: Balance = deposit(1, 88);
pub DepositFactor: Balance = deposit(0, 32);
pub const MaxSignatories: u16 = 100;
}