Skip to content

Commit

Permalink
core/vm: set authorized to nil when called with contract
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 committed Apr 25, 2024
1 parent e62b94a commit 99fbb23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/vm/eips.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 99fbb23

Please sign in to comment.