Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio_contract_abi.cpp
Go to the documentation of this file.
2#include <fc/utility.hpp>
3
4namespace sysio { namespace chain {
5
8
9 types.push_back( type_def{"account_name", "name"} );
10 types.push_back( type_def{"permission_name", "name"} );
11 types.push_back( type_def{"action_name", "name"} );
12 types.push_back( type_def{"table_name", "name"} );
13 types.push_back( type_def{"transaction_id_type", "checksum256"} );
14 types.push_back( type_def{"block_id_type", "checksum256"} );
15 types.push_back( type_def{"weight_type", "uint16"} );
16
17 return types;
18}
19
20abi_def sysio_contract_abi(const abi_def& sysio_system_abi)
21{
22 abi_def eos_abi(sysio_system_abi);
23
24 if( eos_abi.version.size() == 0 ) {
25 eos_abi.version = "sysio::abi/1.0";
26 }
27
29
30 // transaction
31 eos_abi.structs.emplace_back( struct_def {
32 "permission_level", "", {
33 {"actor", "account_name"},
34 {"permission", "permission_name"}
35 }
36 });
37
38 eos_abi.structs.emplace_back( struct_def {
39 "action", "", {
40 {"account", "account_name"},
41 {"name", "action_name"},
42 {"authorization", "permission_level[]"},
43 {"data", "bytes"}
44 }
45 });
46
47 eos_abi.structs.emplace_back( struct_def {
48 "extension", "", {
49 {"type", "uint16"},
50 {"data", "bytes"}
51 }
52 });
53
54 eos_abi.structs.emplace_back( struct_def {
55 "transaction_header", "", {
56 {"expiration", "time_point_sec"},
57 {"ref_block_num", "uint16"},
58 {"ref_block_prefix", "uint32"},
59 {"max_net_usage_words", "varuint32"},
60 {"max_cpu_usage_ms", "uint8"},
61 {"delay_sec", "varuint32"}
62 }
63 });
64
65 eos_abi.structs.emplace_back( struct_def {
66 "transaction", "transaction_header", {
67 {"context_free_actions", "action[]"},
68 {"actions", "action[]"},
69 {"transaction_extensions", "extension[]"}
70 }
71 });
72
73 // block_header
74
75 eos_abi.structs.emplace_back( struct_def {
76 "producer_key", "", {
77 {"producer_name", "account_name"},
78 {"block_signing_key", "public_key"}
79 }
80 });
81
82 eos_abi.structs.emplace_back( struct_def {
83 "producer_schedule", "", {
84 {"version", "uint32"},
85 {"producers", "producer_key[]"}
86 }
87 });
88
89 eos_abi.structs.emplace_back( struct_def {
90 "block_header", "", {
91 {"timestamp", "uint32"},
92 {"producer", "account_name"},
93 {"confirmed", "uint16"},
94 {"previous", "block_id_type"},
95 {"transaction_mroot", "checksum256"},
96 {"action_mroot", "checksum256"},
97 {"schedule_version", "uint32"},
98 {"new_producers", "producer_schedule?"},
99 {"header_extensions", "extension[]"}
100 }
101 });
102
103 // authority
104 eos_abi.structs.emplace_back( struct_def {
105 "key_weight", "", {
106 {"key", "public_key"},
107 {"weight", "weight_type"}
108 }
109 });
110
111 eos_abi.structs.emplace_back( struct_def {
112 "permission_level_weight", "", {
113 {"permission", "permission_level"},
114 {"weight", "weight_type"}
115 }
116 });
117
118 eos_abi.structs.emplace_back( struct_def {
119 "wait_weight", "", {
120 {"wait_sec", "uint32"},
121 {"weight", "weight_type"}
122 }
123 });
124
125 eos_abi.structs.emplace_back( struct_def {
126 "authority", "", {
127 {"threshold", "uint32"},
128 {"keys", "key_weight[]"},
129 {"accounts", "permission_level_weight[]"},
130 {"waits", "wait_weight[]"}
131 }
132 });
133
134 // TODO add any ricardian_clauses
135 //
136 // ACTION PAYLOADS
137
138 eos_abi.structs.emplace_back( struct_def {
139 "newaccount", "", {
140 {"creator", "account_name"},
141 {"name", "account_name"},
142 {"owner", "authority"},
143 {"active", "authority"},
144 }
145 });
146
147 eos_abi.structs.emplace_back( struct_def {
148 "setcode", "", {
149 {"account", "account_name"},
150 {"vmtype", "uint8"},
151 {"vmversion", "uint8"},
152 {"code", "bytes"}
153 }
154 });
155
156 eos_abi.structs.emplace_back( struct_def {
157 "setabi", "", {
158 {"account", "account_name"},
159 {"abi", "bytes"}
160 }
161 });
162
163 eos_abi.structs.emplace_back( struct_def {
164 "updateauth", "", {
165 {"account", "account_name"},
166 {"permission", "permission_name"},
167 {"parent", "permission_name"},
168 {"auth", "authority"}
169 }
170 });
171
172 eos_abi.structs.emplace_back( struct_def {
173 "deleteauth", "", {
174 {"account", "account_name"},
175 {"permission", "permission_name"},
176 }
177 });
178
179 eos_abi.structs.emplace_back( struct_def {
180 "linkauth", "", {
181 {"account", "account_name"},
182 {"code", "account_name"},
183 {"type", "action_name"},
184 {"requirement", "permission_name"},
185 }
186 });
187
188 eos_abi.structs.emplace_back( struct_def {
189 "unlinkauth", "", {
190 {"account", "account_name"},
191 {"code", "account_name"},
192 {"type", "action_name"},
193 }
194 });
195
196 eos_abi.structs.emplace_back( struct_def {
197 "canceldelay", "", {
198 {"canceling_auth", "permission_level"},
199 {"trx_id", "transaction_id_type"},
200 }
201 });
202
203 eos_abi.structs.emplace_back( struct_def {
204 "onerror", "", {
205 {"sender_id", "uint128"},
206 {"sent_trx", "bytes"}
207 }
208 });
209
210 eos_abi.structs.emplace_back( struct_def {
211 "onblock", "", {
212 {"header", "block_header"}
213 }
214 });
215
216 // TODO add ricardian contracts
217 eos_abi.actions.push_back( action_def{name("newaccount"), "newaccount",""} );
218 eos_abi.actions.push_back( action_def{name("setcode"), "setcode",""} );
219 eos_abi.actions.push_back( action_def{name("setabi"), "setabi",""} );
220 eos_abi.actions.push_back( action_def{name("updateauth"), "updateauth",""} );
221 eos_abi.actions.push_back( action_def{name("deleteauth"), "deleteauth",""} );
222 eos_abi.actions.push_back( action_def{name("linkauth"), "linkauth",""} );
223 eos_abi.actions.push_back( action_def{name("unlinkauth"), "unlinkauth",""} );
224 eos_abi.actions.push_back( action_def{name("canceldelay"), "canceldelay",""} );
225 eos_abi.actions.push_back( action_def{name("onerror"), "onerror",""} );
226 eos_abi.actions.push_back( action_def{name("onblock"), "onblock",""} );
227
228 return eos_abi;
229}
230
231} }
std::string name
void move_append(Container &dest, Container &&src)
Definition utility.hpp:151
abi_def sysio_contract_abi(const abi_def &sysio_system_abi)
vector< type_def > common_type_defs()
vector< action_def > actions
Definition abi_def.hpp:127
vector< type_def > types
Definition abi_def.hpp:125
vector< struct_def > structs
Definition abi_def.hpp:126