Skip to content

Commit

Permalink
Merge pull request #11 from dfx-finance/fix-zap
Browse files Browse the repository at this point in the history
fix deadline isue
  • Loading branch information
hottyage authored Jan 22, 2024
2 parents 0d7ea90 + 9121675 commit b479109
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Zap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ contract Zap {
uint256 swapAmount = isFromBase ? _zapAmount - outs[0] : _zapAmount - outs[1];

// Swap on curve
// Since we validate deadline in adding liquidity, we can use block.timestamp for swap
// Since we validate deadline in adding liquidity, we can use block.timestamp + 1 for swap
if (isFromBase) {
_zapFromBase(_curve, base, address(quote), swapAmount, block.timestamp, _zapAmount_);
_zapFromBase(_curve, base, address(quote), swapAmount, block.timestamp + 1, _zapAmount_);
} else {
_zapFromQuote(_curve, address(base), quote, swapAmount, block.timestamp, _zapAmount_);
_zapFromQuote(_curve, address(base), quote, swapAmount, block.timestamp + 1, _zapAmount_);
}
return _zap(_curve, base, quote, _deadline, _minLPAmount);
}
Expand Down

0 comments on commit b479109

Please sign in to comment.