Skip to content

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

Merged
merged 7 commits into from
Aug 8, 2020
Merged

Only join #780

merged 7 commits into from
Aug 8, 2020

Conversation

orenyodfat
Copy link
Contributor

No description provided.

@@ -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");
Copy link
Contributor

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");
Copy link
Contributor

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?

mapping(bytes32=>Proposal) public proposals;
mapping(address=>MemberFund) public fundings;
mapping(address=>MemeberState) public membersState;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"MemberState" not "MemeberState"

@@ -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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accepted, not accepted

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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"than" not "then"

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");
Copy link
Contributor

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?

@@ -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");
Copy link
Contributor

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")

ben-kaufman
ben-kaufman previously approved these changes Aug 4, 2020
@orenyodfat orenyodfat marked this pull request as ready for review August 8, 2020 17:14
@orenyodfat orenyodfat requested a review from leviadam as a code owner August 8, 2020 17:14
@orenyodfat orenyodfat merged commit 780bbed into master-2 Aug 8, 2020
@orenyodfat orenyodfat deleted the only_join branch August 8, 2020 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants