Getting started - Project Setup
We will begin building out our own Uniswap V2 from scratch by initiating a new foundry project, However you can use another framework like hardhat since the end result is the same, for this example we will stick to reliable foundry.
Note: If you don't have foundry installed use the command below or visit docs.
# Installing
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Verifying
forge --version
Following the steps below to get started with a simple starter kit:
1. Initializing
forge init uniswapv2-from-scratch
cd uniswapv2-from-scratch
2. Clean up
rm ./**/Counter*.sol
3. First smart contract
touch src/UniswapV2Pair.sol
4. Boilerplate
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;
contract UniswapV2Pair {}