mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
prevent sstore under accounts with no code
This commit is contained in:
parent
a2065c7ad6
commit
55dd2d5e69
1 changed files with 2 additions and 1 deletions
|
|
@ -518,7 +518,8 @@ func opSload(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by
|
||||||
}
|
}
|
||||||
|
|
||||||
func opSstore(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
func opSstore(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
if interpreter.readOnly {
|
// if scope is an account with no code (EOA delegation through EIP-5806) sstore is protected
|
||||||
|
if interpreter.readOnly || scope.Contract.CodeHash == (common.Hash{}) {
|
||||||
return nil, ErrWriteProtection
|
return nil, ErrWriteProtection
|
||||||
}
|
}
|
||||||
loc := scope.Stack.pop()
|
loc := scope.Stack.pop()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue