/
contract_action.proto
212 lines (176 loc) · 4.78 KB
/
contract_action.proto
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
syntax = "proto3";
package proto;
/*-
*
* Hedera Network Services Protobuf
*
* Copyright (C) 2018 - 2022 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
option java_package = "com.hedera.services.stream.proto";
// <<<pbj.java_package = "com.hedera.hapi.streams">>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
import "basic_types.proto";
message ContractActions {
repeated ContractAction contract_actions = 1;
}
/**
* The type of action described by the action proto.
*/
enum ContractActionType {
/**
* default non-value.
*/
NO_ACTION = 0;
/**
* Most CALL, CALLCODE, DELEGATECALL, and STATICCALL, and first action of ContractCall/ContractCallLocal to deployed
* contracts. This does not include calls to system or precompiled contracts.
*/
CALL = 1;
/**
* CREATE, CREATE2, and first action of ContractCreate.
*/
CREATE = 2;
/**
* like Call, but to precompiled contracts (0x1 to 0x9 as of Berlin)
*/
PRECOMPILE = 3;
/**
* Call, but to system contract like HTS or ERC20 facades over Token accounts
*/
SYSTEM = 4;
}
/**
* The specific operation type of a call. The OP prefix has been added to avoid name collisions for
* the CALL and CREATE operation types since both ContractActionType and CallOperationType enums are
* used in ContractAction
*/
enum CallOperationType {
/**
* default operation type is UNKNOWN
*/
OP_UNKNOWN = 0;
/**
* CALL operation type.
*/
OP_CALL = 1;
/**
* CALLCODE operation type
*/
OP_CALLCODE = 2;
/**
* DELEGATECALL operation type
*/
OP_DELEGATECALL = 3;
/**
* STATICCALL operation type
*/
OP_STATICCALL = 4;
/**
* CREATE operation type
*/
OP_CREATE = 5;
/**
* CREATE2 operation type
*/
OP_CREATE2 = 6;
}
/**
* A finer grained action with a function result. Sometimes called "internal transactions." The function call itself
* will be the first action in a list, followed by sub-action in the order they were executed.
*/
message ContractAction {
/**
* The type of this action.
*/
ContractActionType call_type = 1;
/**
* Only the first action can come from an account, the rest will come from contracts. Because of DELEGATECALL
* and CALLCODE the caller of actions whose parent is an account may also be an account.
*/
oneof caller {
/**
* If the caller was a regular account, the AccountID.
*/
AccountID calling_account = 2;
/**
* If the caller was a smart contract account, the ContractID.
*/
ContractID calling_contract = 3;
}
/**
* The upper limit of gas this action can spend.
*/
int64 gas = 4;
/**
* Bytes passed in as input data to this action.
*/
bytes input = 5;
/**
* Who this action is directed to.
*/
oneof recipient {
/**
* The AccountID of the recipient if the recipient is an account. Only HBars will be transferred, no other side
* effects should be expected.
*/
AccountID recipient_account = 6;
/**
* The ContractID of the recipient if the recipient is a smart contract.
*/
ContractID recipient_contract = 7;
/**
* The bytes of the targeted by the action address.
* Only set on failed executions. If set, denotes that the address did not
* correspond to any account or contract at the time of finalization of
* this action.
* An example would be a failed lazy create as per HIP-583.
*/
bytes targeted_address = 8;
}
/**
* The value (in tinybars) that is associated with this action.
*/
int64 value = 9;
/**
* The actual gas spent by this action.
*/
int64 gas_used = 10;
/**
* The result data of the action.
*/
oneof result_data {
/**
* If successful, the output bytes of the action.
*/
bytes output = 11;
/**
* The contract itself caused the transaction to fail via the `REVERT` operation
*/
bytes revert_reason = 12;
/**
* The transaction itself failed without an explicit `REVERT`
*/
bytes error = 13;
}
/**
* The nesting depth of this call. The original action is at depth=0.
*/
int32 call_depth = 14;
/**
* The call operation type
*/
CallOperationType call_operation_type = 15;
}