diff options
Diffstat (limited to 'libsolidity/codegen/ExpressionCompiler.cpp')
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index e6bb163d..46a335bb 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -1314,6 +1314,8 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) m_context << Instruction::COINBASE; else if (member == "timestamp") m_context << Instruction::TIMESTAMP; + else if (member == "rand") + m_context << Instruction::RAND; else if (member == "difficulty") m_context << Instruction::DIFFICULTY; else if (member == "number") @@ -1558,7 +1560,11 @@ void ExpressionCompiler::endVisit(Identifier const& _identifier) break; case Type::Category::Integer: // "now" - m_context << Instruction::TIMESTAMP; + if (_identifier.name() == "now") { + m_context << Instruction::TIMESTAMP; + } else if (_identifier.name() == "rand") { + m_context << Instruction::RAND; + } break; default: break; |