-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathinvoke.schema.yaml
More file actions
250 lines (224 loc) · 6.02 KB
/
invoke.schema.yaml
File metadata and controls
250 lines (224 loc) · 6.02 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
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "schema:ethdebug/format/program/context/invoke"
title: ethdebug/format/program/context/invoke
description: |
Schema for representing function invocation context at a specific point in
program execution.
This context captures information about function calls, including both
internal function calls (via JUMP) and external contract calls (via CALL,
DELEGATECALL, STATICCALL, etc.). The schema distinguishes between these
different invocation types through the use of `internal` and `external`
boolean properties.
type: object
properties:
invoke:
type: object
title: Function invocation
description: |
Represents a function invocation, either internal (via JUMP) or external
(via CALL opcodes). The schema enforces that exactly one of `internal`
or `external` must be true.
For internal calls, only `target` and `arguments` are valid.
For external calls, `gas`, `value`, `input`, `salt`, `delegate`,
`static`, `create`, and `create2` may be used as appropriate.
properties:
target:
type: object
title: Invocation target
description: |
Pointer to the target of the invocation. For internal calls, this
typically points to a code location. For external calls, this points
to the address and/or selector being called.
properties:
pointer:
$ref: "schema:ethdebug/format/pointer"
required:
- pointer
additionalProperties: false
oneOf:
- $ref: "#/$defs/InternalFunctionInvocation"
- $ref: "#/$defs/ExternalFunctionInvocation"
unevaluatedProperties: false
required:
- target
required:
- invoke
$defs:
InternalFunctionInvocation:
type: object
properties:
internal:
description: |
Indicates this is an internal function call (JUMP/JUMPI).
const: true
arguments:
type: object
title: Function arguments
description: |
Pointer to the arguments for an internal function call.
Only valid for internal calls.
properties:
pointer:
$ref: "schema:ethdebug/format/pointer"
required:
- pointer
additionalProperties: false
required: [internal]
ExternalFunctionInvocation:
type: object
properties:
external:
description: |
Indicates this is an external contract call (CALL/DELEGATECALL/etc).
const: true
gas:
type: object
title: Gas allocation
description: |
Pointer to the gas allocated for an external call
properties:
pointer:
$ref: "schema:ethdebug/format/pointer"
required:
- pointer
additionalProperties: false
value:
type: object
title: ETH value
description: |
Pointer to the amount of ETH being sent with an external call.
properties:
pointer:
$ref: "schema:ethdebug/format/pointer"
required:
- pointer
additionalProperties: false
salt:
type: object
title: CREATE2 salt
description: |
Pointer to the salt value for CREATE2.
Only valid when create2 is true.
properties:
pointer:
$ref: "schema:ethdebug/format/pointer"
required:
- pointer
additionalProperties: false
input:
type: object
title: Call input data
description: |
Pointer to the input data for an external call.
Only valid for external calls.
properties:
pointer:
$ref: "schema:ethdebug/format/pointer"
required:
- pointer
additionalProperties: false
delegate:
type: boolean
description: |
Indicates this external call is a DELEGATECALL.
Only valid when external is true.
static:
type: boolean
description: |
Indicates this external call is a STATICCALL.
Only valid when external is true.
create:
type: boolean
description: |
Indicates this external call creates a new contract (CREATE).
Only valid when external is true.
create2:
type: boolean
description: |
Indicates this external call creates a new contract (CREATE2).
Only valid when external is true.
required: [external]
examples:
- invoke:
target:
pointer:
location: code
offset: 291
length: 2
internal: true
arguments:
pointer:
location: stack
slot: 0
length: 3
- invoke:
target:
pointer:
location: stack
slot: 0
external: true
value:
pointer:
location: stack
slot: 1
gas:
pointer:
location: stack
slot: 2
input:
pointer:
location: memory
offset: 128
length: 68
- invoke:
target:
pointer:
location: stack
slot: 0
external: true
delegate: true
gas:
pointer:
location: stack
slot: 1
input:
pointer:
location: calldata
offset: 4
length: 68
- invoke:
target:
pointer:
location: stack
slot: 0
external: true
create2: true
salt:
pointer:
location: stack
slot: 1
value:
pointer:
location: stack
slot: 2
input:
pointer:
location: memory
offset: 0
length: 200
- invoke:
target:
pointer:
location: stack
slot: 0
external: true
static: true
gas:
pointer:
location: stack
slot: 1
input:
pointer:
location: calldata
offset: 4
length: 36