Skip to content

Commit

Permalink
Clean build with new FraxswapRouterMultihop (#3)
Browse files Browse the repository at this point in the history
* chore: cp over FraxswapRouterMultihop from fraxwap-v3

* chore: comment out unused variables

* refactor: interfaces

* chore: lint
  • Loading branch information
pegahcarter authored Feb 17, 2024
1 parent e7a73a1 commit 42d697a
Show file tree
Hide file tree
Showing 5 changed files with 316 additions and 241 deletions.
23 changes: 7 additions & 16 deletions src/contracts/periphery/FraxswapRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,11 @@ contract FraxswapRouter {
uint256 amountOutput;
{
// scope to avoid stack too deep errors
(
uint256 reserveInput,
uint256 reserveOutput,
uint256 twammReserveInput,
uint256 twammReserveOutput
) = FraxswapRouterLibrary.getReservesWithTwamm(factory, input, output);
(uint256 reserveInput, , uint256 twammReserveInput, ) = FraxswapRouterLibrary.getReservesWithTwamm(
factory,
input,
output
);
amountInput = IERC20(input).balanceOf(address(pair)) - reserveInput - twammReserveInput;
amountOutput = pair.getAmountOut(amountInput, input);
}
Expand Down Expand Up @@ -455,19 +454,11 @@ contract FraxswapRouter {
return FraxswapRouterLibrary.quote(amountA, reserveA, reserveB);
}

function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) public pure virtual returns (uint256 amountOut) {
function getAmountOut(uint256, uint256, uint256) public pure virtual returns (uint256) {
revert("Deprecated: Use getAmountsOut"); // depends on the fee of the pool
}

function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) public pure virtual returns (uint256 amountIn) {
function getAmountIn(uint256, uint256, uint256) public pure virtual returns (uint256) {
revert("Deprecated: Use getAmountsIn"); // depends on the fee of the pool
}

Expand Down
Loading

0 comments on commit 42d697a

Please sign in to comment.