Skip to content

Commit 81940b9

Browse files
committed
fix
Signed-off-by: Ignacio Hagopian <[email protected]>
1 parent 95f771d commit 81940b9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/vm/instructions.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,11 @@ func opExtCodeHash(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext)
467467
slot := scope.Stack.peek()
468468
address := common.Address(slot.Bytes20())
469469
if interpreter.evm.chainRules.IsVerkle {
470-
if _, isPrecompile := interpreter.evm.precompile(address); !isPrecompile && !interpreter.evm.isSystemContract(address) {
470+
if _, isPrecompile := interpreter.evm.precompile(address); isPrecompile || interpreter.evm.isSystemContract(address) {
471+
if !scope.Contract.UseGas(params.WarmStorageReadCostEIP2929) {
472+
return nil, ErrExecutionReverted
473+
}
474+
} else {
471475
chargedGas, ok := interpreter.evm.Accesses.TouchBasicData(address[:], false, scope.Contract.UseGas)
472476
if !ok || (chargedGas == 0 && !scope.Contract.UseGas(params.WarmStorageReadCostEIP2929)) {
473477
return nil, ErrExecutionReverted
@@ -774,7 +778,7 @@ func chargeCallVariantEIP4762(evm *EVM, scope *ScopeContext) bool {
774778
if err != nil {
775779
return false
776780
}
777-
if scope.Contract.UseGas(evm.callGasTemp) {
781+
if !scope.Contract.UseGas(evm.callGasTemp) {
778782
return false
779783
}
780784

0 commit comments

Comments
 (0)