Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean build with new FraxswapRouterMultihop #3

Merged
merged 4 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading