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 f38c1e67..0a6ce940 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -1265,6 +1265,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") @@ -1491,7 +1493,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; |