-
Notifications
You must be signed in to change notification settings - Fork 21
Only join #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only join #780
Conversation
contracts/schemes/Join.sol
Outdated
@@ -127,13 +104,12 @@ contract JoinAndQuit is | |||
returns(bool) { | |||
Proposal memory proposal = proposals[_proposalId]; | |||
require(proposal.proposedMember != address(0), "not a valid proposal"); | |||
require(fundings[proposal.proposedMember].state == MemeberState.Candidate, "proposal already been executed"); | |||
require(membersState[proposal.proposedMember] == MemeberState.Candidate, "proposal already been executed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if memberState is "candidate", that means that the proposal is already executed? Maybe change the name of the state to something more meaningful then (like "executed"?)
@@ -127,13 +104,12 @@ contract JoinAndQuit is | |||
returns(bool) { | |||
Proposal memory proposal = proposals[_proposalId]; | |||
require(proposal.proposedMember != address(0), "not a valid proposal"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe give a more specific error message here?
contracts/schemes/Join.sol
Outdated
mapping(bytes32=>Proposal) public proposals; | ||
mapping(address=>MemberFund) public fundings; | ||
mapping(address=>MemeberState) public membersState; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"MemberState" not "MemeberState"
contracts/schemes/Join.sol
Outdated
@@ -212,11 +188,11 @@ contract JoinAndQuit is | |||
function redeemReputation(bytes32 _proposalId) public returns(uint256 reputation) { | |||
Proposal memory proposal = proposals[_proposalId]; | |||
require(proposal.proposedMember != address(0), "no member to redeem"); | |||
require(!fundings[proposal.proposedMember].rageQuit, "member already rageQuit"); | |||
require(fundings[proposal.proposedMember].state == MemeberState.Accepted, "member not accepeted"); | |||
require(membersState[proposal.proposedMember] == MemeberState.Accepted, "member not accepeted"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accepted, not accepted
contracts/schemes/Join.sol
Outdated
require(fundings[proposer].state != MemeberState.Candidate, "already a candidate"); | ||
require(fundings[proposer].state != MemeberState.Accepted, "accepted and not redeemed yet"); | ||
require(membersState[proposer] != MemeberState.Candidate, "already a candidate"); | ||
require(membersState[proposer] != MemeberState.Accepted, "accepted and not redeemed yet"); | ||
require(avatar.nativeReputation().balanceOf(proposer) == 0, "already a member"); | ||
require(_feeAmount >= minFeeToJoin, "_feeAmount should be >= then the minFeeToJoin"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"than" not "then"
contracts/schemes/Join.sol
Outdated
require(fundings[proposer].state != MemeberState.Candidate, "already a candidate"); | ||
require(fundings[proposer].state != MemeberState.Accepted, "accepted and not redeemed yet"); | ||
require(membersState[proposer] != MemeberState.Candidate, "already a candidate"); | ||
require(membersState[proposer] != MemeberState.Accepted, "accepted and not redeemed yet"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a subject to the error message so we know what it is about?
contracts/schemes/Join.sol
Outdated
@@ -174,11 +150,11 @@ contract JoinAndQuit is | |||
returns(bytes32) | |||
{ | |||
address proposer = msg.sender; | |||
require(fundings[proposer].state != MemeberState.Candidate, "already a candidate"); | |||
require(fundings[proposer].state != MemeberState.Accepted, "accepted and not redeemed yet"); | |||
require(membersState[proposer] != MemeberState.Candidate, "already a candidate"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a subject to the error message so we know what it is about? ("proposer is already a candidate")
No description provided.