What it offers
- swap: Swap exact input tokens through a routing path
- addLiquidity: Deposit two tokens to mint LP tokens
- removeLiquidity: Burn LP tokens to withdraw underlying tokens
Notes
- Standard Uniswap V2 fork interface; 0.3% fee per swap
- Base-only deployment
- Both tokens must be ERC20-approved to the Router before swap/addLiquidity
Its names in a program
On Base,Baseswap is a namespace: its contracts need no import.
Deployments
ABI
BaseSwapRouterABI
import BaseSwapRouterABI from "./protocols/baseswap/BaseSwapRouterABI.json"; Speaks for: v2Router.
swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) returns (uint256[] amounts)addLiquidity(address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns (uint256 amountA, uint256 amountB, uint256 liquidity)removeLiquidity(address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline) returns (uint256 amountA, uint256 amountB)
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
