Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
add check maintenance mode for claiming the reward in case of any compromise case
  • Loading branch information
sdpisreddevil committed Jan 23, 2024
1 parent f507b6d commit 2f7e6fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2397,6 +2397,7 @@ public void removeDenylistPreps() {
@Override
@External
public void claimSponsorBond() {
checkMaintenance();
Address caller = Context.getCaller();
Context.require(!ArrayDBUtils.containsInArrayDb(caller, blockAddresses), TAG + ": Address is blocked");
DictDB<String, BigInteger> userAmounts = sponsorBondReturn.at(caller.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ public void sendInstallmentToContributor(String ipfsKey, BigInteger milestoneBud
Address contributorAddress = (Address) proposalData.get(consts.CONTRIBUTOR_ADDRESS);
String flag = (String) proposalData.get(consts.TOKEN);

Context.require(milestoneBudget.compareTo(remainingAmount)<= 0,TAG+"Requested budget is greater than remaining amount.");
Context.require(milestoneBudget.compareTo(remainingAmount) <= 0, TAG + "Requested budget is greater than remaining amount.");
// installmentAmount = remainingAmount.subtract(milestoneBudget);

installmentAmount = milestoneBudget;
Context.println("yhe installment is "+ installmentAmount);
Context.println("yhe installment is " + installmentAmount);

// if (_installmentCount == 1) {
// installmentAmount = remainingAmount;
Expand Down Expand Up @@ -481,10 +481,11 @@ public void disqualifyProject(String ipfsKey) {
}



@Override
@External
public void claimReward() {
boolean checkMaintainance = callScore(Boolean.class, getCpsScore(), "getMaintenanceMode");
Context.require(!checkMaintainance, TAG + ": CPS is in maintenance mode");
Address caller = Context.getCaller();
List<Address> blockAddresses = callScore(List.class, getCpsScore(), "getBlockedAddresses");
Context.require(!blockAddresses.contains(caller), TAG + ": Address is blocked");
Expand Down

0 comments on commit 2f7e6fb

Please sign in to comment.