mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 03:10:48 +00:00
core/vm: fix create rules
This commit is contained in:
parent
55e2e277bf
commit
1d5144465f
1 changed files with 3 additions and 3 deletions
|
|
@ -579,16 +579,16 @@ func (evm *EVM) initNewContract(contract *Contract, address common.Address, valu
|
||||||
return ret, fmt.Errorf("%w: %v", ErrInvalidEOFInitcode, ErrLegacyCode)
|
return ret, fmt.Errorf("%w: %v", ErrInvalidEOFInitcode, ErrLegacyCode)
|
||||||
}
|
}
|
||||||
// Reject EOF deployment from legacy.
|
// Reject EOF deployment from legacy.
|
||||||
if isInitcodeEOF && hasEOFMagic(ret) {
|
if !isInitcodeEOF && hasEOFMagic(ret) {
|
||||||
return ret, ErrLegacyCode
|
return ret, ErrLegacyCode
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reject code starting with 0xEF if EIP-3541 is enabled.
|
// Reject code starting with 0xEF if EIP-3541 is enabled.
|
||||||
if len(ret) >= 1 && HasEOFByte(ret) {
|
if len(ret) >= 1 && HasEOFByte(ret) {
|
||||||
if evm.chainRules.IsPrague && isInitcodeEOF {
|
if evm.chainRules.IsPrague && isInitcodeEOF {
|
||||||
// Don't reject EOF contracts after Shanghai
|
// Don't reject EOF contracts after Prague
|
||||||
} else if evm.chainRules.IsLondon {
|
} else if evm.chainRules.IsLondon {
|
||||||
err = ErrInvalidCode
|
return ret, ErrInvalidCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue