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>2018-12-19 20:54:27 +0800
commit517e0a104d7de13204659fa24da055bcb17f80a2 (patch)
treef6df8f71f09b233dc3b716a641081122a2d6d487 /core/evm.go
parent834ed1db5b5a7d24dacf58084782f68113171075 (diff)
downloaddexon-517e0a104d7de13204659fa24da055bcb17f80a2.tar.gz
dexon-517e0a104d7de13204659fa24da055bcb17f80a2.tar.zst
dexon-517e0a104d7de13204659fa24da055bcb17f80a2.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 b958a0b13..1fb47199b 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).Set(header.Time),
+ Randomness: header.Randomness,
Difficulty: new(big.Int).Set(header.Difficulty),
GasLimit: header.GasLimit,
GasPrice: new(big.Int).Set(msg.GasPrice()),