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
| WALLET_ADDRESS= | |
| WALLET_SECRET= | |
| INFURA_TEST_URL= |
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
| #!/usr/bin/env bash | |
| # | |
| # Twitter/X Space Downloader Bash Script | |
| # Copyright (c) 2024 Rodrigo Polo - rodrigopolo.com - The MIT License (MIT) | |
| # | |
| # Check if a stream URL is provided | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 <stream_url>" |
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 v3PoolArtifact = require("@uniswap/v3-core/artifacts/contracts/UniswapV3Pool.sol/UniswapV3Pool.json") | |
| const v2PairArtifact = require('@uniswap/v2-periphery/build/IUniswapV2Pair.json') | |
| const USDC_ETH_V3 = '0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640' | |
| const ETH_USDT_V2 = '0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852' | |
| const ETH_USDT_SUSHI = '0x06da0fd433c1a5d7a4faa01111c044910a184553' | |
| sqrtToPrice = (sqrt) => { |
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 routerArtifact = require('@uniswap/v2-periphery/build/UniswapV2Router02.json') | |
| const erc20Abi = require("../erc20.json") | |
| const wethArtifact = require("../weth.json") | |
| WETH_ADDRESS= '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' | |
| USDT_ADDRESS= '0xdAC17F958D2ee523a2206206994597C13D831ec7' | |
| ROUTER_ADDRESS= '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D' | |
| PAIR_ADDRESS= '0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852' |
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
| /* | |
| npx hardhat run --network localhost scripts/01_deployContracts.js | |
| */ | |
| const { ContractFactory, utils } = require("ethers") | |
| const WETH9 = require("../WETH9.json") | |
| const artifacts = { | |
| UniswapV3Factory: require("@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json"), | |
| SwapRouter: require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.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 { Contract, ContractFactory, utils, BigNumber } = require("ethers") | |
| const WETH9 = require("../WETH9.json") | |
| 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"), | |
| NonfungibleTokenPositionDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/NonfungibleTokenPositionDescriptor.sol/NonfungibleTokenPositionDescriptor.json"), | |
| NonfungiblePositionManager: require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"), | |
| WETH9, |
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
| INFURA_URL_TESTNET= | |
| WALLET_ADDRESS= | |
| WALLET_SECRET= |
NewerOlder