EIP-3541: Reject new contracts starting with the 0xEF byte

This commit is contained in:
jangko 2021-06-28 17:14:08 +07:00
parent b4221381d6
commit e08c9ef2d9
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
2 changed files with 8 additions and 0 deletions

View File

@ -235,6 +235,10 @@ proc writeContract*(c: Computation, fork: Fork): bool {.gcsafe.} =
debug "Contract code size exceeds EIP170", limit=EIP170_CODE_SIZE_LIMIT, actual=contractCode.len
return false
if fork >= FkLondon and contractCode[0] == 0xFE.byte:
debug "Contract code can't start with 0xEF byte"
return false
let storageAddr = c.msg.contractAddress
if c.isSelfDestructed(storageAddr): return

View File

@ -175,6 +175,10 @@ proc writeContract*(c: Computation, fork: Fork): bool {.gcsafe.} =
actual = contractCode.len
return false
if fork >= FkLondon and contractCode[0] == 0xFE.byte:
debug "Contract code can't start with 0xEF byte"
return false
let storageAddr = c.msg.contractAddress
if c.isSelfDestructed(storageAddr): return