mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-04-14 21:58:35 +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)
|
||||
}
|
||||
// Reject EOF deployment from legacy.
|
||||
if isInitcodeEOF && hasEOFMagic(ret) {
|
||||
if !isInitcodeEOF && hasEOFMagic(ret) {
|
||||
return ret, ErrLegacyCode
|
||||
}
|
||||
|
||||
// Reject code starting with 0xEF if EIP-3541 is enabled.
|
||||
if len(ret) >= 1 && HasEOFByte(ret) {
|
||||
if evm.chainRules.IsPrague && isInitcodeEOF {
|
||||
// Don't reject EOF contracts after Shanghai
|
||||
// Don't reject EOF contracts after Prague
|
||||
} else if evm.chainRules.IsLondon {
|
||||
err = ErrInvalidCode
|
||||
return ret, ErrInvalidCode
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue