Repository navigation
Expand file tree
/
Copy pathContract.proto
More file actions
342 lines (285 loc) · 7.83 KB
/
Copy pathContract.proto
File metadata and controls
342 lines (285 loc) · 7.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
/*
* java-tron is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* java-tron is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
syntax = "proto3";
package protocol;
option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file
option java_outer_classname = "Contract"; //Specify the class name of the generated Java file
option go_package = "github.com/tronprotocol/grpc-gateway/core";
import "core/Tron.proto";
message AccountCreateContract {
bytes owner_address = 1;
bytes account_address = 2;
AccountType type = 3;
}
// Update account name. Account name is not unique now.
message AccountUpdateContract {
bytes account_name = 1;
bytes owner_address = 2;
}
// Set account id if the account has no id. Account id is unique and case insensitive.
message SetAccountIdContract {
bytes account_id = 1;
bytes owner_address = 2;
}
message TransferContract {
bytes owner_address = 1;
bytes to_address = 2;
int64 amount = 3;
}
message ShieldAddress {
bytes private_address = 1;
bytes public_address = 2;
}
message TransferAssetContract {
bytes asset_name = 1; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format.
bytes owner_address = 2;
bytes to_address = 3;
int64 amount = 4;
}
message VoteAssetContract {
bytes owner_address = 1;
repeated bytes vote_address = 2;
bool support = 3;
int32 count = 5;
}
message VoteWitnessContract {
message Vote {
bytes vote_address = 1;
int64 vote_count = 2;
}
bytes owner_address = 1;
repeated Vote votes = 2;
bool support = 3;
}
message UpdateSettingContract {
bytes owner_address = 1;
bytes contract_address = 2;
int64 consume_user_resource_percent = 3;
}
message UpdateEnergyLimitContract {
bytes owner_address = 1;
bytes contract_address = 2;
int64 origin_energy_limit = 3;
}
message ClearABIContract {
bytes owner_address = 1;
bytes contract_address = 2;
}
message WitnessCreateContract {
bytes owner_address = 1;
bytes url = 2;
}
message WitnessUpdateContract {
bytes owner_address = 1;
bytes update_url = 12;
}
message AssetIssueContract {
string id = 41;
message FrozenSupply {
int64 frozen_amount = 1;
int64 frozen_days = 2;
}
bytes owner_address = 1;
bytes name = 2;
bytes abbr = 3;
int64 total_supply = 4;
repeated FrozenSupply frozen_supply = 5;
int32 trx_num = 6;
int32 precision = 7;
int32 num = 8;
int64 start_time = 9;
int64 end_time = 10;
int64 order = 11; // useless
int32 vote_score = 16;
bytes description = 20;
bytes url = 21;
int64 free_asset_net_limit = 22;
int64 public_free_asset_net_limit = 23;
int64 public_free_asset_net_usage = 24;
int64 public_latest_free_net_time = 25;
}
message ParticipateAssetIssueContract {
bytes owner_address = 1;
bytes to_address = 2;
bytes asset_name = 3; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format.
int64 amount = 4; // the amount of drops
}
enum ResourceCode {
BANDWIDTH = 0x00;
ENERGY = 0x01;
}
message FreezeBalanceContract {
bytes owner_address = 1;
int64 frozen_balance = 2;
int64 frozen_duration = 3;
ResourceCode resource = 10;
bytes receiver_address = 15;
}
message UnfreezeBalanceContract {
bytes owner_address = 1;
ResourceCode resource = 10;
bytes receiver_address = 15;
}
message UnfreezeAssetContract {
bytes owner_address = 1;
}
message WithdrawBalanceContract {
bytes owner_address = 1;
}
message UpdateAssetContract {
bytes owner_address = 1;
bytes description = 2;
bytes url = 3;
int64 new_limit = 4;
int64 new_public_limit = 5;
}
message ProposalCreateContract {
bytes owner_address = 1;
map<int64, int64> parameters = 2;
}
message ProposalApproveContract {
bytes owner_address = 1;
int64 proposal_id = 2;
bool is_add_approval = 3; // add or remove approval
}
message ProposalDeleteContract {
bytes owner_address = 1;
int64 proposal_id = 2;
}
message CreateSmartContract {
bytes owner_address = 1;
SmartContract new_contract = 2;
int64 call_token_value = 3;
int64 token_id = 4;
}
message TriggerSmartContract {
bytes owner_address = 1;
bytes contract_address = 2;
int64 call_value = 3;
bytes data = 4;
int64 call_token_value = 5;
int64 token_id = 6;
}
message BuyStorageContract {
bytes owner_address = 1;
int64 quant = 2; // trx quantity for buy storage (sun)
}
message BuyStorageBytesContract {
bytes owner_address = 1;
int64 bytes = 2; // storage bytes for buy
}
message SellStorageContract {
bytes owner_address = 1;
int64 storage_bytes = 2;
}
message ExchangeCreateContract {
bytes owner_address = 1;
bytes first_token_id = 2;
int64 first_token_balance = 3;
bytes second_token_id = 4;
int64 second_token_balance = 5;
}
message ExchangeInjectContract {
bytes owner_address = 1;
int64 exchange_id = 2;
bytes token_id = 3;
int64 quant = 4;
}
message ExchangeWithdrawContract {
bytes owner_address = 1;
int64 exchange_id = 2;
bytes token_id = 3;
int64 quant = 4;
}
message ExchangeTransactionContract {
bytes owner_address = 1;
int64 exchange_id = 2;
bytes token_id = 3;
int64 quant = 4;
int64 expected = 5;
}
message AccountPermissionUpdateContract {
bytes owner_address = 1;
Permission owner = 2; //Empty is invalidate
Permission witness = 3; //Can be empty
repeated Permission actives = 4; //Empty is invalidate
}
// for shielded transaction
message AuthenticationPath {
repeated bool value = 1;
}
message MerklePath {
repeated AuthenticationPath authentication_paths = 1;
repeated bool index = 2;
bytes rt = 3;
}
message OutputPoint {
bytes hash = 1;
int32 index = 2;
}
message OutputPointInfo {
repeated OutputPoint out_points = 1;
int32 block_num = 2;
}
message PedersenHash {
bytes content = 1;
}
message IncrementalMerkleTree {
PedersenHash left = 1;
PedersenHash right = 2;
repeated PedersenHash parents = 3;
}
message IncrementalMerkleVoucher {
IncrementalMerkleTree tree = 1;
repeated PedersenHash filled = 2;
IncrementalMerkleTree cursor = 3;
int64 cursor_depth = 4;
bytes rt = 5;
OutputPoint output_point = 10;
}
message IncrementalMerkleVoucherInfo {
repeated IncrementalMerkleVoucher vouchers = 1;
repeated bytes paths = 2;
}
message SpendDescription {
bytes value_commitment = 1;
bytes anchor = 2; // merkle root
bytes nullifier = 3; // used for check double spend
bytes rk = 4; // used for check spend authority signature
bytes zkproof = 5;
bytes spend_authority_signature = 6;
}
message ReceiveDescription {
bytes value_commitment = 1;
bytes note_commitment = 2;
bytes epk = 3; // for Encryption
bytes c_enc = 4; // Encryption for incoming, decrypt it with ivk
bytes c_out = 5; // Encryption for audit, decrypt it with ovk
bytes zkproof = 6;
}
message ShieldedTransferContract {
bytes transparent_from_address = 1; // transparent address
int64 from_amount = 2;
repeated SpendDescription spend_description = 3;
repeated ReceiveDescription receive_description = 4;
bytes binding_signature = 5;
bytes transparent_to_address = 6; // transparent address
int64 to_amount = 7; // the amount to transparent to_address
}
// end shielded transaction
message UpdateBrokerageContract {
bytes owner_address = 1;
int32 brokerage = 2; // 1 mean 1%
}