COOPENOMICS  v1
Кооперативная Экономика
eosio.boot.hpp
См. документацию.
1#pragma once
2
3// /**
4// \defgroup public_boot Контракт BOOT
5
6// * Крайне минималистичный системный контракт, поддерживающий только нативные действия и активацию протокольных функций.
7// */
8
9// /**
10// \defgroup public_boot_processes Процессы
11// \ingroup public_boot
12// */
13
14// /**
15// \defgroup public_boot_actions Действия
16// \ingroup public_boot
17// */
18
19// /**
20// \defgroup public_boot_tables Таблицы
21// \ingroup public_boot
22// */
23
24// /**
25// \defgroup public_boot_consts Константы
26// \ingroup public_boot
27// */
28
29#include <eosio/crypto.hpp>
30#include <eosio/eosio.hpp>
31
32namespace eosioboot {
33
34 using eosio::action_wrapper;
35 using eosio::check;
36 using eosio::checksum256;
37 using eosio::ignore;
38 using eosio::name;
40 using eosio::public_key;
41
52 uint16_t weight;
53
54 // explicit serialization macro is not necessary, used here only to improve compilation time
55 EOSLIB_SERIALIZE( permission_level_weight, (permission)(weight) )
56 };
57
63 struct key_weight {
64 eosio::public_key key;
65 uint16_t weight;
66
67 // explicit serialization macro is not necessary, used here only to improve compilation time
68 EOSLIB_SERIALIZE( key_weight, (key)(weight) )
69 };
70
76 struct wait_weight {
77 uint32_t wait_sec;
78 uint16_t weight;
79
80 // explicit serialization macro is not necessary, used here only to improve compilation time
81 EOSLIB_SERIALIZE( wait_weight, (wait_sec)(weight) )
82 };
83
93 struct authority {
94 uint32_t threshold = 0;
95 std::vector<key_weight> keys;
96 std::vector<permission_level_weight> accounts;
97 std::vector<wait_weight> waits;
98
99 // explicit serialization macro is not necessary, used here only to improve compilation time
100 EOSLIB_SERIALIZE( authority, (threshold)(keys)(accounts)(waits) )
101 };
102
112 public:
113 using contract::contract;
132 [[eosio::action]]
133 void newaccount( name creator,
134 name name,
135 ignore<authority> owner,
136 ignore<authority> active) {}
147 [[eosio::action]]
148 void updateauth( ignore<name> account,
149 ignore<name> permission,
150 ignore<name> parent,
151 ignore<authority> auth ) {}
152
161 [[eosio::action]]
162 void deleteauth( ignore<name> account,
163 ignore<name> permission ) {}
164
182 [[eosio::action]]
183 void linkauth( ignore<name> account,
184 ignore<name> code,
185 ignore<name> type,
186 ignore<name> requirement ) {}
187
197 [[eosio::action]]
198 void unlinkauth( ignore<name> account,
199 ignore<name> code,
200 ignore<name> type ) {}
201
210 [[eosio::action]]
211 void canceldelay( ignore<permission_level> canceling_auth, ignore<checksum256> trx_id ) {}
212
223 [[eosio::action]]
224 void setcode( name account, uint8_t vmtype, uint8_t vmversion, const std::vector<char>& code ) {}
225
234 [[eosio::action]]
235 void setabi( name account, const std::vector<char>& abi ) {}
236
249 [[eosio::action]]
250 void onerror( ignore<uint128_t> sender_id, ignore<std::vector<char>> sent_trx );
251
259 [[eosio::action]]
260 void activate( const eosio::checksum256& feature_digest );
261
269 [[eosio::action]]
270 void reqactivated( const eosio::checksum256& feature_digest );
271
272 using newaccount_action = action_wrapper<"newaccount"_n, &boot::newaccount>;
273 using updateauth_action = action_wrapper<"updateauth"_n, &boot::updateauth>;
274 using deleteauth_action = action_wrapper<"deleteauth"_n, &boot::deleteauth>;
275 using linkauth_action = action_wrapper<"linkauth"_n, &boot::linkauth>;
276 using unlinkauth_action = action_wrapper<"unlinkauth"_n, &boot::unlinkauth>;
277 using canceldelay_action = action_wrapper<"canceldelay"_n, &boot::canceldelay>;
278 using setcode_action = action_wrapper<"setcode"_n, &boot::setcode>;
279 using setabi_action = action_wrapper<"setabi"_n, &boot::setabi>;
280 using activate_action = action_wrapper<"activate"_n, &boot::activate>;
281 using reqactivated_action = action_wrapper<"reqactivated"_n, &boot::reqactivated>;
282 }; // end of @defgroup eosioboot eosio.boot
284}
Definition: eosio.boot.hpp:111
action_wrapper<"newaccount"_n, &boot::newaccount > newaccount_action
Definition: eosio.boot.hpp:272
void deleteauth(ignore< name > account, ignore< name > permission)
Definition: eosio.boot.hpp:162
void updateauth(ignore< name > account, ignore< name > permission, ignore< name > parent, ignore< authority > auth)
Definition: eosio.boot.hpp:148
action_wrapper<"setcode"_n, &boot::setcode > setcode_action
Definition: eosio.boot.hpp:278
action_wrapper<"deleteauth"_n, &boot::deleteauth > deleteauth_action
Definition: eosio.boot.hpp:274
void setcode(name account, uint8_t vmtype, uint8_t vmversion, const std::vector< char > &code)
Definition: eosio.boot.hpp:224
action_wrapper<"activate"_n, &boot::activate > activate_action
Definition: eosio.boot.hpp:280
action_wrapper<"canceldelay"_n, &boot::canceldelay > canceldelay_action
Definition: eosio.boot.hpp:277
void reqactivated(const eosio::checksum256 &feature_digest)
Проверяет активацию протокольной функции. Утверждает, что протокольная функция была активирована.
Definition: eosio.boot.cpp:31
action_wrapper<"unlinkauth"_n, &boot::unlinkauth > unlinkauth_action
Definition: eosio.boot.hpp:276
action_wrapper<"linkauth"_n, &boot::linkauth > linkauth_action
Definition: eosio.boot.hpp:275
action_wrapper<"reqactivated"_n, &boot::reqactivated > reqactivated_action
Definition: eosio.boot.hpp:281
void linkauth(ignore< name > account, ignore< name > code, ignore< name > type, ignore< name > requirement)
Definition: eosio.boot.hpp:183
action_wrapper<"updateauth"_n, &boot::updateauth > updateauth_action
Definition: eosio.boot.hpp:273
void activate(const eosio::checksum256 &feature_digest)
Активирует протокольную функцию.
Definition: eosio.boot.cpp:18
void unlinkauth(ignore< name > account, ignore< name > code, ignore< name > type)
Definition: eosio.boot.hpp:198
void canceldelay(ignore< permission_level > canceling_auth, ignore< checksum256 > trx_id)
Definition: eosio.boot.hpp:211
void setabi(name account, const std::vector< char > &abi)
Definition: eosio.boot.hpp:235
action_wrapper<"setabi"_n, &boot::setabi > setabi_action
Definition: eosio.boot.hpp:279
void newaccount(name creator, name name, ignore< authority > owner, ignore< authority > active)
Definition: eosio.boot.hpp:133
const auto active
Definition: eosio.limitauth_tests.cpp:17
const auto owner
Definition: eosio.limitauth_tests.cpp:16
contract
Definition: eosio.msig_tests.cpp:977
permission_level
Definition: eosio.msig_tests.cpp:896
Definition: eosio.msig.hpp:34
Definition: eosio.boot.hpp:32
action(permission_level{ _gateway, "active"_n}, _gateway, "adduser"_n, std::make_tuple(coopname, deposit->username, to_spread, to_circulation, eosio::current_time_point(), true)).send()
Структура, представляющая учетные записи аккаунтов.
Definition: accounts.hpp:60
Definition: eosio.boot.hpp:93
std::vector< wait_weight > waits
Definition: eosio.boot.hpp:97
uint32_t threshold
Definition: eosio.boot.hpp:94
std::vector< key_weight > keys
Definition: eosio.boot.hpp:95
std::vector< permission_level_weight > accounts
Definition: eosio.boot.hpp:96
Definition: eosio.boot.hpp:63
uint16_t weight
Definition: eosio.boot.hpp:65
eosio::public_key key
Definition: eosio.boot.hpp:64
Definition: eosio.boot.hpp:50
permission_level permission
Definition: eosio.boot.hpp:51
uint16_t weight
Definition: eosio.boot.hpp:52
Definition: eosio.boot.hpp:76
uint16_t weight
Definition: eosio.boot.hpp:78
uint32_t wait_sec
Definition: eosio.boot.hpp:77