Skip to content

Commit 3e3c0e2

Browse files
committed
Add DUPN and SWAPN opcode EIP-663
1 parent c982f26 commit 3e3c0e2

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

include/evmc/instructions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ enum evmc_opcode
165165
OP_LOG3 = 0xa3,
166166
OP_LOG4 = 0xa4,
167167

168+
OP_DUPN = 0xb2,
169+
OP_SWAPN = 0xb3,
170+
168171
OP_CREATE = 0xf0,
169172
OP_CALL = 0xf1,
170173
OP_CALLCODE = 0xf2,

lib/instructions/instruction_metrics.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ static struct evmc_instruction_metrics cancun_metrics[256] = {
213213
/* = 0xaf */ {UNDEFINED, 0, 0},
214214
/* = 0xb0 */ {UNDEFINED, 0, 0},
215215
/* = 0xb1 */ {UNDEFINED, 0, 0},
216-
/* = 0xb2 */ {UNDEFINED, 0, 0},
217-
/* = 0xb3 */ {UNDEFINED, 0, 0},
216+
/* DUPN = 0xb2 */ {VERYLOW, 0, 1},
217+
/* SWAPN = 0xb3 */ {VERYLOW, 0, 0},
218218
/* = 0xb4 */ {UNDEFINED, 0, 0},
219219
/* = 0xb5 */ {UNDEFINED, 0, 0},
220220
/* = 0xb6 */ {UNDEFINED, 0, 0},

lib/instructions/instruction_names.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ static const char* cancun_names[256] = {
183183
/* 0xaf */ NULL,
184184
/* 0xb0 */ NULL,
185185
/* 0xb1 */ NULL,
186-
/* 0xb2 */ NULL,
187-
/* 0xb3 */ NULL,
186+
/* 0xb2 */ "DUPN",
187+
/* 0xb3 */ "SWAPN",
188188
/* 0xb4 */ NULL,
189189
/* 0xb5 */ NULL,
190190
/* 0xb6 */ NULL,

0 commit comments

Comments
 (0)