Skip to content

Commit

Permalink
statedb: disallow override for some addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed May 9, 2024
1 parent 515e912 commit 1f78073
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,17 @@ func (s *StateDB) SetCode(addr common.Address, code []byte) {
}
}

// Arbitrum: don't allow users to override arbos-state
var disallowedStateOverrideAddresses = make(map[common.Address]bool)

func DisAllowStateOverride(address common.Address) {
disallowedStateOverrideAddresses[address] = true
}

func (s *StateDB) SetState(addr common.Address, key, value common.Hash) {
if disallowedStateOverrideAddresses[addr] {
return
}
stateObject := s.getOrNewStateObject(addr)
if stateObject != nil {
stateObject.SetState(key, value)
Expand Down

0 comments on commit 1f78073

Please sign in to comment.