From 6137f79f726e8ec6a282ee0ca4ed45c05020ed4c Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Thu, 18 Oct 2018 13:12:16 +0800 Subject: core: vm: implement RAND opcode support DEXON has a built-in on chain random oracle that allow one to retrieve a random variable. Add a new opcode `RAND` to load the random variable onto the stack. --- core/evm.go | 1 + 1 file changed, 1 insertion(+) (limited to 'core/evm.go') diff --git a/core/evm.go b/core/evm.go index bf723cf9e..2d58e33f8 100644 --- a/core/evm.go +++ b/core/evm.go @@ -52,6 +52,7 @@ func NewEVMContext(msg Message, header *types.Header, chain ChainContext, author Coinbase: beneficiary, BlockNumber: new(big.Int).Set(header.Number), Time: new(big.Int).SetUint64(header.Time), + Randomness: header.Randomness, Difficulty: new(big.Int).Set(header.Difficulty), GasLimit: header.GasLimit, GasPrice: new(big.Int).Set(msg.GasPrice()), -- cgit v1.2.3