Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio.bios.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <sysio/action.hpp>
4#include <sysio/crypto.hpp>
5#include <sysio/sysio.hpp>
6#include <sysio/fixed_bytes.hpp>
7#include <sysio/privileged.hpp>
8#include <sysio/producer_schedule.hpp>
9
10namespace sysiobios {
11
12 using sysio::action_wrapper;
13 using sysio::check;
14 using sysio::checksum256;
15 using sysio::ignore;
16 using sysio::name;
19
23
24 // explicit serialization macro is not necessary, used here only to improve compilation time
25 SYSLIB_SERIALIZE( permission_level_weight, (permission)(weight) )
26 };
27
28 struct key_weight {
31
32 // explicit serialization macro is not necessary, used here only to improve compilation time
33 SYSLIB_SERIALIZE( key_weight, (key)(weight) )
34 };
35
36 struct wait_weight {
39
40 // explicit serialization macro is not necessary, used here only to improve compilation time
41 SYSLIB_SERIALIZE( wait_weight, (wait_sec)(weight) )
42 };
43
44 struct authority {
46 std::vector<key_weight> keys;
47 std::vector<permission_level_weight> accounts;
48 std::vector<wait_weight> waits;
49
50 // explicit serialization macro is not necessary, used here only to improve compilation time
51 SYSLIB_SERIALIZE( authority, (threshold)(keys)(accounts)(waits) )
52 };
53
54 struct block_header {
58 checksum256 previous;
59 checksum256 transaction_mroot;
60 checksum256 action_mroot;
62 std::optional<sysio::producer_schedule> new_producers;
63
64 // explicit serialization macro is not necessary, used here only to improve compilation time
67 };
68
74 class [[sysio::contract("sysio.bios")]] bios : public sysio::contract {
75 public:
76 using contract::contract;
90 void newaccount( name creator,
91 name name,
92 ignore<authority> owner,
93 ignore<authority> active){}
102 [[sysio::action]]
103 void updateauth( ignore<name> account,
104 ignore<name> permission,
105 ignore<name> parent,
106 ignore<authority> auth ) {}
107
114 [[sysio::action]]
115 void deleteauth( ignore<name> account,
116 ignore<name> permission ) {}
117
133 [[sysio::action]]
134 void linkauth( ignore<name> account,
135 ignore<name> code,
136 ignore<name> type,
137 ignore<name> requirement ) {}
138
146 [[sysio::action]]
147 void unlinkauth( ignore<name> account,
148 ignore<name> code,
149 ignore<name> type ) {}
150
157 [[sysio::action]]
158 void canceldelay( ignore<permission_level> canceling_auth, ignore<checksum256> trx_id ) {}
159
168 [[sysio::action]]
169 void setcode( name account, uint8_t vmtype, uint8_t vmversion, const std::vector<char>& code ) {}
170
179 [[sysio::action]]
180 void setabi( name account, const std::vector<char>& abi );
181
190 [[sysio::action]]
191 void onerror( ignore<uint128_t> sender_id, ignore<std::vector<char>> sent_trx );
192
198 [[sysio::action]]
199 void setpriv( name account, uint8_t is_priv );
200
209 [[sysio::action]]
210 void setalimits( name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight );
211
220 [[sysio::action]]
221 void setprods( const std::vector<sysio::producer_authority>& schedule );
222
228 [[sysio::action]]
229 void setparams( const sysio::blockchain_parameters& params );
230
237 [[sysio::action]]
238 void reqauth( name from );
239
245 [[sysio::action]]
246 void activate( const sysio::checksum256& feature_digest );
247
253 [[sysio::action]]
254 void reqactivated( const sysio::checksum256& feature_digest );
255
256 struct [[sysio::table]] abi_hash {
258 checksum256 hash;
259 uint64_t primary_key()const { return owner.value; }
260
261 SYSLIB_SERIALIZE( abi_hash, (owner)(hash) )
262 };
263
264 typedef sysio::multi_index< "abihash"_n, abi_hash > abi_hash_table;
265
266 using newaccount_action = action_wrapper<"newaccount"_n, &bios::newaccount>;
267 using updateauth_action = action_wrapper<"updateauth"_n, &bios::updateauth>;
268 using deleteauth_action = action_wrapper<"deleteauth"_n, &bios::deleteauth>;
269 using linkauth_action = action_wrapper<"linkauth"_n, &bios::linkauth>;
270 using unlinkauth_action = action_wrapper<"unlinkauth"_n, &bios::unlinkauth>;
271 using canceldelay_action = action_wrapper<"canceldelay"_n, &bios::canceldelay>;
272 using setcode_action = action_wrapper<"setcode"_n, &bios::setcode>;
273 using setabi_action = action_wrapper<"setabi"_n, &bios::setabi>;
274 using setpriv_action = action_wrapper<"setpriv"_n, &bios::setpriv>;
275 using setalimits_action = action_wrapper<"setalimits"_n, &bios::setalimits>;
276 using setprods_action = action_wrapper<"setprods"_n, &bios::setprods>;
277 using setparams_action = action_wrapper<"setparams"_n, &bios::setparams>;
278 using reqauth_action = action_wrapper<"reqauth"_n, &bios::reqauth>;
279 using activate_action = action_wrapper<"activate"_n, &bios::activate>;
280 using reqactivated_action = action_wrapper<"reqactivated"_n, &bios::reqactivated>;
281 };
282}
contains only the public point of an elliptic curve key.
action_wrapper<"updateauth"_n, &bios::updateauth > updateauth_action
void unlinkauth(ignore< name > account, ignore< name > code, ignore< name > type)
void updateauth(ignore< name > account, ignore< name > permission, ignore< name > parent, ignore< authority > auth)
action_wrapper<"setpriv"_n, &bios::setpriv > setpriv_action
action_wrapper<"reqactivated"_n, &bios::reqactivated > reqactivated_action
void newaccount(name creator, name name, ignore< authority > owner, ignore< authority > active)
void canceldelay(ignore< permission_level > canceling_auth, ignore< checksum256 > trx_id)
void linkauth(ignore< name > account, ignore< name > code, ignore< name > type, ignore< name > requirement)
action_wrapper<"canceldelay"_n, &bios::canceldelay > canceldelay_action
action_wrapper<"setalimits"_n, &bios::setalimits > setalimits_action
action_wrapper<"linkauth"_n, &bios::linkauth > linkauth_action
action_wrapper<"newaccount"_n, &bios::newaccount > newaccount_action
action_wrapper<"activate"_n, &bios::activate > activate_action
action_wrapper<"setabi"_n, &bios::setabi > setabi_action
action_wrapper<"setparams"_n, &bios::setparams > setparams_action
void setcode(name account, uint8_t vmtype, uint8_t vmversion, const std::vector< char > &code)
action_wrapper<"setprods"_n, &bios::setprods > setprods_action
void deleteauth(ignore< name > account, ignore< name > permission)
action_wrapper<"reqauth"_n, &bios::reqauth > reqauth_action
action_wrapper<"unlinkauth"_n, &bios::unlinkauth > unlinkauth_action
action_wrapper<"setcode"_n, &bios::setcode > setcode_action
sysio::multi_index< "abihash"_n, abi_hash > abi_hash_table
action_wrapper<"deleteauth"_n, &bios::deleteauth > deleteauth_action
unsigned short uint16_t
Definition stdint.h:125
signed __int64 int64_t
Definition stdint.h:135
unsigned int uint32_t
Definition stdint.h:126
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
Immutable except for fc::from_variant.
Definition name.hpp:43
std::vector< key_weight > keys
std::vector< permission_level_weight > accounts
std::vector< wait_weight > waits
uint64_t primary_key() const
checksum256 transaction_mroot
std::optional< sysio::producer_schedule > new_producers
sysio::public_key key
account_query_db::get_accounts_by_authorizers_params params