Scorum
config.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Steemit, Inc., and contributors.
3  */
4 
5 // clang-format off
6 
7 #pragma once
8 
10 #include <boost/preprocessor/cat.hpp>
11 
12 namespace scorum {
13 namespace protocol {
14 
15 namespace detail {
16 
17  struct config
18  {
19  static std::unique_ptr<config> instance;
20 
21  const uint32_t blockid_pool_size;
22 
25 
26  const uint32_t cashout_window_seconds;
27 
28  const fc::microseconds upvote_lockout;
29 
30  const fc::microseconds active_sp_holders_reward_period;
31 
33 
34  const fc::microseconds reverse_auction_window_seconds;
35 
36  const fc::microseconds vote_regeneration_seconds;
37 
38  const fc::microseconds owner_auth_recovery_period;
40  const fc::microseconds owner_update_limit;
41 
42  const fc::microseconds recent_rshares_decay_rate;
43 
47 
48  const uint32_t budgets_limit_per_owner;
49 
52 
55 
56  const uint32_t min_vote_interval_sec;
57 
59 
60  const fc::time_point_sec initial_date;
61 
62  const fc::time_point_sec blogging_start_date;
63 
64  const fc::time_point_sec fifa_world_cup_2018_bounty_cashout_date;
65 
66  const fc::microseconds expiraton_for_registration_bonus;
67 
68  const fc::time_point_sec witness_reward_migration_date;
69 
70  const uint8_t scorum_max_witnesses;
71 
73 
75 
76  enum test_mode { test };
77 
78  explicit config(test_mode);
79  config();
80  };
81 
82  const config& get_config();
83 
84  void override_config(std::unique_ptr<config> new_config);
85 }
86 }
87 }
88 
89 #define DAYS_TO_SECONDS(X) (60u*60u*24u*X)
90 
91 #define SCORUM_BLOCKCHAIN_VERSION ( version(0, 6, 0) )
92 
93 #define SCORUM_BLOCKCHAIN_HARDFORK_VERSION ( hardfork_version( SCORUM_BLOCKCHAIN_VERSION ) )
94 
95 #define SCORUM_ADDRESS_PREFIX "SCR"
96 
97 #define SCORUM_CURRENCY_PRECISION 9
98 
99 #define SCORUM_DEFAULT_BUDGETS_AUCTION_SET {100, 85, 75, 65}
100 
101 // Scorum Coin = SCR with 9 digits of precision
102 #define SCORUM_SYMBOL (uint64_t(SCORUM_CURRENCY_PRECISION) | (uint64_t('S') << 8) | (uint64_t('C') << 16) | (uint64_t('R') << 24))
103 // Scorum Power = SP with 9 digits of precision
104 #define SP_SYMBOL (uint64_t(SCORUM_CURRENCY_PRECISION) | (uint64_t('S') << 8) | (uint64_t('P') << 16))
105 
106 #define SCORUM_MAX_SHARE_SUPPLY share_value_type(100000000e+9) //100 million
107 
108 #define SCORUM_VOTE_DUST_THRESHOLD share_type(50)
109 
110 #define SCORUM_ATOMICSWAP_CONTRACT_METADATA_MAX_LENGTH 10*1024
111 #define SCORUM_ATOMICSWAP_SECRET_MAX_LENGTH 1024
112 
113 //Got only minimum for transactions bandwidth. Required spend SCR to enlarge up to SCORUM_VOTE_DUST_THRESHOLD
114 #define SCORUM_MIN_ACCOUNT_CREATION_FEE asset(SCORUM_VOTE_DUST_THRESHOLD/2, SCORUM_SYMBOL)
115 
116 #define SCORUM_MIN_COMMENT_PAYOUT_SHARE share_type(5)
117 
118 #define SCORUM_MIN_PER_BLOCK_REWARD share_type(1)
119 
120 #define SCORUM_CREATE_ACCOUNT_WITH_SCORUM_MODIFIER 30
121 
122 #define SCORUM_MIN_DELEGATE_VESTING_SHARES_MODIFIER 10
123 
124 #define SCORUM_START_WITHDRAW_COEFFICIENT 10
125 
126 #define SCORUM_ACTIVE_SP_HOLDERS_REWARD_PERIOD (scorum::protocol::detail::get_config().active_sp_holders_reward_period)
127 
128 #define SCORUM_MIN_BET_STAKE_FOR_MATCHING share_type(1)
129 
130 
132 #define SCORUM_BLOCKID_POOL_SIZE (scorum::protocol::detail::get_config().blockid_pool_size)
133 
134 #define SCORUM_CASHOUT_WINDOW_SECONDS (scorum::protocol::detail::get_config().cashout_window_seconds)
135 
136 #define SCORUM_UPVOTE_LOCKOUT (scorum::protocol::detail::get_config().upvote_lockout)
137 
138 #define SCORUM_OWNER_AUTH_RECOVERY_PERIOD (scorum::protocol::detail::get_config().owner_auth_recovery_period)
139 #define SCORUM_ACCOUNT_RECOVERY_REQUEST_EXPIRATION_PERIOD (scorum::protocol::detail::get_config().account_recovery_request_expiration_period)
140 #define SCORUM_OWNER_UPDATE_LIMIT (scorum::protocol::detail::get_config().owner_update_limit)
141 
142 #define SCORUM_REWARDS_INITIAL_SUPPLY_PERIOD_IN_DAYS (scorum::protocol::detail::get_config().rewards_initial_supply_period_in_days)
143 
144 #define SCORUM_GUARANTED_REWARD_SUPPLY_PERIOD_IN_DAYS (scorum::protocol::detail::get_config().guaranted_reward_supply_period_in_days)
145 #define SCORUM_REWARD_INCREASE_THRESHOLD_IN_DAYS (scorum::protocol::detail::get_config().reward_increase_threshold_in_days)
146 
147 #define SCORUM_BUDGETS_LIMIT_PER_OWNER (scorum::protocol::detail::get_config().budgets_limit_per_owner)
148 
149 #define SCORUM_ATOMICSWAP_INITIATOR_REFUND_LOCK_SECS (scorum::protocol::detail::get_config().atomicswap_initiator_refund_lock_secs)
150 #define SCORUM_ATOMICSWAP_PARTICIPANT_REFUND_LOCK_SECS (scorum::protocol::detail::get_config().atomicswap_participant_refund_lock_secs)
151 
152 #define SCORUM_ATOMICSWAP_LIMIT_REQUESTED_CONTRACTS_PER_OWNER (scorum::protocol::detail::get_config().atomicswap_limit_requested_contracts_per_owner)
153 #define SCORUM_ATOMICSWAP_LIMIT_REQUESTED_CONTRACTS_PER_RECIPIENT (scorum::protocol::detail::get_config().atomicswap_limit_requested_contracts_per_recipient)
154 
155 #define SCORUM_VESTING_WITHDRAW_INTERVALS (scorum::protocol::detail::get_config().vesting_withdraw_intervals)
156 #define SCORUM_VESTING_WITHDRAW_INTERVAL_SECONDS (scorum::protocol::detail::get_config().vesting_withdraw_interval_seconds)
157 
158 #define SCORUM_MIN_VOTE_INTERVAL_SEC (scorum::protocol::detail::get_config().min_vote_interval_sec)
159 
160 #define SCORUM_DB_FREE_MEMORY_THRESHOLD_MB (scorum::protocol::detail::get_config().db_free_memory_threshold_mb)
161 
163 
164 #define SCORUM_REGISTRATION_BONUS_LIMIT_PER_MEMBER_PER_N_BLOCK 100
165 
166 #define SCORUM_REGISTRATION_BONUS_LIMIT_PER_MEMBER_N_BLOCK 2
167 
168 #define SCORUM_REGISTRATION_COMMITTEE_MAX_MEMBERS_LIMIT 30
169 #define SCORUM_DEVELOPMENT_COMMITTEE_MAX_MEMBERS_LIMIT 30
170 
171 #define SCORUM_BLOCK_INTERVAL 3
172 #define SCORUM_BLOCKS_PER_YEAR (365*24*60*60/SCORUM_BLOCK_INTERVAL)
173 #define SCORUM_BLOCKS_PER_DAY (24*60*60/SCORUM_BLOCK_INTERVAL)
174 #define SCORUM_BLOCKS_PER_HOUR (60*60/SCORUM_BLOCK_INTERVAL)
175 #define SCORUM_START_MINER_VOTING_BLOCK (SCORUM_BLOCKS_PER_DAY * 30)
176 
177 #define SCORUM_MAX_VOTED_WITNESSES (scorum::protocol::detail::get_config().scorum_max_voted_witnesses)
178 #define SCORUM_MAX_RUNNER_WITNESSES (scorum::protocol::detail::get_config().scorum_max_witnesses - scorum::protocol::detail::get_config().scorum_max_voted_witnesses)
179 #define SCORUM_MAX_WITNESSES (scorum::protocol::detail::get_config().scorum_max_witnesses)
180 #define SCORUM_MAX_WITNESSES_LIMIT 21
181 #define SCORUM_WITNESS_MISSED_BLOCKS_THRESHOLD SCORUM_BLOCKS_PER_DAY/2
182 #define SCORUM_HARDFORK_REQUIRED_WITNESSES (scorum::protocol::detail::get_config().scorum_hardfork_required_witnesses)
183 
184 #define SCORUM_MAX_TIME_UNTIL_EXPIRATION (60*60) // seconds, aka: 1 hour
185 #define SCORUM_MAX_MEMO_SIZE 2048
186 #define SCORUM_MAX_PROXY_RECURSION_DEPTH 4
187 
188 #define SCORUM_MAX_WITHDRAW_ROUTES 10
189 #define SCORUM_SAVINGS_WITHDRAW_TIME (fc::days(3))
190 #define SCORUM_SAVINGS_WITHDRAW_REQUEST_LIMIT 100
191 #define SCORUM_VOTE_REGENERATION_SECONDS (scorum::protocol::detail::get_config().vote_regeneration_seconds)
192 #define SCORUM_MAX_VOTE_CHANGES 3
193 #define SCORUM_REVERSE_AUCTION_WINDOW_SECONDS (scorum::protocol::detail::get_config().reverse_auction_window_seconds)
194 
195 #define SCORUM_MIN_ROOT_COMMENT_INTERVAL (fc::minutes(5))
196 #define SCORUM_MIN_REPLY_INTERVAL (fc::seconds(20))
197 
198 #define SCORUM_MAX_ACCOUNT_WITNESS_VOTES 30
199 
200 #define SCORUM_100_PERCENT 10000
201 #define SCORUM_1_PERCENT (SCORUM_100_PERCENT/100)
202 #define SCORUM_1_TENTH_PERCENT (SCORUM_100_PERCENT/1000)
203 #define SCORUM_PERCENT(X) (uint16_t)(X*SCORUM_1_PERCENT)
204 
205 #define SCORUM_DEV_TEAM_PER_BLOCK_REWARD_PERCENT SCORUM_PERCENT(50)
206 #define SCORUM_WITNESS_PER_BLOCK_REWARD_PERCENT SCORUM_PERCENT(10)
207 #define SCORUM_ACTIVE_SP_HOLDERS_PER_BLOCK_REWARD_PERCENT SCORUM_PERCENT(10)
208 #define SCORUM_CURATION_REWARD_PERCENT SCORUM_PERCENT(25)
209 #define SCORUM_PARENT_COMMENT_REWARD_PERCENT SCORUM_PERCENT(50)
210 
211 #define SCORUM_ADJUST_REWARD_PERCENT SCORUM_PERCENT(5)
212 
213 #define SCORUM_BANDWIDTH_AVERAGE_WINDOW_SECONDS (DAYS_TO_SECONDS(7))
214 #define SCORUM_BANDWIDTH_PRECISION (uint64_t(1000000))
215 #define SCORUM_MAX_COMMENT_DEPTH (6)
216 #define SCORUM_SOFT_MAX_COMMENT_DEPTH (6)
217 
218 #define SCORUM_MAX_RESERVE_RATIO (20000)
219 
220 #define SCORUM_CREATE_ACCOUNT_DELEGATION_RATIO 5
221 #define SCORUM_CREATE_ACCOUNT_DELEGATION_TIME fc::days(30)
222 #define SCORUM_CREATE_ACCOUNT_REG_COMMITTEE_DELEGATION_MAX asset(10'000'000'000, SP_SYMBOL)
223 
224 #define SCORUM_RECENT_RSHARES_DECAY_RATE (scorum::protocol::detail::get_config().recent_rshares_decay_rate)
225 // note, if redefining these constants make sure calculate_claims doesn't overflow
226 
227 #define SCORUM_MIN_ACCOUNT_NAME_LENGTH 3
228 #define SCORUM_MAX_ACCOUNT_NAME_LENGTH 16
229 
230 #define SCORUM_MIN_PERMLINK_LENGTH 0
231 #define SCORUM_MAX_PERMLINK_LENGTH 256
232 #define SCORUM_MAX_WITNESS_URL_LENGTH 2048
233 
234 #define SCORUM_MAX_SIG_CHECK_DEPTH 2
235 
236 #define SCORUM_MAX_TRANSACTION_SIZE (1024*64)
237 #define SCORUM_MIN_BLOCK_SIZE_LIMIT (SCORUM_MAX_TRANSACTION_SIZE)
238 #define SCORUM_MAX_BLOCK_SIZE (SCORUM_MAX_TRANSACTION_SIZE*SCORUM_BLOCK_INTERVAL*2000)
239 
240 #define SCORUM_MIN_UNDO_HISTORY 10
241 #define SCORUM_MAX_UNDO_HISTORY 10000
242 
243 #define SCORUM_MIN_TRANSACTION_EXPIRATION_LIMIT (SCORUM_BLOCK_INTERVAL * 5) // 5 transactions per block
244 
245 #define SCORUM_IRREVERSIBLE_THRESHOLD (75 * SCORUM_1_PERCENT)
246 
247 #define VIRTUAL_SCHEDULE_LAP_LENGTH ( fc::uint128::max_value() )
248 
249 #define SCORUM_COMMITTEE_QUORUM_PERCENT (60u)
250 
251 #define SCORUM_COMMITTEE_ADVERTISING_MODERATOR_QUORUM_PERCENT (50u)
252 #define SCORUM_COMMITTEE_BETTING_MODERATOR_QUORUM_PERCENT (50u)
253 #define SCORUM_COMMITTEE_BETTING_RESOLVE_DELAY_QUORUM_PERCENT (50u)
254 #define SCORUM_COMMITTEE_TRANSFER_QUORUM_PERCENT (50u)
255 #define SCORUM_COMMITTEE_ADD_EXCLUDE_QUORUM_PERCENT (60u)
256 
257 #define SCORUM_VOTING_POWER_DECAY_PERCENT 5
258 
259 #define SCORUM_MIN_QUORUM_VALUE_PERCENT (50u)
260 #define SCORUM_MAX_QUORUM_VALUE_PERCENT (100u)
261 
262 #define SCORUM_PROPOSAL_LIFETIME_MIN_SECONDS (DAYS_TO_SECONDS(1u))
263 #define SCORUM_PROPOSAL_LIFETIME_MAX_SECONDS (DAYS_TO_SECONDS(10u))
264 
265 #define SCORUM_BETTING_RESOLVE_DELAY_SEC (DAYS_TO_SECONDS(1u))
266 #define SCORUM_BETTING_START_TIME_DIFF_MAX (fc::hours(12))
267 
268 #define SCORUM_BETTING_THRESHOLD_FACTOR 1000
269 
274 #define SCORUM_PROXY_TO_SELF_ACCOUNT (scorum::protocol::account_name_type())
276 #define SCORUM_ROOT_POST_PARENT_ACCOUNT (scorum::protocol::account_name_type())
277 
278 #define SCORUM_MISSING_MODERATOR_ACCOUNT (scorum::protocol::account_name_type())
279 
280 #define SCORUM_BLOGGING_START_DATE (scorum::protocol::detail::get_config().blogging_start_date)
281 #define SCORUM_FIFA_WORLD_CUP_2018_BOUNTY_CASHOUT_DATE (scorum::protocol::detail::get_config().fifa_world_cup_2018_bounty_cashout_date)
282 #define SCORUM_EXPIRATON_FOR_REGISTRATION_BONUS (scorum::protocol::detail::get_config().expiraton_for_registration_bonus)
283 #define SCORUM_WITNESS_REWARD_MIGRATION_DATE (scorum::protocol::detail::get_config().witness_reward_migration_date)
284 
285 #define SCORUM_ADVERTISING_CASHOUT_PERIOD_SEC (scorum::protocol::detail::get_config().advertising_cashout_period_sec)
286 
287 #define SCORUM_MIN_ODDS (scorum::protocol::odds(1001, 1000)) // min: 1.001 && max: 1001
288 #define SCORUM_MIN_STAKE_FOR_MATCHING (share_type(1))
289 #define SCORUM_MIN_BET_STAKE (scorum::protocol::asset(1'000'000, SCORUM_SYMBOL)) // 0.001'000'000 SCR
290 
291 #define SCORUM_MAX_BET_STAKE (scorum::protocol::asset(9214157878975800, SCORUM_SYMBOL))
292 
293 #define SCORUM_NFT_MODERATOR account_name_type("nft-moderator")
294 
295 #ifdef IS_LOW_MEM
296 #define SCORUM_LOW_MEMORY_NODE (true)
297 #else
298 #define SCORUM_LOW_MEMORY_NODE (false)
299 #endif
300 
301 #ifdef CLEAR_VOTES
302 #define SCORUM_CLEAR_VOTES (true)
303 #else
304 #define SCORUM_CLEAR_VOTES (false)
305 #endif
306 
307 #ifdef SKIP_BY_TX_ID
308 #define SCORUM_SKIP_BY_TX_ID (true)
309 #else
310 #define SCORUM_SKIP_BY_TX_ID (false)
311 #endif
312 
313 #ifdef LIVE_TESTNET
314 #define SCORUM_LIVE_TESTNET (true)
315 #else
316 #define SCORUM_LIVE_TESTNET (false)
317 #endif
318 
320 
321 // clang-format on
const config & get_config()
Definition: config.cpp:164
void override_config(std::unique_ptr< config > new_config)
Definition: config.cpp:169
Definition: asset.cpp:15
const fc::time_point_sec witness_reward_migration_date
Definition: config.hpp:68
const uint8_t scorum_max_witnesses
Definition: config.hpp:70
const uint32_t vesting_withdraw_intervals
Definition: config.hpp:23
const uint32_t blockid_pool_size
Definition: config.hpp:21
const uint32_t budgets_limit_per_owner
Definition: config.hpp:48
const uint32_t guaranted_reward_supply_period_in_days
Definition: config.hpp:45
const fc::time_point_sec fifa_world_cup_2018_bounty_cashout_date
Definition: config.hpp:64
const fc::microseconds owner_auth_recovery_period
Definition: config.hpp:38
const uint32_t cashout_window_seconds
Definition: config.hpp:26
const uint8_t scorum_hardfork_required_witnesses
Definition: config.hpp:74
const fc::microseconds reverse_auction_window_seconds
Definition: config.hpp:34
const uint32_t advertising_cashout_period_sec
Definition: config.hpp:32
const uint32_t rewards_initial_supply_period_in_days
Definition: config.hpp:44
const fc::microseconds account_recovery_request_expiration_period
Definition: config.hpp:39
const uint32_t min_vote_interval_sec
Definition: config.hpp:56
const uint32_t vesting_withdraw_interval_seconds
Definition: config.hpp:24
const fc::time_point_sec blogging_start_date
Definition: config.hpp:62
const uint32_t db_free_memory_threshold_mb
Definition: config.hpp:58
static std::unique_ptr< config > instance
Definition: config.hpp:19
const fc::microseconds owner_update_limit
Definition: config.hpp:40
const fc::microseconds recent_rshares_decay_rate
Definition: config.hpp:42
const uint32_t atomicswap_initiator_refund_lock_secs
Definition: config.hpp:50
const fc::microseconds vote_regeneration_seconds
Definition: config.hpp:36
const fc::microseconds expiraton_for_registration_bonus
Definition: config.hpp:66
const uint8_t scorum_max_voted_witnesses
Definition: config.hpp:72
const fc::microseconds active_sp_holders_reward_period
Definition: config.hpp:30
config()
production config
Definition: config.cpp:24
const fc::time_point_sec initial_date
Definition: config.hpp:60
const fc::microseconds upvote_lockout
Definition: config.hpp:28
const uint32_t atomicswap_limit_requested_contracts_per_owner
Definition: config.hpp:53
const uint32_t atomicswap_participant_refund_lock_secs
Definition: config.hpp:51
const uint32_t reward_increase_threshold_in_days
Definition: config.hpp:46
const uint32_t atomicswap_limit_requested_contracts_per_recipient
Definition: config.hpp:54