Developer
Boomswap is a Uniswap V2 fork. Developers can interact with Boomswap in the same way they use Uniswap repositories and SDKs.
The following steps were made when forking the original code:
V2-Core-Master Module
Contracts and Modifications
BoomswapERC20.sol : Originally
UniswapV2ERC20, this contract has been modified for LP name and symbol adjustments.BoomswapPair.sol : Originally
UniswapV2Pair. Fee value in updated in theBoomswapPair-swap()function at these two lines:
// 19 = 1.9% fee
uint256 balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(19));
uint256 balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(19));BoomswapFactory.sol: Formerly
UniswapV2Factory. Key modification includes the initialization of the state variableINIT_CODE_HASH. The deployment of this contract requires a specified_feeToSetteraddress, which has the authority to adjust thefeeToparameter.
V2-Periphery-Master Module
Implementation Steps
Retrieve the contract address and
INIT_CODE_HASHfrom the deployed Factory.In
UniswapV2Library.sol, replace the existing init code hash in thepairForfunction (Remove the '0x' prefix).Compile and deploy the
IUniswapV2Router02andBoomswapRouter.solcontracts (previouslyUniswapV2Router02) using the appropriate pragma solidity version.BoomswapRouter Deployment: Requires the
_FACTORYaddress and the WBMC address (formerly WETH).
Consider modifying UniswapV2Library.sol and UniswapV2LiquidityMathLibrary.sol fees initially at 0.3% (997/1000).
Don't subsitute WETH with WBMC. Maintain the convention usage of ETH everywhere in the code: in names like IWETH, amountETHMin, etc.
API Endpoints Documentation
Don't forget to approve token before calling any of the following endpoints.
Use
addLiquidityfor ERC-20/ERC-20 pairs.For WBMC pairs (WETH convention), use
addLiquidityETH.To remove liquidity, use
removeLiquidityorremoveLiquidityETH.For withdrawal estimates, follow the logic in
UniswapV2Pair-burn().
Quotation: Use
quote.Exact Output: Use
getAmountOut|getAmountsOut.Exact Input: Use
getAmountIn|getAmountsIn.Pair Reserves (TVL): Use
getReserves.
Resources
Contracts
Last updated