Skip to content

Commit

Permalink
Add Cancun instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
frabert committed May 29, 2024
1 parent c51a87f commit 3b3dcb1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pyevmasm/evmasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from future.builtins import next, bytes # type: ignore
import copy

DEFAULT_FORK = "shanghai"
DEFAULT_FORK = "cancun"

"""
Example use::
Expand Down Expand Up @@ -1101,6 +1101,15 @@ def __repr__(self):
shanghai_instruction_table, previous_fork=london_instruction_table
)

cancun_instruction_table = {
0x5e: ("MCOPY", 0, 3, 0, 700, "Copy data from a memory location"),
0x4a: ("BLOBBASEFEE", 0, 0, 1, 2, "Blob base-fee in wei")
}

cancun_instruction_table = InstructionTable( # type: ignore
cancun_instruction_table, previous_fork=shanghai_instruction_table
)

accepted_forks = (
"frontier",
"homestead",
Expand All @@ -1112,7 +1121,8 @@ def __repr__(self):
"serenity",
"istanbul",
"london",
"shanghai"
"shanghai",
"cancun",
)


Expand All @@ -1128,6 +1138,7 @@ def __repr__(self):
"istanbul": istanbul_instruction_table,
"london": london_instruction_table,
"shanghai": shanghai_instruction_table,
"cancun": cancun_instruction_table,
}


Expand Down Expand Up @@ -1163,6 +1174,7 @@ def block_to_fork(block_number):
9069000: "istanbul",
12965000: "london",
17034870: "shanghai",
19426587: "cancun",
99999999: "serenity", # to be replaced after Serenity launch
}
fork_names = list(forks_by_block.values())
Expand Down

0 comments on commit 3b3dcb1

Please sign in to comment.