This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ContractFactory, utils } = require("ethers") | |
const WETH9 = require("../WETH9.json") | |
const fs = require('fs'); | |
const { promisify } = require('util'); | |
const artifacts = { | |
UniswapV3Factory: require("@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json"), | |
SwapRouter: require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json"), | |
NFTDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/libraries/NFTDescriptor.sol/NFTDescriptor.json"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers') | |
const v3PoolArtifact = require("@uniswap/v3-core/artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json") | |
const poolAddresses = [ | |
'0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640', // USDC/ETH 0.05% | |
'0xcbcdf9626bc03e24f779434178a73a0b4bad62ed', // WBTC/ETH 0.3% | |
'0x5777d92f208679db4b9778590fa3cab3ac9e2168', // DAI/USDC 0.01% | |
'0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8', // USDC/ETH 0.3% | |
'0x4585fe77225b41b697c938b018e2ac67ac5a20c0', // WBTC/ETH 0.05% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ContractFactory, utils } = require("ethers") | |
const WETH9 = require("../WETH9.json") | |
const fs = require('fs'); | |
const { promisify } = require('util'); | |
const artifacts = { | |
UniswapV3Factory: require("@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json"), | |
SwapRouter: require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json"), | |
NFTDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/libraries/NFTDescriptor.sol/NFTDescriptor.json"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers'); | |
const dmmFactoryAbi = require("../abis/dmmFactory.json") | |
WETH_ADDRESS= '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' | |
USDT_ADDRESS= '0xdAC17F958D2ee523a2206206994597C13D831ec7' | |
DMM_FACTORY_ADDRESS='0x833e4083B7ae46CeA85695c4f7ed25CDAd8886dE' | |
const provider = new ethers.providers.JsonRpcProvider('http://127.0.0.1:8545/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers'); | |
const dmmRouterAbi = require("../abis/dmmRouter.json") | |
const erc20Abi = require("../abis/erc20.json") | |
const wethAbi = require("../abis/weth.json") | |
WETH_ADDRESS= '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' | |
USDT_ADDRESS= '0xdAC17F958D2ee523a2206206994597C13D831ec7' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const JSBI = require('jsbi') | |
const { TickMath, FullMath } = require('@uniswap/v3-sdk') | |
const baseToken = '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599' // WETH | |
const quoteToken = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' // WBTC | |
async function main( | |
baseToken, | |
quoteToken, | |
inputAmount, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"inputs": [], | |
"stateMutability": "nonpayable", | |
"type": "constructor" | |
}, | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ethers = require('ethers') | |
const poolAbi = [ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{"indexed": true, "internalType": "address", "name": "sender", "type": "address"}, | |
{"indexed": true, "internalType": "address", "name": "recipient", "type": "address"}, | |
{"indexed": false, "internalType": "int256", "name": "amount0", "type": "int256"}, | |
{"indexed": false, "internalType": "int256", "name": "amount1", "type": "int256"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { SwapRouter } = require('@uniswap/universal-router-sdk') | |
const { TradeType, Ether, Token, CurrencyAmount, Percent } = require('@uniswap/sdk-core') | |
const { Trade: V2Trade } = require('@uniswap/v2-sdk') | |
const { Pool, nearestUsableTick, TickMath, TICK_SPACINGS, FeeAmount, Trade: V3Trade, Route: RouteV3 } = require('@uniswap/v3-sdk') | |
const { MixedRouteTrade, Trade: RouterTrade } = require('@uniswap/router-sdk') | |
const IUniswapV3Pool = require('@uniswap/v3-core/artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json') | |
const JSBI = require('jsbi') | |
const erc20Abi = require('../abis/erc20.json') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SwapRouterArtifact = require('@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json') | |
const erc20Abi = [ | |
{ | |
"inputs": [ | |
{"internalType": "address", "name": "spender", "type": "address"}, | |
{"internalType": "uint256", "name": "amount", "type": "uint256"} | |
], | |
"name": "approve", | |
"outputs": [{"internalType": "bool", "name": "", "type": "bool"}], |