@@ -54,6 +54,7 @@ contract JoinAndQuit is
54
54
}
55
55
56
56
struct MemberFund {
57
+ bool candidate;
57
58
bool rageQuit;
58
59
uint256 funding;
59
60
}
@@ -68,7 +69,7 @@ contract JoinAndQuit is
68
69
uint256 public minFeeToJoin;
69
70
uint256 public memberReputation;
70
71
uint256 public fundingGoal;
71
- uint256 public fundingGoalDeadLine ;
72
+ uint256 public fundingGoalDeadline ;
72
73
uint256 public totalDonation;
73
74
74
75
/**
@@ -83,7 +84,7 @@ contract JoinAndQuit is
83
84
* @param _memberReputation the repution which will be allocated for members
84
85
if this param is zero so the repution will be allocated proportional to the fee paid
85
86
* @param _fundingGoal the funding goal
86
- * @param _fundingGoalDeadLine the funding goal deadline
87
+ * @param _fundingGoalDeadline the funding goal deadline
87
88
*/
88
89
function initialize (
89
90
Avatar _avatar ,
@@ -95,7 +96,7 @@ contract JoinAndQuit is
95
96
uint256 _minFeeToJoin ,
96
97
uint256 _memberReputation ,
97
98
uint256 _fundingGoal ,
98
- uint256 _fundingGoalDeadLine
99
+ uint256 _fundingGoalDeadline
99
100
)
100
101
external
101
102
initializer
@@ -121,7 +122,7 @@ contract JoinAndQuit is
121
122
minFeeToJoin = _minFeeToJoin;
122
123
memberReputation = _memberReputation;
123
124
fundingGoal = _fundingGoal;
124
- fundingGoalDeadLine = _fundingGoalDeadLine ;
125
+ fundingGoalDeadline = _fundingGoalDeadline ;
125
126
}
126
127
127
128
/**
@@ -159,6 +160,7 @@ contract JoinAndQuit is
159
160
fundingToken.safeTransfer (proposal.proposedMember, proposal.funding);
160
161
}
161
162
}
163
+ fundings[proposal.proposedMember].candidate = false ;
162
164
emit ProposalExecuted (address (avatar), _proposalId, _decision);
163
165
return true ;
164
166
}
@@ -178,8 +180,10 @@ contract JoinAndQuit is
178
180
returns (bytes32 )
179
181
{
180
182
address proposer = msg .sender ;
183
+ require (! fundings[proposer].candidate, "already a candidate " );
181
184
require (avatar.nativeReputation ().balanceOf (proposer) == 0 , "already a member " );
182
185
require (_feeAmount >= minFeeToJoin, "_feeAmount should be >= then the minFeeToJoin " );
186
+ fundings[proposer].candidate = true ;
183
187
if (fundingToken == IERC20 (0 )) {
184
188
require (_feeAmount == msg .value , "ETH received shoul match the _feeAmount " );
185
189
} else {
@@ -266,7 +270,7 @@ contract JoinAndQuit is
266
270
/**
267
271
* @dev setFundingGoalReachedFlag check if funding goal reached.
268
272
*/
269
- function setFundingGoalReachedFlag () private {
273
+ function setFundingGoalReachedFlag () public {
270
274
uint256 avatarBalance;
271
275
if (fundingToken == IERC20 (0 )) {
272
276
avatarBalance = (address (avatar.vault ())).balance;
@@ -277,7 +281,7 @@ contract JoinAndQuit is
277
281
.hashCompareWithLengthCheck (CommonInterface.FUNDED_BEFORE_DEADLINE_VALUE) == false ) &&
278
282
(avatarBalance >= fundingGoal) &&
279
283
// solhint-disable-next-line not-rely-on-time
280
- (now < fundingGoalDeadLine )) {
284
+ (now < fundingGoalDeadline )) {
281
285
require (
282
286
Controller (
283
287
avatar.owner ()).
0 commit comments