diff --git a/libsolidity/analysis/GlobalContext.cpp b/libsolidity/analysis/GlobalContext.cpp index b9c8a3c6faab..6b2340d70bf5 100644 --- a/libsolidity/analysis/GlobalContext.cpp +++ b/libsolidity/analysis/GlobalContext.cpp @@ -401,19 +401,17 @@ inline vector> constructMagicVariable } void GlobalContext::addVoteMethod() { - // bool vote(address[] memory addresses, unit256[] tronpowerlist) + // void vote(address[] memory addresses, unit256[] tronpowerlist) TypePointers parameterTypes; parameterTypes.push_back(TypeProvider::array(DataLocation::Memory, TypeProvider::address())); parameterTypes.push_back(TypeProvider::array(DataLocation::Memory, TypeProvider::uint256())); TypePointers returnParameterTypes; - returnParameterTypes.push_back(TypeProvider::boolean()); strings parameterNames; parameterNames.push_back("srList"); parameterNames.push_back("tronpowerList"); strings returnParameterNames; - returnParameterNames.push_back("ok"); m_magicVariables.push_back(make_shared(magicVariableToID("vote"), "vote", TypeProvider::function( parameterTypes, diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 7c2bdb4bb3bf..51763470798d 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -1370,7 +1370,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) m_context << Instruction::DUP1 << Instruction::MLOAD; } m_context << Instruction::NATIVEVOTE; - m_context << Instruction::DUP1 << Instruction::ISZERO; + m_context << Instruction::ISZERO; m_context.appendConditionalRevert(true); break; }