Skip to content

Commit

Permalink
Update KaliCurve.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
audsssy committed Dec 12, 2023
1 parent e704814 commit 0cccfe2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/KaliCurve.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
pragma solidity >=0.8.4;

import {LibString} from "solbase/utils/LibString.sol";
import {IERC721} from "forge-std/interfaces/IERC721.sol";
import {IERC20} from "forge-std/interfaces/IERC20.sol";

import {IStorage} from "./interface/IStorage.sol";
import {Storage} from "./Storage.sol";
Expand Down Expand Up @@ -194,7 +192,6 @@ contract KaliCurve is Storage {
address owner = this.getCurveOwner(curveId);

// Validate mint conditions.
uint256 burnPrice = this.getPrice(false, curveId);
if (donation != this.getPrice(true, curveId) || donation != msg.value) {
revert InvalidAmount();
}
Expand All @@ -206,7 +203,7 @@ contract KaliCurve is Storage {
impactDAO = summonDao(curveId, owner, patron);

// Lock amount of burn price in contract to cover future burns.
totalDonation = donation - burnPrice;
totalDonation = donation - this.getPrice(false, curveId);
} else {
// Confirm new or recurring patron.
if (IKaliTokenManager(impactDAO).balanceOf(patron) > 0) {
Expand All @@ -218,15 +215,13 @@ contract KaliCurve is Storage {
IKaliTokenManager(impactDAO).mintTokens(patron, 1 ether);

// Lock token amount in burn price to cover future burns.
totalDonation = donation - burnPrice;
totalDonation = donation - this.getPrice(false, curveId);
}
}

// Distribute donation.
addUnclaimed(this.getCurveTreasury(curveId) ? impactDAO : owner, totalDonation);

// Increment curve supply.

emit Donated(curveId, patron, donation, incrementCurveSupply(curveId));
}

Expand Down

0 comments on commit 0cccfe2

Please sign in to comment.