COOPENOMICS  v1
Кооперативная Экономика
consts.hpp
См. документацию.
1#pragma once
2
3using namespace eosio;
4
5// /**
6// \defgroup public_contracts Контракты
7// \brief Контракты Кооперативной Экономики
8// *
9// * Группа содержит контракты, предназначенные для кооперативной экономики. Контракты описывают основные логические
10// * единицы и функциональность для управления и взаимодействия в рамках кооперативной экосистемы. От регистрации
11// * участников до обменных операций - все аспекты кооперативной деятельности регулируются этими контрактами.
12// */
13
14// /**
15// \defgroup public_consts Константы
16// \brief Константы контрактов
17// *
18// * В этой группе представлены основные константы, используемые в контрактах кооперативной экономики.
19// * Константы обеспечивают стабильность и предсказуемость поведения контрактов, а также упрощают
20// * процесс чтения и понимания кода.
21// */
22
23// /**
24// \defgroup public_actions Действия
25// \brief Методы действий контрактов
26// *
27// * Действия представляют собой методы, которые можно вызывать в контрактах. Они отвечают за
28// * выполнение определенных задач, таких как создание аккаунта, обновление информации или
29// * осуществление транзакции. Эта группа описывает все доступные действия, которые предоставляют
30// * контракты кооперативной экономики.
31// */
32
33// /**
34// \defgroup public_tables Таблицы
35// \brief Структуры таблиц контрактов
36// *
37// * Таблицы в контрактах EOSIO используются для хранения состояния контракта на блокчейне. В этой группе
38// * представлены основные структуры данных, которые используются в таблицах контрактов кооперативной экономики.
39// * От сведений о участниках до деталей транзакций - все это сохраняется в таблицах.
40// */
41
42
43// /**
44// \defgroup public_structures Структуры
45// \brief Структуры контрактов
46// *
47// * Структуры - это фундаментальные блоки данных, используемые для описания и хранения информации в контрактах.
48// * Эта группа содержит описание основных структур, используемых в контрактах кооперативной экономики.
49// * Они обеспечивают четкую организацию данных и упрощают взаимодействие с контрактом.
50// */
51
52//registrator
53static constexpr eosio::name _regaccount_action = "joincoop"_n;
54
55//wallet
56static constexpr eosio::name _deposit_action = "deposit"_n;
57static constexpr eosio::name _withdraw_action = "withdraw"_n;
58
59//funds
60static constexpr eosio::name _afund_withdraw_action = "subaccum"_n;
61static constexpr eosio::name _efund_withdraw_action = "subexp"_n;
62
63//freedecision
64static constexpr eosio::name _free_decision_action = "freedecision"_n;
65
66// marketplace linked actions
67static constexpr eosio::name _change_action = "change"_n;
68static constexpr eosio::name _product_contribution_action = "productcntr"_n;
69static constexpr eosio::name _product_return_action = "productrtrn"_n;
70static constexpr eosio::name _marketplace_writeoff_action = "mktwroff"_n;
71static constexpr eosio::name _marketplace_issue_action = "mktissue"_n;
72static constexpr eosio::name _marketplace_return_action = "mktretrn"_n;
73
74// branch linked actions
75static constexpr eosio::name _branch_aid_action = "brnaid"_n;
76
77// capitalization linked actions
78
79
80//capital::debts
81
82static constexpr eosio::name _result_action = "result"_n;
83
84//program_types
85static constexpr eosio::name _wallet_program = "wallet"_n;
86static constexpr eosio::name _marketplace_program = "marketplace"_n;
87
88static constexpr eosio::name _source_program = "generator"_n;
89static constexpr eosio::name _capital_program = "capital"_n;
90
91
92static const std::set<eosio::name> soviet_actions = {
93 "joincoop"_n, //регистрация пайщика
94 "leavecoop"_n, //выход пайщика из кооператива (возврат паевого взноса)
95 "freedecision"_n, //свободное решение совета по произвольному вопросу повестки (sov.decision)
96
97 //MEET
98 "creategm"_n,//предложение повестки планового общего собрание
99 "completegm"_n, //решение общего собрания пайщиков
100 "ballot"_n, //бюллетень участника общего собрания пайщиков
101 "gmnotify"_n, //уведомление участника общего собрания пайщиков
102 //BRANCH
103 "branchdec"_n, //решение собрания пайщиков об учреждении кооперативного участка
104 "branchliab"_n, //договор о полной материальной ответственности председателя участка (линк в пакет совета)
105 "branchauth"_n, //доверенность председателю кооперативного участка (линк в пакет совета)
106 "brnaid"_n, //заявление на материальную помощь доверенному участка на повестку совета (p.brn.aid)
107 //CAPITAL
108 "capitalinvst"_n, //заявление на инвестиции по договору УХД
109 "createresult"_n, //клайм прироста благороста из задания
110 "createdebt"_n, //взять ссуду под залог будущего задания
111 "capresexpns"_n, //произвести выплату по расходам задания
112 "capwthdrprog"_n, //произвести возврат накопленных членских взносов по программе на капиталиста
113 "capwthdrproj"_n, //произвести возврат накопленных членских взносов по проекту на актора
114 "capwthdrres"_n, //произвести возврат из задания
115
116 //WALLET
117 "createwthd"_n, //создать заявление на возврат паевого взноса
118
119 //EXPENSE
120 "createexp"_n, //служебная записка-смета о расходах (шасси расходов)
121
122 //LEDGER
123 "ledgerwthd"_n, //заявление на списание со счета через ledger
124
125 //MARKETPLACE
126 "authoffs2c"_n, //заявление на взнос имуществом
127 "authoffc2r"_n, //заявление на возврат паевого взноса имуществом
128 "mktwroff"_n, //проект списания скоропорта на повестку совета (p.mkt.wroff)
129 "mktissue"_n, //заявление о выдаче имущества пайщику в паевой ветке на повестку совета (p.mkt.supply)
130 "mktretrn"_n, //заявление о внесении паевого взноса имуществом при гарантийном возврате на повестку совета (p.mkt.return)
131};
132
133//program_ids
134static constexpr uint64_t _wallet_program_id = 1;
135static constexpr uint64_t _marketplace_program_id = 2;
136static constexpr uint64_t _source_program_id = 3;
137static constexpr uint64_t _capital_program_id = 4;
138
139
140
141#define HUNDR_PERCENTS 1000000
142#define ONE_PERCENT 10000
143
144
145// Дефайны для основной сети
146#define ANO "ano"
147#define GATEWAY "gateway"
148#define DRAFT "draft"
149#define MARKETPLACE "marketplace"
150#define SOVIET "soviet"
151#define REGISTRATOR "registrator"
152#define SYSTEM "eosio"
153#define FUND "fund"
154#define BRANCH "branch"
155#define CAPITAL "capital"
156#define WALLET "wallet"
157#define LOAN "loan"
158#define MEET "meet"
159#define LEDGER "ledger"
160#define LEDGER2 "ledger2"
161#define APPS "apps"
162
163
168 static constexpr eosio::name _provider = "voskhod"_n;
169 static constexpr eosio::name _provider_chairman = "ant"_n;
170
171 static constexpr eosio::name _capital = "capital"_n;
172 static constexpr eosio::name _ano = "ano"_n;
173 static constexpr eosio::name _gateway = "gateway"_n;
174 static constexpr eosio::name _wallet = "wallet"_n;
175 static constexpr eosio::name _draft = "draft"_n;
176 static constexpr eosio::name _marketplace = "marketplace"_n;
177 static constexpr eosio::name _soviet = "soviet"_n;
178 static constexpr eosio::name _registrator = "registrator"_n;
179 static constexpr eosio::name _system = "eosio"_n;
180 static constexpr eosio::name _fund = "fund"_n;
181 static constexpr eosio::name _branch = "branch"_n;
182 static constexpr eosio::name _loan = "loan"_n;
183 static constexpr eosio::name _meet = "meet"_n;
184 static constexpr eosio::name _ledger = "ledger"_n;
185 static constexpr eosio::name _ledger2 = "ledger2"_n;
186 static constexpr eosio::name _apps = "apps"_n;
187 static constexpr eosio::name _expense = "expense"_n;
188 static constexpr eosio::name _power_account = "eosio.power"_n;
189 static constexpr eosio::name _saving_account = "eosio.saving"_n;
190
191
192
193 static std::vector<name> contracts_whitelist = {
194 "ano"_n,
195 "gateway"_n,
196 "draft"_n,
197 "marketplace"_n,
198 "soviet"_n,
199 "registrator"_n,
200 "eosio"_n,
201 "fund"_n,
202 "branch"_n,
203 "wallet"_n,
204 "meet"_n,
205 "loan"_n,
206 "test"_n,
207 "contributor"_n,
208 "eosio.token"_n,
209 "eosio.msig"_n,
210 "eosio.wrap"_n,
211 "eosio.power"_n,
212 "eosio.saving"_n,
213 "ledger"_n,
214 "ledger2"_n,
215 "capital"_n,
216 "apps"_n,
217 "expense"_n
218 // Добавьте остальные стандартные или пользовательские контракты по необходимости
219 };
220
221 static std::vector<name> token_whitelist = {
222 "eosio"_n,
223 "eosio.vpay"_n,
224 "eosio.saving"_n,
225 "eosio.bpay"_n,
226 "eosio.saving"_n,
227 "eosio.power"_n,
228 "eosio.ram"_n,
229 "eosio.stake"_n,
231 // Добавьте другие аккаунты в список по мере необходимости
232 };
233
234
235 static constexpr eosio::symbol _root_symbol = eosio::symbol(eosio::symbol_code("AXON"), 4);
236 static constexpr eosio::symbol _root_govern_symbol = eosio::symbol(eosio::symbol_code("RUB"), 4);
237
238 // Единицы измерения количества имущества marketplace (Эпик 17, L14):
239 // количество — fixed-point asset с символом единицы. Точность = младшая
240 // единица: KG(3)=граммы, LTR(3)=миллилитры, PCS(0)=штука неделима.
241 static constexpr eosio::symbol _unit_kg = eosio::symbol(eosio::symbol_code("KG"), 3);
242 static constexpr eosio::symbol _unit_liter = eosio::symbol(eosio::symbol_code("LTR"), 3);
243 static constexpr eosio::symbol _unit_piece = eosio::symbol(eosio::symbol_code("PCS"), 0);
244 static const eosio::asset _provider_initial = eosio::asset(1000000, _root_govern_symbol);
245 static const eosio::asset _provider_minimum = eosio::asset(3000000, _root_govern_symbol);
246
247 static const eosio::asset _provider_org_initial = eosio::asset(10000000, _root_govern_symbol);
248 static const eosio::asset _provider_org_minimum = eosio::asset(30000000, _root_govern_symbol);
249
250 static constexpr eosio::name _root_contract = "eosio.token"_n;
251 static constexpr eosio::symbol RAM_symbol{"RAM", 0};
252 static constexpr eosio::symbol _ramcore_symbol = eosio::symbol(eosio::symbol_code("RAMCORE"),4);
253 static constexpr uint64_t _ram_price_per_byte = 1;
255 static constexpr uint64_t _register_amount = 10000;
257 static constexpr uint64_t _signature_expiration = 86400 * 365 * 2;
258 static constexpr uint64_t _auction_name_length_limit = 12;
259
260 static constexpr uint64_t _deposit_expiration_seconds = 3600;
261
262 static constexpr uint64_t _decision_expiration = 30 * 86400;
263
264 static constexpr uint64_t _producers_percent = 900000; // 90%
265 static constexpr uint64_t _fund_percent = 100000; // 10%
266
267#ifdef IS_TESTNET
268 static constexpr uint64_t MIN_SOVIET_MEMBERS_COUNT = 1;
269 static constexpr bool ENFORCE_SINGLE_BRANCH_TRUSTEE = false;
270#else
271 static constexpr uint64_t MIN_SOVIET_MEMBERS_COUNT = 3;
272 static constexpr bool ENFORCE_SINGLE_BRANCH_TRUSTEE = true;
273#endif
274
static const eosio::asset _provider_org_minimum
Definition: consts.hpp:248
static const std::set< eosio::name > soviet_actions
Definition: consts.hpp:92
static constexpr eosio::name _provider
Definition: consts.hpp:168
static constexpr eosio::name _marketplace_issue_action
Выдача имущества пайщику в паевой ветке Стола заказов по решению совета (p.mkt.supply)
Definition: consts.hpp:71
static constexpr eosio::name _ano
Definition: consts.hpp:172
static constexpr uint64_t _wallet_program_id
Definition: consts.hpp:134
static constexpr uint64_t _producers_percent
Definition: consts.hpp:264
static const eosio::asset _provider_initial
Definition: consts.hpp:244
static constexpr uint64_t _signature_expiration
Definition: consts.hpp:257
static constexpr eosio::name _provider_chairman
Definition: consts.hpp:169
static constexpr eosio::symbol _unit_piece
Definition: consts.hpp:243
static constexpr eosio::name _fund
Definition: consts.hpp:180
static constexpr eosio::name _change_action
Definition: consts.hpp:67
static constexpr uint64_t _decision_expiration
Definition: consts.hpp:262
static constexpr eosio::symbol _ramcore_symbol
Definition: consts.hpp:252
static constexpr eosio::name _wallet_program
Главный Кошелёк
Definition: consts.hpp:85
static constexpr eosio::name _capital
Definition: consts.hpp:171
static constexpr eosio::name _system
Definition: consts.hpp:179
static constexpr eosio::name _marketplace_return_action
Гарантийный возврат: принятие имущества и восстановление паевого взноса по решению совета (p....
Definition: consts.hpp:72
static constexpr eosio::symbol RAM_symbol
Definition: consts.hpp:251
static constexpr eosio::name _gateway
Definition: consts.hpp:173
static constexpr eosio::name _product_return_action
Definition: consts.hpp:69
static std::vector< name > contracts_whitelist
Definition: consts.hpp:193
static constexpr eosio::symbol _root_govern_symbol
Definition: consts.hpp:236
static constexpr eosio::name _result_action
Definition: consts.hpp:82
static constexpr eosio::name _expense
Definition: consts.hpp:187
static constexpr eosio::symbol _root_symbol
Definition: consts.hpp:235
static constexpr eosio::name _wallet
Definition: consts.hpp:174
static constexpr uint64_t _fund_percent
Definition: consts.hpp:265
static constexpr eosio::name _source_program
Кошелёк для генерации по договору УХД
Definition: consts.hpp:88
static constexpr eosio::name _draft
Definition: consts.hpp:175
static constexpr uint64_t _auction_name_length_limit
Definition: consts.hpp:258
static constexpr uint64_t _capital_program_id
Definition: consts.hpp:137
static constexpr eosio::name _apps
Definition: consts.hpp:186
static constexpr eosio::name _capital_program
Кошелёк программы "Благорост".
Definition: consts.hpp:89
static constexpr eosio::name _root_contract
Definition: consts.hpp:250
static constexpr eosio::name _power_account
Definition: consts.hpp:188
static constexpr uint64_t _marketplace_program_id
Definition: consts.hpp:135
static constexpr eosio::name _deposit_action
Definition: consts.hpp:56
static constexpr eosio::name _withdraw_action
Definition: consts.hpp:57
static constexpr eosio::name _efund_withdraw_action
Definition: consts.hpp:61
static constexpr eosio::name _loan
Definition: consts.hpp:182
static constexpr uint64_t _deposit_expiration_seconds
Definition: consts.hpp:260
static constexpr eosio::name _marketplace_program
Кошелёк программы "Маркетплейс".
Definition: consts.hpp:86
static const eosio::asset _provider_org_initial
Definition: consts.hpp:247
static constexpr eosio::symbol _unit_liter
Definition: consts.hpp:242
static constexpr eosio::name _free_decision_action
Definition: consts.hpp:64
static constexpr uint64_t _source_program_id
Definition: consts.hpp:136
static constexpr uint64_t MIN_SOVIET_MEMBERS_COUNT
Definition: consts.hpp:271
static constexpr eosio::name _marketplace_writeoff_action
Списание скоропорта по решению совета (p.mkt.wroff)
Definition: consts.hpp:70
static constexpr eosio::name _ledger
Definition: consts.hpp:184
static constexpr eosio::name _regaccount_action
Definition: consts.hpp:53
static const eosio::asset _provider_minimum
Definition: consts.hpp:245
static constexpr eosio::name _saving_account
Definition: consts.hpp:189
static constexpr eosio::name _branch_aid_action
Материальная помощь доверенному КУ по решению совета (p.brn.aid)
Definition: consts.hpp:75
static constexpr eosio::name _product_contribution_action
Definition: consts.hpp:68
static constexpr bool ENFORCE_SINGLE_BRANCH_TRUSTEE
Definition: consts.hpp:272
static constexpr eosio::name _afund_withdraw_action
Definition: consts.hpp:60
static constexpr uint64_t _ram_price_per_byte
Definition: consts.hpp:253
static constexpr eosio::symbol _unit_kg
Definition: consts.hpp:241
static constexpr eosio::name _branch
Definition: consts.hpp:181
static constexpr eosio::name _registrator
Definition: consts.hpp:178
static constexpr eosio::name _meet
Definition: consts.hpp:183
static std::vector< name > token_whitelist
Definition: consts.hpp:221
static constexpr eosio::name _soviet
Definition: consts.hpp:177
static constexpr uint64_t _register_amount
Definition: consts.hpp:255
static constexpr eosio::name _ledger2
Definition: consts.hpp:185
static constexpr eosio::name _marketplace
Definition: consts.hpp:176
Definition: eosio.msig.hpp:34