FundUSDC.t.sol
1 // SPDX-License-Identifier: MIT 2 pragma solidity ^0.8.20; 3 import "forge-std/Test.sol"; 4 import './FundUSDC.sol'; 5 import "solmate/tokens/ERC20.sol"; 6 7 contract TestFundUSDC is Test { 8 9 FundUSDC fundUSDC; 10 ERC20 constant usdc = ERC20(0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359); 11 12 function test_shouldSwapEThtoUSDC() public { 13 fundUSDC = new FundUSDC(); 14 15 fundUSDC.swapExactOutputSingle{value: 100 ether}(10_000_000, 100 ether); 16 17 assertEq(usdc.balanceOf(address(this)), 10_000_000); 18 } 19 }