15
15
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
16
use crate :: PolimecRuntime ;
17
17
use frame_support:: BoundedVec ;
18
- pub use pallet_funding:: instantiator:: { BidParams , ContributionParams , EvaluationParams } ;
18
+ pub use pallet_funding:: instantiator:: EvaluationParams ;
19
19
use pallet_funding:: {
20
- BiddingTicketSizes , ContributingTicketSizes , CurrencyMetadata , ParticipantsAccountType , ParticipationMode ,
21
- PriceProviderOf , ProjectMetadata , ProjectMetadataOf , TicketSize ,
20
+ BiddingTicketSizes , CurrencyMetadata , ParticipantsAccountType , PriceProviderOf , ProjectMetadata , ProjectMetadataOf ,
21
+ TicketSize ,
22
22
} ;
23
- use sp_arithmetic:: { FixedPointNumber , Percent } ;
24
23
25
24
use macros:: generate_accounts;
26
- use polimec_common:: { assets:: AcceptedFundingAsset , ProvideAssetPrice , USD_DECIMALS , USD_UNIT } ;
27
- use polimec_runtime:: { AccountId , PLMC } ;
28
- use sp_runtime:: { traits:: ConstU32 , Perquintill } ;
29
- use ParticipationMode :: { Classic , OTM } ;
25
+ use polimec_common:: {
26
+ assets:: AcceptedFundingAsset :: { DOT , USDC , USDT , WETH } ,
27
+ ProvideAssetPrice , USD_DECIMALS , USD_UNIT ,
28
+ } ;
29
+ use polimec_runtime:: AccountId ;
30
+ use sp_runtime:: traits:: ConstU32 ;
30
31
31
32
pub const IPFS_CID : & str = "QmeuJ24ffwLAZppQcgcggJs3n689bewednYkuc8Bx5Gngz" ;
32
33
pub const CT_DECIMALS : u8 = 18 ;
@@ -52,22 +53,12 @@ pub fn bounded_symbol() -> BoundedVec<u8, ConstU32<64>> {
52
53
pub fn ipfs_hash ( ) -> BoundedVec < u8 , ConstU32 < 96 > > {
53
54
BoundedVec :: try_from ( IPFS_CID . as_bytes ( ) . to_vec ( ) ) . unwrap ( )
54
55
}
55
- pub fn default_weights ( ) -> Vec < u8 > {
56
- vec ! [ 20u8 , 15u8 , 10u8 , 25u8 , 30u8 ]
57
- }
58
- pub fn default_bidder_modes ( ) -> Vec < ParticipationMode > {
59
- vec ! [ Classic ( 1u8 ) , Classic ( 6u8 ) , OTM , OTM , Classic ( 3u8 ) ]
60
- }
61
- pub fn default_contributor_modes ( ) -> Vec < ParticipationMode > {
62
- vec ! [ Classic ( 1u8 ) , Classic ( 1u8 ) , OTM , OTM , Classic ( 3u8 ) ]
63
- }
64
56
65
57
pub fn default_project_metadata ( issuer : AccountId ) -> ProjectMetadataOf < polimec_runtime:: Runtime > {
66
58
ProjectMetadata {
67
59
token_information : CurrencyMetadata { name : bounded_name ( ) , symbol : bounded_symbol ( ) , decimals : CT_DECIMALS } ,
68
60
mainnet_token_max_supply : 8_000_000 * CT_UNIT ,
69
61
total_allocation_size : 1_000_000 * CT_UNIT ,
70
- auction_round_allocation_percentage : Percent :: from_percent ( 50u8 ) ,
71
62
minimum_price : PriceProviderOf :: < PolimecRuntime > :: calculate_decimals_aware_price (
72
63
sp_runtime:: FixedU128 :: from_float ( 10.0 ) ,
73
64
USD_DECIMALS ,
@@ -77,95 +68,12 @@ pub fn default_project_metadata(issuer: AccountId) -> ProjectMetadataOf<polimec_
77
68
bidding_ticket_sizes : BiddingTicketSizes {
78
69
professional : TicketSize :: new ( 5000 * USD_UNIT , None ) ,
79
70
institutional : TicketSize :: new ( 5000 * USD_UNIT , None ) ,
71
+ retail : TicketSize :: new ( 10 * USD_UNIT , None ) ,
80
72
phantom : Default :: default ( ) ,
81
73
} ,
82
- contributing_ticket_sizes : ContributingTicketSizes {
83
- retail : TicketSize :: new ( USD_UNIT , None ) ,
84
- professional : TicketSize :: new ( USD_UNIT , None ) ,
85
- institutional : TicketSize :: new ( USD_UNIT , None ) ,
86
- phantom : Default :: default ( ) ,
87
- } ,
88
- participation_currencies : vec ! [ AcceptedFundingAsset :: USDT ] . try_into ( ) . unwrap ( ) ,
74
+ participation_currencies : vec ! [ USDT , USDC , DOT , WETH ] . try_into ( ) . unwrap ( ) ,
89
75
funding_destination_account : issuer,
90
76
policy_ipfs_cid : Some ( ipfs_hash ( ) ) ,
91
77
participants_account_type : ParticipantsAccountType :: Polkadot ,
92
78
}
93
79
}
94
- pub fn default_evaluations ( ) -> Vec < EvaluationParams < PolimecRuntime > > {
95
- vec ! [
96
- EvaluationParams :: from( ( EVAL_1 . into( ) , 500_000 * PLMC ) ) ,
97
- EvaluationParams :: from( ( EVAL_2 . into( ) , 250_000 * PLMC ) ) ,
98
- EvaluationParams :: from( ( EVAL_3 . into( ) , 320_000 * PLMC ) ) ,
99
- ]
100
- }
101
- pub fn default_bidders ( ) -> Vec < AccountId > {
102
- vec ! [ BIDDER_1 . into( ) , BIDDER_2 . into( ) , BIDDER_3 . into( ) , BIDDER_4 . into( ) , BIDDER_5 . into( ) ]
103
- }
104
-
105
- pub fn default_bids ( ) -> Vec < BidParams < PolimecRuntime > > {
106
- let inst = IntegrationInstantiator :: new ( None ) ;
107
- let default_metadata = default_project_metadata ( ISSUER . into ( ) ) ;
108
- let auction_allocation =
109
- default_metadata. auction_round_allocation_percentage * default_metadata. total_allocation_size ;
110
- let auction_90_percent = Perquintill :: from_percent ( 90 ) * auction_allocation;
111
- let auction_usd_funding = default_metadata. minimum_price . saturating_mul_int ( auction_90_percent) ;
112
-
113
- inst. generate_bids_from_total_usd (
114
- auction_usd_funding,
115
- default_metadata. minimum_price ,
116
- default_weights ( ) ,
117
- default_bidders ( ) ,
118
- default_bidder_modes ( ) ,
119
- )
120
- }
121
-
122
- pub fn default_community_contributions ( ) -> Vec < ContributionParams < PolimecRuntime > > {
123
- let inst = IntegrationInstantiator :: new ( None ) ;
124
-
125
- let default_metadata = default_project_metadata ( ISSUER . into ( ) ) ;
126
-
127
- let auction_allocation =
128
- default_metadata. auction_round_allocation_percentage * default_metadata. total_allocation_size ;
129
- let contribution_allocation = default_metadata. total_allocation_size - auction_allocation;
130
-
131
- let eighty_percent_funding_ct = Perquintill :: from_percent ( 80 ) * contribution_allocation;
132
- let eighty_percent_funding_usd = default_metadata. minimum_price . saturating_mul_int ( eighty_percent_funding_ct) ;
133
-
134
- inst. generate_contributions_from_total_usd (
135
- eighty_percent_funding_usd,
136
- default_metadata. minimum_price ,
137
- default_weights ( ) ,
138
- default_community_contributors ( ) ,
139
- default_contributor_modes ( ) ,
140
- )
141
- }
142
-
143
- pub fn default_remainder_contributions ( ) -> Vec < ContributionParams < PolimecRuntime > > {
144
- let inst = IntegrationInstantiator :: new ( None ) ;
145
-
146
- let default_metadata = default_project_metadata ( ISSUER . into ( ) ) ;
147
-
148
- let auction_allocation =
149
- default_metadata. auction_round_allocation_percentage * default_metadata. total_allocation_size ;
150
- let contribution_allocation = default_metadata. total_allocation_size - auction_allocation;
151
-
152
- let ten_percent_auction = Perquintill :: from_percent ( 10 ) * auction_allocation;
153
- let ten_percent_auction_usd = default_metadata. minimum_price . saturating_mul_int ( ten_percent_auction) ;
154
- let ten_percent_contribution = Perquintill :: from_percent ( 10 ) * contribution_allocation;
155
- let ten_percent_contribution_usd = default_metadata. minimum_price . saturating_mul_int ( ten_percent_contribution) ;
156
-
157
- inst. generate_contributions_from_total_usd (
158
- ten_percent_auction_usd + ten_percent_contribution_usd,
159
- default_metadata. minimum_price ,
160
- vec ! [ 20u8 , 15u8 , 10u8 , 25u8 , 23u8 , 7u8 ] ,
161
- default_remainder_contributors ( ) ,
162
- default_contributor_modes ( ) ,
163
- )
164
- }
165
- pub fn default_community_contributors ( ) -> Vec < AccountId > {
166
- vec ! [ BUYER_1 . into( ) , BUYER_2 . into( ) , BUYER_3 . into( ) , BUYER_4 . into( ) , BUYER_5 . into( ) ]
167
- }
168
-
169
- pub fn default_remainder_contributors ( ) -> Vec < AccountId > {
170
- vec ! [ EVAL_4 . into( ) , BUYER_6 . into( ) , BIDDER_6 . into( ) , EVAL_1 . into( ) , BUYER_1 . into( ) , BIDDER_1 . into( ) ]
171
- }
0 commit comments