Skip to content

Commit

Permalink
fix: available
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Oct 25, 2024
1 parent 340d1d0 commit b9b4ed0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Auctions/DumperAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ contract DumperAuction is Governance2Step, ReentrancyGuard {

if (secondsElapsed > auctionLength) return 0;

// Exponential decay from https://github.com/ajna-finance/ajna-core/blob/master/src/libraries/helpers/PoolHelper.sol
// Exponential step decay from https://github.com/ajna-finance/ajna-core/blob/master/src/libraries/helpers/PoolHelper.sol
uint256 hoursComponent = 1e27 >> (secondsElapsed / 3600);
uint256 minutesComponent = Maths.rpow(
MINUTE_HALF_LIFE,
Expand Down Expand Up @@ -521,8 +521,8 @@ contract DumperAuction is Governance2Step, ReentrancyGuard {
);

// Max amount that can be taken.
uint256 available = available(_from);
_amountTaken = available > _maxAmount ? _maxAmount : available;
uint256 _available = available(_from);
_amountTaken = _available > _maxAmount ? _maxAmount : _available;

// Get the amount needed
uint256 needed = _getAmountNeeded(
Expand Down Expand Up @@ -577,7 +577,8 @@ contract DumperAuction is Governance2Step, ReentrancyGuard {

// Verify the order details.
require(_hash == order.hash(COW_DOMAIN_SEPARATOR), "bad order");
require(paymentAmount > 0, "zero amount");
require(paymentAmount != 0, "zero amount");
require(available(address(order.sellToken)) != 0, "zero available");
require(order.feeAmount == 0, "fee");
require(order.partiallyFillable, "partial fill");
require(order.validTo < auction.kicked + auctionLength, "expired");
Expand Down

0 comments on commit b9b4ed0

Please sign in to comment.