-
Notifications
You must be signed in to change notification settings - Fork 14
/
ExactSwap.sol
28 lines (25 loc) · 917 Bytes
/
ExactSwap.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "./interfaces/IUniswapV2Pair.sol";
import "./interfaces/IERC20.sol";
contract ExactSwap {
/**
* PERFORM AN SIMPLE SWAP WITHOUT ROUTER EXERCISE
*
* The contract has an initial balance of 1 WETH.
* The challenge is to swap an exact amount of WETH for 1337 USDC token using the `swap` function
* from USDC/WETH pool.
*
*/
function performExactSwap(address pool, address weth, address usdc) public {
/**
* swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data);
*
* amount0Out: the amount of USDC to receive from swap.
* amount1Out: the amount of WETH to receive from swap.
* to: recipient address to receive the USDC tokens.
* data: leave it empty.
*/
// your code start here
}
}