aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/instructions.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/instructions.go')
-rw-r--r--core/vm/instructions.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/vm/instructions.go b/core/vm/instructions.go
index 3a82190da..3d17287ed 100644
--- a/core/vm/instructions.go
+++ b/core/vm/instructions.go
@@ -417,14 +417,16 @@ func opRand(pc *uint64, interpreter *EVMInterpreter, contract *Contract, memory
binaryNonce := make([]byte, binary.MaxVarintLen64)
binary.PutUvarint(binaryNonce, nonce)
- binaryGas := make([]byte, binary.MaxVarintLen64)
- binary.PutUvarint(binaryGas, contract.Gas)
+ binaryUsedIndex := make([]byte, binary.MaxVarintLen64)
+ binary.PutUvarint(binaryUsedIndex, evm.RandCallIndex)
+
+ evm.RandCallIndex += 1
hash := crypto.Keccak256(
evm.Randomness,
contract.Caller().Bytes(),
binaryNonce,
- binaryGas)
+ binaryUsedIndex)
stack.push(interpreter.intPool.get().SetBytes(hash))
return nil, nil