mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core/vm: fix create, reject EOF deployment from legacy contracts
This commit is contained in:
parent
3f038776b6
commit
1a9855486f
1 changed files with 4 additions and 0 deletions
|
|
@ -567,6 +567,10 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
|
||||||
if err == nil && isInitcodeEOF && !hasEOFMagic(ret) {
|
if err == nil && isInitcodeEOF && !hasEOFMagic(ret) {
|
||||||
err = ErrLegacyCode
|
err = ErrLegacyCode
|
||||||
}
|
}
|
||||||
|
// Reject EOF deployment from legacy.
|
||||||
|
if err == nil && !isInitcodeEOF && hasEOFMagic(ret) {
|
||||||
|
err = ErrLegacyCode
|
||||||
|
}
|
||||||
|
|
||||||
// Reject code starting with 0xEF if EIP-3541 is enabled.
|
// Reject code starting with 0xEF if EIP-3541 is enabled.
|
||||||
if err == nil && len(ret) >= 1 && HasEOFByte(ret) {
|
if err == nil && len(ret) >= 1 && HasEOFByte(ret) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue