-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathCurveV1AddLiquidity.test.sol
39 lines (34 loc) · 1.18 KB
/
CurveV1AddLiquidity.test.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
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import {Test, console2} from "forge-std/Test.sol";
import {IStableSwap3Pool} from
"../../../src/interfaces/curve/IStableSwap3Pool.sol";
import {IERC20} from "../../../src/interfaces/IERC20.sol";
import {
DAI,
USDC,
USDT,
CURVE_3POOL,
CURVE_3CRV
} from "../../../src/Constants.sol";
contract CurveV1AddLiquidityTest is Test {
IStableSwap3Pool private constant pool = IStableSwap3Pool(CURVE_3POOL);
IERC20 private constant lp = IERC20(CURVE_3CRV);
IERC20 private constant dai = IERC20(DAI);
IERC20 private constant usdc = IERC20(USDC);
IERC20 private constant usdt = IERC20(USDT);
function setUp() public {
deal(DAI, address(this), 1e6 * 1e18);
dai.approve(address(pool), type(uint256).max);
}
// Exercise 1
// Call add_liquidity
// Add 1,000,000 DAI of liquidity to the pool contract
function test_add_liquidity() public {
// Write your code here
uint256[3] memory coins = [uint256(1e6 * 1e18), uint256(0), uint256(0)];
pool.add_liquidity(coins, 1);
uint256 lpBal = lp.balanceOf(address(this));
assertGt(lpBal, 0);
}
}