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;
71
72// branch linked actions
73static constexpr eosio::name _branch_aid_action = "brnaid"_n;
74
75// capitalization linked actions
76
77
78//capital::debts
79
80static constexpr eosio::name _result_action = "result"_n;
81
82//program_types
83static constexpr eosio::name _wallet_program = "wallet"_n;
84static constexpr eosio::name _marketplace_program = "marketplace"_n;
85
86static constexpr eosio::name _source_program = "generator"_n;
87static constexpr eosio::name _capital_program = "capital"_n;
88
89
90static const std::set<eosio::name> soviet_actions = {
91 "joincoop"_n, //регистрация пайщика
92 "leavecoop"_n, //выход пайщика из кооператива (возврат паевого взноса)
93
94 //MEET
95 "creategm"_n,//предложение повестки планового общего собрание
96 "completegm"_n, //решение общего собрания пайщиков
97 "ballot"_n, //бюллетень участника общего собрания пайщиков
98 "gmnotify"_n, //уведомление участника общего собрания пайщиков
99 //BRANCH
100 "branchdec"_n, //решение собрания пайщиков об учреждении кооперативного участка
101 "branchliab"_n, //договор о полной материальной ответственности председателя участка (линк в пакет совета)
102 "branchauth"_n, //доверенность председателю кооперативного участка (линк в пакет совета)
103 "brnaid"_n, //заявление на материальную помощь доверенному участка на повестку совета (p.brn.aid)
104 //CAPITAL
105 "capitalinvst"_n, //заявление на инвестиции по договору УХД
106 "createresult"_n, //клайм прироста благороста из задания
107 "createdebt"_n, //взять ссуду под залог будущего задания
108 "capresexpns"_n, //произвести выплату по расходам задания
109 "capwthdrprog"_n, //произвести возврат накопленных членских взносов по программе на капиталиста
110 "capwthdrproj"_n, //произвести возврат накопленных членских взносов по проекту на актора
111 "capwthdrres"_n, //произвести возврат из задания
112
113 //WALLET
114 "createwthd"_n, //создать заявление на возврат паевого взноса
115
116 //EXPENSE
117 "createexp"_n, //служебная записка-смета о расходах (шасси расходов)
118
119 //LEDGER
120 "ledgerwthd"_n, //заявление на списание со счета через ledger
121
122 //MARKETPLACE
123 "authoffs2c"_n, //заявление на взнос имуществом
124 "authoffc2r"_n, //заявление на возврат паевого взноса имуществом
125 "mktwroff"_n, //проект списания скоропорта на повестку совета (p.mkt.wroff)
126};
127
128//program_ids
129static constexpr uint64_t _wallet_program_id = 1;
130static constexpr uint64_t _marketplace_program_id = 2;
131static constexpr uint64_t _source_program_id = 3;
132static constexpr uint64_t _capital_program_id = 4;
133
134
135
136#define HUNDR_PERCENTS 1000000
137#define ONE_PERCENT 10000
138
139
140// Дефайны для основной сети
141#define ANO "ano"
142#define GATEWAY "gateway"
143#define DRAFT "draft"
144#define MARKETPLACE "marketplace"
145#define SOVIET "soviet"
146#define REGISTRATOR "registrator"
147#define SYSTEM "eosio"
148#define FUND "fund"
149#define BRANCH "branch"
150#define CAPITAL "capital"
151#define WALLET "wallet"
152#define LOAN "loan"
153#define MEET "meet"
154#define LEDGER "ledger"
155#define LEDGER2 "ledger2"
156#define APPS "apps"
157
158
163 static constexpr eosio::name _provider = "voskhod"_n;
164 static constexpr eosio::name _provider_chairman = "ant"_n;
165
166 static constexpr eosio::name _capital = "capital"_n;
167 static constexpr eosio::name _ano = "ano"_n;
168 static constexpr eosio::name _gateway = "gateway"_n;
169 static constexpr eosio::name _wallet = "wallet"_n;
170 static constexpr eosio::name _draft = "draft"_n;
171 static constexpr eosio::name _marketplace = "marketplace"_n;
172 static constexpr eosio::name _soviet = "soviet"_n;
173 static constexpr eosio::name _registrator = "registrator"_n;
174 static constexpr eosio::name _system = "eosio"_n;
175 static constexpr eosio::name _fund = "fund"_n;
176 static constexpr eosio::name _branch = "branch"_n;
177 static constexpr eosio::name _loan = "loan"_n;
178 static constexpr eosio::name _meet = "meet"_n;
179 static constexpr eosio::name _ledger = "ledger"_n;
180 static constexpr eosio::name _ledger2 = "ledger2"_n;
181 static constexpr eosio::name _apps = "apps"_n;
182 static constexpr eosio::name _expense = "expense"_n;
183 static constexpr eosio::name _power_account = "eosio.power"_n;
184 static constexpr eosio::name _saving_account = "eosio.saving"_n;
185
186
187
188 static std::vector<name> contracts_whitelist = {
189 "ano"_n,
190 "gateway"_n,
191 "draft"_n,
192 "marketplace"_n,
193 "soviet"_n,
194 "registrator"_n,
195 "eosio"_n,
196 "fund"_n,
197 "branch"_n,
198 "wallet"_n,
199 "meet"_n,
200 "loan"_n,
201 "test"_n,
202 "contributor"_n,
203 "eosio.token"_n,
204 "eosio.msig"_n,
205 "eosio.wrap"_n,
206 "eosio.power"_n,
207 "eosio.saving"_n,
208 "ledger"_n,
209 "ledger2"_n,
210 "capital"_n,
211 "apps"_n,
212 "expense"_n
213 // Добавьте остальные стандартные или пользовательские контракты по необходимости
214 };
215
216 static std::vector<name> token_whitelist = {
217 "eosio"_n,
218 "eosio.vpay"_n,
219 "eosio.saving"_n,
220 "eosio.bpay"_n,
221 "eosio.saving"_n,
222 "eosio.power"_n,
223 "eosio.ram"_n,
224 "eosio.stake"_n,
226 // Добавьте другие аккаунты в список по мере необходимости
227 };
228
229
230 static constexpr eosio::symbol _root_symbol = eosio::symbol(eosio::symbol_code("AXON"), 4);
231 static constexpr eosio::symbol _root_govern_symbol = eosio::symbol(eosio::symbol_code("RUB"), 4);
232
233 // Единицы измерения количества имущества marketplace (Эпик 17, L14):
234 // количество — fixed-point asset с символом единицы. Точность = младшая
235 // единица: KG(3)=граммы, LTR(3)=миллилитры, PCS(0)=штука неделима.
236 static constexpr eosio::symbol _unit_kg = eosio::symbol(eosio::symbol_code("KG"), 3);
237 static constexpr eosio::symbol _unit_liter = eosio::symbol(eosio::symbol_code("LTR"), 3);
238 static constexpr eosio::symbol _unit_piece = eosio::symbol(eosio::symbol_code("PCS"), 0);
239 static const eosio::asset _provider_initial = eosio::asset(1000000, _root_govern_symbol);
240 static const eosio::asset _provider_minimum = eosio::asset(3000000, _root_govern_symbol);
241
242 static const eosio::asset _provider_org_initial = eosio::asset(10000000, _root_govern_symbol);
243 static const eosio::asset _provider_org_minimum = eosio::asset(30000000, _root_govern_symbol);
244
245 static constexpr eosio::name _root_contract = "eosio.token"_n;
246 static constexpr eosio::symbol RAM_symbol{"RAM", 0};
247 static constexpr eosio::symbol _ramcore_symbol = eosio::symbol(eosio::symbol_code("RAMCORE"),4);
248 static constexpr uint64_t _ram_price_per_byte = 1;
250 static constexpr uint64_t _register_amount = 10000;
252 static constexpr uint64_t _signature_expiration = 86400 * 365 * 2;
253 static constexpr uint64_t _auction_name_length_limit = 12;
254
255 static constexpr uint64_t _deposit_expiration_seconds = 3600;
256
257 static constexpr uint64_t _decision_expiration = 30 * 86400;
258
259 static constexpr uint64_t _producers_percent = 900000; // 90%
260 static constexpr uint64_t _fund_percent = 100000; // 10%
261
262#ifdef IS_TESTNET
263 static constexpr uint64_t MIN_SOVIET_MEMBERS_COUNT = 1;
264 static constexpr bool ENFORCE_SINGLE_BRANCH_TRUSTEE = false;
265#else
266 static constexpr uint64_t MIN_SOVIET_MEMBERS_COUNT = 3;
267 static constexpr bool ENFORCE_SINGLE_BRANCH_TRUSTEE = true;
268#endif
269
static const eosio::asset _provider_org_minimum
Definition: consts.hpp:243
static const std::set< eosio::name > soviet_actions
Definition: consts.hpp:90
static constexpr eosio::name _provider
Definition: consts.hpp:163
static constexpr eosio::name _ano
Definition: consts.hpp:167
static constexpr uint64_t _wallet_program_id
Definition: consts.hpp:129
static constexpr uint64_t _producers_percent
Definition: consts.hpp:259
static const eosio::asset _provider_initial
Definition: consts.hpp:239
static constexpr uint64_t _signature_expiration
Definition: consts.hpp:252
static constexpr eosio::name _provider_chairman
Definition: consts.hpp:164
static constexpr eosio::symbol _unit_piece
Definition: consts.hpp:238
static constexpr eosio::name _fund
Definition: consts.hpp:175
static constexpr eosio::name _change_action
Definition: consts.hpp:67
static constexpr uint64_t _decision_expiration
Definition: consts.hpp:257
static constexpr eosio::symbol _ramcore_symbol
Definition: consts.hpp:247
static constexpr eosio::name _wallet_program
Главный Кошелёк
Definition: consts.hpp:83
static constexpr eosio::name _capital
Definition: consts.hpp:166
static constexpr eosio::name _system
Definition: consts.hpp:174
static constexpr eosio::symbol RAM_symbol
Definition: consts.hpp:246
static constexpr eosio::name _gateway
Definition: consts.hpp:168
static constexpr eosio::name _product_return_action
Definition: consts.hpp:69
static std::vector< name > contracts_whitelist
Definition: consts.hpp:188
static constexpr eosio::symbol _root_govern_symbol
Definition: consts.hpp:231
static constexpr eosio::name _result_action
Definition: consts.hpp:80
static constexpr eosio::name _expense
Definition: consts.hpp:182
static constexpr eosio::symbol _root_symbol
Definition: consts.hpp:230
static constexpr eosio::name _wallet
Definition: consts.hpp:169
static constexpr uint64_t _fund_percent
Definition: consts.hpp:260
static constexpr eosio::name _source_program
Кошелёк для генерации по договору УХД
Definition: consts.hpp:86
static constexpr eosio::name _draft
Definition: consts.hpp:170
static constexpr uint64_t _auction_name_length_limit
Definition: consts.hpp:253
static constexpr uint64_t _capital_program_id
Definition: consts.hpp:132
static constexpr eosio::name _apps
Definition: consts.hpp:181
static constexpr eosio::name _capital_program
Кошелёк программы "Благорост".
Definition: consts.hpp:87
static constexpr eosio::name _root_contract
Definition: consts.hpp:245
static constexpr eosio::name _power_account
Definition: consts.hpp:183
static constexpr uint64_t _marketplace_program_id
Definition: consts.hpp:130
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:177
static constexpr uint64_t _deposit_expiration_seconds
Definition: consts.hpp:255
static constexpr eosio::name _marketplace_program
Кошелёк программы "Маркетплейс".
Definition: consts.hpp:84
static const eosio::asset _provider_org_initial
Definition: consts.hpp:242
static constexpr eosio::symbol _unit_liter
Definition: consts.hpp:237
static constexpr eosio::name _free_decision_action
Definition: consts.hpp:64
static constexpr uint64_t _source_program_id
Definition: consts.hpp:131
static constexpr uint64_t MIN_SOVIET_MEMBERS_COUNT
Definition: consts.hpp:266
static constexpr eosio::name _marketplace_writeoff_action
Списание скоропорта по решению совета (p.mkt.wroff)
Definition: consts.hpp:70
static constexpr eosio::name _ledger
Definition: consts.hpp:179
static constexpr eosio::name _regaccount_action
Definition: consts.hpp:53
static const eosio::asset _provider_minimum
Definition: consts.hpp:240
static constexpr eosio::name _saving_account
Definition: consts.hpp:184
static constexpr eosio::name _branch_aid_action
Материальная помощь доверенному КУ по решению совета (p.brn.aid)
Definition: consts.hpp:73
static constexpr eosio::name _product_contribution_action
Definition: consts.hpp:68
static constexpr bool ENFORCE_SINGLE_BRANCH_TRUSTEE
Definition: consts.hpp:267
static constexpr eosio::name _afund_withdraw_action
Definition: consts.hpp:60
static constexpr uint64_t _ram_price_per_byte
Definition: consts.hpp:248
static constexpr eosio::symbol _unit_kg
Definition: consts.hpp:236
static constexpr eosio::name _branch
Definition: consts.hpp:176
static constexpr eosio::name _registrator
Definition: consts.hpp:173
static constexpr eosio::name _meet
Definition: consts.hpp:178
static std::vector< name > token_whitelist
Definition: consts.hpp:216
static constexpr eosio::name _soviet
Definition: consts.hpp:172
static constexpr uint64_t _register_amount
Definition: consts.hpp:250
static constexpr eosio::name _ledger2
Definition: consts.hpp:180
static constexpr eosio::name _marketplace
Definition: consts.hpp:171
Definition: eosio.msig.hpp:34