From a3621921074d5dcde70b9072397992077a4e24d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B9=8F=E9=A3=9E?= Date: Fri, 16 Aug 2019 15:01:44 +0800 Subject: [PATCH] Fix the check logic of CALLCODE. The verification rule "state modification is attempted during a static call" also applies to CALLCODE. --- ethereumj-core/src/main/java/org/ethereum/vm/VM.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/vm/VM.java b/ethereumj-core/src/main/java/org/ethereum/vm/VM.java index 37101de763..7ac8aefdd6 100644 --- a/ethereumj-core/src/main/java/org/ethereum/vm/VM.java +++ b/ethereumj-core/src/main/java/org/ethereum/vm/VM.java @@ -1322,7 +1322,7 @@ else if (!currentValue.isZero() && newValue.isZero()) { DataWord value = op.callHasValue() ? program.stackPop() : DataWord.ZERO; - if (program.isStaticCall() && op == CALL && !value.isZero()) + if (program.isStaticCall() && (op == CALL || op == CALLCODE) && !value.isZero()) throw new Program.StaticCallModificationException(); if (!value.isZero()) {