Skip to content

Commit

Permalink
calculate tree index correctly for SLOAD access event (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwasinger authored Feb 11, 2022
1 parent b7d0870 commit 1a98ca7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ func opSload(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]by
loc := scope.Stack.peek()
hash := common.Hash(loc.Bytes32())
val := interpreter.evm.StateDB.GetState(scope.Contract.Address(), hash)
loc.SetBytes(val.Bytes())

if interpreter.evm.chainConfig.IsCancun(interpreter.evm.Context.BlockNumber) {
index := trieUtils.GetTreeKeyStorageSlot(scope.Contract.Address().Bytes(), loc)
// TODO SSTORE write events
interpreter.evm.Accesses.SetLeafValue(index, val.Bytes())
}
loc.SetBytes(val.Bytes())
return nil, nil
}

Expand Down

0 comments on commit 1a98ca7

Please sign in to comment.