@@ -72,11 +72,12 @@ use astar_primitives::{
72
72
} ,
73
73
evm:: { EvmRevertCodeHandler , HashedDefaultMappings } ,
74
74
governance:: {
75
- CommunityCouncilCollectiveInst , CommunityCouncilMembershipInst , EnsureRootOrAllMainCouncil ,
76
- EnsureRootOrAllTechnicalCommittee , EnsureRootOrTwoThirdsCommunityCouncil ,
77
- EnsureRootOrTwoThirdsMainCouncil , EnsureRootOrTwoThirdsTechnicalCommittee ,
78
- MainCouncilCollectiveInst , MainCouncilMembershipInst , MainTreasuryInst ,
79
- TechnicalCommitteeCollectiveInst , TechnicalCommitteeMembershipInst ,
75
+ CommunityCouncilCollectiveInst , CommunityCouncilMembershipInst , CommunityTreasuryInst ,
76
+ EnsureRootOrAllMainCouncil , EnsureRootOrAllTechnicalCommittee ,
77
+ EnsureRootOrTwoThirdsCommunityCouncil , EnsureRootOrTwoThirdsMainCouncil ,
78
+ EnsureRootOrTwoThirdsTechnicalCommittee , MainCouncilCollectiveInst ,
79
+ MainCouncilMembershipInst , MainTreasuryInst , TechnicalCommitteeCollectiveInst ,
80
+ TechnicalCommitteeMembershipInst ,
80
81
} ,
81
82
Address , AssetId , Balance , BlockNumber , Hash , Header , Nonce ,
82
83
} ;
@@ -1022,7 +1023,7 @@ impl pallet_democracy::Config for Runtime {
1022
1023
1023
1024
parameter_types ! {
1024
1025
pub const ProposalBond : Permill = Permill :: from_percent( 5 ) ;
1025
- pub TreasuryAccount : AccountId = Treasury :: account_id( ) ;
1026
+ pub MainTreasuryAccount : AccountId = Treasury :: account_id( ) ;
1026
1027
}
1027
1028
1028
1029
impl pallet_treasury:: Config < MainTreasuryInst > for Runtime {
@@ -1050,7 +1051,48 @@ impl pallet_treasury::Config<MainTreasuryInst> for Runtime {
1050
1051
type AssetKind = ( ) ; // Only native asset is supported
1051
1052
type Beneficiary = AccountId ;
1052
1053
type BeneficiaryLookup = IdentityLookup < Self :: Beneficiary > ;
1053
- type Paymaster = PayFromAccount < Balances , TreasuryAccount > ;
1054
+ type Paymaster = PayFromAccount < Balances , MainTreasuryAccount > ;
1055
+ type BalanceConverter = UnityAssetBalanceConversion ;
1056
+
1057
+ // New approach to using treasury, useful for OpenGov but not necessarily for us.
1058
+ type SpendOrigin = frame_support:: traits:: NeverEnsureOrigin < Balance > ;
1059
+ // Only used by 'spend' approach which is disabled
1060
+ type PayoutPeriod = ConstU32 < 0 > ;
1061
+ #[ cfg( feature = "runtime-benchmarks" ) ]
1062
+ type BenchmarkHelper = ( ) ;
1063
+ type WeightInfo = pallet_treasury:: weights:: SubstrateWeight < Runtime > ;
1064
+ }
1065
+
1066
+ parameter_types ! {
1067
+ pub const CommunityTreasuryPalletId : PalletId = PalletId ( * b"py/comtr" ) ;
1068
+ }
1069
+
1070
+ impl pallet_treasury:: Config < CommunityTreasuryInst > for Runtime {
1071
+ type PalletId = CommunityTreasuryPalletId ;
1072
+ type Currency = Balances ;
1073
+ type RuntimeEvent = RuntimeEvent ;
1074
+
1075
+ // Two origins which can either approve or reject the spending proposal
1076
+ type ApproveOrigin = EnsureRootOrTwoThirdsCommunityCouncil ;
1077
+ type RejectOrigin = EnsureRootOrTwoThirdsCommunityCouncil ;
1078
+
1079
+ type OnSlash = CommunityTreasury ;
1080
+ type ProposalBond = ProposalBond ;
1081
+ type ProposalBondMinimum = ConstU128 < { 10 * AST } > ;
1082
+ // TODO: do we even want this or should we make it unlimited?
1083
+ type ProposalBondMaximum = ConstU128 < { 100 * AST } > ;
1084
+ type SpendPeriod = ConstU32 < { 1 * MINUTES } > ;
1085
+
1086
+ // We don't do periodic burns of the community treasury
1087
+ type Burn = ( ) ;
1088
+ type BurnDestination = ( ) ;
1089
+ type SpendFunds = ( ) ;
1090
+
1091
+ type MaxApprovals = ConstU32 < 64 > ;
1092
+ type AssetKind = ( ) ; // Only native asset is supported
1093
+ type Beneficiary = AccountId ;
1094
+ type BeneficiaryLookup = IdentityLookup < Self :: Beneficiary > ;
1095
+ type Paymaster = PayFromAccount < Balances , MainTreasuryAccount > ;
1054
1096
type BalanceConverter = UnityAssetBalanceConversion ;
1055
1097
1056
1098
// New approach to using treasury, useful for OpenGov but not necessarily for us.
@@ -1088,6 +1130,7 @@ construct_runtime!(
1088
1130
CommunityCouncil : pallet_collective:: <Instance4 >,
1089
1131
Democracy : pallet_democracy,
1090
1132
Treasury : pallet_treasury:: <Instance1 >,
1133
+ CommunityTreasury : pallet_treasury:: <Instance2 >,
1091
1134
1092
1135
EVM : pallet_evm,
1093
1136
Ethereum : pallet_ethereum,
0 commit comments