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 hashes = [ | |
| '0x04fffe0fb9d0ac806b0f3c329a83d8dd5ddcd598ee82779043d83802d6ee784a', | |
| '0x8df99a1c9bbbf7cda5a9f1bc11d3b3cd0c6d99f31039396a29779fea252960f6', | |
| '0x3f94bc2af1300a01827e59a745b05af8517ae4fc5e25ee1add9789d19c9bfd00', | |
| '0x68cf26f581d6c0add08c9fcf9b1d4d31cff660d8bfb6b7d9e3636a7aa1e0a91f', | |
| '0xed797fb4d05950dca9279c55f2436211a3eb585f1f20877e7384017500951fe4', | |
| '0x7596c887baea532f2a2370af06d1990dac8be04f68e8f906dd82025d2ce42ad7', | |
| '0x8892ffda5398dbf54d0fb6bc4d2bbdbc31de250f633cf1becc568a92fbe63c51', | |
| '0x9219aa3bc64b325f84f9e3c101e602c83f65f61272a982c8f2fd1c55874ecc6d', | |
| '0x81995eb1d1a62c3dbdb817663e39b40d235861e4ee6513962299d8a15905dded', |
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
| WEBSOCKET_URL=wss://mainnet.infura.io/ws/v3/abc |
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
| require('dotenv').config() | |
| const ethers = require("ethers") | |
| // ie: -> Flash(address,address,uint256,uint256,uint256,uint256) | |
| const getEventSignature = (eventName, abi) => { | |
| const eventAbi = abi.find((entry) => entry.name === eventName); | |
| const types = eventAbi.inputs.map((input) => input.type); | |
| return `${eventName}(${types.join(',')})`; | |
| } |
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"}], |
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 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
| [ | |
| { | |
| "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 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
| 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 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/') |
NewerOlder