Skip to content

Commit

Permalink
May 24, 2023, 8:17 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
xthet committed May 24, 2023
1 parent 2dba47d commit 6d9e435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions contracts/Campaign.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ contract Campaign is KeeperCompatibleInterface, ReentrancyGuard{
goalAmount = _goalAmount;
i_initTimeStamp = block.timestamp;
duration = _duration > i_maxDur ? i_maxDur : _duration;
deadline = i_initTimeStamp.add(duration);
deadline = i_initTimeStamp + duration;
s_imageURI = _imageURI;
currentBalance = 0;
}
Expand All @@ -120,15 +120,15 @@ contract Campaign is KeeperCompatibleInterface, ReentrancyGuard{
// if(msg.sender != i_crf){revert();}
if(c_state != C_State.Fundraising){revert();}
if(_donator == i_creator){revert();}
currentBalance = currentBalance.add(msg.value);
currentBalance = currentBalance + msg.value;
if(_rewardable){
if(rewards[msg.value] != address(0)){
(bool success, ) = rewards[msg.value].call(abi.encodeWithSignature("addDonator(address)", _donator));
if(!success){revert();}
entDonations[_donator].push(msg.value);
}
}
aggrDonations[_donator] = aggrDonations[_donator].add(msg.value);
aggrDonations[_donator] = aggrDonations[_donator] + msg.value;
emit FundingRecieved(_donator, msg.value, currentBalance);
}

Expand Down Expand Up @@ -208,8 +208,8 @@ contract Campaign is KeeperCompatibleInterface, ReentrancyGuard{
}

function updateDur(uint256 _addedDur) external isCreator {
duration = ((duration.add(_addedDur)) > i_maxDur) ? i_maxDur : duration.add(_addedDur);
deadline = i_initTimeStamp.add(duration);
duration = (((duration + _addedDur)) > i_maxDur) ? i_maxDur : (duration + _addedDur);
deadline = i_initTimeStamp + duration;
}

// getter functions
Expand Down
2 changes: 1 addition & 1 deletion contracts/CrowdFunder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ contract CrowdFunder {
function publishCampaign(address _campaignAddress, address _upkeepCreator, address _linkToken) external {
(bool success, ) = _campaignAddress.delegatecall(abi.encodeWithSignature("timeBox(address,address,address)", _upkeepCreator, _linkToken, _campaignAddress));
if(success){
campaignCounter = campaignCounter.add(1);
campaignCounter = campaignCounter + 1;
emit CampaignPublished(_campaignAddress, msg.sender);
}else{revert();}
}
Expand Down

0 comments on commit 6d9e435

Please sign in to comment.