mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
Fix readonly flag handling in STATICCALL precompile execution
This commit is contained in:
parent
799f8a403c
commit
e9b0168414
1 changed files with 2 additions and 2 deletions
|
|
@ -210,9 +210,9 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
|
||||||
}
|
}
|
||||||
evm.Context.Transfer(evm.StateDB, caller.Address(), addr, value)
|
evm.Context.Transfer(evm.StateDB, caller.Address(), addr, value)
|
||||||
|
|
||||||
// It is allowed to call precompiles, even via call -- as opposed to callcode, staticcall and delegatecall it can also modify state
|
// Precompiles must use the current call-frame read-only context.
|
||||||
if isPrecompile {
|
if isPrecompile {
|
||||||
ret, gas, err = evm.RunPrecompiledContract(p, caller, input, gas, value, false)
|
ret, gas, err = evm.RunPrecompiledContract(p, caller, input, gas, value, evm.interpreter.readOnly)
|
||||||
} else {
|
} else {
|
||||||
// Initialise a new contract and set the code that is to be used by the EVM.
|
// Initialise a new contract and set the code that is to be used by the EVM.
|
||||||
// The contract is a scoped environment for this execution context only.
|
// The contract is a scoped environment for this execution context only.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue