diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-10-18 11:38:05 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-09 13:31:14 +0800 |
commit | 433aebb7c91acf6d364acd76f6018dc1b4f847af (patch) | |
tree | 755cb38bb4ec4c873cc86c537200d4cfa1b1b83f /libsolidity/analysis/GlobalContext.cpp | |
parent | 91c1c3ada94f983f71938fba5abb570207acc248 (diff) | |
download | dexon-solidity-433aebb7c91acf6d364acd76f6018dc1b4f847af.tar dexon-solidity-433aebb7c91acf6d364acd76f6018dc1b4f847af.tar.gz dexon-solidity-433aebb7c91acf6d364acd76f6018dc1b4f847af.tar.bz2 dexon-solidity-433aebb7c91acf6d364acd76f6018dc1b4f847af.tar.lz dexon-solidity-433aebb7c91acf6d364acd76f6018dc1b4f847af.tar.xz dexon-solidity-433aebb7c91acf6d364acd76f6018dc1b4f847af.tar.zst dexon-solidity-433aebb7c91acf6d364acd76f6018dc1b4f847af.zip |
Add opcode RAND supportv0.4.25
DEXON has a built-in on chain random oracle that allow one to retrieve a
random variable. Add `rand` solidity variable is introduced to load the
random variable onto the stack.
Diffstat (limited to 'libsolidity/analysis/GlobalContext.cpp')
-rw-r--r-- | libsolidity/analysis/GlobalContext.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libsolidity/analysis/GlobalContext.cpp b/libsolidity/analysis/GlobalContext.cpp index 756bb540..347cf943 100644 --- a/libsolidity/analysis/GlobalContext.cpp +++ b/libsolidity/analysis/GlobalContext.cpp @@ -51,6 +51,7 @@ m_magicVariables(vector<shared_ptr<MagicVariableDeclaration const>>{ make_shared<MagicVariableDeclaration>("msg", make_shared<MagicType>(MagicType::Kind::Message)), make_shared<MagicVariableDeclaration>("mulmod", make_shared<FunctionType>(strings{"uint256", "uint256", "uint256"}, strings{"uint256"}, FunctionType::Kind::MulMod, false, StateMutability::Pure)), make_shared<MagicVariableDeclaration>("now", make_shared<IntegerType>(256)), + make_shared<MagicVariableDeclaration>("rand", make_shared<IntegerType>(256)), make_shared<MagicVariableDeclaration>("require", make_shared<FunctionType>(strings{"bool"}, strings{}, FunctionType::Kind::Require, false, StateMutability::Pure)), make_shared<MagicVariableDeclaration>("require", make_shared<FunctionType>(strings{"bool", "string memory"}, strings{}, FunctionType::Kind::Require, false, StateMutability::Pure)), make_shared<MagicVariableDeclaration>("revert", make_shared<FunctionType>(strings(), strings(), FunctionType::Kind::Revert, false, StateMutability::Pure)), |