Skip to content

Commit

Permalink
remove vote instruction return value
Browse files Browse the repository at this point in the history
  • Loading branch information
neo hong committed Jul 26, 2021
1 parent 46e16fc commit 5efacc0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions libsolidity/analysis/GlobalContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,19 +510,17 @@ void GlobalContext::addValidateMultiSignMethod() {
}

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<MagicVariableDeclaration>(magicVariableToID("vote"), "vote", TypeProvider::function(
parameterTypes,
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/codegen/ExpressionCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,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;
}
Expand Down

0 comments on commit 5efacc0

Please sign in to comment.