-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject-settings.js
243 lines (200 loc) · 8.47 KB
/
project-settings.js
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
const BigNumber = require('bignumber.js'); // using bn.js from web3-utils
const web3util = require('web3-utils');
// these settings are used in both deployments and tests
// ethereum network related variables
let ether = 1000000000000000000; // 1 ether in wei
let days = 3600 * 24; // 1 day in seconds
let now = parseInt(( Date.now() / 1000 ).toFixed()); // unixtime now in seconds
let solidity = {
ether:ether,
days:days,
now:now
};
// Project Token settings
// hardcoded in contract atm.
let token_settings = {
// supply: new BigNumber(500).mul(10 ** 6).mul( 10 ** 18 ), // 500 mil tokens * decimals
supply: 0,
decimals: 18, // make sure to update supply decimals if updated
name: "BlockBitsIO Token",
symbol: "BBX",
version: "1" // required in order to be able to deploy a new version if need arises
};
/*
Project Token SCADA - Token Stake Calculation And Distribution Algorithm
- TokenSCADA1Market - requires a global hard cap, individual caps need to be 0
- TokenSCADA2Fixed - requires individual hard caps, global is calculated
- TokenSCADA3Variable - requires individual hard caps, global is calculated
*/
let tokenSCADA = {
type:"TokenSCADAVariable",
requires_global_hard_cap: true
};
let platformWalletAddress = "0x93f46df4161f1dd333a99a2ec6f53156c027f83f";
let pre_ico_start = 1517443201; // 00:00:01 1st of feb 2018
let pre_ico_end = 1519862399;
let ico_start = 1520640001;
let ico_end = 1525219199;
// override for tests
pre_ico_start = now + 1 * days;
pre_ico_end = now + 7 * days;
ico_start = pre_ico_end + 7 * days;
ico_end = ico_start + 30 * days;
let funding_global_soft_cap = new BigNumber(4700).mul( ether );
let funding_global_hard_cap = new BigNumber(34700).mul( ether );
let pre_amount_in_ether = new BigNumber(6700).mul( 10 ** 18 );
let ico_amount_in_ether = new BigNumber(34700).mul( 10 ** 18 ); // includes pre-ico cap, excludes extra marketing
let extra_marketing = {
"hard_cap":300 * solidity.ether, // 300 ether hard cap
"tokens_per_eth":20000, // 20 000 BBX per ETH
"start_date":pre_ico_start,
"end_date":ico_start
};
let pre_ico_settings = {
name: "PRE ICO", // bytes32 _name,
start_time: pre_ico_start, // uint256 _time_start,
end_time: pre_ico_end, // uint256 _time_end,
amount_cap_soft: 0, // uint256 _amount_cap_soft,
amount_cap_hard: pre_amount_in_ether, // uint256 _amount_cap_hard,
methods: 3, // uint8 _methods, 3 = DIRECT_AND_MILESTONE
minimum_entry: 0, // uint256 _minimum_entry,
fixed_tokens: 9800, // uint256 _fixed_tokens
price_addition_percentage: 0, // uint8 _price_addition_percentage
token_share_percentage: 0, // uint8
};
let ico_settings = {
name: "ICO",
start_time: ico_start,
end_time: ico_end,
amount_cap_soft: 0,
amount_cap_hard: ico_amount_in_ether, // includes pre-ico cap
methods: 3,
minimum_entry: 0,
fixed_tokens: 7000,
price_addition_percentage: 0, // add this many percentages to previous stage parity
token_share_percentage: 0,
};
let funding_periods = [pre_ico_settings, ico_settings];
if(tokenSCADA.requires_global_hard_cap === false) {
// remove hard caps if SCADA requires them to not be set
funding_global_soft_cap = 0;
funding_global_hard_cap = 0;
for(let i = 0; i < funding_periods.length; i++) {
funding_global_soft_cap+= funding_periods[i].amount_cap_soft;
funding_global_hard_cap+= funding_periods[i].amount_cap_hard;
funding_periods[i].amount_cap_soft = 0;
funding_periods[i].amount_cap_hard = 0;
}
}
let project_milestones = [];
project_milestones.push(
{
name: "Milestone 1", // bytes32 _name
description: "Minimalistic Platform", // string description
duration: 90 * days, // uint256 _duration
funding_percentage: 20, // uint8 _funding_percentage
}
);
project_milestones.push(
{
name: "Milestone 2", // bytes32 _name
description: "3rd Party Launch Functionality", // string description
duration: 180 * days, // uint256 _duration
funding_percentage: 20, // uint8 _funding_percentage
}
);
project_milestones.push(
{
name: "Milestone 3", // bytes32 _name
description: "Code Upgrade Tools and Token Buyback", // string description
duration: 90 * days, // uint256 _duration
funding_percentage: 10, // uint8 _funding_percentage
}
);
project_milestones.push(
{
name: "Milestone 4", // bytes32 _name
description: "Basic Risk indicators and Collaboration tools", // string description
duration: 90 * days, // uint256 _duration
funding_percentage: 15, // uint8 _funding_percentage
}
);
project_milestones.push(
{
name: "Milestone 5", // bytes32 _name
description: "Advanced functionality", // string description
duration: 90 * days, // uint256 _duration
funding_percentage: 15, // uint8 _funding_percentage
}
);
project_milestones.push(
{
name: "Milestone 6", // bytes32 _name
description: "Token Holder Upgrades", // string description
duration: 90 * days, // uint256 _duration
funding_percentage: 10, // uint8 _funding_percentage
}
);
project_milestones.push(
{
name: "Milestone 7", // bytes32 _name
description: "Full Decentralization", // string description
duration: 90 * days, // uint256 _duration
funding_percentage: 10, // uint8 _funding_percentage
}
);
let emergency_fund_percentage = 10;
let token_sale_percentage = 57;
/*
for(let i = 0; i < funding_periods.length; i++) {
token_sale_percentage+=funding_periods[i].token_share_percentage;
}
*/
let project_bylaws = {
// Token bylaws
// (0 to 100) what percentage of the whole token supply is to be sold in the funding process
"token_sale_percentage": token_sale_percentage,
// Can the application mint new tokens after initial supply is created? ( true / false )
"token_fixed_supply": true,
// Are the project owner's tokens locked until project state == COMPLETED
"owner_tokens_locked": true,
// token sale calculation and distribution algorithm
"tokenSCADA": "TokenSCADA3Variable",
// Funding bylaws
// SCADA requires global soft and hard caps
"funding_global_soft_cap": funding_global_soft_cap,
"funding_global_hard_cap": funding_global_hard_cap,
// Bounty
"token_bounty_percentage": 3,
// Proposal Bylaws
// (X days) proposal voting duration
"proposal_voting_duration": 7 * days,
// Meeting Bylaws
// (X days) how many days a meeting needs to be created in advance
"meeting_time_set_req": 7 * days,
// Milestone Bylaws
// (unixtime) milestone development starts 14 days after ico ends
"development_start": ico_end + 14 * days,
"min_postponing": 7 * days,
"max_postponing": 90 * days,
// if this is available, emergency fund will be crated out of total milestone funding amount.
// the rest gets then split up into milestone balances using their respective percentage settings
"emergency_fund_percentage": emergency_fund_percentage,
// Cashback Bylaws
"cashback_investor_no": 7 * days,
"cashback_owner_mia_dur": 3650 * days
};
let application_settings = {
bylaws:project_bylaws,
funding_periods:funding_periods,
milestones:project_milestones,
token:token_settings,
tokenSCADA:tokenSCADA,
solidity:solidity,
doDeployments: true, // true
platformWalletAddress: platformWalletAddress,
extra_marketing:extra_marketing
};
module.exports = {
application_settings:application_settings
};