aboutsummaryrefslogtreecommitdiffstats
path: root/core/evm.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-18 13:12:16 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:50 +0800
commit6137f79f726e8ec6a282ee0ca4ed45c05020ed4c (patch)
tree9a9e5c3cc01e0a7c1898799562e13fabeaf608d5 /core/evm.go
parent1fa4415d48e4ed7ee0f75ed21e62847ea68d3a0f (diff)
downloaddexon-6137f79f726e8ec6a282ee0ca4ed45c05020ed4c.tar
dexon-6137f79f726e8ec6a282ee0ca4ed45c05020ed4c.tar.gz
dexon-6137f79f726e8ec6a282ee0ca4ed45c05020ed4c.tar.bz2
dexon-6137f79f726e8ec6a282ee0ca4ed45c05020ed4c.tar.lz
dexon-6137f79f726e8ec6a282ee0ca4ed45c05020ed4c.tar.xz
dexon-6137f79f726e8ec6a282ee0ca4ed45c05020ed4c.tar.zst
dexon-6137f79f726e8ec6a282ee0ca4ed45c05020ed4c.zip
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.
Diffstat (limited to 'core/evm.go')
-rw-r--r--core/evm.go1
1 files changed, 1 insertions, 0 deletions
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()),