core/vm: fix condition

This commit is contained in:
Felix Lange 2025-06-10 16:11:52 +02:00
parent 370af2ed06
commit 6a077c6e01

View file

@ -526,11 +526,15 @@ func (evm *EVM) initNewContract(contract *Contract, address common.Address) ([]b
}
// Check whether the max code size has been exceeded, assign err if the case.
if evm.chainRules.IsOsaka && len(ret) > params.MaxCodeSizeOsaka {
if evm.chainRules.IsOsaka {
if len(ret) > params.MaxCodeSizeOsaka {
return ret, ErrMaxCodeSizeExceeded
} else if evm.chainRules.IsEIP158 && len(ret) > params.MaxCodeSize {
}
} else if evm.chainRules.IsEIP158 {
if len(ret) > params.MaxCodeSize {
return ret, ErrMaxCodeSizeExceeded
}
}
// Reject code starting with 0xEF if EIP-3541 is enabled.
if len(ret) >= 1 && ret[0] == 0xEF && evm.chainRules.IsLondon {