Skip to content

Commit

Permalink
add cancun check
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Apr 27, 2024
1 parent 4bb7c44 commit d6ba9a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vyper/builtins/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@
from vyper.codegen.ir_node import Encoding, scope_multi
from vyper.codegen.keccak256_helper import keccak256_helper
from vyper.evm.address_space import MEMORY
from vyper.evm.opcodes import version_check
from vyper.exceptions import (
ArgumentException,
CompilerPanic,
EvmVersionException,
InvalidLiteral,
InvalidType,
StateAccessViolation,
Expand Down Expand Up @@ -1220,6 +1222,9 @@ class BlobHash(BuiltinFunctionT):

@process_inputs
def build_IR(self, expr, args, kwargs, context):
if not version_check(begin="cancun"):
raise EvmVersionException("`blobhash` is not available pre-cancun", expr)

return IRnode.from_list(["blobhash", args[0]], typ=BYTES32_T)


Expand Down

0 comments on commit d6ba9a2

Please sign in to comment.