mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
refactor implementation of opcode restriction
This commit is contained in:
parent
0a6941be8e
commit
82ba7bfac6
2 changed files with 6 additions and 6 deletions
|
|
@ -423,7 +423,7 @@ func (tx *Transaction) UnmarshalJSON(input []byte) error {
|
||||||
if dec.To == nil {
|
if dec.To == nil {
|
||||||
return errors.New("missing required field 'to' in transaction")
|
return errors.New("missing required field 'to' in transaction")
|
||||||
}
|
}
|
||||||
itx.To = *dec.To
|
itx.To = dec.To
|
||||||
if dec.Gas == nil {
|
if dec.Gas == nil {
|
||||||
return errors.New("missing required field 'gas' for txdata")
|
return errors.New("missing required field 'gas' for txdata")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,7 @@ 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.evm.TxContext.Is5806 && (scope.Contract.CodeHash == (common.Hash{}) || scope.Contract.CodeHash == types.EmptyCodeHash) {
|
if interpreter.evm.TxContext.Is5806 && interpreter.evm.Origin == scope.Contract.self.Address() {
|
||||||
return nil, ErrEip5806Write
|
return nil, ErrEip5806Write
|
||||||
}
|
}
|
||||||
if interpreter.readOnly {
|
if interpreter.readOnly {
|
||||||
|
|
@ -578,7 +578,7 @@ func opGas(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
func opCreate(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
func opCreate(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
if interpreter.evm.TxContext.Is5806 && (scope.Contract.CodeHash == (common.Hash{}) || scope.Contract.CodeHash == types.EmptyCodeHash) {
|
if interpreter.evm.TxContext.Is5806 && interpreter.evm.Origin == scope.Contract.self.Address() {
|
||||||
return nil, ErrEip5806Write
|
return nil, ErrEip5806Write
|
||||||
}
|
}
|
||||||
if interpreter.readOnly {
|
if interpreter.readOnly {
|
||||||
|
|
@ -622,7 +622,7 @@ func opCreate(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]b
|
||||||
}
|
}
|
||||||
|
|
||||||
func opCreate2(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
func opCreate2(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
if interpreter.evm.TxContext.Is5806 && (scope.Contract.CodeHash == (common.Hash{}) || scope.Contract.CodeHash == types.EmptyCodeHash) {
|
if interpreter.evm.TxContext.Is5806 && interpreter.evm.Origin == scope.Contract.self.Address() {
|
||||||
return nil, ErrEip5806Write
|
return nil, ErrEip5806Write
|
||||||
}
|
}
|
||||||
if interpreter.readOnly {
|
if interpreter.readOnly {
|
||||||
|
|
@ -806,7 +806,7 @@ func opStop(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byt
|
||||||
}
|
}
|
||||||
|
|
||||||
func opSelfdestruct(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
func opSelfdestruct(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
if interpreter.evm.TxContext.Is5806 && (scope.Contract.CodeHash == (common.Hash{}) || scope.Contract.CodeHash == types.EmptyCodeHash) {
|
if interpreter.evm.TxContext.Is5806 && interpreter.evm.Origin == scope.Contract.self.Address() {
|
||||||
return nil, ErrEip5806Write
|
return nil, ErrEip5806Write
|
||||||
}
|
}
|
||||||
if interpreter.readOnly {
|
if interpreter.readOnly {
|
||||||
|
|
@ -824,7 +824,7 @@ func opSelfdestruct(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext
|
||||||
}
|
}
|
||||||
|
|
||||||
func opSelfdestruct6780(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
func opSelfdestruct6780(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
|
||||||
if interpreter.evm.TxContext.Is5806 && (scope.Contract.CodeHash == (common.Hash{}) || scope.Contract.CodeHash == types.EmptyCodeHash) {
|
if interpreter.evm.TxContext.Is5806 && interpreter.evm.Origin == scope.Contract.self.Address() {
|
||||||
return nil, ErrEip5806Write
|
return nil, ErrEip5806Write
|
||||||
}
|
}
|
||||||
if interpreter.readOnly {
|
if interpreter.readOnly {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue