We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fce14ba commit e5291efCopy full SHA for e5291ef
core/vm/eips.go
@@ -206,12 +206,12 @@ func enableSharding(jt *JumpTable) {
206
207
// opDataHash implements DATAHASH opcode
208
func opDataHash(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) ([]byte, error) {
209
- idx := scope.Stack.pop()
210
- if uint64(len(interpreter.evm.TxContext.DataHashes)) < idx.Uint64() {
211
- scope.Stack.push(uint256.NewInt(0))
212
- } else {
+ idx := scope.Stack.peek()
+ if idx.LtUint64(uint64(len(interpreter.evm.TxContext.DataHashes))) {
213
hash := interpreter.evm.TxContext.DataHashes[idx.Uint64()]
214
- scope.Stack.push(new(uint256.Int).SetBytes(hash.Bytes()))
+ idx.SetBytes(hash.Bytes())
+ } else {
+ idx.Clear()
215
}
216
return nil, nil
217
0 commit comments