EIP-3541: Reject new contracts starting with the 0xEF byte
This commit is contained in:
parent
b4221381d6
commit
e08c9ef2d9
|
@ -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
|
debug "Contract code size exceeds EIP170", limit=EIP170_CODE_SIZE_LIMIT, actual=contractCode.len
|
||||||
return false
|
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
|
let storageAddr = c.msg.contractAddress
|
||||||
if c.isSelfDestructed(storageAddr): return
|
if c.isSelfDestructed(storageAddr): return
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,10 @@ proc writeContract*(c: Computation, fork: Fork): bool {.gcsafe.} =
|
||||||
actual = contractCode.len
|
actual = contractCode.len
|
||||||
return false
|
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
|
let storageAddr = c.msg.contractAddress
|
||||||
if c.isSelfDestructed(storageAddr): return
|
if c.isSelfDestructed(storageAddr): return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue