From 99fbb2344d515f01550300f634a9803aad1cdbfe Mon Sep 17 00:00:00 2001 From: Manav Darji Date: Thu, 25 Apr 2024 18:51:33 +0530 Subject: [PATCH] core/vm: set authorized to nil when called with contract --- core/vm/eips.go | 1 + core/vm/evm.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/vm/eips.go b/core/vm/eips.go index b544075bde..92cc851aba 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -373,6 +373,7 @@ func opAuth(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byt // Verify if the provided authority address isn't a contract if code := interpreter.evm.StateDB.GetCode(authority); len(code) != 0 { + scope.Authorized = nil scope.Stack.push(uint256.NewInt(0)) return nil, ErrAuthorizedIsContract } diff --git a/core/vm/evm.go b/core/vm/evm.go index 7de1ac1137..f596dcc85c 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -428,7 +428,7 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte return ret, gas, err } -// AuthCall mimic Call except it sets the caller to the Authorized addres$ in Scope. +// AuthCall mimic Call except it sets the caller to the Authorized address in Scope. func (evm *EVM) AuthCall(invoker ContractRef, caller, addr common.Address, input []byte, gas uint64, value *big.Int, interruptCtx context.Context) (ret []byte, leftOverGas uint64, err error) { // Fail if we're trying to execute above the call depth limit if evm.depth > int(params.CallCreateDepth) {