diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-18 13:12:16 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:49:53 +0800 |
commit | f8969c0635452e2610995ffef8f7417d7051c43e (patch) | |
tree | e5c929c58fd8435fd8404ac22e11450ae17b821d /core/evm.go | |
parent | 96cbe2f0f1cbfb44649178b32fba8bd4d0859747 (diff) | |
download | dexon-f8969c0635452e2610995ffef8f7417d7051c43e.tar dexon-f8969c0635452e2610995ffef8f7417d7051c43e.tar.gz dexon-f8969c0635452e2610995ffef8f7417d7051c43e.tar.bz2 dexon-f8969c0635452e2610995ffef8f7417d7051c43e.tar.lz dexon-f8969c0635452e2610995ffef8f7417d7051c43e.tar.xz dexon-f8969c0635452e2610995ffef8f7417d7051c43e.tar.zst dexon-f8969c0635452e2610995ffef8f7417d7051c43e.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.go | 1 |
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()), |