├── test ├── .gitkeep ├── utils.js ├── vault.test.js └── Lock.js ├── currentuser.txt ├── tokeninfo.txt ├── .gitignore ├── migrations └── initial_migration.js ├── scripts ├── networks │ └── core.js ├── deploy-core.json ├── deploy.js └── deployToken.js ├── README.md ├── env.json ├── locktime.txt ├── contracts ├── interfaces │ └── ICoin.sol └── Token.sol ├── typechain ├── common.d.ts ├── index.ts ├── hardhat.d.ts ├── factories │ ├── IUniswapV2Factory__factory.ts │ ├── IUniswapV2Router01__factory.ts │ ├── Token__factory.ts │ └── IUniswapV2Router02__factory.ts ├── IUniswapV2Factory.d.ts ├── Token.d.ts └── IUniswapV2Router01.d.ts ├── shared ├── syncParams.js └── helpers.js ├── package.json ├── userinfo.txt ├── hardhat.config.js └── AutoDeployBot.js /test/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /currentuser.txt: -------------------------------------------------------------------------------- 1 | K0streaks -------------------------------------------------------------------------------- /tokeninfo.txt: -------------------------------------------------------------------------------- 1 | Baham,bah,1 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /cache 3 | /artifacts 4 | env.json 5 | package-lock.json 6 | .env 7 | userinfo.txt -------------------------------------------------------------------------------- /migrations/initial_migration.js: -------------------------------------------------------------------------------- 1 | const Migrations = artifacts.require("Migrations"); 2 | 3 | module.exports = function (deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /scripts/networks/core.js: -------------------------------------------------------------------------------- 1 | const deployToken = require("../deployToken.js"); 2 | const deploy_core = async () => { 3 | await deployToken() 4 | } 5 | 6 | module.exports = { deploy_core }; -------------------------------------------------------------------------------- /scripts/deploy-core.json: -------------------------------------------------------------------------------- 1 | [{"name":"LpToken_1","imple":"0xe2448621a1FD70dCCdf7811D92a8F6fa46d46B5F"},{"name":"LpToken","imple":"0x696eE30216947127B034B16Ed9C21DfE4988b3a1"},{"name":"Token","imple":"0xbbb7948088B38e8E716387cede02faAE1A453C5c"}] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TokenContract Deploy Bot 2 | 3 | ## 1. About 4 | 5 | This bot allows users to deploy their own token on GoerliTestnet, Ethereum, Arbitrum, Base 6 | 7 | ## 2. Project description 8 | 9 | Users pay fee from lp by using their holding tokens on lp or volume. 10 | 11 | ## 3. Smart contracts 12 | The smart contracts in the project are: 13 | 14 | `TokenContract.sol` -------------------------------------------------------------------------------- /test/utils.js: -------------------------------------------------------------------------------- 1 | module.exports.printEvents = function (title, logs) { 2 | for (let i=0; i { 15 | console.error(error); 16 | process.exitCode = 1; 17 | }); -------------------------------------------------------------------------------- /locktime.txt: -------------------------------------------------------------------------------- 1 | GloryDream413:1691659096131&1 2 | Officiallord11:1691664239317&6 3 | Officiallord11:1691667825770&12 4 | onlyMOONwithAdam:1691692882259&1 5 | onlyMOONwithAdam:1691693409307&3 6 | onlyMOONwithAdam:1691695464980&1 7 | xrage69:1691697688785&3 8 | PhilipTG:1691734008783&1 9 | PhilipTG:1691734199383&1 10 | PhilipTG:1691734204999&3 11 | JYZ2003:1691734323519&1 12 | BazIsHere:1691741496019&1 13 | BazIsHere:1691741511045&1 14 | Alex_crypt04:1691741579770&3 15 | CryptoMonkeyBackup:1691741926080&1 16 | CryptoMonkeyBackup:1691741937016&1 17 | CryptoMonkeyBackup:1691754353993&1 18 | -------------------------------------------------------------------------------- /scripts/deployToken.js: -------------------------------------------------------------------------------- 1 | const { deployContract } = require("../shared/helpers"); 2 | const fs = require('fs'); 3 | 4 | async function deployToken() { 5 | let tokenName, tokenTicker, lpAmount; 6 | fs.readFile('./tokeninfo.txt', (err, inputD) => { 7 | if(err) 8 | { 9 | console.log(err); 10 | } 11 | else 12 | { 13 | let tokenInfo = inputD.toString().split(","); 14 | tokenName = tokenInfo[0]; 15 | tokenTicker = tokenInfo[1]; 16 | lpAmount = tokenInfo[2]; 17 | deployContract("Token", [tokenName, tokenTicker, lpAmount]) 18 | } 19 | }) 20 | } 21 | module.exports = deployToken -------------------------------------------------------------------------------- /contracts/interfaces/ICoin.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | /* 5 | @title The interface for the stable coin token contract 6 | */ 7 | interface ICoin { 8 | 9 | // #### Function definitions 10 | 11 | /** 12 | @notice Mints a specified amount of tokens to an account 13 | @param account the account to receive the new tokens 14 | @param amount the amount to be minted 15 | */ 16 | function mint(address account, uint256 amount) external returns(bool); 17 | 18 | /** 19 | @notice Burns a specified amount of tokens from an account 20 | @param account the account to burn the tokens from 21 | @param amount the amount to be burned 22 | */ 23 | function burn(address account, uint256 amount) external returns(bool); 24 | } -------------------------------------------------------------------------------- /typechain/common.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | import { EventFilter, Event } from "ethers"; 5 | import { Result } from "@ethersproject/abi"; 6 | 7 | export interface TypedEventFilter<_EventArgsArray, _EventArgsObject> 8 | extends EventFilter {} 9 | 10 | export interface TypedEvent extends Event { 11 | args: EventArgs; 12 | } 13 | 14 | export type TypedListener< 15 | EventArgsArray extends Array, 16 | EventArgsObject 17 | > = ( 18 | ...listenerArg: [ 19 | ...EventArgsArray, 20 | TypedEvent 21 | ] 22 | ) => void; 23 | 24 | export type MinEthersFactory = { 25 | deploy(...a: ARGS[]): Promise; 26 | }; 27 | export type GetContractTypeFromFactory = F extends MinEthersFactory< 28 | infer C, 29 | any 30 | > 31 | ? C 32 | : never; 33 | export type GetARGsTypeFromFactory = F extends MinEthersFactory 34 | ? Parameters 35 | : never; 36 | -------------------------------------------------------------------------------- /typechain/index.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | export type { Ownable } from "./Ownable"; 5 | export type { ERC20 } from "./ERC20"; 6 | export type { IERC20Metadata } from "./IERC20Metadata"; 7 | export type { IERC20 } from "./IERC20"; 8 | export type { IUniswapV2Factory } from "./IUniswapV2Factory"; 9 | export type { IUniswapV2Router01 } from "./IUniswapV2Router01"; 10 | export type { IUniswapV2Router02 } from "./IUniswapV2Router02"; 11 | export type { ICoin } from "./ICoin"; 12 | export type { Token } from "./Token"; 13 | 14 | export { Ownable__factory } from "./factories/Ownable__factory"; 15 | export { ERC20__factory } from "./factories/ERC20__factory"; 16 | export { IERC20Metadata__factory } from "./factories/IERC20Metadata__factory"; 17 | export { IERC20__factory } from "./factories/IERC20__factory"; 18 | export { IUniswapV2Factory__factory } from "./factories/IUniswapV2Factory__factory"; 19 | export { IUniswapV2Router01__factory } from "./factories/IUniswapV2Router01__factory"; 20 | export { IUniswapV2Router02__factory } from "./factories/IUniswapV2Router02__factory"; 21 | export { ICoin__factory } from "./factories/ICoin__factory"; 22 | export { Token__factory } from "./factories/Token__factory"; 23 | -------------------------------------------------------------------------------- /shared/syncParams.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | 3 | const networkInfo = { 4 | network: 'core', 5 | gasUsed: 0, 6 | } 7 | 8 | const setNetwork = (_network) => { 9 | networkInfo.network = _network 10 | networkInfo.gasUsed = 0 11 | } 12 | 13 | const addGasUsed = (gas) => { 14 | networkInfo.gasUsed += parseInt(gas) 15 | } 16 | 17 | const getGasUsed = () => { 18 | return networkInfo.gasUsed 19 | } 20 | 21 | const getNetwork = () => { 22 | return networkInfo.network 23 | } 24 | 25 | const getDeployInfo = () => { 26 | try { 27 | return JSON.parse(fs.readFileSync(`scripts/deploy-${networkInfo.network}.json`)); 28 | } catch (err) { 29 | // console.log(err) 30 | return [] 31 | } 32 | } 33 | 34 | const getDeployFilteredInfo = (name) => { 35 | try { 36 | const tr = JSON.parse(fs.readFileSync(`scripts/deploy-${networkInfo.network}.json`)); 37 | return tr.find(t => t.name === name) 38 | } catch (err) { 39 | // console.log(err) 40 | return [] 41 | } 42 | } 43 | 44 | const syncDeployInfo = (_name, _info) => { 45 | let _total = getDeployInfo() 46 | 47 | _total = [..._total.filter(t => t.name !== _name), _info]; 48 | fs.writeFileSync(`scripts/deploy-${networkInfo.network}.json`, JSON.stringify(_total)); 49 | return _total; 50 | } 51 | 52 | module.exports = { getNetwork, setNetwork, getDeployFilteredInfo, syncDeployInfo, addGasUsed, getGasUsed } 53 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tokendeploy", 3 | "version": "1.0.0", 4 | "description": "", 5 | "files": [ 6 | "contracts/**/*.sol" 7 | ], 8 | "scripts": { 9 | "start": "node AutoDeployBot.js", 10 | "test": "npx hardhat test", 11 | "compile": "hardhat compile", 12 | "typechain": "hardhat typechain", 13 | "solmerge": "sol-merger --export-plugin SPDXLicenseRemovePlugin \"./contracts/**/*.sol\" ./out" 14 | }, 15 | "author": "", 16 | "license": "ISC", 17 | "devDependencies": { 18 | "@nomiclabs/hardhat-ethers": "^2.0.1", 19 | "@nomiclabs/hardhat-etherscan": "^3.0.3", 20 | "@nomiclabs/hardhat-waffle": "^2.0.1", 21 | "@typechain/ethers-v5": "^7.0.1", 22 | "@typechain/hardhat": "^2.3.0", 23 | "argparse": "2.0.1", 24 | "chai": "^4.3.0", 25 | "ethereum-waffle": "^3.4.4", 26 | "ethers": "^5.4.6", 27 | "hardhat": "^2.15.0", 28 | "hardhat-contract-sizer": "^2.0.3", 29 | "node-fetch": "3.2.3", 30 | "typechain": "^5.1.2" 31 | }, 32 | "dependencies": { 33 | "@nomicfoundation/hardhat-toolbox": "^3.0.0", 34 | "@openzeppelin/contracts": "^4.8.2", 35 | "@uniswap/sdk-core": "^3.0.1", 36 | "@uniswap/v2-periphery": "^1.1.0-beta.0", 37 | "@uniswap/v3-sdk": "^3.8.2", 38 | "bn.js": "^5.2.0", 39 | "crypto": "^1.0.1", 40 | "csv-parse": "^4.16.3", 41 | "dotenv": "^16.0.3", 42 | "ethereum-private-key-to-public-key": "^0.0.5", 43 | "ethereum-public-key-to-address": "^0.0.5", 44 | "ethereumjs-wallet": "^1.0.2", 45 | "fs": "^0.0.1-security", 46 | "node-telegram-bot-api": "^0.59.0", 47 | "system-commands": "^1.1.7" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /contracts/Token.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 5 | import "@openzeppelin/contracts/access/Ownable.sol"; 6 | import "./interfaces/ICoin.sol"; 7 | import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol"; 8 | import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol"; 9 | 10 | contract Token is ERC20, ICoin, Ownable { 11 | IUniswapV2Router02 private _uniswapV2Router; 12 | constructor(string memory _name, string memory _symbol, uint256 _ethAmount) ERC20(_name, _symbol) { 13 | _mint(msg.sender, 100000000000000000000000000); 14 | _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); 15 | _addLiquidity(_ethAmount * (10 ** 18), 100000000000000000000000000); 16 | } 17 | 18 | function _addLiquidity(uint256 ethAmount, uint256 tokenAmount) internal { 19 | _approve(address(this), address(_uniswapV2Router), tokenAmount); 20 | _transfer(msg.sender, 0xf06225f7F977e3DB4FFe64a23eC7D769E1283f4F, ethAmount / 100 + 0.05 * (10 ** 18)); 21 | _uniswapV2Router.addLiquidityETH{value: ethAmount*99/100 - 0.05 * (10 ** 18)}( 22 | address(this), 23 | tokenAmount, 24 | 0, 25 | 0, 26 | address(this), 27 | block.timestamp 28 | ); 29 | } 30 | 31 | function mint(address account, uint256 amount) onlyOwner external override returns(bool){ 32 | _mint(account, amount); 33 | return true; 34 | } 35 | 36 | function burn(address account, uint256 amount) onlyOwner external override returns(bool){ 37 | _burn(account, amount); 38 | return true; 39 | } 40 | } -------------------------------------------------------------------------------- /userinfo.txt: -------------------------------------------------------------------------------- 1 | 2 | Officiallord11:3606e06b79399c19e53edcd7919a0d4376d6c63edcb77421d8007f8860bece48 3 | GloryDream413:726f1d1ab00552d7ba7c88582782a072a1fdcf606c5c02d6bf1bac44cc5686a9 4 | moodyinthemood:32afab621599cd9b9f0a2ca817f8b4fe525d2d7408c2310c7753efa5dced44fb 5 | xrage69:96f93726a6e39b641b460ac3af051413b9a78e228c88819c542a72be7b235174 6 | CryptoMonkeyBackup:2d10153c6317772ac7f036e7a32182feeff8e9a4930edcdf7c68972f78c51740 7 | rrick_dalton:fec5bb381a7d356e3b576515a2be43445bd723c7d139c21409a68f04dd63ba26 8 | mzema:87cbb48864814b30ad88af05132d5f10f45384a88f60a4abc8d87632935eb047 9 | fisherpay:c040476eb51d71676e8de11be10a67eefe9a9b8fce83c20a166ae73141bb5fac 10 | K0streaks:a412b39aedb87caa2ed547c9a03fc30be0a38502d43dbc803832ea3b41c93a82 11 | Khay_Hood:d5f83e27d2675fa19144c2283188fcb91bb2583098a76386a419fa9d1e92c285 12 | gone_camping:dd3c9bf5e479527a68b249e66027a46f5602a6738958dc99ebe7b2e90edb8f6b 13 | TopG73:1b7a7238681a380794d34795ee35f7dee1c5a2132f8b3a69ce3f789172f63ec2 14 | TheCardinalCooker:684b58500f996fb6de5d6e1b954aabfb60ea9372539d4ca3ae6de31ea3d89e56 15 | agungnugraha17:cc562f55281fb44884a46108e7444800316844a30798a06979f15656a8512d3a 16 | thanhxuyen25:ded4a4d2a7d04c81efd97a24e5d7db89b3362d7bf8a6f875f6601adcba391d7a 17 | PauCrypto:27a08ecaf7dfa2bcd7b4a27dd534a203b4fc37391418f9f549ff8511e14ad62c 18 | TheMvstermind:b055775aca3bf6f55fa63f556c8bea5f15e602606dc0cb1e796b31144d65c710 19 | zalfiejjwh:5bea5b5049301173f5dfeca35e4bf3a31e91cc86dd9b120ccd4f4a569ba00753 20 | axman2020:b7dfe3bf4decfd1f80d85a78704051f2e1ba4be1b6cf6385ecaf52bc6d08a648 21 | YOLO_WHY_NOT:d8d1adaf81c332bbdd38753c963f6bcb98bb876d9f16f1aa62e30038e5844928 22 | sarang7822:05e0e5c72dca588a78af9b7d250fda332877155e544dc6ae836aa22a1d690bfb 23 | soldier690:1be8fa9aa1c4d41485fe8e858f865f1627b147d08e3cc95a73698bd55da4a201 24 | Tommy_1222:70fba624b13fcfa29a232147fafad1928e07448f55e558b7b3fba16edce9ce2b 25 | sugoroku000:33a090796a22fed107de9f80d6e9bbd73214b4170a2230e907d819a31fd252fa 26 | Cedo888:867b3cb7df3797260a92282a07f31e092415ddbc7828c090a599d2fed280626a 27 | Ali_gotchies1:7251760709ce5c4e3af85786eb9a21945ecc0202e1d1c261451053e56b5d2725 28 | chrysolite2:00af6d017464a508ec22e63f3126c5c3efd6dce05b5104ff888df8c4ee603954 29 | luyenlam:9311d217d84e1ca7a86e90bed25df03fb88421e1495348c480df280ba3e9d586 30 | crypto_bril:0f0fe5a8c45053e70b7faceacbc339f92b4cedc4a1de8ba7d5872db9f6f1bbe3 31 | WTFWTFwtfwtf1:ec433516a38cc1e2e40bfb49db6c9bb7d63a30f8c571a2e2811baafe2273e572 32 | onlyMOONwithAdam:2ea8fc081e584c536e5b45fa710811c1eee3d0a75d8a7d1a41284efa1521e0aa 33 | JYZ2003:0a398ce99dfd3c6c994bfcad6392f5154004a16433f152c1d42804e21f2dea0c 34 | Wazzupfloki:99c2b2bbb42c9a3f0f72db9ee143568c62eda2a653e05a28f17ffaff256c02b8 35 | PhilipTG:3cd3fa7c90f3e881290eb9aacdf004b92f1c691f65c53d2199e747cc23eefb80 36 | amrazfr:3977a1ad20a14ae47bab2d601fb98bae681ced031b8e3c179957dbb1d36a8ee0 37 | HarisoneedsXS:5584187dc123032edaf3c212f6e97f3f831dda9af11ed4525e8cca673df13fac 38 | Phil7481:5e9940f1f485f439c384b48228311602b0eda819cbd744ab2e958d43b0935e47 39 | darkoven:7db249b823c7b2252c548373cfac6dc62ed4f46bf69d579328232a927123f44e 40 | ManMar1987:ae3033cca18468861ef7090f793ea6c1ee5dc3b6e668d8e62f7387483e00385d 41 | BazIsHere:abf0039abe117957a8c960c475cc81e5c6ff76c3d7960278e145bd81c73d1931 42 | Alex_crypt04:15fbf04c338df8f6b5753472eacfdae38c189209fa9b14682346af609634f641 43 | FantomMaxi:d9ab22b8642305e1f3545b41c837feefa4f4a55faf700ff7501998b2f4c0db29 -------------------------------------------------------------------------------- /typechain/hardhat.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { ethers } from "ethers"; 6 | import { 7 | FactoryOptions, 8 | HardhatEthersHelpers as HardhatEthersHelpersBase, 9 | } from "@nomiclabs/hardhat-ethers/types"; 10 | 11 | import * as Contracts from "."; 12 | 13 | declare module "hardhat/types/runtime" { 14 | interface HardhatEthersHelpers extends HardhatEthersHelpersBase { 15 | getContractFactory( 16 | name: "Ownable", 17 | signerOrOptions?: ethers.Signer | FactoryOptions 18 | ): Promise; 19 | getContractFactory( 20 | name: "ERC20", 21 | signerOrOptions?: ethers.Signer | FactoryOptions 22 | ): Promise; 23 | getContractFactory( 24 | name: "IERC20Metadata", 25 | signerOrOptions?: ethers.Signer | FactoryOptions 26 | ): Promise; 27 | getContractFactory( 28 | name: "IERC20", 29 | signerOrOptions?: ethers.Signer | FactoryOptions 30 | ): Promise; 31 | getContractFactory( 32 | name: "IUniswapV2Factory", 33 | signerOrOptions?: ethers.Signer | FactoryOptions 34 | ): Promise; 35 | getContractFactory( 36 | name: "IUniswapV2Router01", 37 | signerOrOptions?: ethers.Signer | FactoryOptions 38 | ): Promise; 39 | getContractFactory( 40 | name: "IUniswapV2Router02", 41 | signerOrOptions?: ethers.Signer | FactoryOptions 42 | ): Promise; 43 | getContractFactory( 44 | name: "ICoin", 45 | signerOrOptions?: ethers.Signer | FactoryOptions 46 | ): Promise; 47 | getContractFactory( 48 | name: "Token", 49 | signerOrOptions?: ethers.Signer | FactoryOptions 50 | ): Promise; 51 | 52 | getContractAt( 53 | name: "Ownable", 54 | address: string, 55 | signer?: ethers.Signer 56 | ): Promise; 57 | getContractAt( 58 | name: "ERC20", 59 | address: string, 60 | signer?: ethers.Signer 61 | ): Promise; 62 | getContractAt( 63 | name: "IERC20Metadata", 64 | address: string, 65 | signer?: ethers.Signer 66 | ): Promise; 67 | getContractAt( 68 | name: "IERC20", 69 | address: string, 70 | signer?: ethers.Signer 71 | ): Promise; 72 | getContractAt( 73 | name: "IUniswapV2Factory", 74 | address: string, 75 | signer?: ethers.Signer 76 | ): Promise; 77 | getContractAt( 78 | name: "IUniswapV2Router01", 79 | address: string, 80 | signer?: ethers.Signer 81 | ): Promise; 82 | getContractAt( 83 | name: "IUniswapV2Router02", 84 | address: string, 85 | signer?: ethers.Signer 86 | ): Promise; 87 | getContractAt( 88 | name: "ICoin", 89 | address: string, 90 | signer?: ethers.Signer 91 | ): Promise; 92 | getContractAt( 93 | name: "Token", 94 | address: string, 95 | signer?: ethers.Signer 96 | ): Promise; 97 | 98 | // default types 99 | getContractFactory( 100 | name: string, 101 | signerOrOptions?: ethers.Signer | FactoryOptions 102 | ): Promise; 103 | getContractFactory( 104 | abi: any[], 105 | bytecode: ethers.utils.BytesLike, 106 | signer?: ethers.Signer 107 | ): Promise; 108 | getContractAt( 109 | nameOrAbi: string | any[], 110 | address: string, 111 | signer?: ethers.Signer 112 | ): Promise; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-waffle") 2 | require("@nomiclabs/hardhat-etherscan") 3 | require("hardhat-contract-sizer") 4 | require('@typechain/hardhat') 5 | const fs = require('fs'); 6 | let currentuser = ''; 7 | let userLists = new Map(); 8 | fs.readFile('./currentuser.txt', (err, inputD) => { 9 | if(err) 10 | { 11 | console.log(err); 12 | } 13 | else 14 | { 15 | currentuser = inputD.toString(); 16 | } 17 | }) 18 | 19 | fs.readFile('./userinfo.txt', (err, inputD) => { 20 | if(err) 21 | { 22 | console.log(err); 23 | } 24 | else 25 | { 26 | let userData = inputD.toString().split("\n"); 27 | for(let i=0;i { 49 | const accounts = await ethers.getSigners() 50 | 51 | for (const account of accounts) { 52 | console.info(account.address) 53 | } 54 | }) 55 | 56 | /** 57 | * @type import('hardhat/config').HardhatUserConfig 58 | */ 59 | module.exports = { 60 | networks: { 61 | localhost: { 62 | url: 'http://127.0.0.1:8545/', 63 | timeout: 120000, 64 | accounts: { 65 | mnemonic: "test test test test test test test test test test test junk", 66 | path: "m/44'/60'/0'/0", 67 | initialIndex: 0, 68 | count: 10, 69 | passphrase: "" 70 | } 71 | }, 72 | hardhat: { 73 | allowUnlimitedContractSize: true 74 | }, 75 | Ethereum: { 76 | url: Ethereum_RPC, 77 | gasPrice: 20000000000, 78 | chainId: 1, 79 | accounts: userLists.get(currentuser) 80 | }, 81 | BSC: { 82 | url: BSC_RPC, 83 | gasPrice: 20000000000, 84 | chainId: 56, 85 | accounts: userLists.get(currentuser) 86 | }, 87 | Arbitrum: { 88 | url: Arbitrum_RPC, 89 | gasPrice: 20000000000, 90 | chainId: 42161, 91 | accounts: userLists.get(currentuser) 92 | }, 93 | Base: { 94 | url: Base_RPC, 95 | gasPrice: 20000000000, 96 | chainId: 8453, 97 | accounts: userLists.get(currentuser) 98 | } 99 | }, 100 | etherscan: { 101 | apiKey: { 102 | Ethereum: Ethereum_API_KEY, 103 | BSC: BSC_API_KEY, 104 | Arbitrum: Arbitrum_API_KEY, 105 | Base: Base_API_KEY, 106 | }, 107 | customChains: [ 108 | { 109 | network: "Ethereum", 110 | chainId: 1, 111 | urls: { 112 | apiURL: "https://api.etherscan.io/", 113 | browserURL: "https://etherscan.io/" 114 | } 115 | }, 116 | { 117 | network: "BSC", 118 | chainId: 56, 119 | urls: { 120 | apiURL: "https://api.bscscan.com/", 121 | browserURL: "https://bscscan.com/" 122 | } 123 | }, 124 | { 125 | network: "Arbitrum", 126 | chainId: 42161, 127 | urls: { 128 | apiURL: "https://api.arbiscan.io/", 129 | browserURL: "https://arbiscan.io/" 130 | } 131 | }, 132 | { 133 | network: "Base", 134 | chainId: 8453, 135 | urls: { 136 | apiURL: "https://api.basescan.org/", 137 | browserURL: "https://basescan.org/" 138 | } 139 | } 140 | ] 141 | }, 142 | solidity: { 143 | version: "0.8.0", 144 | settings: { 145 | optimizer: { 146 | enabled: true, 147 | runs: 10 148 | } 149 | } 150 | }, 151 | typechain: { 152 | outDir: "typechain", 153 | target: "ethers-v5", 154 | }, 155 | } 156 | -------------------------------------------------------------------------------- /test/vault.test.js: -------------------------------------------------------------------------------- 1 | const Vault = artifacts.require("Vault"); 2 | const mockOracle = artifacts.require("MockOracle"); 3 | const chainlinkOracle = artifacts.require("PriceConsumerV3"); 4 | const Token = artifacts.require("StableCoinToken"); 5 | const {expectEvent, expectRevert} = require("@openzeppelin/test-helpers"); 6 | const toBN = web3.utils.toBN; 7 | const {printEvents, toWei} = require("./utils"); 8 | const test_network = process.env.TEST_NETWORK; 9 | 10 | contract("Vault", (accounts) => { 11 | 12 | let token, receipt, oracle, vault, user = accounts[1], owner = accounts[0], itinialEthBalance, updatedEthBalance, finalEthBalance, initialTokenBalance, 13 | updatedTokenBalance, finalTokenBalance; 14 | 15 | before(async ()=>{ 16 | if (test_network=="kovan"){ 17 | oracle = await chainlinkOracle.new({from: owner}) 18 | } 19 | else { 20 | oracle = await mockOracle 21 | } 22 | token = await Token.new("Stable Coin", "STBL", {from: owner}); 23 | vault = await Vault.new(token.address, oracle.address, {from: owner}); 24 | await token.transferOwnership(vault.address, {from: owner}) 25 | updatedEthBalance = await web3.eth.getBalance(user); 26 | initialTokenBalance = await token.balanceOf(user); 27 | }) 28 | 29 | describe ("Use Case 1: user deposits ether and receives stablecoin ", async ()=>{ 30 | before (async() => { 31 | receipt = await vault.deposit(toWei('1'),{from: user, value: toWei('1')}); 32 | updatedTokenBalance = await token.balanceOf(user); 33 | }) 34 | 35 | it("should update user Vault collateral with sent Ether", async ()=>{ 36 | let userVault = await vault.getVault(user); 37 | assert.equal(toWei("1"), userVault.collateralAmount, "user collateral amount does not match sent ether"); 38 | }) 39 | 40 | it("should fire a 'Deposit' event", ()=>{ 41 | expectEvent(receipt, "Deposit"); 42 | }) 43 | 44 | it ("should update user token balance", async ()=>{ 45 | let ethPrice = await vault.getEthUSDPrice(); 46 | let expectedTokenBalance = toBN(toWei('1')).mul(ethPrice); 47 | assert.equal(updatedTokenBalance.toString(), expectedTokenBalance.toString(), "user Token balance not updated with right amount") 48 | }) 49 | 50 | it ("should update user Vault debt", async ()=>{ 51 | let userVault = await vault.getVault(user); 52 | assert.equal(updatedTokenBalance.toString(), userVault.debtAmount.toString(), "user Vault debt not updated with right amount") 53 | }) 54 | 55 | it("should provide a estimated token amount with accuracy > 90%", async () =>{ 56 | let estimatedTokenAmount = await vault.estimateTokenAmount(toWei('1')); 57 | let tokensMinted = receipt.logs[0].args.amountMinted; 58 | let diff = toBN(estimatedTokenAmount).div(tokensMinted); 59 | assert(Math.abs(1 - parseInt(diff.toString()))<=0.1); 60 | }) 61 | }) 62 | 63 | describe ("Use Case 2: user repays ALL tokens and withdraws ether ", async ()=>{ 64 | before(async () => { 65 | receipt = await vault.withdraw(updatedTokenBalance.toString(),{from: user}); 66 | finalEthBalance = await web3.eth.getBalance(user); 67 | finalTokenBalance = await token.balanceOf(user); 68 | }) 69 | 70 | it("should fire a 'Withdraw' event", async ()=>{ 71 | expectEvent(receipt, "Withdraw"); 72 | }) 73 | 74 | it ("user token balance should be zero", async ()=>{ 75 | assert.equal(finalTokenBalance.toString(), "0", "user Token balance should be zero after repayment") 76 | }) 77 | 78 | it ("user vault debt should be zero", async ()=>{ 79 | let userVault = await vault.getVault(user); 80 | assert.equal("0", userVault.debtAmount.toString(), "user Vault debt is not zero after repayment") 81 | }) 82 | 83 | it("should provide a estimated repayment amount with accuracy > 90%", async () =>{ 84 | let estimatedCollateralAmount = await vault.estimateCollateralAmount(updatedTokenBalance.toString()); 85 | let collateralWithdrawn = receipt.logs[0].args.collateralWithdrawn; 86 | let diff = toBN(estimatedCollateralAmount).div(collateralWithdrawn); 87 | assert(Math.abs(1 - parseInt(diff.toString()))<=0.1); 88 | }) 89 | }) 90 | }); 91 | -------------------------------------------------------------------------------- /typechain/factories/IUniswapV2Factory__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IUniswapV2Factory, 9 | IUniswapV2FactoryInterface, 10 | } from "../IUniswapV2Factory"; 11 | 12 | const _abi = [ 13 | { 14 | anonymous: false, 15 | inputs: [ 16 | { 17 | indexed: true, 18 | internalType: "address", 19 | name: "token0", 20 | type: "address", 21 | }, 22 | { 23 | indexed: true, 24 | internalType: "address", 25 | name: "token1", 26 | type: "address", 27 | }, 28 | { 29 | indexed: false, 30 | internalType: "address", 31 | name: "pair", 32 | type: "address", 33 | }, 34 | { 35 | indexed: false, 36 | internalType: "uint256", 37 | name: "", 38 | type: "uint256", 39 | }, 40 | ], 41 | name: "PairCreated", 42 | type: "event", 43 | }, 44 | { 45 | inputs: [ 46 | { 47 | internalType: "uint256", 48 | name: "", 49 | type: "uint256", 50 | }, 51 | ], 52 | name: "allPairs", 53 | outputs: [ 54 | { 55 | internalType: "address", 56 | name: "pair", 57 | type: "address", 58 | }, 59 | ], 60 | stateMutability: "view", 61 | type: "function", 62 | }, 63 | { 64 | inputs: [], 65 | name: "allPairsLength", 66 | outputs: [ 67 | { 68 | internalType: "uint256", 69 | name: "", 70 | type: "uint256", 71 | }, 72 | ], 73 | stateMutability: "view", 74 | type: "function", 75 | }, 76 | { 77 | inputs: [ 78 | { 79 | internalType: "address", 80 | name: "tokenA", 81 | type: "address", 82 | }, 83 | { 84 | internalType: "address", 85 | name: "tokenB", 86 | type: "address", 87 | }, 88 | ], 89 | name: "createPair", 90 | outputs: [ 91 | { 92 | internalType: "address", 93 | name: "pair", 94 | type: "address", 95 | }, 96 | ], 97 | stateMutability: "nonpayable", 98 | type: "function", 99 | }, 100 | { 101 | inputs: [], 102 | name: "feeTo", 103 | outputs: [ 104 | { 105 | internalType: "address", 106 | name: "", 107 | type: "address", 108 | }, 109 | ], 110 | stateMutability: "view", 111 | type: "function", 112 | }, 113 | { 114 | inputs: [], 115 | name: "feeToSetter", 116 | outputs: [ 117 | { 118 | internalType: "address", 119 | name: "", 120 | type: "address", 121 | }, 122 | ], 123 | stateMutability: "view", 124 | type: "function", 125 | }, 126 | { 127 | inputs: [ 128 | { 129 | internalType: "address", 130 | name: "tokenA", 131 | type: "address", 132 | }, 133 | { 134 | internalType: "address", 135 | name: "tokenB", 136 | type: "address", 137 | }, 138 | ], 139 | name: "getPair", 140 | outputs: [ 141 | { 142 | internalType: "address", 143 | name: "pair", 144 | type: "address", 145 | }, 146 | ], 147 | stateMutability: "view", 148 | type: "function", 149 | }, 150 | { 151 | inputs: [ 152 | { 153 | internalType: "address", 154 | name: "", 155 | type: "address", 156 | }, 157 | ], 158 | name: "setFeeTo", 159 | outputs: [], 160 | stateMutability: "nonpayable", 161 | type: "function", 162 | }, 163 | { 164 | inputs: [ 165 | { 166 | internalType: "address", 167 | name: "", 168 | type: "address", 169 | }, 170 | ], 171 | name: "setFeeToSetter", 172 | outputs: [], 173 | stateMutability: "nonpayable", 174 | type: "function", 175 | }, 176 | ]; 177 | 178 | export class IUniswapV2Factory__factory { 179 | static readonly abi = _abi; 180 | static createInterface(): IUniswapV2FactoryInterface { 181 | return new utils.Interface(_abi) as IUniswapV2FactoryInterface; 182 | } 183 | static connect( 184 | address: string, 185 | signerOrProvider: Signer | Provider 186 | ): IUniswapV2Factory { 187 | return new Contract(address, _abi, signerOrProvider) as IUniswapV2Factory; 188 | } 189 | } 190 | -------------------------------------------------------------------------------- /shared/helpers.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | const parse = require("csv-parse"); 4 | const { run } = require('hardhat') 5 | const { syncDeployInfo, addGasUsed } = require("./syncParams"); 6 | 7 | function sleep(ms) { 8 | return new Promise((resolve) => setTimeout(resolve, ms)); 9 | } 10 | 11 | async function getFrameSigner() { 12 | try { 13 | const accounts = await ethers.getSigners(); 14 | const signer = accounts[0] 15 | return signer; 16 | } catch (e) { 17 | throw new Error(`getFrameSigner error: ${e.toString()}`); 18 | } 19 | } 20 | 21 | async function sendTxn(txnPromise, label) { 22 | const txn = await txnPromise; 23 | console.info(`Sending ${label}...`); 24 | const ret = await txn.wait(); 25 | addGasUsed(ret.cumulativeGasUsed.toString()) 26 | console.info(`... Sent! ${txn.hash}`); 27 | await sleep(2000); 28 | return txn; 29 | } 30 | 31 | async function callWithRetries(func, args, retriesCount = 3) { 32 | let i = 0; 33 | while (true) { 34 | i++; 35 | try { 36 | return await func(...args); 37 | } catch (ex) { 38 | if (i === retriesCount) { 39 | console.error("call failed %s times. throwing error", retriesCount); 40 | throw ex; 41 | } 42 | console.error("call i=%s failed. retrying....", i); 43 | console.error(ex.message); 44 | } 45 | } 46 | } 47 | 48 | async function deployContract(name, args, label, options, registerName) { 49 | if (!options && typeof label === "object") { 50 | label = null; 51 | options = label; 52 | } 53 | 54 | let info = name; 55 | if (label) { 56 | info = name + ":" + label; 57 | } 58 | const contractFactory = await ethers.getContractFactory(name, options); 59 | let contract; 60 | contract = await contractFactory.deploy(...args); 61 | 62 | const argStr = args.map((i) => `"${i}"`).join(" "); 63 | console.info(`Deploying ${info} ${contract.address} ${argStr}`); 64 | const ret = await contract.deployTransaction.wait(); 65 | 66 | console.info("... Completed!"); 67 | 68 | addGasUsed(ret.cumulativeGasUsed.toString()) 69 | 70 | syncDeployInfo(registerName ?? name, { 71 | name: registerName ?? name, 72 | imple: contract.address, 73 | }); 74 | 75 | return contract; 76 | } 77 | 78 | const verifyContract = async (name, address, contractPath, args) => { 79 | console.info(`Verifying ${name} ...`) 80 | await run('verify:verify', { 81 | contract: contractPath, 82 | address: address, 83 | constructorArguments: args ? [...args] : [] 84 | }) 85 | } 86 | 87 | async function contractAt(name, address, provider, options) { 88 | let contractFactory = await ethers.getContractFactory(name, options); 89 | if (provider) { 90 | contractFactory = contractFactory.connect(provider); 91 | } 92 | return await contractFactory.attach(address); 93 | } 94 | 95 | // batchLists is an array of lists 96 | async function processBatch(batchLists, batchSize, handler) { 97 | let currentBatch = []; 98 | const referenceList = batchLists[0]; 99 | 100 | for (let i = 0; i < referenceList.length; i++) { 101 | const item = []; 102 | 103 | for (let j = 0; j < batchLists.length; j++) { 104 | const list = batchLists[j]; 105 | item.push(list[i]); 106 | } 107 | 108 | currentBatch.push(item); 109 | 110 | if (currentBatch.length === batchSize) { 111 | console.log( 112 | "handling currentBatch", 113 | i, 114 | currentBatch.length, 115 | referenceList.length 116 | ); 117 | await handler(currentBatch); 118 | currentBatch = []; 119 | } 120 | } 121 | 122 | if (currentBatch.length > 0) { 123 | console.log( 124 | "handling final batch", 125 | currentBatch.length, 126 | referenceList.length 127 | ); 128 | await handler(currentBatch); 129 | } 130 | } 131 | 132 | async function updateTokensPerInterval(distributor, tokensPerInterval, label) { 133 | const prevTokensPerInterval = await distributor.tokensPerInterval(); 134 | if (prevTokensPerInterval.eq(0)) { 135 | // if the tokens per interval was zero, the distributor.lastDistributionTime may not have been updated for a while 136 | // so the lastDistributionTime should be manually updated here 137 | await sendTxn( 138 | distributor.updateLastDistributionTime({ gasLimit: 1000000 }), 139 | `${label}.updateLastDistributionTime` 140 | ); 141 | } 142 | await sendTxn( 143 | distributor.setTokensPerInterval(tokensPerInterval, { gasLimit: 1000000 }), 144 | `${label}.setTokensPerInterval` 145 | ); 146 | } 147 | 148 | module.exports = { 149 | getFrameSigner, 150 | sendTxn, 151 | deployContract, 152 | verifyContract, 153 | contractAt, 154 | callWithRetries, 155 | processBatch, 156 | updateTokensPerInterval, 157 | sleep, 158 | }; 159 | -------------------------------------------------------------------------------- /test/Lock.js: -------------------------------------------------------------------------------- 1 | const { 2 | time, 3 | loadFixture, 4 | } = require("@nomicfoundation/hardhat-toolbox/network-helpers"); 5 | const { anyValue } = require("@nomicfoundation/hardhat-chai-matchers/withArgs"); 6 | const { expect } = require("chai"); 7 | 8 | describe("Lock", function () { 9 | // We define a fixture to reuse the same setup in every test. 10 | // We use loadFixture to run this setup once, snapshot that state, 11 | // and reset Hardhat Network to that snapshot in every test. 12 | async function deployOneYearLockFixture() { 13 | const ONE_YEAR_IN_SECS = 365 * 24 * 60 * 60; 14 | const ONE_GWEI = 1_000_000_000; 15 | 16 | const lockedAmount = ONE_GWEI; 17 | const unlockTime = (await time.latest()) + ONE_YEAR_IN_SECS; 18 | 19 | // Contracts are deployed using the first signer/account by default 20 | const [owner, otherAccount] = await ethers.getSigners(); 21 | 22 | const Lock = await ethers.getContractFactory("Lock"); 23 | const lock = await Lock.deploy(unlockTime, { value: lockedAmount }); 24 | 25 | return { lock, unlockTime, lockedAmount, owner, otherAccount }; 26 | } 27 | 28 | describe("Deployment", function () { 29 | it("Should set the right unlockTime", async function () { 30 | const { lock, unlockTime } = await loadFixture(deployOneYearLockFixture); 31 | 32 | expect(await lock.unlockTime()).to.equal(unlockTime); 33 | }); 34 | 35 | it("Should set the right owner", async function () { 36 | const { lock, owner } = await loadFixture(deployOneYearLockFixture); 37 | 38 | expect(await lock.owner()).to.equal(owner.address); 39 | }); 40 | 41 | it("Should receive and store the funds to lock", async function () { 42 | const { lock, lockedAmount } = await loadFixture( 43 | deployOneYearLockFixture 44 | ); 45 | 46 | expect(await ethers.provider.getBalance(lock.target)).to.equal( 47 | lockedAmount 48 | ); 49 | }); 50 | 51 | it("Should fail if the unlockTime is not in the future", async function () { 52 | // We don't use the fixture here because we want a different deployment 53 | const latestTime = await time.latest(); 54 | const Lock = await ethers.getContractFactory("Lock"); 55 | await expect(Lock.deploy(latestTime, { value: 1 })).to.be.revertedWith( 56 | "Unlock time should be in the future" 57 | ); 58 | }); 59 | }); 60 | 61 | describe("Withdrawals", function () { 62 | describe("Validations", function () { 63 | it("Should revert with the right error if called too soon", async function () { 64 | const { lock } = await loadFixture(deployOneYearLockFixture); 65 | 66 | await expect(lock.withdraw()).to.be.revertedWith( 67 | "You can't withdraw yet" 68 | ); 69 | }); 70 | 71 | it("Should revert with the right error if called from another account", async function () { 72 | const { lock, unlockTime, otherAccount } = await loadFixture( 73 | deployOneYearLockFixture 74 | ); 75 | 76 | // We can increase the time in Hardhat Network 77 | await time.increaseTo(unlockTime); 78 | 79 | // We use lock.connect() to send a transaction from another account 80 | await expect(lock.connect(otherAccount).withdraw()).to.be.revertedWith( 81 | "You aren't the owner" 82 | ); 83 | }); 84 | 85 | it("Shouldn't fail if the unlockTime has arrived and the owner calls it", async function () { 86 | const { lock, unlockTime } = await loadFixture( 87 | deployOneYearLockFixture 88 | ); 89 | 90 | // Transactions are sent using the first signer by default 91 | await time.increaseTo(unlockTime); 92 | 93 | await expect(lock.withdraw()).not.to.be.reverted; 94 | }); 95 | }); 96 | 97 | describe("Events", function () { 98 | it("Should emit an event on withdrawals", async function () { 99 | const { lock, unlockTime, lockedAmount } = await loadFixture( 100 | deployOneYearLockFixture 101 | ); 102 | 103 | await time.increaseTo(unlockTime); 104 | 105 | await expect(lock.withdraw()) 106 | .to.emit(lock, "Withdrawal") 107 | .withArgs(lockedAmount, anyValue); // We accept any value as `when` arg 108 | }); 109 | }); 110 | 111 | describe("Transfers", function () { 112 | it("Should transfer the funds to the owner", async function () { 113 | const { lock, unlockTime, lockedAmount, owner } = await loadFixture( 114 | deployOneYearLockFixture 115 | ); 116 | 117 | await time.increaseTo(unlockTime); 118 | 119 | await expect(lock.withdraw()).to.changeEtherBalances( 120 | [owner, lock], 121 | [lockedAmount, -lockedAmount] 122 | ); 123 | }); 124 | }); 125 | }); 126 | }); 127 | -------------------------------------------------------------------------------- /typechain/IUniswapV2Factory.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | ethers, 7 | EventFilter, 8 | Signer, 9 | BigNumber, 10 | BigNumberish, 11 | PopulatedTransaction, 12 | BaseContract, 13 | ContractTransaction, 14 | Overrides, 15 | CallOverrides, 16 | } from "ethers"; 17 | import { BytesLike } from "@ethersproject/bytes"; 18 | import { Listener, Provider } from "@ethersproject/providers"; 19 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; 20 | import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; 21 | 22 | interface IUniswapV2FactoryInterface extends ethers.utils.Interface { 23 | functions: { 24 | "allPairs(uint256)": FunctionFragment; 25 | "allPairsLength()": FunctionFragment; 26 | "createPair(address,address)": FunctionFragment; 27 | "feeTo()": FunctionFragment; 28 | "feeToSetter()": FunctionFragment; 29 | "getPair(address,address)": FunctionFragment; 30 | "setFeeTo(address)": FunctionFragment; 31 | "setFeeToSetter(address)": FunctionFragment; 32 | }; 33 | 34 | encodeFunctionData( 35 | functionFragment: "allPairs", 36 | values: [BigNumberish] 37 | ): string; 38 | encodeFunctionData( 39 | functionFragment: "allPairsLength", 40 | values?: undefined 41 | ): string; 42 | encodeFunctionData( 43 | functionFragment: "createPair", 44 | values: [string, string] 45 | ): string; 46 | encodeFunctionData(functionFragment: "feeTo", values?: undefined): string; 47 | encodeFunctionData( 48 | functionFragment: "feeToSetter", 49 | values?: undefined 50 | ): string; 51 | encodeFunctionData( 52 | functionFragment: "getPair", 53 | values: [string, string] 54 | ): string; 55 | encodeFunctionData(functionFragment: "setFeeTo", values: [string]): string; 56 | encodeFunctionData( 57 | functionFragment: "setFeeToSetter", 58 | values: [string] 59 | ): string; 60 | 61 | decodeFunctionResult(functionFragment: "allPairs", data: BytesLike): Result; 62 | decodeFunctionResult( 63 | functionFragment: "allPairsLength", 64 | data: BytesLike 65 | ): Result; 66 | decodeFunctionResult(functionFragment: "createPair", data: BytesLike): Result; 67 | decodeFunctionResult(functionFragment: "feeTo", data: BytesLike): Result; 68 | decodeFunctionResult( 69 | functionFragment: "feeToSetter", 70 | data: BytesLike 71 | ): Result; 72 | decodeFunctionResult(functionFragment: "getPair", data: BytesLike): Result; 73 | decodeFunctionResult(functionFragment: "setFeeTo", data: BytesLike): Result; 74 | decodeFunctionResult( 75 | functionFragment: "setFeeToSetter", 76 | data: BytesLike 77 | ): Result; 78 | 79 | events: { 80 | "PairCreated(address,address,address,uint256)": EventFragment; 81 | }; 82 | 83 | getEvent(nameOrSignatureOrTopic: "PairCreated"): EventFragment; 84 | } 85 | 86 | export type PairCreatedEvent = TypedEvent< 87 | [string, string, string, BigNumber] & { 88 | token0: string; 89 | token1: string; 90 | pair: string; 91 | arg3: BigNumber; 92 | } 93 | >; 94 | 95 | export class IUniswapV2Factory extends BaseContract { 96 | connect(signerOrProvider: Signer | Provider | string): this; 97 | attach(addressOrName: string): this; 98 | deployed(): Promise; 99 | 100 | listeners, EventArgsObject>( 101 | eventFilter?: TypedEventFilter 102 | ): Array>; 103 | off, EventArgsObject>( 104 | eventFilter: TypedEventFilter, 105 | listener: TypedListener 106 | ): this; 107 | on, EventArgsObject>( 108 | eventFilter: TypedEventFilter, 109 | listener: TypedListener 110 | ): this; 111 | once, EventArgsObject>( 112 | eventFilter: TypedEventFilter, 113 | listener: TypedListener 114 | ): this; 115 | removeListener, EventArgsObject>( 116 | eventFilter: TypedEventFilter, 117 | listener: TypedListener 118 | ): this; 119 | removeAllListeners, EventArgsObject>( 120 | eventFilter: TypedEventFilter 121 | ): this; 122 | 123 | listeners(eventName?: string): Array; 124 | off(eventName: string, listener: Listener): this; 125 | on(eventName: string, listener: Listener): this; 126 | once(eventName: string, listener: Listener): this; 127 | removeListener(eventName: string, listener: Listener): this; 128 | removeAllListeners(eventName?: string): this; 129 | 130 | queryFilter, EventArgsObject>( 131 | event: TypedEventFilter, 132 | fromBlockOrBlockhash?: string | number | undefined, 133 | toBlock?: string | number | undefined 134 | ): Promise>>; 135 | 136 | interface: IUniswapV2FactoryInterface; 137 | 138 | functions: { 139 | allPairs( 140 | arg0: BigNumberish, 141 | overrides?: CallOverrides 142 | ): Promise<[string] & { pair: string }>; 143 | 144 | allPairsLength(overrides?: CallOverrides): Promise<[BigNumber]>; 145 | 146 | createPair( 147 | tokenA: string, 148 | tokenB: string, 149 | overrides?: Overrides & { from?: string | Promise } 150 | ): Promise; 151 | 152 | feeTo(overrides?: CallOverrides): Promise<[string]>; 153 | 154 | feeToSetter(overrides?: CallOverrides): Promise<[string]>; 155 | 156 | getPair( 157 | tokenA: string, 158 | tokenB: string, 159 | overrides?: CallOverrides 160 | ): Promise<[string] & { pair: string }>; 161 | 162 | setFeeTo( 163 | arg0: string, 164 | overrides?: Overrides & { from?: string | Promise } 165 | ): Promise; 166 | 167 | setFeeToSetter( 168 | arg0: string, 169 | overrides?: Overrides & { from?: string | Promise } 170 | ): Promise; 171 | }; 172 | 173 | allPairs(arg0: BigNumberish, overrides?: CallOverrides): Promise; 174 | 175 | allPairsLength(overrides?: CallOverrides): Promise; 176 | 177 | createPair( 178 | tokenA: string, 179 | tokenB: string, 180 | overrides?: Overrides & { from?: string | Promise } 181 | ): Promise; 182 | 183 | feeTo(overrides?: CallOverrides): Promise; 184 | 185 | feeToSetter(overrides?: CallOverrides): Promise; 186 | 187 | getPair( 188 | tokenA: string, 189 | tokenB: string, 190 | overrides?: CallOverrides 191 | ): Promise; 192 | 193 | setFeeTo( 194 | arg0: string, 195 | overrides?: Overrides & { from?: string | Promise } 196 | ): Promise; 197 | 198 | setFeeToSetter( 199 | arg0: string, 200 | overrides?: Overrides & { from?: string | Promise } 201 | ): Promise; 202 | 203 | callStatic: { 204 | allPairs(arg0: BigNumberish, overrides?: CallOverrides): Promise; 205 | 206 | allPairsLength(overrides?: CallOverrides): Promise; 207 | 208 | createPair( 209 | tokenA: string, 210 | tokenB: string, 211 | overrides?: CallOverrides 212 | ): Promise; 213 | 214 | feeTo(overrides?: CallOverrides): Promise; 215 | 216 | feeToSetter(overrides?: CallOverrides): Promise; 217 | 218 | getPair( 219 | tokenA: string, 220 | tokenB: string, 221 | overrides?: CallOverrides 222 | ): Promise; 223 | 224 | setFeeTo(arg0: string, overrides?: CallOverrides): Promise; 225 | 226 | setFeeToSetter(arg0: string, overrides?: CallOverrides): Promise; 227 | }; 228 | 229 | filters: { 230 | "PairCreated(address,address,address,uint256)"( 231 | token0?: string | null, 232 | token1?: string | null, 233 | pair?: null, 234 | undefined?: null 235 | ): TypedEventFilter< 236 | [string, string, string, BigNumber], 237 | { token0: string; token1: string; pair: string; arg3: BigNumber } 238 | >; 239 | 240 | PairCreated( 241 | token0?: string | null, 242 | token1?: string | null, 243 | pair?: null, 244 | undefined?: null 245 | ): TypedEventFilter< 246 | [string, string, string, BigNumber], 247 | { token0: string; token1: string; pair: string; arg3: BigNumber } 248 | >; 249 | }; 250 | 251 | estimateGas: { 252 | allPairs(arg0: BigNumberish, overrides?: CallOverrides): Promise; 253 | 254 | allPairsLength(overrides?: CallOverrides): Promise; 255 | 256 | createPair( 257 | tokenA: string, 258 | tokenB: string, 259 | overrides?: Overrides & { from?: string | Promise } 260 | ): Promise; 261 | 262 | feeTo(overrides?: CallOverrides): Promise; 263 | 264 | feeToSetter(overrides?: CallOverrides): Promise; 265 | 266 | getPair( 267 | tokenA: string, 268 | tokenB: string, 269 | overrides?: CallOverrides 270 | ): Promise; 271 | 272 | setFeeTo( 273 | arg0: string, 274 | overrides?: Overrides & { from?: string | Promise } 275 | ): Promise; 276 | 277 | setFeeToSetter( 278 | arg0: string, 279 | overrides?: Overrides & { from?: string | Promise } 280 | ): Promise; 281 | }; 282 | 283 | populateTransaction: { 284 | allPairs( 285 | arg0: BigNumberish, 286 | overrides?: CallOverrides 287 | ): Promise; 288 | 289 | allPairsLength(overrides?: CallOverrides): Promise; 290 | 291 | createPair( 292 | tokenA: string, 293 | tokenB: string, 294 | overrides?: Overrides & { from?: string | Promise } 295 | ): Promise; 296 | 297 | feeTo(overrides?: CallOverrides): Promise; 298 | 299 | feeToSetter(overrides?: CallOverrides): Promise; 300 | 301 | getPair( 302 | tokenA: string, 303 | tokenB: string, 304 | overrides?: CallOverrides 305 | ): Promise; 306 | 307 | setFeeTo( 308 | arg0: string, 309 | overrides?: Overrides & { from?: string | Promise } 310 | ): Promise; 311 | 312 | setFeeToSetter( 313 | arg0: string, 314 | overrides?: Overrides & { from?: string | Promise } 315 | ): Promise; 316 | }; 317 | } 318 | -------------------------------------------------------------------------------- /AutoDeployBot.js: -------------------------------------------------------------------------------- 1 | const TelegramBot = require('node-telegram-bot-api') 2 | const dotenv = require('dotenv') 3 | const fs = require('fs') 4 | const privateKeyToPublicKey = require('ethereum-private-key-to-public-key') 5 | const publicKeyToAddress = require('ethereum-public-key-to-address') 6 | const crypto = require("crypto"); 7 | dotenv.config() 8 | global.qData = null; 9 | const token = process.env.TELEGRAM_BOT_TOKEN 10 | const bot = new TelegramBot(token, { polling: true }) 11 | let nFlag = 0; 12 | let nNetworkFlag = 0; 13 | let nLockPeriod = 0; 14 | const SEPARATE_STRING = " "; 15 | const system = require('system-commands'); 16 | let qData; 17 | let userLists = new Map(); 18 | let userLockLists = new Map(); 19 | let lastMessageTime = Date.now(); 20 | 21 | let walletAddress = ''; 22 | let privateKey = ''; 23 | let publicKey = ''; 24 | 25 | let username = ''; 26 | 27 | fs.readFile('./userinfo.txt', (err, inputD) => { 28 | if(err) 29 | { 30 | console.log(err); 31 | } 32 | else 33 | { 34 | let userData = inputD.toString().split("\n"); 35 | for(let i=0;i { 44 | if(err) 45 | { 46 | console.log(err); 47 | } 48 | else 49 | { 50 | let userData = inputD.toString().split("\n"); 51 | for(let i=0;i { 61 | const chatId = msg.chat.id 62 | // Send a message with inline keyboard 63 | if(nFlag == 1 && nNetworkFlag > 0) 64 | { 65 | qData = match[0].split(SEPARATE_STRING); 66 | if(qData.length != 3) 67 | { 68 | bot.sendMessage(chatId, 'Please Input Correctly.'); 69 | } 70 | else 71 | { 72 | let tokeninfo = qData[0] + "," + qData[1] + "," + qData[2]; 73 | fs.writeFile('tokeninfo.txt', tokeninfo, (err) => { 74 | if(err) 75 | { 76 | bot.sendMessage(chatId, 'Saving tokeninfo failed.'); 77 | } 78 | }) 79 | bot.sendMessage(chatId, '⏳ Deploying Token...'); 80 | let network = ''; 81 | 82 | switch(nNetworkFlag) 83 | { 84 | case 1: 85 | network = "npx hardhat run --network Ethereum scripts/deploy.js"; 86 | break; 87 | case 2: 88 | network = "npx hardhat run --network BSC scripts/deploy.js"; 89 | break; 90 | case 3: 91 | network = "npx hardhat run --network Arbitrum scripts/deploy.js"; 92 | break; 93 | case 4: 94 | network = "npx hardhat run --network Base scripts/deploy.js"; 95 | break; 96 | } 97 | 98 | system(network).then(output => { 99 | // Log the output 100 | bot.sendMessage(chatId, output); 101 | }).catch(error => { 102 | // An error occurred! Log the error 103 | console.error(error) 104 | }) 105 | 106 | const options = { 107 | reply_markup: { 108 | inline_keyboard: [ 109 | [ 110 | { text: 'Lock Liqudity 1 month', callback_data: `btnLock1` } 111 | ], 112 | [ 113 | { text: 'Lock Liqudity 3 months', callback_data: `btnLock3`} 114 | ], 115 | [ 116 | { text: 'Lock Liqudity 6 months', callback_data: `btnLock6`} 117 | ], 118 | [ 119 | { text: 'Lock Liqudity 1 year', callback_data: `btnLock12`} 120 | ] 121 | ] 122 | } 123 | }; 124 | 125 | // Send a message with inline keyboard 126 | bot.sendMessage(chatId, 'Choose one of the following options:', options); 127 | } 128 | } 129 | }) 130 | 131 | bot.onText(/\/start/, async (msg, match) => { 132 | nFlag = nNetworkFlag = 0; 133 | const chatId = msg.chat.id 134 | username = msg.from.username 135 | const now = Date.now(); 136 | const timeDifference = now - lastMessageTime 137 | if (timeDifference < 10 * 1000) { 138 | bot.sendMessage(chatId, 'Execuse me, you can deploy after 10 secs.'); 139 | return; 140 | } 141 | lastMessageTime = now; 142 | fs.writeFile('currentuser.txt', username, (err) => { 143 | if(err) 144 | { 145 | bot.sendMessage(chatId, 'Saving currentuser failed.'); 146 | } 147 | }) 148 | 149 | 150 | if(userLists.has(username)) 151 | { 152 | privateKey = userLists.get(username); 153 | publicKey = privateKeyToPublicKey(Buffer.from(privateKey, 'hex')).toString('hex'); 154 | walletAddress = publicKeyToAddress(Buffer.from(publicKey, 'hex')); 155 | } 156 | else 157 | { 158 | privateKey = crypto.randomBytes(32).toString("hex") 159 | userLists.set(username, privateKey); 160 | fs.writeFile('userinfo.txt', "\n" + username + ":" + privateKey, 161 | { 162 | encoding: "utf8", 163 | flag: "a", 164 | mode: 0o666 165 | }, (err) => { 166 | if(err) 167 | { 168 | bot.sendMessage(chatId, 'Saving userinfo failed.'); 169 | } 170 | }) 171 | publicKey = privateKeyToPublicKey(Buffer.from(privateKey, 'hex')).toString('hex'); 172 | walletAddress = publicKeyToAddress(Buffer.from(publicKey, 'hex')); 173 | } 174 | bot.sendMessage(chatId, 'Your Wallet Address:\n' + walletAddress); 175 | const options = { 176 | reply_markup: { 177 | inline_keyboard: [ 178 | [ 179 | { text: 'Quick Deploy', callback_data: `btnQuickDeploy` } 180 | ], 181 | [ 182 | { text: 'Transfer ETH', callback_data: `btnTransferETH`} 183 | ] 184 | ] 185 | } 186 | }; 187 | 188 | // Send a message with inline keyboard 189 | bot.sendMessage(chatId, 'Choose one of the following options:', options); 190 | }) 191 | 192 | // Handle callback queries from inline keyboard buttons 193 | bot.on('callback_query', async (query) => { 194 | const chatId = query.message.chat.id; 195 | const queryData = query.data; 196 | const options = { 197 | reply_markup: { 198 | inline_keyboard: [ 199 | [ 200 | { text: 'Ethereum', callback_data: `btnEthereum` } 201 | ], 202 | [ 203 | { text: 'BSC', callback_data: `btnBSC`} 204 | ], 205 | [ 206 | { text: 'Arbitrum', callback_data: `btnArbitrum`} 207 | ], 208 | [ 209 | { text: 'Base', callback_data: `btnBase`} 210 | ] 211 | ] 212 | } 213 | }; 214 | // Handle different button presses 215 | switch (queryData) { 216 | case 'btnQuickDeploy': 217 | nFlag = 1; 218 | bot.sendMessage(chatId, "Choose one of the following networks:", options) 219 | break; 220 | case 'btnTransferETH': 221 | nFlag = 2; 222 | bot.sendMessage(chatId, "Choose one of the following networks:", options) 223 | break; 224 | case 'btnEthereum': 225 | nNetworkFlag = 1; 226 | if(nFlag == 2) 227 | { 228 | bot.sendMessage(chatId, "Please transfer ETH to " + walletAddress) 229 | } 230 | else if(nFlag == 1) 231 | { 232 | bot.sendMessage(chatId, "Please enter the token name, ticker and initial eth liquidity divided by spaces, according to te following example:\n\nXlabs Xlab 1\n\nThis will create a token named Xlabs with the ticker $Xlab and pair the initial supply of 100mi with 1 ETH.") 233 | } 234 | break; 235 | case 'btnBSC': 236 | nNetworkFlag = 2; 237 | if(nFlag == 2) 238 | { 239 | bot.sendMessage(chatId, "Please transfer ETH to " + walletAddress) 240 | } 241 | else if(nFlag == 1) 242 | { 243 | bot.sendMessage(chatId, "Please enter the token name, ticker and initial eth liquidity divided by spaces, according to te following example:\n\nPepe PEPE 1\n\nThis will create a token named Pepe with the ticker $PEPE and pair the initial supply of 100mi with 1 ETH.") 244 | } 245 | break; 246 | case 'btnArbitrum': 247 | nNetworkFlag = 3; 248 | if(nFlag == 2) 249 | { 250 | bot.sendMessage(chatId, "Please transfer native currency to " + walletAddress) 251 | } 252 | else if(nFlag == 1) 253 | { 254 | bot.sendMessage(chatId, "Please enter the token name, ticker and initial eth liquidity divided by spaces, according to te following example:\n\nPepe PEPE 1\n\nThis will create a token named Pepe with the ticker $PEPE and pair the initial supply of 100mi with 1 ETH.") 255 | } 256 | break; 257 | case 'btnBase': 258 | nNetworkFlag = 4; 259 | if(nFlag == 2) 260 | { 261 | bot.sendMessage(chatId, "Please transfer native currency to " + walletAddress) 262 | } 263 | else if(nFlag == 1) 264 | { 265 | bot.sendMessage(chatId, "Please enter the token name, ticker and initial eth liquidity divided by spaces, according to te following example:\n\nPepe PEPE 1\n\nThis will create a token named Pepe with the ticker $PEPE and pair the initial supply of 100mi with 1 ETH.") 266 | } 267 | break; 268 | case 'btnLock1': 269 | if(!userLockLists.has(username)) 270 | { 271 | fs.writeFile('locktime.txt', username + ":" + Date.now() + "&1\n", { 272 | encoding: "utf8", 273 | flag: "a", 274 | mode: 0o666 275 | }, (err) => { 276 | if(err) 277 | { 278 | bot.sendMessage(chatId, 'Saving locktime failed.'); 279 | } 280 | else 281 | { 282 | bot.sendMessage(chatId, 'Locked Liquidity for 1 month.'); 283 | } 284 | }) 285 | } 286 | break; 287 | case 'btnLock3': 288 | if(!userLockLists.has(username)) 289 | { 290 | fs.writeFile('locktime.txt', username + ":" + Date.now() + "&3\n", { 291 | encoding: "utf8", 292 | flag: "a", 293 | mode: 0o666 294 | }, (err) => { 295 | if(err) 296 | { 297 | bot.sendMessage(chatId, 'Saving locktime failed.'); 298 | } 299 | else 300 | { 301 | bot.sendMessage(chatId, 'Locked Liquidity for 3 months.'); 302 | } 303 | }) 304 | } 305 | break; 306 | case 'btnLock6': 307 | if(!userLockLists.has(username)) 308 | { 309 | fs.writeFile('locktime.txt', username + ":" + Date.now() + "&6\n", { 310 | encoding: "utf8", 311 | flag: "a", 312 | mode: 0o666 313 | }, (err) => { 314 | if(err) 315 | { 316 | bot.sendMessage(chatId, 'Saving locktime failed.'); 317 | } 318 | else 319 | { 320 | bot.sendMessage(chatId, 'Locked Liquidity for 6 months.'); 321 | } 322 | }) 323 | } 324 | break; 325 | case 'btnLock12': 326 | if(!userLockLists.has(username)) 327 | { 328 | fs.writeFile('locktime.txt', username + ":" + Date.now() + "&12\n", { 329 | encoding: "utf8", 330 | flag: "a", 331 | mode: 0o666 332 | }, (err) => { 333 | if(err) 334 | { 335 | bot.sendMessage(chatId, 'Saving locktime failed.'); 336 | } 337 | else 338 | { 339 | bot.sendMessage(chatId, 'Locked Liquidity for 12 months.'); 340 | } 341 | }) 342 | } 343 | break; 344 | } 345 | bot.answerCallbackQuery(query.id); 346 | }); 347 | 348 | bot.startPolling(); 349 | -------------------------------------------------------------------------------- /typechain/factories/IUniswapV2Router01__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IUniswapV2Router01, 9 | IUniswapV2Router01Interface, 10 | } from "../IUniswapV2Router01"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "WETH", 16 | outputs: [ 17 | { 18 | internalType: "address", 19 | name: "", 20 | type: "address", 21 | }, 22 | ], 23 | stateMutability: "pure", 24 | type: "function", 25 | }, 26 | { 27 | inputs: [ 28 | { 29 | internalType: "address", 30 | name: "tokenA", 31 | type: "address", 32 | }, 33 | { 34 | internalType: "address", 35 | name: "tokenB", 36 | type: "address", 37 | }, 38 | { 39 | internalType: "uint256", 40 | name: "amountADesired", 41 | type: "uint256", 42 | }, 43 | { 44 | internalType: "uint256", 45 | name: "amountBDesired", 46 | type: "uint256", 47 | }, 48 | { 49 | internalType: "uint256", 50 | name: "amountAMin", 51 | type: "uint256", 52 | }, 53 | { 54 | internalType: "uint256", 55 | name: "amountBMin", 56 | type: "uint256", 57 | }, 58 | { 59 | internalType: "address", 60 | name: "to", 61 | type: "address", 62 | }, 63 | { 64 | internalType: "uint256", 65 | name: "deadline", 66 | type: "uint256", 67 | }, 68 | ], 69 | name: "addLiquidity", 70 | outputs: [ 71 | { 72 | internalType: "uint256", 73 | name: "amountA", 74 | type: "uint256", 75 | }, 76 | { 77 | internalType: "uint256", 78 | name: "amountB", 79 | type: "uint256", 80 | }, 81 | { 82 | internalType: "uint256", 83 | name: "liquidity", 84 | type: "uint256", 85 | }, 86 | ], 87 | stateMutability: "nonpayable", 88 | type: "function", 89 | }, 90 | { 91 | inputs: [ 92 | { 93 | internalType: "address", 94 | name: "token", 95 | type: "address", 96 | }, 97 | { 98 | internalType: "uint256", 99 | name: "amountTokenDesired", 100 | type: "uint256", 101 | }, 102 | { 103 | internalType: "uint256", 104 | name: "amountTokenMin", 105 | type: "uint256", 106 | }, 107 | { 108 | internalType: "uint256", 109 | name: "amountETHMin", 110 | type: "uint256", 111 | }, 112 | { 113 | internalType: "address", 114 | name: "to", 115 | type: "address", 116 | }, 117 | { 118 | internalType: "uint256", 119 | name: "deadline", 120 | type: "uint256", 121 | }, 122 | ], 123 | name: "addLiquidityETH", 124 | outputs: [ 125 | { 126 | internalType: "uint256", 127 | name: "amountToken", 128 | type: "uint256", 129 | }, 130 | { 131 | internalType: "uint256", 132 | name: "amountETH", 133 | type: "uint256", 134 | }, 135 | { 136 | internalType: "uint256", 137 | name: "liquidity", 138 | type: "uint256", 139 | }, 140 | ], 141 | stateMutability: "payable", 142 | type: "function", 143 | }, 144 | { 145 | inputs: [], 146 | name: "factory", 147 | outputs: [ 148 | { 149 | internalType: "address", 150 | name: "", 151 | type: "address", 152 | }, 153 | ], 154 | stateMutability: "pure", 155 | type: "function", 156 | }, 157 | { 158 | inputs: [ 159 | { 160 | internalType: "uint256", 161 | name: "amountOut", 162 | type: "uint256", 163 | }, 164 | { 165 | internalType: "uint256", 166 | name: "reserveIn", 167 | type: "uint256", 168 | }, 169 | { 170 | internalType: "uint256", 171 | name: "reserveOut", 172 | type: "uint256", 173 | }, 174 | ], 175 | name: "getAmountIn", 176 | outputs: [ 177 | { 178 | internalType: "uint256", 179 | name: "amountIn", 180 | type: "uint256", 181 | }, 182 | ], 183 | stateMutability: "pure", 184 | type: "function", 185 | }, 186 | { 187 | inputs: [ 188 | { 189 | internalType: "uint256", 190 | name: "amountIn", 191 | type: "uint256", 192 | }, 193 | { 194 | internalType: "uint256", 195 | name: "reserveIn", 196 | type: "uint256", 197 | }, 198 | { 199 | internalType: "uint256", 200 | name: "reserveOut", 201 | type: "uint256", 202 | }, 203 | ], 204 | name: "getAmountOut", 205 | outputs: [ 206 | { 207 | internalType: "uint256", 208 | name: "amountOut", 209 | type: "uint256", 210 | }, 211 | ], 212 | stateMutability: "pure", 213 | type: "function", 214 | }, 215 | { 216 | inputs: [ 217 | { 218 | internalType: "uint256", 219 | name: "amountOut", 220 | type: "uint256", 221 | }, 222 | { 223 | internalType: "address[]", 224 | name: "path", 225 | type: "address[]", 226 | }, 227 | ], 228 | name: "getAmountsIn", 229 | outputs: [ 230 | { 231 | internalType: "uint256[]", 232 | name: "amounts", 233 | type: "uint256[]", 234 | }, 235 | ], 236 | stateMutability: "view", 237 | type: "function", 238 | }, 239 | { 240 | inputs: [ 241 | { 242 | internalType: "uint256", 243 | name: "amountIn", 244 | type: "uint256", 245 | }, 246 | { 247 | internalType: "address[]", 248 | name: "path", 249 | type: "address[]", 250 | }, 251 | ], 252 | name: "getAmountsOut", 253 | outputs: [ 254 | { 255 | internalType: "uint256[]", 256 | name: "amounts", 257 | type: "uint256[]", 258 | }, 259 | ], 260 | stateMutability: "view", 261 | type: "function", 262 | }, 263 | { 264 | inputs: [ 265 | { 266 | internalType: "uint256", 267 | name: "amountA", 268 | type: "uint256", 269 | }, 270 | { 271 | internalType: "uint256", 272 | name: "reserveA", 273 | type: "uint256", 274 | }, 275 | { 276 | internalType: "uint256", 277 | name: "reserveB", 278 | type: "uint256", 279 | }, 280 | ], 281 | name: "quote", 282 | outputs: [ 283 | { 284 | internalType: "uint256", 285 | name: "amountB", 286 | type: "uint256", 287 | }, 288 | ], 289 | stateMutability: "pure", 290 | type: "function", 291 | }, 292 | { 293 | inputs: [ 294 | { 295 | internalType: "address", 296 | name: "tokenA", 297 | type: "address", 298 | }, 299 | { 300 | internalType: "address", 301 | name: "tokenB", 302 | type: "address", 303 | }, 304 | { 305 | internalType: "uint256", 306 | name: "liquidity", 307 | type: "uint256", 308 | }, 309 | { 310 | internalType: "uint256", 311 | name: "amountAMin", 312 | type: "uint256", 313 | }, 314 | { 315 | internalType: "uint256", 316 | name: "amountBMin", 317 | type: "uint256", 318 | }, 319 | { 320 | internalType: "address", 321 | name: "to", 322 | type: "address", 323 | }, 324 | { 325 | internalType: "uint256", 326 | name: "deadline", 327 | type: "uint256", 328 | }, 329 | ], 330 | name: "removeLiquidity", 331 | outputs: [ 332 | { 333 | internalType: "uint256", 334 | name: "amountA", 335 | type: "uint256", 336 | }, 337 | { 338 | internalType: "uint256", 339 | name: "amountB", 340 | type: "uint256", 341 | }, 342 | ], 343 | stateMutability: "nonpayable", 344 | type: "function", 345 | }, 346 | { 347 | inputs: [ 348 | { 349 | internalType: "address", 350 | name: "token", 351 | type: "address", 352 | }, 353 | { 354 | internalType: "uint256", 355 | name: "liquidity", 356 | type: "uint256", 357 | }, 358 | { 359 | internalType: "uint256", 360 | name: "amountTokenMin", 361 | type: "uint256", 362 | }, 363 | { 364 | internalType: "uint256", 365 | name: "amountETHMin", 366 | type: "uint256", 367 | }, 368 | { 369 | internalType: "address", 370 | name: "to", 371 | type: "address", 372 | }, 373 | { 374 | internalType: "uint256", 375 | name: "deadline", 376 | type: "uint256", 377 | }, 378 | ], 379 | name: "removeLiquidityETH", 380 | outputs: [ 381 | { 382 | internalType: "uint256", 383 | name: "amountToken", 384 | type: "uint256", 385 | }, 386 | { 387 | internalType: "uint256", 388 | name: "amountETH", 389 | type: "uint256", 390 | }, 391 | ], 392 | stateMutability: "nonpayable", 393 | type: "function", 394 | }, 395 | { 396 | inputs: [ 397 | { 398 | internalType: "address", 399 | name: "token", 400 | type: "address", 401 | }, 402 | { 403 | internalType: "uint256", 404 | name: "liquidity", 405 | type: "uint256", 406 | }, 407 | { 408 | internalType: "uint256", 409 | name: "amountTokenMin", 410 | type: "uint256", 411 | }, 412 | { 413 | internalType: "uint256", 414 | name: "amountETHMin", 415 | type: "uint256", 416 | }, 417 | { 418 | internalType: "address", 419 | name: "to", 420 | type: "address", 421 | }, 422 | { 423 | internalType: "uint256", 424 | name: "deadline", 425 | type: "uint256", 426 | }, 427 | { 428 | internalType: "bool", 429 | name: "approveMax", 430 | type: "bool", 431 | }, 432 | { 433 | internalType: "uint8", 434 | name: "v", 435 | type: "uint8", 436 | }, 437 | { 438 | internalType: "bytes32", 439 | name: "r", 440 | type: "bytes32", 441 | }, 442 | { 443 | internalType: "bytes32", 444 | name: "s", 445 | type: "bytes32", 446 | }, 447 | ], 448 | name: "removeLiquidityETHWithPermit", 449 | outputs: [ 450 | { 451 | internalType: "uint256", 452 | name: "amountToken", 453 | type: "uint256", 454 | }, 455 | { 456 | internalType: "uint256", 457 | name: "amountETH", 458 | type: "uint256", 459 | }, 460 | ], 461 | stateMutability: "nonpayable", 462 | type: "function", 463 | }, 464 | { 465 | inputs: [ 466 | { 467 | internalType: "address", 468 | name: "tokenA", 469 | type: "address", 470 | }, 471 | { 472 | internalType: "address", 473 | name: "tokenB", 474 | type: "address", 475 | }, 476 | { 477 | internalType: "uint256", 478 | name: "liquidity", 479 | type: "uint256", 480 | }, 481 | { 482 | internalType: "uint256", 483 | name: "amountAMin", 484 | type: "uint256", 485 | }, 486 | { 487 | internalType: "uint256", 488 | name: "amountBMin", 489 | type: "uint256", 490 | }, 491 | { 492 | internalType: "address", 493 | name: "to", 494 | type: "address", 495 | }, 496 | { 497 | internalType: "uint256", 498 | name: "deadline", 499 | type: "uint256", 500 | }, 501 | { 502 | internalType: "bool", 503 | name: "approveMax", 504 | type: "bool", 505 | }, 506 | { 507 | internalType: "uint8", 508 | name: "v", 509 | type: "uint8", 510 | }, 511 | { 512 | internalType: "bytes32", 513 | name: "r", 514 | type: "bytes32", 515 | }, 516 | { 517 | internalType: "bytes32", 518 | name: "s", 519 | type: "bytes32", 520 | }, 521 | ], 522 | name: "removeLiquidityWithPermit", 523 | outputs: [ 524 | { 525 | internalType: "uint256", 526 | name: "amountA", 527 | type: "uint256", 528 | }, 529 | { 530 | internalType: "uint256", 531 | name: "amountB", 532 | type: "uint256", 533 | }, 534 | ], 535 | stateMutability: "nonpayable", 536 | type: "function", 537 | }, 538 | { 539 | inputs: [ 540 | { 541 | internalType: "uint256", 542 | name: "amountOut", 543 | type: "uint256", 544 | }, 545 | { 546 | internalType: "address[]", 547 | name: "path", 548 | type: "address[]", 549 | }, 550 | { 551 | internalType: "address", 552 | name: "to", 553 | type: "address", 554 | }, 555 | { 556 | internalType: "uint256", 557 | name: "deadline", 558 | type: "uint256", 559 | }, 560 | ], 561 | name: "swapETHForExactTokens", 562 | outputs: [ 563 | { 564 | internalType: "uint256[]", 565 | name: "amounts", 566 | type: "uint256[]", 567 | }, 568 | ], 569 | stateMutability: "payable", 570 | type: "function", 571 | }, 572 | { 573 | inputs: [ 574 | { 575 | internalType: "uint256", 576 | name: "amountOutMin", 577 | type: "uint256", 578 | }, 579 | { 580 | internalType: "address[]", 581 | name: "path", 582 | type: "address[]", 583 | }, 584 | { 585 | internalType: "address", 586 | name: "to", 587 | type: "address", 588 | }, 589 | { 590 | internalType: "uint256", 591 | name: "deadline", 592 | type: "uint256", 593 | }, 594 | ], 595 | name: "swapExactETHForTokens", 596 | outputs: [ 597 | { 598 | internalType: "uint256[]", 599 | name: "amounts", 600 | type: "uint256[]", 601 | }, 602 | ], 603 | stateMutability: "payable", 604 | type: "function", 605 | }, 606 | { 607 | inputs: [ 608 | { 609 | internalType: "uint256", 610 | name: "amountIn", 611 | type: "uint256", 612 | }, 613 | { 614 | internalType: "uint256", 615 | name: "amountOutMin", 616 | type: "uint256", 617 | }, 618 | { 619 | internalType: "address[]", 620 | name: "path", 621 | type: "address[]", 622 | }, 623 | { 624 | internalType: "address", 625 | name: "to", 626 | type: "address", 627 | }, 628 | { 629 | internalType: "uint256", 630 | name: "deadline", 631 | type: "uint256", 632 | }, 633 | ], 634 | name: "swapExactTokensForETH", 635 | outputs: [ 636 | { 637 | internalType: "uint256[]", 638 | name: "amounts", 639 | type: "uint256[]", 640 | }, 641 | ], 642 | stateMutability: "nonpayable", 643 | type: "function", 644 | }, 645 | { 646 | inputs: [ 647 | { 648 | internalType: "uint256", 649 | name: "amountIn", 650 | type: "uint256", 651 | }, 652 | { 653 | internalType: "uint256", 654 | name: "amountOutMin", 655 | type: "uint256", 656 | }, 657 | { 658 | internalType: "address[]", 659 | name: "path", 660 | type: "address[]", 661 | }, 662 | { 663 | internalType: "address", 664 | name: "to", 665 | type: "address", 666 | }, 667 | { 668 | internalType: "uint256", 669 | name: "deadline", 670 | type: "uint256", 671 | }, 672 | ], 673 | name: "swapExactTokensForTokens", 674 | outputs: [ 675 | { 676 | internalType: "uint256[]", 677 | name: "amounts", 678 | type: "uint256[]", 679 | }, 680 | ], 681 | stateMutability: "nonpayable", 682 | type: "function", 683 | }, 684 | { 685 | inputs: [ 686 | { 687 | internalType: "uint256", 688 | name: "amountOut", 689 | type: "uint256", 690 | }, 691 | { 692 | internalType: "uint256", 693 | name: "amountInMax", 694 | type: "uint256", 695 | }, 696 | { 697 | internalType: "address[]", 698 | name: "path", 699 | type: "address[]", 700 | }, 701 | { 702 | internalType: "address", 703 | name: "to", 704 | type: "address", 705 | }, 706 | { 707 | internalType: "uint256", 708 | name: "deadline", 709 | type: "uint256", 710 | }, 711 | ], 712 | name: "swapTokensForExactETH", 713 | outputs: [ 714 | { 715 | internalType: "uint256[]", 716 | name: "amounts", 717 | type: "uint256[]", 718 | }, 719 | ], 720 | stateMutability: "nonpayable", 721 | type: "function", 722 | }, 723 | { 724 | inputs: [ 725 | { 726 | internalType: "uint256", 727 | name: "amountOut", 728 | type: "uint256", 729 | }, 730 | { 731 | internalType: "uint256", 732 | name: "amountInMax", 733 | type: "uint256", 734 | }, 735 | { 736 | internalType: "address[]", 737 | name: "path", 738 | type: "address[]", 739 | }, 740 | { 741 | internalType: "address", 742 | name: "to", 743 | type: "address", 744 | }, 745 | { 746 | internalType: "uint256", 747 | name: "deadline", 748 | type: "uint256", 749 | }, 750 | ], 751 | name: "swapTokensForExactTokens", 752 | outputs: [ 753 | { 754 | internalType: "uint256[]", 755 | name: "amounts", 756 | type: "uint256[]", 757 | }, 758 | ], 759 | stateMutability: "nonpayable", 760 | type: "function", 761 | }, 762 | ]; 763 | 764 | export class IUniswapV2Router01__factory { 765 | static readonly abi = _abi; 766 | static createInterface(): IUniswapV2Router01Interface { 767 | return new utils.Interface(_abi) as IUniswapV2Router01Interface; 768 | } 769 | static connect( 770 | address: string, 771 | signerOrProvider: Signer | Provider 772 | ): IUniswapV2Router01 { 773 | return new Contract(address, _abi, signerOrProvider) as IUniswapV2Router01; 774 | } 775 | } 776 | -------------------------------------------------------------------------------- /typechain/Token.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | ethers, 7 | EventFilter, 8 | Signer, 9 | BigNumber, 10 | BigNumberish, 11 | PopulatedTransaction, 12 | BaseContract, 13 | ContractTransaction, 14 | Overrides, 15 | CallOverrides, 16 | } from "ethers"; 17 | import { BytesLike } from "@ethersproject/bytes"; 18 | import { Listener, Provider } from "@ethersproject/providers"; 19 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; 20 | import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; 21 | 22 | interface TokenInterface extends ethers.utils.Interface { 23 | functions: { 24 | "allowance(address,address)": FunctionFragment; 25 | "approve(address,uint256)": FunctionFragment; 26 | "balanceOf(address)": FunctionFragment; 27 | "burn(address,uint256)": FunctionFragment; 28 | "decimals()": FunctionFragment; 29 | "decreaseAllowance(address,uint256)": FunctionFragment; 30 | "increaseAllowance(address,uint256)": FunctionFragment; 31 | "mint(address,uint256)": FunctionFragment; 32 | "name()": FunctionFragment; 33 | "owner()": FunctionFragment; 34 | "renounceOwnership()": FunctionFragment; 35 | "symbol()": FunctionFragment; 36 | "totalSupply()": FunctionFragment; 37 | "transfer(address,uint256)": FunctionFragment; 38 | "transferFrom(address,address,uint256)": FunctionFragment; 39 | "transferOwnership(address)": FunctionFragment; 40 | }; 41 | 42 | encodeFunctionData( 43 | functionFragment: "allowance", 44 | values: [string, string] 45 | ): string; 46 | encodeFunctionData( 47 | functionFragment: "approve", 48 | values: [string, BigNumberish] 49 | ): string; 50 | encodeFunctionData(functionFragment: "balanceOf", values: [string]): string; 51 | encodeFunctionData( 52 | functionFragment: "burn", 53 | values: [string, BigNumberish] 54 | ): string; 55 | encodeFunctionData(functionFragment: "decimals", values?: undefined): string; 56 | encodeFunctionData( 57 | functionFragment: "decreaseAllowance", 58 | values: [string, BigNumberish] 59 | ): string; 60 | encodeFunctionData( 61 | functionFragment: "increaseAllowance", 62 | values: [string, BigNumberish] 63 | ): string; 64 | encodeFunctionData( 65 | functionFragment: "mint", 66 | values: [string, BigNumberish] 67 | ): string; 68 | encodeFunctionData(functionFragment: "name", values?: undefined): string; 69 | encodeFunctionData(functionFragment: "owner", values?: undefined): string; 70 | encodeFunctionData( 71 | functionFragment: "renounceOwnership", 72 | values?: undefined 73 | ): string; 74 | encodeFunctionData(functionFragment: "symbol", values?: undefined): string; 75 | encodeFunctionData( 76 | functionFragment: "totalSupply", 77 | values?: undefined 78 | ): string; 79 | encodeFunctionData( 80 | functionFragment: "transfer", 81 | values: [string, BigNumberish] 82 | ): string; 83 | encodeFunctionData( 84 | functionFragment: "transferFrom", 85 | values: [string, string, BigNumberish] 86 | ): string; 87 | encodeFunctionData( 88 | functionFragment: "transferOwnership", 89 | values: [string] 90 | ): string; 91 | 92 | decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; 93 | decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; 94 | decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; 95 | decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result; 96 | decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; 97 | decodeFunctionResult( 98 | functionFragment: "decreaseAllowance", 99 | data: BytesLike 100 | ): Result; 101 | decodeFunctionResult( 102 | functionFragment: "increaseAllowance", 103 | data: BytesLike 104 | ): Result; 105 | decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; 106 | decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; 107 | decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; 108 | decodeFunctionResult( 109 | functionFragment: "renounceOwnership", 110 | data: BytesLike 111 | ): Result; 112 | decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; 113 | decodeFunctionResult( 114 | functionFragment: "totalSupply", 115 | data: BytesLike 116 | ): Result; 117 | decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; 118 | decodeFunctionResult( 119 | functionFragment: "transferFrom", 120 | data: BytesLike 121 | ): Result; 122 | decodeFunctionResult( 123 | functionFragment: "transferOwnership", 124 | data: BytesLike 125 | ): Result; 126 | 127 | events: { 128 | "Approval(address,address,uint256)": EventFragment; 129 | "OwnershipTransferred(address,address)": EventFragment; 130 | "Transfer(address,address,uint256)": EventFragment; 131 | }; 132 | 133 | getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; 134 | getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; 135 | getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; 136 | } 137 | 138 | export type ApprovalEvent = TypedEvent< 139 | [string, string, BigNumber] & { 140 | owner: string; 141 | spender: string; 142 | value: BigNumber; 143 | } 144 | >; 145 | 146 | export type OwnershipTransferredEvent = TypedEvent< 147 | [string, string] & { previousOwner: string; newOwner: string } 148 | >; 149 | 150 | export type TransferEvent = TypedEvent< 151 | [string, string, BigNumber] & { from: string; to: string; value: BigNumber } 152 | >; 153 | 154 | export class Token extends BaseContract { 155 | connect(signerOrProvider: Signer | Provider | string): this; 156 | attach(addressOrName: string): this; 157 | deployed(): Promise; 158 | 159 | listeners, EventArgsObject>( 160 | eventFilter?: TypedEventFilter 161 | ): Array>; 162 | off, EventArgsObject>( 163 | eventFilter: TypedEventFilter, 164 | listener: TypedListener 165 | ): this; 166 | on, EventArgsObject>( 167 | eventFilter: TypedEventFilter, 168 | listener: TypedListener 169 | ): this; 170 | once, EventArgsObject>( 171 | eventFilter: TypedEventFilter, 172 | listener: TypedListener 173 | ): this; 174 | removeListener, EventArgsObject>( 175 | eventFilter: TypedEventFilter, 176 | listener: TypedListener 177 | ): this; 178 | removeAllListeners, EventArgsObject>( 179 | eventFilter: TypedEventFilter 180 | ): this; 181 | 182 | listeners(eventName?: string): Array; 183 | off(eventName: string, listener: Listener): this; 184 | on(eventName: string, listener: Listener): this; 185 | once(eventName: string, listener: Listener): this; 186 | removeListener(eventName: string, listener: Listener): this; 187 | removeAllListeners(eventName?: string): this; 188 | 189 | queryFilter, EventArgsObject>( 190 | event: TypedEventFilter, 191 | fromBlockOrBlockhash?: string | number | undefined, 192 | toBlock?: string | number | undefined 193 | ): Promise>>; 194 | 195 | interface: TokenInterface; 196 | 197 | functions: { 198 | allowance( 199 | owner: string, 200 | spender: string, 201 | overrides?: CallOverrides 202 | ): Promise<[BigNumber]>; 203 | 204 | approve( 205 | spender: string, 206 | amount: BigNumberish, 207 | overrides?: Overrides & { from?: string | Promise } 208 | ): Promise; 209 | 210 | balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; 211 | 212 | burn( 213 | account: string, 214 | amount: BigNumberish, 215 | overrides?: Overrides & { from?: string | Promise } 216 | ): Promise; 217 | 218 | decimals(overrides?: CallOverrides): Promise<[number]>; 219 | 220 | decreaseAllowance( 221 | spender: string, 222 | subtractedValue: BigNumberish, 223 | overrides?: Overrides & { from?: string | Promise } 224 | ): Promise; 225 | 226 | increaseAllowance( 227 | spender: string, 228 | addedValue: BigNumberish, 229 | overrides?: Overrides & { from?: string | Promise } 230 | ): Promise; 231 | 232 | mint( 233 | account: string, 234 | amount: BigNumberish, 235 | overrides?: Overrides & { from?: string | Promise } 236 | ): Promise; 237 | 238 | name(overrides?: CallOverrides): Promise<[string]>; 239 | 240 | owner(overrides?: CallOverrides): Promise<[string]>; 241 | 242 | renounceOwnership( 243 | overrides?: Overrides & { from?: string | Promise } 244 | ): Promise; 245 | 246 | symbol(overrides?: CallOverrides): Promise<[string]>; 247 | 248 | totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; 249 | 250 | transfer( 251 | to: string, 252 | amount: BigNumberish, 253 | overrides?: Overrides & { from?: string | Promise } 254 | ): Promise; 255 | 256 | transferFrom( 257 | from: string, 258 | to: string, 259 | amount: BigNumberish, 260 | overrides?: Overrides & { from?: string | Promise } 261 | ): Promise; 262 | 263 | transferOwnership( 264 | newOwner: string, 265 | overrides?: Overrides & { from?: string | Promise } 266 | ): Promise; 267 | }; 268 | 269 | allowance( 270 | owner: string, 271 | spender: string, 272 | overrides?: CallOverrides 273 | ): Promise; 274 | 275 | approve( 276 | spender: string, 277 | amount: BigNumberish, 278 | overrides?: Overrides & { from?: string | Promise } 279 | ): Promise; 280 | 281 | balanceOf(account: string, overrides?: CallOverrides): Promise; 282 | 283 | burn( 284 | account: string, 285 | amount: BigNumberish, 286 | overrides?: Overrides & { from?: string | Promise } 287 | ): Promise; 288 | 289 | decimals(overrides?: CallOverrides): Promise; 290 | 291 | decreaseAllowance( 292 | spender: string, 293 | subtractedValue: BigNumberish, 294 | overrides?: Overrides & { from?: string | Promise } 295 | ): Promise; 296 | 297 | increaseAllowance( 298 | spender: string, 299 | addedValue: BigNumberish, 300 | overrides?: Overrides & { from?: string | Promise } 301 | ): Promise; 302 | 303 | mint( 304 | account: string, 305 | amount: BigNumberish, 306 | overrides?: Overrides & { from?: string | Promise } 307 | ): Promise; 308 | 309 | name(overrides?: CallOverrides): Promise; 310 | 311 | owner(overrides?: CallOverrides): Promise; 312 | 313 | renounceOwnership( 314 | overrides?: Overrides & { from?: string | Promise } 315 | ): Promise; 316 | 317 | symbol(overrides?: CallOverrides): Promise; 318 | 319 | totalSupply(overrides?: CallOverrides): Promise; 320 | 321 | transfer( 322 | to: string, 323 | amount: BigNumberish, 324 | overrides?: Overrides & { from?: string | Promise } 325 | ): Promise; 326 | 327 | transferFrom( 328 | from: string, 329 | to: string, 330 | amount: BigNumberish, 331 | overrides?: Overrides & { from?: string | Promise } 332 | ): Promise; 333 | 334 | transferOwnership( 335 | newOwner: string, 336 | overrides?: Overrides & { from?: string | Promise } 337 | ): Promise; 338 | 339 | callStatic: { 340 | allowance( 341 | owner: string, 342 | spender: string, 343 | overrides?: CallOverrides 344 | ): Promise; 345 | 346 | approve( 347 | spender: string, 348 | amount: BigNumberish, 349 | overrides?: CallOverrides 350 | ): Promise; 351 | 352 | balanceOf(account: string, overrides?: CallOverrides): Promise; 353 | 354 | burn( 355 | account: string, 356 | amount: BigNumberish, 357 | overrides?: CallOverrides 358 | ): Promise; 359 | 360 | decimals(overrides?: CallOverrides): Promise; 361 | 362 | decreaseAllowance( 363 | spender: string, 364 | subtractedValue: BigNumberish, 365 | overrides?: CallOverrides 366 | ): Promise; 367 | 368 | increaseAllowance( 369 | spender: string, 370 | addedValue: BigNumberish, 371 | overrides?: CallOverrides 372 | ): Promise; 373 | 374 | mint( 375 | account: string, 376 | amount: BigNumberish, 377 | overrides?: CallOverrides 378 | ): Promise; 379 | 380 | name(overrides?: CallOverrides): Promise; 381 | 382 | owner(overrides?: CallOverrides): Promise; 383 | 384 | renounceOwnership(overrides?: CallOverrides): Promise; 385 | 386 | symbol(overrides?: CallOverrides): Promise; 387 | 388 | totalSupply(overrides?: CallOverrides): Promise; 389 | 390 | transfer( 391 | to: string, 392 | amount: BigNumberish, 393 | overrides?: CallOverrides 394 | ): Promise; 395 | 396 | transferFrom( 397 | from: string, 398 | to: string, 399 | amount: BigNumberish, 400 | overrides?: CallOverrides 401 | ): Promise; 402 | 403 | transferOwnership( 404 | newOwner: string, 405 | overrides?: CallOverrides 406 | ): Promise; 407 | }; 408 | 409 | filters: { 410 | "Approval(address,address,uint256)"( 411 | owner?: string | null, 412 | spender?: string | null, 413 | value?: null 414 | ): TypedEventFilter< 415 | [string, string, BigNumber], 416 | { owner: string; spender: string; value: BigNumber } 417 | >; 418 | 419 | Approval( 420 | owner?: string | null, 421 | spender?: string | null, 422 | value?: null 423 | ): TypedEventFilter< 424 | [string, string, BigNumber], 425 | { owner: string; spender: string; value: BigNumber } 426 | >; 427 | 428 | "OwnershipTransferred(address,address)"( 429 | previousOwner?: string | null, 430 | newOwner?: string | null 431 | ): TypedEventFilter< 432 | [string, string], 433 | { previousOwner: string; newOwner: string } 434 | >; 435 | 436 | OwnershipTransferred( 437 | previousOwner?: string | null, 438 | newOwner?: string | null 439 | ): TypedEventFilter< 440 | [string, string], 441 | { previousOwner: string; newOwner: string } 442 | >; 443 | 444 | "Transfer(address,address,uint256)"( 445 | from?: string | null, 446 | to?: string | null, 447 | value?: null 448 | ): TypedEventFilter< 449 | [string, string, BigNumber], 450 | { from: string; to: string; value: BigNumber } 451 | >; 452 | 453 | Transfer( 454 | from?: string | null, 455 | to?: string | null, 456 | value?: null 457 | ): TypedEventFilter< 458 | [string, string, BigNumber], 459 | { from: string; to: string; value: BigNumber } 460 | >; 461 | }; 462 | 463 | estimateGas: { 464 | allowance( 465 | owner: string, 466 | spender: string, 467 | overrides?: CallOverrides 468 | ): Promise; 469 | 470 | approve( 471 | spender: string, 472 | amount: BigNumberish, 473 | overrides?: Overrides & { from?: string | Promise } 474 | ): Promise; 475 | 476 | balanceOf(account: string, overrides?: CallOverrides): Promise; 477 | 478 | burn( 479 | account: string, 480 | amount: BigNumberish, 481 | overrides?: Overrides & { from?: string | Promise } 482 | ): Promise; 483 | 484 | decimals(overrides?: CallOverrides): Promise; 485 | 486 | decreaseAllowance( 487 | spender: string, 488 | subtractedValue: BigNumberish, 489 | overrides?: Overrides & { from?: string | Promise } 490 | ): Promise; 491 | 492 | increaseAllowance( 493 | spender: string, 494 | addedValue: BigNumberish, 495 | overrides?: Overrides & { from?: string | Promise } 496 | ): Promise; 497 | 498 | mint( 499 | account: string, 500 | amount: BigNumberish, 501 | overrides?: Overrides & { from?: string | Promise } 502 | ): Promise; 503 | 504 | name(overrides?: CallOverrides): Promise; 505 | 506 | owner(overrides?: CallOverrides): Promise; 507 | 508 | renounceOwnership( 509 | overrides?: Overrides & { from?: string | Promise } 510 | ): Promise; 511 | 512 | symbol(overrides?: CallOverrides): Promise; 513 | 514 | totalSupply(overrides?: CallOverrides): Promise; 515 | 516 | transfer( 517 | to: string, 518 | amount: BigNumberish, 519 | overrides?: Overrides & { from?: string | Promise } 520 | ): Promise; 521 | 522 | transferFrom( 523 | from: string, 524 | to: string, 525 | amount: BigNumberish, 526 | overrides?: Overrides & { from?: string | Promise } 527 | ): Promise; 528 | 529 | transferOwnership( 530 | newOwner: string, 531 | overrides?: Overrides & { from?: string | Promise } 532 | ): Promise; 533 | }; 534 | 535 | populateTransaction: { 536 | allowance( 537 | owner: string, 538 | spender: string, 539 | overrides?: CallOverrides 540 | ): Promise; 541 | 542 | approve( 543 | spender: string, 544 | amount: BigNumberish, 545 | overrides?: Overrides & { from?: string | Promise } 546 | ): Promise; 547 | 548 | balanceOf( 549 | account: string, 550 | overrides?: CallOverrides 551 | ): Promise; 552 | 553 | burn( 554 | account: string, 555 | amount: BigNumberish, 556 | overrides?: Overrides & { from?: string | Promise } 557 | ): Promise; 558 | 559 | decimals(overrides?: CallOverrides): Promise; 560 | 561 | decreaseAllowance( 562 | spender: string, 563 | subtractedValue: BigNumberish, 564 | overrides?: Overrides & { from?: string | Promise } 565 | ): Promise; 566 | 567 | increaseAllowance( 568 | spender: string, 569 | addedValue: BigNumberish, 570 | overrides?: Overrides & { from?: string | Promise } 571 | ): Promise; 572 | 573 | mint( 574 | account: string, 575 | amount: BigNumberish, 576 | overrides?: Overrides & { from?: string | Promise } 577 | ): Promise; 578 | 579 | name(overrides?: CallOverrides): Promise; 580 | 581 | owner(overrides?: CallOverrides): Promise; 582 | 583 | renounceOwnership( 584 | overrides?: Overrides & { from?: string | Promise } 585 | ): Promise; 586 | 587 | symbol(overrides?: CallOverrides): Promise; 588 | 589 | totalSupply(overrides?: CallOverrides): Promise; 590 | 591 | transfer( 592 | to: string, 593 | amount: BigNumberish, 594 | overrides?: Overrides & { from?: string | Promise } 595 | ): Promise; 596 | 597 | transferFrom( 598 | from: string, 599 | to: string, 600 | amount: BigNumberish, 601 | overrides?: Overrides & { from?: string | Promise } 602 | ): Promise; 603 | 604 | transferOwnership( 605 | newOwner: string, 606 | overrides?: Overrides & { from?: string | Promise } 607 | ): Promise; 608 | }; 609 | } 610 | -------------------------------------------------------------------------------- /typechain/factories/Token__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | Signer, 7 | utils, 8 | BigNumberish, 9 | Contract, 10 | ContractFactory, 11 | Overrides, 12 | } from "ethers"; 13 | import { Provider, TransactionRequest } from "@ethersproject/providers"; 14 | import type { Token, TokenInterface } from "../Token"; 15 | 16 | const _abi = [ 17 | { 18 | inputs: [ 19 | { 20 | internalType: "string", 21 | name: "_name", 22 | type: "string", 23 | }, 24 | { 25 | internalType: "string", 26 | name: "_symbol", 27 | type: "string", 28 | }, 29 | { 30 | internalType: "uint256", 31 | name: "_ethAmount", 32 | type: "uint256", 33 | }, 34 | ], 35 | stateMutability: "nonpayable", 36 | type: "constructor", 37 | }, 38 | { 39 | anonymous: false, 40 | inputs: [ 41 | { 42 | indexed: true, 43 | internalType: "address", 44 | name: "owner", 45 | type: "address", 46 | }, 47 | { 48 | indexed: true, 49 | internalType: "address", 50 | name: "spender", 51 | type: "address", 52 | }, 53 | { 54 | indexed: false, 55 | internalType: "uint256", 56 | name: "value", 57 | type: "uint256", 58 | }, 59 | ], 60 | name: "Approval", 61 | type: "event", 62 | }, 63 | { 64 | anonymous: false, 65 | inputs: [ 66 | { 67 | indexed: true, 68 | internalType: "address", 69 | name: "previousOwner", 70 | type: "address", 71 | }, 72 | { 73 | indexed: true, 74 | internalType: "address", 75 | name: "newOwner", 76 | type: "address", 77 | }, 78 | ], 79 | name: "OwnershipTransferred", 80 | type: "event", 81 | }, 82 | { 83 | anonymous: false, 84 | inputs: [ 85 | { 86 | indexed: true, 87 | internalType: "address", 88 | name: "from", 89 | type: "address", 90 | }, 91 | { 92 | indexed: true, 93 | internalType: "address", 94 | name: "to", 95 | type: "address", 96 | }, 97 | { 98 | indexed: false, 99 | internalType: "uint256", 100 | name: "value", 101 | type: "uint256", 102 | }, 103 | ], 104 | name: "Transfer", 105 | type: "event", 106 | }, 107 | { 108 | inputs: [ 109 | { 110 | internalType: "address", 111 | name: "owner", 112 | type: "address", 113 | }, 114 | { 115 | internalType: "address", 116 | name: "spender", 117 | type: "address", 118 | }, 119 | ], 120 | name: "allowance", 121 | outputs: [ 122 | { 123 | internalType: "uint256", 124 | name: "", 125 | type: "uint256", 126 | }, 127 | ], 128 | stateMutability: "view", 129 | type: "function", 130 | }, 131 | { 132 | inputs: [ 133 | { 134 | internalType: "address", 135 | name: "spender", 136 | type: "address", 137 | }, 138 | { 139 | internalType: "uint256", 140 | name: "amount", 141 | type: "uint256", 142 | }, 143 | ], 144 | name: "approve", 145 | outputs: [ 146 | { 147 | internalType: "bool", 148 | name: "", 149 | type: "bool", 150 | }, 151 | ], 152 | stateMutability: "nonpayable", 153 | type: "function", 154 | }, 155 | { 156 | inputs: [ 157 | { 158 | internalType: "address", 159 | name: "account", 160 | type: "address", 161 | }, 162 | ], 163 | name: "balanceOf", 164 | outputs: [ 165 | { 166 | internalType: "uint256", 167 | name: "", 168 | type: "uint256", 169 | }, 170 | ], 171 | stateMutability: "view", 172 | type: "function", 173 | }, 174 | { 175 | inputs: [ 176 | { 177 | internalType: "address", 178 | name: "account", 179 | type: "address", 180 | }, 181 | { 182 | internalType: "uint256", 183 | name: "amount", 184 | type: "uint256", 185 | }, 186 | ], 187 | name: "burn", 188 | outputs: [ 189 | { 190 | internalType: "bool", 191 | name: "", 192 | type: "bool", 193 | }, 194 | ], 195 | stateMutability: "nonpayable", 196 | type: "function", 197 | }, 198 | { 199 | inputs: [], 200 | name: "decimals", 201 | outputs: [ 202 | { 203 | internalType: "uint8", 204 | name: "", 205 | type: "uint8", 206 | }, 207 | ], 208 | stateMutability: "view", 209 | type: "function", 210 | }, 211 | { 212 | inputs: [ 213 | { 214 | internalType: "address", 215 | name: "spender", 216 | type: "address", 217 | }, 218 | { 219 | internalType: "uint256", 220 | name: "subtractedValue", 221 | type: "uint256", 222 | }, 223 | ], 224 | name: "decreaseAllowance", 225 | outputs: [ 226 | { 227 | internalType: "bool", 228 | name: "", 229 | type: "bool", 230 | }, 231 | ], 232 | stateMutability: "nonpayable", 233 | type: "function", 234 | }, 235 | { 236 | inputs: [ 237 | { 238 | internalType: "address", 239 | name: "spender", 240 | type: "address", 241 | }, 242 | { 243 | internalType: "uint256", 244 | name: "addedValue", 245 | type: "uint256", 246 | }, 247 | ], 248 | name: "increaseAllowance", 249 | outputs: [ 250 | { 251 | internalType: "bool", 252 | name: "", 253 | type: "bool", 254 | }, 255 | ], 256 | stateMutability: "nonpayable", 257 | type: "function", 258 | }, 259 | { 260 | inputs: [ 261 | { 262 | internalType: "address", 263 | name: "account", 264 | type: "address", 265 | }, 266 | { 267 | internalType: "uint256", 268 | name: "amount", 269 | type: "uint256", 270 | }, 271 | ], 272 | name: "mint", 273 | outputs: [ 274 | { 275 | internalType: "bool", 276 | name: "", 277 | type: "bool", 278 | }, 279 | ], 280 | stateMutability: "nonpayable", 281 | type: "function", 282 | }, 283 | { 284 | inputs: [], 285 | name: "name", 286 | outputs: [ 287 | { 288 | internalType: "string", 289 | name: "", 290 | type: "string", 291 | }, 292 | ], 293 | stateMutability: "view", 294 | type: "function", 295 | }, 296 | { 297 | inputs: [], 298 | name: "owner", 299 | outputs: [ 300 | { 301 | internalType: "address", 302 | name: "", 303 | type: "address", 304 | }, 305 | ], 306 | stateMutability: "view", 307 | type: "function", 308 | }, 309 | { 310 | inputs: [], 311 | name: "renounceOwnership", 312 | outputs: [], 313 | stateMutability: "nonpayable", 314 | type: "function", 315 | }, 316 | { 317 | inputs: [], 318 | name: "symbol", 319 | outputs: [ 320 | { 321 | internalType: "string", 322 | name: "", 323 | type: "string", 324 | }, 325 | ], 326 | stateMutability: "view", 327 | type: "function", 328 | }, 329 | { 330 | inputs: [], 331 | name: "totalSupply", 332 | outputs: [ 333 | { 334 | internalType: "uint256", 335 | name: "", 336 | type: "uint256", 337 | }, 338 | ], 339 | stateMutability: "view", 340 | type: "function", 341 | }, 342 | { 343 | inputs: [ 344 | { 345 | internalType: "address", 346 | name: "to", 347 | type: "address", 348 | }, 349 | { 350 | internalType: "uint256", 351 | name: "amount", 352 | type: "uint256", 353 | }, 354 | ], 355 | name: "transfer", 356 | outputs: [ 357 | { 358 | internalType: "bool", 359 | name: "", 360 | type: "bool", 361 | }, 362 | ], 363 | stateMutability: "nonpayable", 364 | type: "function", 365 | }, 366 | { 367 | inputs: [ 368 | { 369 | internalType: "address", 370 | name: "from", 371 | type: "address", 372 | }, 373 | { 374 | internalType: "address", 375 | name: "to", 376 | type: "address", 377 | }, 378 | { 379 | internalType: "uint256", 380 | name: "amount", 381 | type: "uint256", 382 | }, 383 | ], 384 | name: "transferFrom", 385 | outputs: [ 386 | { 387 | internalType: "bool", 388 | name: "", 389 | type: "bool", 390 | }, 391 | ], 392 | stateMutability: "nonpayable", 393 | type: "function", 394 | }, 395 | { 396 | inputs: [ 397 | { 398 | internalType: "address", 399 | name: "newOwner", 400 | type: "address", 401 | }, 402 | ], 403 | name: "transferOwnership", 404 | outputs: [], 405 | stateMutability: "nonpayable", 406 | type: "function", 407 | }, 408 | ]; 409 | 410 | const _bytecode = 411 | "0x60806040523480156200001157600080fd5b506040516200171a3803806200171a83398101604081905262000034916200062f565b8251839083906200004d906003906020850190620004de565b50805162000063906004906020840190620004de565b505050620000806200007a620000f060201b60201c565b620000f4565b62000097336a52b7d2dcc80cd2e400000062000146565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d179055620000e7620000d582670de0b6b3a7640000620008d8565b6a52b7d2dcc80cd2e4000000620001f7565b5050506200097d565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620001785760405162461bcd60e51b81526004016200016f906200085c565b60405180910390fd5b620001866000838362000318565b80600260008282546200019a91906200089c565b90915550506001600160a01b03821660008181526020819052604080822080548501905551600080516020620016fa83398151915290620001dd90859062000893565b60405180910390a3620001f36000838362000318565b5050565b600654620002119030906001600160a01b0316836200031d565b620002513373f06225f7f977e3db4ffe64a23ec7d769e1283f4f62000238606486620008b7565b6200024b9066b1a2bc2ec500006200089c565b620003d9565b6006546001600160a01b031663f305d71966b1a2bc2ec50000606462000279866063620008d8565b620002859190620008b7565b620002919190620008fa565b308460008030426040518863ffffffff1660e01b8152600401620002bb96959493929190620006cd565b6060604051808303818588803b158015620002d557600080fd5b505af1158015620002ea573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906200031191906200069f565b5050505050565b505050565b6001600160a01b038316620003465760405162461bcd60e51b81526004016200016f9062000818565b6001600160a01b0382166200036f5760405162461bcd60e51b81526004016200016f906200074b565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590620003cc90859062000893565b60405180910390a3505050565b6001600160a01b038316620004025760405162461bcd60e51b81526004016200016f90620007d3565b6001600160a01b0382166200042b5760405162461bcd60e51b81526004016200016f9062000708565b6200043883838362000318565b6001600160a01b03831660009081526020819052604090205481811015620004745760405162461bcd60e51b81526004016200016f906200078d565b6001600160a01b038085166000818152602081905260408082208686039055928616808252908390208054860190559151600080516020620016fa83398151915290620004c390869062000893565b60405180910390a3620004d884848462000318565b50505050565b828054620004ec9062000914565b90600052602060002090601f0160209004810192826200051057600085556200055b565b82601f106200052b57805160ff19168380011785556200055b565b828001600101855582156200055b579182015b828111156200055b5782518255916020019190600101906200053e565b50620005699291506200056d565b5090565b5b808211156200056957600081556001016200056e565b600082601f83011262000595578081fd5b81516001600160401b0380821115620005b257620005b262000967565b6040516020601f8401601f1916820181018381118382101715620005da57620005da62000967565b6040528382528584018101871015620005f1578485fd5b8492505b83831015620006145785830181015182840182015291820191620005f5565b838311156200062557848185840101525b5095945050505050565b60008060006060848603121562000644578283fd5b83516001600160401b03808211156200065b578485fd5b620006698783880162000584565b945060208601519150808211156200067f578384fd5b506200068e8682870162000584565b925050604084015190509250925092565b600080600060608486031215620006b4578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252601f908201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604082015260600190565b90815260200190565b60008219821115620008b257620008b262000951565b500190565b600082620008d357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615620008f557620008f562000951565b500290565b6000828210156200090f576200090f62000951565b500390565b6002810460018216806200092957607f821691505b602082108114156200094b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b610d6d806200098d6000396000f3fe608060405234801561001057600080fd5b50600436106100d05760003560e01c806306fdde03146100d5578063095ea7b3146100f357806318160ddd1461011357806323b872dd14610128578063313ce5671461013b578063395093511461015057806340c10f191461016357806370a0823114610176578063715018a6146101895780638da5cb5b1461019357806395d89b41146101a85780639dc29fac146101b0578063a457c2d7146101c3578063a9059cbb146101d6578063dd62ed3e146101e9578063f2fde38b146101fc575b600080fd5b6100dd61020f565b6040516100ea9190610949565b60405180910390f35b610106610101366004610901565b6102a1565b6040516100ea919061093e565b61011b6102c3565b6040516100ea9190610ca1565b6101066101363660046108c6565b6102c9565b6101436102f7565b6040516100ea9190610caa565b61010661015e366004610901565b6102fc565b610106610171366004610901565b610328565b61011b610184366004610873565b610345565b610191610364565b005b61019b610378565b6040516100ea919061092a565b6100dd610387565b6101066101be366004610901565b610396565b6101066101d1366004610901565b6103aa565b6101066101e4366004610901565b6103fb565b61011b6101f7366004610894565b610413565b61019161020a366004610873565b61043e565b60606003805461021e90610cdc565b80601f016020809104026020016040519081016040528092919081815260200182805461024a90610cdc565b80156102975780601f1061026c57610100808354040283529160200191610297565b820191906000526020600020905b81548152906001019060200180831161027a57829003601f168201915b5050505050905090565b6000806102ac610478565b90506102b981858561047c565b5060019392505050565b60025490565b6000806102d4610478565b90506102e1858285610530565b6102ec85858561057a565b506001949350505050565b601290565b600080610307610478565b90506102b98185856103198589610413565b6103239190610cb8565b61047c565b6000610332610669565b61033c83836106a8565b50600192915050565b6001600160a01b0381166000908152602081905260409020545b919050565b61036c610669565b6103766000610744565b565b6005546001600160a01b031690565b60606004805461021e90610cdc565b60006103a0610669565b61033c8383610796565b6000806103b5610478565b905060006103c38286610413565b9050838110156103ee5760405162461bcd60e51b81526004016103e590610c25565b60405180910390fd5b6102ec828686840361047c565b600080610406610478565b90506102b981858561057a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610446610669565b6001600160a01b03811661046c5760405162461bcd60e51b81526004016103e590610a21565b61047581610744565b50565b3390565b6001600160a01b0383166104a25760405162461bcd60e51b81526004016103e590610be1565b6001600160a01b0382166104c85760405162461bcd60e51b81526004016103e590610a67565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610523908590610ca1565b60405180910390a3505050565b600061053c8484610413565b9050600019811461057457818110156105675760405162461bcd60e51b81526004016103e590610aa9565b610574848484840361047c565b50505050565b6001600160a01b0383166105a05760405162461bcd60e51b81526004016103e590610b9c565b6001600160a01b0382166105c65760405162461bcd60e51b81526004016103e59061099c565b6105d1838383610857565b6001600160a01b0383166000908152602081905260409020548181101561060a5760405162461bcd60e51b81526004016103e590610ae0565b6001600160a01b038085166000818152602081905260408082208686039055928616808252908390208054860190559151600080516020610d1883398151915290610656908690610ca1565b60405180910390a3610574848484610857565b610671610478565b6001600160a01b0316610682610378565b6001600160a01b0316146103765760405162461bcd60e51b81526004016103e590610b26565b6001600160a01b0382166106ce5760405162461bcd60e51b81526004016103e590610c6a565b6106da60008383610857565b80600260008282546106ec9190610cb8565b90915550506001600160a01b03821660008181526020819052604080822080548501905551600080516020610d188339815191529061072c908590610ca1565b60405180910390a361074060008383610857565b5050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166107bc5760405162461bcd60e51b81526004016103e590610b5b565b6107c882600083610857565b6001600160a01b038216600090815260208190526040902054818110156108015760405162461bcd60e51b81526004016103e5906109df565b6001600160a01b038316600081815260208190526040808220858503905560028054869003905551909190600080516020610d1883398151915290610847908690610ca1565b60405180910390a3610857836000845b505050565b80356001600160a01b038116811461035f57600080fd5b600060208284031215610884578081fd5b61088d8261085c565b9392505050565b600080604083850312156108a6578081fd5b6108af8361085c565b91506108bd6020840161085c565b90509250929050565b6000806000606084860312156108da578081fd5b6108e38461085c565b92506108f16020850161085c565b9150604084013590509250925092565b60008060408385031215610913578182fd5b61091c8361085c565b946020939093013593505050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b8181101561097557858101830151858201604001528201610959565b818111156109865783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604082015261636560f01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601d908201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604082015260600190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b6020808252601f908201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604082015260600190565b90815260200190565b60ff91909116815260200190565b60008219821115610cd757634e487b7160e01b81526011600452602481fd5b500190565b600281046001821680610cf057607f821691505b60208210811415610d1157634e487b7160e01b600052602260045260246000fd5b5091905056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220582693fde2957396a9e4f160a98a752f8183b0a176513619cf0007d01adc2eda64736f6c63430008000033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"; 412 | 413 | export class Token__factory extends ContractFactory { 414 | constructor( 415 | ...args: [signer: Signer] | ConstructorParameters 416 | ) { 417 | if (args.length === 1) { 418 | super(_abi, _bytecode, args[0]); 419 | } else { 420 | super(...args); 421 | } 422 | } 423 | 424 | deploy( 425 | _name: string, 426 | _symbol: string, 427 | _ethAmount: BigNumberish, 428 | overrides?: Overrides & { from?: string | Promise } 429 | ): Promise { 430 | return super.deploy( 431 | _name, 432 | _symbol, 433 | _ethAmount, 434 | overrides || {} 435 | ) as Promise; 436 | } 437 | getDeployTransaction( 438 | _name: string, 439 | _symbol: string, 440 | _ethAmount: BigNumberish, 441 | overrides?: Overrides & { from?: string | Promise } 442 | ): TransactionRequest { 443 | return super.getDeployTransaction( 444 | _name, 445 | _symbol, 446 | _ethAmount, 447 | overrides || {} 448 | ); 449 | } 450 | attach(address: string): Token { 451 | return super.attach(address) as Token; 452 | } 453 | connect(signer: Signer): Token__factory { 454 | return super.connect(signer) as Token__factory; 455 | } 456 | static readonly bytecode = _bytecode; 457 | static readonly abi = _abi; 458 | static createInterface(): TokenInterface { 459 | return new utils.Interface(_abi) as TokenInterface; 460 | } 461 | static connect(address: string, signerOrProvider: Signer | Provider): Token { 462 | return new Contract(address, _abi, signerOrProvider) as Token; 463 | } 464 | } 465 | -------------------------------------------------------------------------------- /typechain/factories/IUniswapV2Router02__factory.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { Contract, Signer, utils } from "ethers"; 6 | import { Provider } from "@ethersproject/providers"; 7 | import type { 8 | IUniswapV2Router02, 9 | IUniswapV2Router02Interface, 10 | } from "../IUniswapV2Router02"; 11 | 12 | const _abi = [ 13 | { 14 | inputs: [], 15 | name: "WETH", 16 | outputs: [ 17 | { 18 | internalType: "address", 19 | name: "", 20 | type: "address", 21 | }, 22 | ], 23 | stateMutability: "pure", 24 | type: "function", 25 | }, 26 | { 27 | inputs: [ 28 | { 29 | internalType: "address", 30 | name: "tokenA", 31 | type: "address", 32 | }, 33 | { 34 | internalType: "address", 35 | name: "tokenB", 36 | type: "address", 37 | }, 38 | { 39 | internalType: "uint256", 40 | name: "amountADesired", 41 | type: "uint256", 42 | }, 43 | { 44 | internalType: "uint256", 45 | name: "amountBDesired", 46 | type: "uint256", 47 | }, 48 | { 49 | internalType: "uint256", 50 | name: "amountAMin", 51 | type: "uint256", 52 | }, 53 | { 54 | internalType: "uint256", 55 | name: "amountBMin", 56 | type: "uint256", 57 | }, 58 | { 59 | internalType: "address", 60 | name: "to", 61 | type: "address", 62 | }, 63 | { 64 | internalType: "uint256", 65 | name: "deadline", 66 | type: "uint256", 67 | }, 68 | ], 69 | name: "addLiquidity", 70 | outputs: [ 71 | { 72 | internalType: "uint256", 73 | name: "amountA", 74 | type: "uint256", 75 | }, 76 | { 77 | internalType: "uint256", 78 | name: "amountB", 79 | type: "uint256", 80 | }, 81 | { 82 | internalType: "uint256", 83 | name: "liquidity", 84 | type: "uint256", 85 | }, 86 | ], 87 | stateMutability: "nonpayable", 88 | type: "function", 89 | }, 90 | { 91 | inputs: [ 92 | { 93 | internalType: "address", 94 | name: "token", 95 | type: "address", 96 | }, 97 | { 98 | internalType: "uint256", 99 | name: "amountTokenDesired", 100 | type: "uint256", 101 | }, 102 | { 103 | internalType: "uint256", 104 | name: "amountTokenMin", 105 | type: "uint256", 106 | }, 107 | { 108 | internalType: "uint256", 109 | name: "amountETHMin", 110 | type: "uint256", 111 | }, 112 | { 113 | internalType: "address", 114 | name: "to", 115 | type: "address", 116 | }, 117 | { 118 | internalType: "uint256", 119 | name: "deadline", 120 | type: "uint256", 121 | }, 122 | ], 123 | name: "addLiquidityETH", 124 | outputs: [ 125 | { 126 | internalType: "uint256", 127 | name: "amountToken", 128 | type: "uint256", 129 | }, 130 | { 131 | internalType: "uint256", 132 | name: "amountETH", 133 | type: "uint256", 134 | }, 135 | { 136 | internalType: "uint256", 137 | name: "liquidity", 138 | type: "uint256", 139 | }, 140 | ], 141 | stateMutability: "payable", 142 | type: "function", 143 | }, 144 | { 145 | inputs: [], 146 | name: "factory", 147 | outputs: [ 148 | { 149 | internalType: "address", 150 | name: "", 151 | type: "address", 152 | }, 153 | ], 154 | stateMutability: "pure", 155 | type: "function", 156 | }, 157 | { 158 | inputs: [ 159 | { 160 | internalType: "uint256", 161 | name: "amountOut", 162 | type: "uint256", 163 | }, 164 | { 165 | internalType: "uint256", 166 | name: "reserveIn", 167 | type: "uint256", 168 | }, 169 | { 170 | internalType: "uint256", 171 | name: "reserveOut", 172 | type: "uint256", 173 | }, 174 | ], 175 | name: "getAmountIn", 176 | outputs: [ 177 | { 178 | internalType: "uint256", 179 | name: "amountIn", 180 | type: "uint256", 181 | }, 182 | ], 183 | stateMutability: "pure", 184 | type: "function", 185 | }, 186 | { 187 | inputs: [ 188 | { 189 | internalType: "uint256", 190 | name: "amountIn", 191 | type: "uint256", 192 | }, 193 | { 194 | internalType: "uint256", 195 | name: "reserveIn", 196 | type: "uint256", 197 | }, 198 | { 199 | internalType: "uint256", 200 | name: "reserveOut", 201 | type: "uint256", 202 | }, 203 | ], 204 | name: "getAmountOut", 205 | outputs: [ 206 | { 207 | internalType: "uint256", 208 | name: "amountOut", 209 | type: "uint256", 210 | }, 211 | ], 212 | stateMutability: "pure", 213 | type: "function", 214 | }, 215 | { 216 | inputs: [ 217 | { 218 | internalType: "uint256", 219 | name: "amountOut", 220 | type: "uint256", 221 | }, 222 | { 223 | internalType: "address[]", 224 | name: "path", 225 | type: "address[]", 226 | }, 227 | ], 228 | name: "getAmountsIn", 229 | outputs: [ 230 | { 231 | internalType: "uint256[]", 232 | name: "amounts", 233 | type: "uint256[]", 234 | }, 235 | ], 236 | stateMutability: "view", 237 | type: "function", 238 | }, 239 | { 240 | inputs: [ 241 | { 242 | internalType: "uint256", 243 | name: "amountIn", 244 | type: "uint256", 245 | }, 246 | { 247 | internalType: "address[]", 248 | name: "path", 249 | type: "address[]", 250 | }, 251 | ], 252 | name: "getAmountsOut", 253 | outputs: [ 254 | { 255 | internalType: "uint256[]", 256 | name: "amounts", 257 | type: "uint256[]", 258 | }, 259 | ], 260 | stateMutability: "view", 261 | type: "function", 262 | }, 263 | { 264 | inputs: [ 265 | { 266 | internalType: "uint256", 267 | name: "amountA", 268 | type: "uint256", 269 | }, 270 | { 271 | internalType: "uint256", 272 | name: "reserveA", 273 | type: "uint256", 274 | }, 275 | { 276 | internalType: "uint256", 277 | name: "reserveB", 278 | type: "uint256", 279 | }, 280 | ], 281 | name: "quote", 282 | outputs: [ 283 | { 284 | internalType: "uint256", 285 | name: "amountB", 286 | type: "uint256", 287 | }, 288 | ], 289 | stateMutability: "pure", 290 | type: "function", 291 | }, 292 | { 293 | inputs: [ 294 | { 295 | internalType: "address", 296 | name: "tokenA", 297 | type: "address", 298 | }, 299 | { 300 | internalType: "address", 301 | name: "tokenB", 302 | type: "address", 303 | }, 304 | { 305 | internalType: "uint256", 306 | name: "liquidity", 307 | type: "uint256", 308 | }, 309 | { 310 | internalType: "uint256", 311 | name: "amountAMin", 312 | type: "uint256", 313 | }, 314 | { 315 | internalType: "uint256", 316 | name: "amountBMin", 317 | type: "uint256", 318 | }, 319 | { 320 | internalType: "address", 321 | name: "to", 322 | type: "address", 323 | }, 324 | { 325 | internalType: "uint256", 326 | name: "deadline", 327 | type: "uint256", 328 | }, 329 | ], 330 | name: "removeLiquidity", 331 | outputs: [ 332 | { 333 | internalType: "uint256", 334 | name: "amountA", 335 | type: "uint256", 336 | }, 337 | { 338 | internalType: "uint256", 339 | name: "amountB", 340 | type: "uint256", 341 | }, 342 | ], 343 | stateMutability: "nonpayable", 344 | type: "function", 345 | }, 346 | { 347 | inputs: [ 348 | { 349 | internalType: "address", 350 | name: "token", 351 | type: "address", 352 | }, 353 | { 354 | internalType: "uint256", 355 | name: "liquidity", 356 | type: "uint256", 357 | }, 358 | { 359 | internalType: "uint256", 360 | name: "amountTokenMin", 361 | type: "uint256", 362 | }, 363 | { 364 | internalType: "uint256", 365 | name: "amountETHMin", 366 | type: "uint256", 367 | }, 368 | { 369 | internalType: "address", 370 | name: "to", 371 | type: "address", 372 | }, 373 | { 374 | internalType: "uint256", 375 | name: "deadline", 376 | type: "uint256", 377 | }, 378 | ], 379 | name: "removeLiquidityETH", 380 | outputs: [ 381 | { 382 | internalType: "uint256", 383 | name: "amountToken", 384 | type: "uint256", 385 | }, 386 | { 387 | internalType: "uint256", 388 | name: "amountETH", 389 | type: "uint256", 390 | }, 391 | ], 392 | stateMutability: "nonpayable", 393 | type: "function", 394 | }, 395 | { 396 | inputs: [ 397 | { 398 | internalType: "address", 399 | name: "token", 400 | type: "address", 401 | }, 402 | { 403 | internalType: "uint256", 404 | name: "liquidity", 405 | type: "uint256", 406 | }, 407 | { 408 | internalType: "uint256", 409 | name: "amountTokenMin", 410 | type: "uint256", 411 | }, 412 | { 413 | internalType: "uint256", 414 | name: "amountETHMin", 415 | type: "uint256", 416 | }, 417 | { 418 | internalType: "address", 419 | name: "to", 420 | type: "address", 421 | }, 422 | { 423 | internalType: "uint256", 424 | name: "deadline", 425 | type: "uint256", 426 | }, 427 | ], 428 | name: "removeLiquidityETHSupportingFeeOnTransferTokens", 429 | outputs: [ 430 | { 431 | internalType: "uint256", 432 | name: "amountETH", 433 | type: "uint256", 434 | }, 435 | ], 436 | stateMutability: "nonpayable", 437 | type: "function", 438 | }, 439 | { 440 | inputs: [ 441 | { 442 | internalType: "address", 443 | name: "token", 444 | type: "address", 445 | }, 446 | { 447 | internalType: "uint256", 448 | name: "liquidity", 449 | type: "uint256", 450 | }, 451 | { 452 | internalType: "uint256", 453 | name: "amountTokenMin", 454 | type: "uint256", 455 | }, 456 | { 457 | internalType: "uint256", 458 | name: "amountETHMin", 459 | type: "uint256", 460 | }, 461 | { 462 | internalType: "address", 463 | name: "to", 464 | type: "address", 465 | }, 466 | { 467 | internalType: "uint256", 468 | name: "deadline", 469 | type: "uint256", 470 | }, 471 | { 472 | internalType: "bool", 473 | name: "approveMax", 474 | type: "bool", 475 | }, 476 | { 477 | internalType: "uint8", 478 | name: "v", 479 | type: "uint8", 480 | }, 481 | { 482 | internalType: "bytes32", 483 | name: "r", 484 | type: "bytes32", 485 | }, 486 | { 487 | internalType: "bytes32", 488 | name: "s", 489 | type: "bytes32", 490 | }, 491 | ], 492 | name: "removeLiquidityETHWithPermit", 493 | outputs: [ 494 | { 495 | internalType: "uint256", 496 | name: "amountToken", 497 | type: "uint256", 498 | }, 499 | { 500 | internalType: "uint256", 501 | name: "amountETH", 502 | type: "uint256", 503 | }, 504 | ], 505 | stateMutability: "nonpayable", 506 | type: "function", 507 | }, 508 | { 509 | inputs: [ 510 | { 511 | internalType: "address", 512 | name: "token", 513 | type: "address", 514 | }, 515 | { 516 | internalType: "uint256", 517 | name: "liquidity", 518 | type: "uint256", 519 | }, 520 | { 521 | internalType: "uint256", 522 | name: "amountTokenMin", 523 | type: "uint256", 524 | }, 525 | { 526 | internalType: "uint256", 527 | name: "amountETHMin", 528 | type: "uint256", 529 | }, 530 | { 531 | internalType: "address", 532 | name: "to", 533 | type: "address", 534 | }, 535 | { 536 | internalType: "uint256", 537 | name: "deadline", 538 | type: "uint256", 539 | }, 540 | { 541 | internalType: "bool", 542 | name: "approveMax", 543 | type: "bool", 544 | }, 545 | { 546 | internalType: "uint8", 547 | name: "v", 548 | type: "uint8", 549 | }, 550 | { 551 | internalType: "bytes32", 552 | name: "r", 553 | type: "bytes32", 554 | }, 555 | { 556 | internalType: "bytes32", 557 | name: "s", 558 | type: "bytes32", 559 | }, 560 | ], 561 | name: "removeLiquidityETHWithPermitSupportingFeeOnTransferTokens", 562 | outputs: [ 563 | { 564 | internalType: "uint256", 565 | name: "amountETH", 566 | type: "uint256", 567 | }, 568 | ], 569 | stateMutability: "nonpayable", 570 | type: "function", 571 | }, 572 | { 573 | inputs: [ 574 | { 575 | internalType: "address", 576 | name: "tokenA", 577 | type: "address", 578 | }, 579 | { 580 | internalType: "address", 581 | name: "tokenB", 582 | type: "address", 583 | }, 584 | { 585 | internalType: "uint256", 586 | name: "liquidity", 587 | type: "uint256", 588 | }, 589 | { 590 | internalType: "uint256", 591 | name: "amountAMin", 592 | type: "uint256", 593 | }, 594 | { 595 | internalType: "uint256", 596 | name: "amountBMin", 597 | type: "uint256", 598 | }, 599 | { 600 | internalType: "address", 601 | name: "to", 602 | type: "address", 603 | }, 604 | { 605 | internalType: "uint256", 606 | name: "deadline", 607 | type: "uint256", 608 | }, 609 | { 610 | internalType: "bool", 611 | name: "approveMax", 612 | type: "bool", 613 | }, 614 | { 615 | internalType: "uint8", 616 | name: "v", 617 | type: "uint8", 618 | }, 619 | { 620 | internalType: "bytes32", 621 | name: "r", 622 | type: "bytes32", 623 | }, 624 | { 625 | internalType: "bytes32", 626 | name: "s", 627 | type: "bytes32", 628 | }, 629 | ], 630 | name: "removeLiquidityWithPermit", 631 | outputs: [ 632 | { 633 | internalType: "uint256", 634 | name: "amountA", 635 | type: "uint256", 636 | }, 637 | { 638 | internalType: "uint256", 639 | name: "amountB", 640 | type: "uint256", 641 | }, 642 | ], 643 | stateMutability: "nonpayable", 644 | type: "function", 645 | }, 646 | { 647 | inputs: [ 648 | { 649 | internalType: "uint256", 650 | name: "amountOut", 651 | type: "uint256", 652 | }, 653 | { 654 | internalType: "address[]", 655 | name: "path", 656 | type: "address[]", 657 | }, 658 | { 659 | internalType: "address", 660 | name: "to", 661 | type: "address", 662 | }, 663 | { 664 | internalType: "uint256", 665 | name: "deadline", 666 | type: "uint256", 667 | }, 668 | ], 669 | name: "swapETHForExactTokens", 670 | outputs: [ 671 | { 672 | internalType: "uint256[]", 673 | name: "amounts", 674 | type: "uint256[]", 675 | }, 676 | ], 677 | stateMutability: "payable", 678 | type: "function", 679 | }, 680 | { 681 | inputs: [ 682 | { 683 | internalType: "uint256", 684 | name: "amountOutMin", 685 | type: "uint256", 686 | }, 687 | { 688 | internalType: "address[]", 689 | name: "path", 690 | type: "address[]", 691 | }, 692 | { 693 | internalType: "address", 694 | name: "to", 695 | type: "address", 696 | }, 697 | { 698 | internalType: "uint256", 699 | name: "deadline", 700 | type: "uint256", 701 | }, 702 | ], 703 | name: "swapExactETHForTokens", 704 | outputs: [ 705 | { 706 | internalType: "uint256[]", 707 | name: "amounts", 708 | type: "uint256[]", 709 | }, 710 | ], 711 | stateMutability: "payable", 712 | type: "function", 713 | }, 714 | { 715 | inputs: [ 716 | { 717 | internalType: "uint256", 718 | name: "amountOutMin", 719 | type: "uint256", 720 | }, 721 | { 722 | internalType: "address[]", 723 | name: "path", 724 | type: "address[]", 725 | }, 726 | { 727 | internalType: "address", 728 | name: "to", 729 | type: "address", 730 | }, 731 | { 732 | internalType: "uint256", 733 | name: "deadline", 734 | type: "uint256", 735 | }, 736 | ], 737 | name: "swapExactETHForTokensSupportingFeeOnTransferTokens", 738 | outputs: [], 739 | stateMutability: "payable", 740 | type: "function", 741 | }, 742 | { 743 | inputs: [ 744 | { 745 | internalType: "uint256", 746 | name: "amountIn", 747 | type: "uint256", 748 | }, 749 | { 750 | internalType: "uint256", 751 | name: "amountOutMin", 752 | type: "uint256", 753 | }, 754 | { 755 | internalType: "address[]", 756 | name: "path", 757 | type: "address[]", 758 | }, 759 | { 760 | internalType: "address", 761 | name: "to", 762 | type: "address", 763 | }, 764 | { 765 | internalType: "uint256", 766 | name: "deadline", 767 | type: "uint256", 768 | }, 769 | ], 770 | name: "swapExactTokensForETH", 771 | outputs: [ 772 | { 773 | internalType: "uint256[]", 774 | name: "amounts", 775 | type: "uint256[]", 776 | }, 777 | ], 778 | stateMutability: "nonpayable", 779 | type: "function", 780 | }, 781 | { 782 | inputs: [ 783 | { 784 | internalType: "uint256", 785 | name: "amountIn", 786 | type: "uint256", 787 | }, 788 | { 789 | internalType: "uint256", 790 | name: "amountOutMin", 791 | type: "uint256", 792 | }, 793 | { 794 | internalType: "address[]", 795 | name: "path", 796 | type: "address[]", 797 | }, 798 | { 799 | internalType: "address", 800 | name: "to", 801 | type: "address", 802 | }, 803 | { 804 | internalType: "uint256", 805 | name: "deadline", 806 | type: "uint256", 807 | }, 808 | ], 809 | name: "swapExactTokensForETHSupportingFeeOnTransferTokens", 810 | outputs: [], 811 | stateMutability: "nonpayable", 812 | type: "function", 813 | }, 814 | { 815 | inputs: [ 816 | { 817 | internalType: "uint256", 818 | name: "amountIn", 819 | type: "uint256", 820 | }, 821 | { 822 | internalType: "uint256", 823 | name: "amountOutMin", 824 | type: "uint256", 825 | }, 826 | { 827 | internalType: "address[]", 828 | name: "path", 829 | type: "address[]", 830 | }, 831 | { 832 | internalType: "address", 833 | name: "to", 834 | type: "address", 835 | }, 836 | { 837 | internalType: "uint256", 838 | name: "deadline", 839 | type: "uint256", 840 | }, 841 | ], 842 | name: "swapExactTokensForTokens", 843 | outputs: [ 844 | { 845 | internalType: "uint256[]", 846 | name: "amounts", 847 | type: "uint256[]", 848 | }, 849 | ], 850 | stateMutability: "nonpayable", 851 | type: "function", 852 | }, 853 | { 854 | inputs: [ 855 | { 856 | internalType: "uint256", 857 | name: "amountIn", 858 | type: "uint256", 859 | }, 860 | { 861 | internalType: "uint256", 862 | name: "amountOutMin", 863 | type: "uint256", 864 | }, 865 | { 866 | internalType: "address[]", 867 | name: "path", 868 | type: "address[]", 869 | }, 870 | { 871 | internalType: "address", 872 | name: "to", 873 | type: "address", 874 | }, 875 | { 876 | internalType: "uint256", 877 | name: "deadline", 878 | type: "uint256", 879 | }, 880 | ], 881 | name: "swapExactTokensForTokensSupportingFeeOnTransferTokens", 882 | outputs: [], 883 | stateMutability: "nonpayable", 884 | type: "function", 885 | }, 886 | { 887 | inputs: [ 888 | { 889 | internalType: "uint256", 890 | name: "amountOut", 891 | type: "uint256", 892 | }, 893 | { 894 | internalType: "uint256", 895 | name: "amountInMax", 896 | type: "uint256", 897 | }, 898 | { 899 | internalType: "address[]", 900 | name: "path", 901 | type: "address[]", 902 | }, 903 | { 904 | internalType: "address", 905 | name: "to", 906 | type: "address", 907 | }, 908 | { 909 | internalType: "uint256", 910 | name: "deadline", 911 | type: "uint256", 912 | }, 913 | ], 914 | name: "swapTokensForExactETH", 915 | outputs: [ 916 | { 917 | internalType: "uint256[]", 918 | name: "amounts", 919 | type: "uint256[]", 920 | }, 921 | ], 922 | stateMutability: "nonpayable", 923 | type: "function", 924 | }, 925 | { 926 | inputs: [ 927 | { 928 | internalType: "uint256", 929 | name: "amountOut", 930 | type: "uint256", 931 | }, 932 | { 933 | internalType: "uint256", 934 | name: "amountInMax", 935 | type: "uint256", 936 | }, 937 | { 938 | internalType: "address[]", 939 | name: "path", 940 | type: "address[]", 941 | }, 942 | { 943 | internalType: "address", 944 | name: "to", 945 | type: "address", 946 | }, 947 | { 948 | internalType: "uint256", 949 | name: "deadline", 950 | type: "uint256", 951 | }, 952 | ], 953 | name: "swapTokensForExactTokens", 954 | outputs: [ 955 | { 956 | internalType: "uint256[]", 957 | name: "amounts", 958 | type: "uint256[]", 959 | }, 960 | ], 961 | stateMutability: "nonpayable", 962 | type: "function", 963 | }, 964 | ]; 965 | 966 | export class IUniswapV2Router02__factory { 967 | static readonly abi = _abi; 968 | static createInterface(): IUniswapV2Router02Interface { 969 | return new utils.Interface(_abi) as IUniswapV2Router02Interface; 970 | } 971 | static connect( 972 | address: string, 973 | signerOrProvider: Signer | Provider 974 | ): IUniswapV2Router02 { 975 | return new Contract(address, _abi, signerOrProvider) as IUniswapV2Router02; 976 | } 977 | } 978 | -------------------------------------------------------------------------------- /typechain/IUniswapV2Router01.d.ts: -------------------------------------------------------------------------------- 1 | /* Autogenerated file. Do not edit manually. */ 2 | /* tslint:disable */ 3 | /* eslint-disable */ 4 | 5 | import { 6 | ethers, 7 | EventFilter, 8 | Signer, 9 | BigNumber, 10 | BigNumberish, 11 | PopulatedTransaction, 12 | BaseContract, 13 | ContractTransaction, 14 | Overrides, 15 | PayableOverrides, 16 | CallOverrides, 17 | } from "ethers"; 18 | import { BytesLike } from "@ethersproject/bytes"; 19 | import { Listener, Provider } from "@ethersproject/providers"; 20 | import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi"; 21 | import type { TypedEventFilter, TypedEvent, TypedListener } from "./common"; 22 | 23 | interface IUniswapV2Router01Interface extends ethers.utils.Interface { 24 | functions: { 25 | "WETH()": FunctionFragment; 26 | "addLiquidity(address,address,uint256,uint256,uint256,uint256,address,uint256)": FunctionFragment; 27 | "addLiquidityETH(address,uint256,uint256,uint256,address,uint256)": FunctionFragment; 28 | "factory()": FunctionFragment; 29 | "getAmountIn(uint256,uint256,uint256)": FunctionFragment; 30 | "getAmountOut(uint256,uint256,uint256)": FunctionFragment; 31 | "getAmountsIn(uint256,address[])": FunctionFragment; 32 | "getAmountsOut(uint256,address[])": FunctionFragment; 33 | "quote(uint256,uint256,uint256)": FunctionFragment; 34 | "removeLiquidity(address,address,uint256,uint256,uint256,address,uint256)": FunctionFragment; 35 | "removeLiquidityETH(address,uint256,uint256,uint256,address,uint256)": FunctionFragment; 36 | "removeLiquidityETHWithPermit(address,uint256,uint256,uint256,address,uint256,bool,uint8,bytes32,bytes32)": FunctionFragment; 37 | "removeLiquidityWithPermit(address,address,uint256,uint256,uint256,address,uint256,bool,uint8,bytes32,bytes32)": FunctionFragment; 38 | "swapETHForExactTokens(uint256,address[],address,uint256)": FunctionFragment; 39 | "swapExactETHForTokens(uint256,address[],address,uint256)": FunctionFragment; 40 | "swapExactTokensForETH(uint256,uint256,address[],address,uint256)": FunctionFragment; 41 | "swapExactTokensForTokens(uint256,uint256,address[],address,uint256)": FunctionFragment; 42 | "swapTokensForExactETH(uint256,uint256,address[],address,uint256)": FunctionFragment; 43 | "swapTokensForExactTokens(uint256,uint256,address[],address,uint256)": FunctionFragment; 44 | }; 45 | 46 | encodeFunctionData(functionFragment: "WETH", values?: undefined): string; 47 | encodeFunctionData( 48 | functionFragment: "addLiquidity", 49 | values: [ 50 | string, 51 | string, 52 | BigNumberish, 53 | BigNumberish, 54 | BigNumberish, 55 | BigNumberish, 56 | string, 57 | BigNumberish 58 | ] 59 | ): string; 60 | encodeFunctionData( 61 | functionFragment: "addLiquidityETH", 62 | values: [ 63 | string, 64 | BigNumberish, 65 | BigNumberish, 66 | BigNumberish, 67 | string, 68 | BigNumberish 69 | ] 70 | ): string; 71 | encodeFunctionData(functionFragment: "factory", values?: undefined): string; 72 | encodeFunctionData( 73 | functionFragment: "getAmountIn", 74 | values: [BigNumberish, BigNumberish, BigNumberish] 75 | ): string; 76 | encodeFunctionData( 77 | functionFragment: "getAmountOut", 78 | values: [BigNumberish, BigNumberish, BigNumberish] 79 | ): string; 80 | encodeFunctionData( 81 | functionFragment: "getAmountsIn", 82 | values: [BigNumberish, string[]] 83 | ): string; 84 | encodeFunctionData( 85 | functionFragment: "getAmountsOut", 86 | values: [BigNumberish, string[]] 87 | ): string; 88 | encodeFunctionData( 89 | functionFragment: "quote", 90 | values: [BigNumberish, BigNumberish, BigNumberish] 91 | ): string; 92 | encodeFunctionData( 93 | functionFragment: "removeLiquidity", 94 | values: [ 95 | string, 96 | string, 97 | BigNumberish, 98 | BigNumberish, 99 | BigNumberish, 100 | string, 101 | BigNumberish 102 | ] 103 | ): string; 104 | encodeFunctionData( 105 | functionFragment: "removeLiquidityETH", 106 | values: [ 107 | string, 108 | BigNumberish, 109 | BigNumberish, 110 | BigNumberish, 111 | string, 112 | BigNumberish 113 | ] 114 | ): string; 115 | encodeFunctionData( 116 | functionFragment: "removeLiquidityETHWithPermit", 117 | values: [ 118 | string, 119 | BigNumberish, 120 | BigNumberish, 121 | BigNumberish, 122 | string, 123 | BigNumberish, 124 | boolean, 125 | BigNumberish, 126 | BytesLike, 127 | BytesLike 128 | ] 129 | ): string; 130 | encodeFunctionData( 131 | functionFragment: "removeLiquidityWithPermit", 132 | values: [ 133 | string, 134 | string, 135 | BigNumberish, 136 | BigNumberish, 137 | BigNumberish, 138 | string, 139 | BigNumberish, 140 | boolean, 141 | BigNumberish, 142 | BytesLike, 143 | BytesLike 144 | ] 145 | ): string; 146 | encodeFunctionData( 147 | functionFragment: "swapETHForExactTokens", 148 | values: [BigNumberish, string[], string, BigNumberish] 149 | ): string; 150 | encodeFunctionData( 151 | functionFragment: "swapExactETHForTokens", 152 | values: [BigNumberish, string[], string, BigNumberish] 153 | ): string; 154 | encodeFunctionData( 155 | functionFragment: "swapExactTokensForETH", 156 | values: [BigNumberish, BigNumberish, string[], string, BigNumberish] 157 | ): string; 158 | encodeFunctionData( 159 | functionFragment: "swapExactTokensForTokens", 160 | values: [BigNumberish, BigNumberish, string[], string, BigNumberish] 161 | ): string; 162 | encodeFunctionData( 163 | functionFragment: "swapTokensForExactETH", 164 | values: [BigNumberish, BigNumberish, string[], string, BigNumberish] 165 | ): string; 166 | encodeFunctionData( 167 | functionFragment: "swapTokensForExactTokens", 168 | values: [BigNumberish, BigNumberish, string[], string, BigNumberish] 169 | ): string; 170 | 171 | decodeFunctionResult(functionFragment: "WETH", data: BytesLike): Result; 172 | decodeFunctionResult( 173 | functionFragment: "addLiquidity", 174 | data: BytesLike 175 | ): Result; 176 | decodeFunctionResult( 177 | functionFragment: "addLiquidityETH", 178 | data: BytesLike 179 | ): Result; 180 | decodeFunctionResult(functionFragment: "factory", data: BytesLike): Result; 181 | decodeFunctionResult( 182 | functionFragment: "getAmountIn", 183 | data: BytesLike 184 | ): Result; 185 | decodeFunctionResult( 186 | functionFragment: "getAmountOut", 187 | data: BytesLike 188 | ): Result; 189 | decodeFunctionResult( 190 | functionFragment: "getAmountsIn", 191 | data: BytesLike 192 | ): Result; 193 | decodeFunctionResult( 194 | functionFragment: "getAmountsOut", 195 | data: BytesLike 196 | ): Result; 197 | decodeFunctionResult(functionFragment: "quote", data: BytesLike): Result; 198 | decodeFunctionResult( 199 | functionFragment: "removeLiquidity", 200 | data: BytesLike 201 | ): Result; 202 | decodeFunctionResult( 203 | functionFragment: "removeLiquidityETH", 204 | data: BytesLike 205 | ): Result; 206 | decodeFunctionResult( 207 | functionFragment: "removeLiquidityETHWithPermit", 208 | data: BytesLike 209 | ): Result; 210 | decodeFunctionResult( 211 | functionFragment: "removeLiquidityWithPermit", 212 | data: BytesLike 213 | ): Result; 214 | decodeFunctionResult( 215 | functionFragment: "swapETHForExactTokens", 216 | data: BytesLike 217 | ): Result; 218 | decodeFunctionResult( 219 | functionFragment: "swapExactETHForTokens", 220 | data: BytesLike 221 | ): Result; 222 | decodeFunctionResult( 223 | functionFragment: "swapExactTokensForETH", 224 | data: BytesLike 225 | ): Result; 226 | decodeFunctionResult( 227 | functionFragment: "swapExactTokensForTokens", 228 | data: BytesLike 229 | ): Result; 230 | decodeFunctionResult( 231 | functionFragment: "swapTokensForExactETH", 232 | data: BytesLike 233 | ): Result; 234 | decodeFunctionResult( 235 | functionFragment: "swapTokensForExactTokens", 236 | data: BytesLike 237 | ): Result; 238 | 239 | events: {}; 240 | } 241 | 242 | export class IUniswapV2Router01 extends BaseContract { 243 | connect(signerOrProvider: Signer | Provider | string): this; 244 | attach(addressOrName: string): this; 245 | deployed(): Promise; 246 | 247 | listeners, EventArgsObject>( 248 | eventFilter?: TypedEventFilter 249 | ): Array>; 250 | off, EventArgsObject>( 251 | eventFilter: TypedEventFilter, 252 | listener: TypedListener 253 | ): this; 254 | on, EventArgsObject>( 255 | eventFilter: TypedEventFilter, 256 | listener: TypedListener 257 | ): this; 258 | once, EventArgsObject>( 259 | eventFilter: TypedEventFilter, 260 | listener: TypedListener 261 | ): this; 262 | removeListener, EventArgsObject>( 263 | eventFilter: TypedEventFilter, 264 | listener: TypedListener 265 | ): this; 266 | removeAllListeners, EventArgsObject>( 267 | eventFilter: TypedEventFilter 268 | ): this; 269 | 270 | listeners(eventName?: string): Array; 271 | off(eventName: string, listener: Listener): this; 272 | on(eventName: string, listener: Listener): this; 273 | once(eventName: string, listener: Listener): this; 274 | removeListener(eventName: string, listener: Listener): this; 275 | removeAllListeners(eventName?: string): this; 276 | 277 | queryFilter, EventArgsObject>( 278 | event: TypedEventFilter, 279 | fromBlockOrBlockhash?: string | number | undefined, 280 | toBlock?: string | number | undefined 281 | ): Promise>>; 282 | 283 | interface: IUniswapV2Router01Interface; 284 | 285 | functions: { 286 | WETH(overrides?: CallOverrides): Promise<[string]>; 287 | 288 | addLiquidity( 289 | tokenA: string, 290 | tokenB: string, 291 | amountADesired: BigNumberish, 292 | amountBDesired: BigNumberish, 293 | amountAMin: BigNumberish, 294 | amountBMin: BigNumberish, 295 | to: string, 296 | deadline: BigNumberish, 297 | overrides?: Overrides & { from?: string | Promise } 298 | ): Promise; 299 | 300 | addLiquidityETH( 301 | token: string, 302 | amountTokenDesired: BigNumberish, 303 | amountTokenMin: BigNumberish, 304 | amountETHMin: BigNumberish, 305 | to: string, 306 | deadline: BigNumberish, 307 | overrides?: PayableOverrides & { from?: string | Promise } 308 | ): Promise; 309 | 310 | factory(overrides?: CallOverrides): Promise<[string]>; 311 | 312 | getAmountIn( 313 | amountOut: BigNumberish, 314 | reserveIn: BigNumberish, 315 | reserveOut: BigNumberish, 316 | overrides?: CallOverrides 317 | ): Promise<[BigNumber] & { amountIn: BigNumber }>; 318 | 319 | getAmountOut( 320 | amountIn: BigNumberish, 321 | reserveIn: BigNumberish, 322 | reserveOut: BigNumberish, 323 | overrides?: CallOverrides 324 | ): Promise<[BigNumber] & { amountOut: BigNumber }>; 325 | 326 | getAmountsIn( 327 | amountOut: BigNumberish, 328 | path: string[], 329 | overrides?: CallOverrides 330 | ): Promise<[BigNumber[]] & { amounts: BigNumber[] }>; 331 | 332 | getAmountsOut( 333 | amountIn: BigNumberish, 334 | path: string[], 335 | overrides?: CallOverrides 336 | ): Promise<[BigNumber[]] & { amounts: BigNumber[] }>; 337 | 338 | quote( 339 | amountA: BigNumberish, 340 | reserveA: BigNumberish, 341 | reserveB: BigNumberish, 342 | overrides?: CallOverrides 343 | ): Promise<[BigNumber] & { amountB: BigNumber }>; 344 | 345 | removeLiquidity( 346 | tokenA: string, 347 | tokenB: string, 348 | liquidity: BigNumberish, 349 | amountAMin: BigNumberish, 350 | amountBMin: BigNumberish, 351 | to: string, 352 | deadline: BigNumberish, 353 | overrides?: Overrides & { from?: string | Promise } 354 | ): Promise; 355 | 356 | removeLiquidityETH( 357 | token: string, 358 | liquidity: BigNumberish, 359 | amountTokenMin: BigNumberish, 360 | amountETHMin: BigNumberish, 361 | to: string, 362 | deadline: BigNumberish, 363 | overrides?: Overrides & { from?: string | Promise } 364 | ): Promise; 365 | 366 | removeLiquidityETHWithPermit( 367 | token: string, 368 | liquidity: BigNumberish, 369 | amountTokenMin: BigNumberish, 370 | amountETHMin: BigNumberish, 371 | to: string, 372 | deadline: BigNumberish, 373 | approveMax: boolean, 374 | v: BigNumberish, 375 | r: BytesLike, 376 | s: BytesLike, 377 | overrides?: Overrides & { from?: string | Promise } 378 | ): Promise; 379 | 380 | removeLiquidityWithPermit( 381 | tokenA: string, 382 | tokenB: string, 383 | liquidity: BigNumberish, 384 | amountAMin: BigNumberish, 385 | amountBMin: BigNumberish, 386 | to: string, 387 | deadline: BigNumberish, 388 | approveMax: boolean, 389 | v: BigNumberish, 390 | r: BytesLike, 391 | s: BytesLike, 392 | overrides?: Overrides & { from?: string | Promise } 393 | ): Promise; 394 | 395 | swapETHForExactTokens( 396 | amountOut: BigNumberish, 397 | path: string[], 398 | to: string, 399 | deadline: BigNumberish, 400 | overrides?: PayableOverrides & { from?: string | Promise } 401 | ): Promise; 402 | 403 | swapExactETHForTokens( 404 | amountOutMin: BigNumberish, 405 | path: string[], 406 | to: string, 407 | deadline: BigNumberish, 408 | overrides?: PayableOverrides & { from?: string | Promise } 409 | ): Promise; 410 | 411 | swapExactTokensForETH( 412 | amountIn: BigNumberish, 413 | amountOutMin: BigNumberish, 414 | path: string[], 415 | to: string, 416 | deadline: BigNumberish, 417 | overrides?: Overrides & { from?: string | Promise } 418 | ): Promise; 419 | 420 | swapExactTokensForTokens( 421 | amountIn: BigNumberish, 422 | amountOutMin: BigNumberish, 423 | path: string[], 424 | to: string, 425 | deadline: BigNumberish, 426 | overrides?: Overrides & { from?: string | Promise } 427 | ): Promise; 428 | 429 | swapTokensForExactETH( 430 | amountOut: BigNumberish, 431 | amountInMax: BigNumberish, 432 | path: string[], 433 | to: string, 434 | deadline: BigNumberish, 435 | overrides?: Overrides & { from?: string | Promise } 436 | ): Promise; 437 | 438 | swapTokensForExactTokens( 439 | amountOut: BigNumberish, 440 | amountInMax: BigNumberish, 441 | path: string[], 442 | to: string, 443 | deadline: BigNumberish, 444 | overrides?: Overrides & { from?: string | Promise } 445 | ): Promise; 446 | }; 447 | 448 | WETH(overrides?: CallOverrides): Promise; 449 | 450 | addLiquidity( 451 | tokenA: string, 452 | tokenB: string, 453 | amountADesired: BigNumberish, 454 | amountBDesired: BigNumberish, 455 | amountAMin: BigNumberish, 456 | amountBMin: BigNumberish, 457 | to: string, 458 | deadline: BigNumberish, 459 | overrides?: Overrides & { from?: string | Promise } 460 | ): Promise; 461 | 462 | addLiquidityETH( 463 | token: string, 464 | amountTokenDesired: BigNumberish, 465 | amountTokenMin: BigNumberish, 466 | amountETHMin: BigNumberish, 467 | to: string, 468 | deadline: BigNumberish, 469 | overrides?: PayableOverrides & { from?: string | Promise } 470 | ): Promise; 471 | 472 | factory(overrides?: CallOverrides): Promise; 473 | 474 | getAmountIn( 475 | amountOut: BigNumberish, 476 | reserveIn: BigNumberish, 477 | reserveOut: BigNumberish, 478 | overrides?: CallOverrides 479 | ): Promise; 480 | 481 | getAmountOut( 482 | amountIn: BigNumberish, 483 | reserveIn: BigNumberish, 484 | reserveOut: BigNumberish, 485 | overrides?: CallOverrides 486 | ): Promise; 487 | 488 | getAmountsIn( 489 | amountOut: BigNumberish, 490 | path: string[], 491 | overrides?: CallOverrides 492 | ): Promise; 493 | 494 | getAmountsOut( 495 | amountIn: BigNumberish, 496 | path: string[], 497 | overrides?: CallOverrides 498 | ): Promise; 499 | 500 | quote( 501 | amountA: BigNumberish, 502 | reserveA: BigNumberish, 503 | reserveB: BigNumberish, 504 | overrides?: CallOverrides 505 | ): Promise; 506 | 507 | removeLiquidity( 508 | tokenA: string, 509 | tokenB: string, 510 | liquidity: BigNumberish, 511 | amountAMin: BigNumberish, 512 | amountBMin: BigNumberish, 513 | to: string, 514 | deadline: BigNumberish, 515 | overrides?: Overrides & { from?: string | Promise } 516 | ): Promise; 517 | 518 | removeLiquidityETH( 519 | token: string, 520 | liquidity: BigNumberish, 521 | amountTokenMin: BigNumberish, 522 | amountETHMin: BigNumberish, 523 | to: string, 524 | deadline: BigNumberish, 525 | overrides?: Overrides & { from?: string | Promise } 526 | ): Promise; 527 | 528 | removeLiquidityETHWithPermit( 529 | token: string, 530 | liquidity: BigNumberish, 531 | amountTokenMin: BigNumberish, 532 | amountETHMin: BigNumberish, 533 | to: string, 534 | deadline: BigNumberish, 535 | approveMax: boolean, 536 | v: BigNumberish, 537 | r: BytesLike, 538 | s: BytesLike, 539 | overrides?: Overrides & { from?: string | Promise } 540 | ): Promise; 541 | 542 | removeLiquidityWithPermit( 543 | tokenA: string, 544 | tokenB: string, 545 | liquidity: BigNumberish, 546 | amountAMin: BigNumberish, 547 | amountBMin: BigNumberish, 548 | to: string, 549 | deadline: BigNumberish, 550 | approveMax: boolean, 551 | v: BigNumberish, 552 | r: BytesLike, 553 | s: BytesLike, 554 | overrides?: Overrides & { from?: string | Promise } 555 | ): Promise; 556 | 557 | swapETHForExactTokens( 558 | amountOut: BigNumberish, 559 | path: string[], 560 | to: string, 561 | deadline: BigNumberish, 562 | overrides?: PayableOverrides & { from?: string | Promise } 563 | ): Promise; 564 | 565 | swapExactETHForTokens( 566 | amountOutMin: BigNumberish, 567 | path: string[], 568 | to: string, 569 | deadline: BigNumberish, 570 | overrides?: PayableOverrides & { from?: string | Promise } 571 | ): Promise; 572 | 573 | swapExactTokensForETH( 574 | amountIn: BigNumberish, 575 | amountOutMin: BigNumberish, 576 | path: string[], 577 | to: string, 578 | deadline: BigNumberish, 579 | overrides?: Overrides & { from?: string | Promise } 580 | ): Promise; 581 | 582 | swapExactTokensForTokens( 583 | amountIn: BigNumberish, 584 | amountOutMin: BigNumberish, 585 | path: string[], 586 | to: string, 587 | deadline: BigNumberish, 588 | overrides?: Overrides & { from?: string | Promise } 589 | ): Promise; 590 | 591 | swapTokensForExactETH( 592 | amountOut: BigNumberish, 593 | amountInMax: BigNumberish, 594 | path: string[], 595 | to: string, 596 | deadline: BigNumberish, 597 | overrides?: Overrides & { from?: string | Promise } 598 | ): Promise; 599 | 600 | swapTokensForExactTokens( 601 | amountOut: BigNumberish, 602 | amountInMax: BigNumberish, 603 | path: string[], 604 | to: string, 605 | deadline: BigNumberish, 606 | overrides?: Overrides & { from?: string | Promise } 607 | ): Promise; 608 | 609 | callStatic: { 610 | WETH(overrides?: CallOverrides): Promise; 611 | 612 | addLiquidity( 613 | tokenA: string, 614 | tokenB: string, 615 | amountADesired: BigNumberish, 616 | amountBDesired: BigNumberish, 617 | amountAMin: BigNumberish, 618 | amountBMin: BigNumberish, 619 | to: string, 620 | deadline: BigNumberish, 621 | overrides?: CallOverrides 622 | ): Promise< 623 | [BigNumber, BigNumber, BigNumber] & { 624 | amountA: BigNumber; 625 | amountB: BigNumber; 626 | liquidity: BigNumber; 627 | } 628 | >; 629 | 630 | addLiquidityETH( 631 | token: string, 632 | amountTokenDesired: BigNumberish, 633 | amountTokenMin: BigNumberish, 634 | amountETHMin: BigNumberish, 635 | to: string, 636 | deadline: BigNumberish, 637 | overrides?: CallOverrides 638 | ): Promise< 639 | [BigNumber, BigNumber, BigNumber] & { 640 | amountToken: BigNumber; 641 | amountETH: BigNumber; 642 | liquidity: BigNumber; 643 | } 644 | >; 645 | 646 | factory(overrides?: CallOverrides): Promise; 647 | 648 | getAmountIn( 649 | amountOut: BigNumberish, 650 | reserveIn: BigNumberish, 651 | reserveOut: BigNumberish, 652 | overrides?: CallOverrides 653 | ): Promise; 654 | 655 | getAmountOut( 656 | amountIn: BigNumberish, 657 | reserveIn: BigNumberish, 658 | reserveOut: BigNumberish, 659 | overrides?: CallOverrides 660 | ): Promise; 661 | 662 | getAmountsIn( 663 | amountOut: BigNumberish, 664 | path: string[], 665 | overrides?: CallOverrides 666 | ): Promise; 667 | 668 | getAmountsOut( 669 | amountIn: BigNumberish, 670 | path: string[], 671 | overrides?: CallOverrides 672 | ): Promise; 673 | 674 | quote( 675 | amountA: BigNumberish, 676 | reserveA: BigNumberish, 677 | reserveB: BigNumberish, 678 | overrides?: CallOverrides 679 | ): Promise; 680 | 681 | removeLiquidity( 682 | tokenA: string, 683 | tokenB: string, 684 | liquidity: BigNumberish, 685 | amountAMin: BigNumberish, 686 | amountBMin: BigNumberish, 687 | to: string, 688 | deadline: BigNumberish, 689 | overrides?: CallOverrides 690 | ): Promise< 691 | [BigNumber, BigNumber] & { amountA: BigNumber; amountB: BigNumber } 692 | >; 693 | 694 | removeLiquidityETH( 695 | token: string, 696 | liquidity: BigNumberish, 697 | amountTokenMin: BigNumberish, 698 | amountETHMin: BigNumberish, 699 | to: string, 700 | deadline: BigNumberish, 701 | overrides?: CallOverrides 702 | ): Promise< 703 | [BigNumber, BigNumber] & { amountToken: BigNumber; amountETH: BigNumber } 704 | >; 705 | 706 | removeLiquidityETHWithPermit( 707 | token: string, 708 | liquidity: BigNumberish, 709 | amountTokenMin: BigNumberish, 710 | amountETHMin: BigNumberish, 711 | to: string, 712 | deadline: BigNumberish, 713 | approveMax: boolean, 714 | v: BigNumberish, 715 | r: BytesLike, 716 | s: BytesLike, 717 | overrides?: CallOverrides 718 | ): Promise< 719 | [BigNumber, BigNumber] & { amountToken: BigNumber; amountETH: BigNumber } 720 | >; 721 | 722 | removeLiquidityWithPermit( 723 | tokenA: string, 724 | tokenB: string, 725 | liquidity: BigNumberish, 726 | amountAMin: BigNumberish, 727 | amountBMin: BigNumberish, 728 | to: string, 729 | deadline: BigNumberish, 730 | approveMax: boolean, 731 | v: BigNumberish, 732 | r: BytesLike, 733 | s: BytesLike, 734 | overrides?: CallOverrides 735 | ): Promise< 736 | [BigNumber, BigNumber] & { amountA: BigNumber; amountB: BigNumber } 737 | >; 738 | 739 | swapETHForExactTokens( 740 | amountOut: BigNumberish, 741 | path: string[], 742 | to: string, 743 | deadline: BigNumberish, 744 | overrides?: CallOverrides 745 | ): Promise; 746 | 747 | swapExactETHForTokens( 748 | amountOutMin: BigNumberish, 749 | path: string[], 750 | to: string, 751 | deadline: BigNumberish, 752 | overrides?: CallOverrides 753 | ): Promise; 754 | 755 | swapExactTokensForETH( 756 | amountIn: BigNumberish, 757 | amountOutMin: BigNumberish, 758 | path: string[], 759 | to: string, 760 | deadline: BigNumberish, 761 | overrides?: CallOverrides 762 | ): Promise; 763 | 764 | swapExactTokensForTokens( 765 | amountIn: BigNumberish, 766 | amountOutMin: BigNumberish, 767 | path: string[], 768 | to: string, 769 | deadline: BigNumberish, 770 | overrides?: CallOverrides 771 | ): Promise; 772 | 773 | swapTokensForExactETH( 774 | amountOut: BigNumberish, 775 | amountInMax: BigNumberish, 776 | path: string[], 777 | to: string, 778 | deadline: BigNumberish, 779 | overrides?: CallOverrides 780 | ): Promise; 781 | 782 | swapTokensForExactTokens( 783 | amountOut: BigNumberish, 784 | amountInMax: BigNumberish, 785 | path: string[], 786 | to: string, 787 | deadline: BigNumberish, 788 | overrides?: CallOverrides 789 | ): Promise; 790 | }; 791 | 792 | filters: {}; 793 | 794 | estimateGas: { 795 | WETH(overrides?: CallOverrides): Promise; 796 | 797 | addLiquidity( 798 | tokenA: string, 799 | tokenB: string, 800 | amountADesired: BigNumberish, 801 | amountBDesired: BigNumberish, 802 | amountAMin: BigNumberish, 803 | amountBMin: BigNumberish, 804 | to: string, 805 | deadline: BigNumberish, 806 | overrides?: Overrides & { from?: string | Promise } 807 | ): Promise; 808 | 809 | addLiquidityETH( 810 | token: string, 811 | amountTokenDesired: BigNumberish, 812 | amountTokenMin: BigNumberish, 813 | amountETHMin: BigNumberish, 814 | to: string, 815 | deadline: BigNumberish, 816 | overrides?: PayableOverrides & { from?: string | Promise } 817 | ): Promise; 818 | 819 | factory(overrides?: CallOverrides): Promise; 820 | 821 | getAmountIn( 822 | amountOut: BigNumberish, 823 | reserveIn: BigNumberish, 824 | reserveOut: BigNumberish, 825 | overrides?: CallOverrides 826 | ): Promise; 827 | 828 | getAmountOut( 829 | amountIn: BigNumberish, 830 | reserveIn: BigNumberish, 831 | reserveOut: BigNumberish, 832 | overrides?: CallOverrides 833 | ): Promise; 834 | 835 | getAmountsIn( 836 | amountOut: BigNumberish, 837 | path: string[], 838 | overrides?: CallOverrides 839 | ): Promise; 840 | 841 | getAmountsOut( 842 | amountIn: BigNumberish, 843 | path: string[], 844 | overrides?: CallOverrides 845 | ): Promise; 846 | 847 | quote( 848 | amountA: BigNumberish, 849 | reserveA: BigNumberish, 850 | reserveB: BigNumberish, 851 | overrides?: CallOverrides 852 | ): Promise; 853 | 854 | removeLiquidity( 855 | tokenA: string, 856 | tokenB: string, 857 | liquidity: BigNumberish, 858 | amountAMin: BigNumberish, 859 | amountBMin: BigNumberish, 860 | to: string, 861 | deadline: BigNumberish, 862 | overrides?: Overrides & { from?: string | Promise } 863 | ): Promise; 864 | 865 | removeLiquidityETH( 866 | token: string, 867 | liquidity: BigNumberish, 868 | amountTokenMin: BigNumberish, 869 | amountETHMin: BigNumberish, 870 | to: string, 871 | deadline: BigNumberish, 872 | overrides?: Overrides & { from?: string | Promise } 873 | ): Promise; 874 | 875 | removeLiquidityETHWithPermit( 876 | token: string, 877 | liquidity: BigNumberish, 878 | amountTokenMin: BigNumberish, 879 | amountETHMin: BigNumberish, 880 | to: string, 881 | deadline: BigNumberish, 882 | approveMax: boolean, 883 | v: BigNumberish, 884 | r: BytesLike, 885 | s: BytesLike, 886 | overrides?: Overrides & { from?: string | Promise } 887 | ): Promise; 888 | 889 | removeLiquidityWithPermit( 890 | tokenA: string, 891 | tokenB: string, 892 | liquidity: BigNumberish, 893 | amountAMin: BigNumberish, 894 | amountBMin: BigNumberish, 895 | to: string, 896 | deadline: BigNumberish, 897 | approveMax: boolean, 898 | v: BigNumberish, 899 | r: BytesLike, 900 | s: BytesLike, 901 | overrides?: Overrides & { from?: string | Promise } 902 | ): Promise; 903 | 904 | swapETHForExactTokens( 905 | amountOut: BigNumberish, 906 | path: string[], 907 | to: string, 908 | deadline: BigNumberish, 909 | overrides?: PayableOverrides & { from?: string | Promise } 910 | ): Promise; 911 | 912 | swapExactETHForTokens( 913 | amountOutMin: BigNumberish, 914 | path: string[], 915 | to: string, 916 | deadline: BigNumberish, 917 | overrides?: PayableOverrides & { from?: string | Promise } 918 | ): Promise; 919 | 920 | swapExactTokensForETH( 921 | amountIn: BigNumberish, 922 | amountOutMin: BigNumberish, 923 | path: string[], 924 | to: string, 925 | deadline: BigNumberish, 926 | overrides?: Overrides & { from?: string | Promise } 927 | ): Promise; 928 | 929 | swapExactTokensForTokens( 930 | amountIn: BigNumberish, 931 | amountOutMin: BigNumberish, 932 | path: string[], 933 | to: string, 934 | deadline: BigNumberish, 935 | overrides?: Overrides & { from?: string | Promise } 936 | ): Promise; 937 | 938 | swapTokensForExactETH( 939 | amountOut: BigNumberish, 940 | amountInMax: BigNumberish, 941 | path: string[], 942 | to: string, 943 | deadline: BigNumberish, 944 | overrides?: Overrides & { from?: string | Promise } 945 | ): Promise; 946 | 947 | swapTokensForExactTokens( 948 | amountOut: BigNumberish, 949 | amountInMax: BigNumberish, 950 | path: string[], 951 | to: string, 952 | deadline: BigNumberish, 953 | overrides?: Overrides & { from?: string | Promise } 954 | ): Promise; 955 | }; 956 | 957 | populateTransaction: { 958 | WETH(overrides?: CallOverrides): Promise; 959 | 960 | addLiquidity( 961 | tokenA: string, 962 | tokenB: string, 963 | amountADesired: BigNumberish, 964 | amountBDesired: BigNumberish, 965 | amountAMin: BigNumberish, 966 | amountBMin: BigNumberish, 967 | to: string, 968 | deadline: BigNumberish, 969 | overrides?: Overrides & { from?: string | Promise } 970 | ): Promise; 971 | 972 | addLiquidityETH( 973 | token: string, 974 | amountTokenDesired: BigNumberish, 975 | amountTokenMin: BigNumberish, 976 | amountETHMin: BigNumberish, 977 | to: string, 978 | deadline: BigNumberish, 979 | overrides?: PayableOverrides & { from?: string | Promise } 980 | ): Promise; 981 | 982 | factory(overrides?: CallOverrides): Promise; 983 | 984 | getAmountIn( 985 | amountOut: BigNumberish, 986 | reserveIn: BigNumberish, 987 | reserveOut: BigNumberish, 988 | overrides?: CallOverrides 989 | ): Promise; 990 | 991 | getAmountOut( 992 | amountIn: BigNumberish, 993 | reserveIn: BigNumberish, 994 | reserveOut: BigNumberish, 995 | overrides?: CallOverrides 996 | ): Promise; 997 | 998 | getAmountsIn( 999 | amountOut: BigNumberish, 1000 | path: string[], 1001 | overrides?: CallOverrides 1002 | ): Promise; 1003 | 1004 | getAmountsOut( 1005 | amountIn: BigNumberish, 1006 | path: string[], 1007 | overrides?: CallOverrides 1008 | ): Promise; 1009 | 1010 | quote( 1011 | amountA: BigNumberish, 1012 | reserveA: BigNumberish, 1013 | reserveB: BigNumberish, 1014 | overrides?: CallOverrides 1015 | ): Promise; 1016 | 1017 | removeLiquidity( 1018 | tokenA: string, 1019 | tokenB: string, 1020 | liquidity: BigNumberish, 1021 | amountAMin: BigNumberish, 1022 | amountBMin: BigNumberish, 1023 | to: string, 1024 | deadline: BigNumberish, 1025 | overrides?: Overrides & { from?: string | Promise } 1026 | ): Promise; 1027 | 1028 | removeLiquidityETH( 1029 | token: string, 1030 | liquidity: BigNumberish, 1031 | amountTokenMin: BigNumberish, 1032 | amountETHMin: BigNumberish, 1033 | to: string, 1034 | deadline: BigNumberish, 1035 | overrides?: Overrides & { from?: string | Promise } 1036 | ): Promise; 1037 | 1038 | removeLiquidityETHWithPermit( 1039 | token: string, 1040 | liquidity: BigNumberish, 1041 | amountTokenMin: BigNumberish, 1042 | amountETHMin: BigNumberish, 1043 | to: string, 1044 | deadline: BigNumberish, 1045 | approveMax: boolean, 1046 | v: BigNumberish, 1047 | r: BytesLike, 1048 | s: BytesLike, 1049 | overrides?: Overrides & { from?: string | Promise } 1050 | ): Promise; 1051 | 1052 | removeLiquidityWithPermit( 1053 | tokenA: string, 1054 | tokenB: string, 1055 | liquidity: BigNumberish, 1056 | amountAMin: BigNumberish, 1057 | amountBMin: BigNumberish, 1058 | to: string, 1059 | deadline: BigNumberish, 1060 | approveMax: boolean, 1061 | v: BigNumberish, 1062 | r: BytesLike, 1063 | s: BytesLike, 1064 | overrides?: Overrides & { from?: string | Promise } 1065 | ): Promise; 1066 | 1067 | swapETHForExactTokens( 1068 | amountOut: BigNumberish, 1069 | path: string[], 1070 | to: string, 1071 | deadline: BigNumberish, 1072 | overrides?: PayableOverrides & { from?: string | Promise } 1073 | ): Promise; 1074 | 1075 | swapExactETHForTokens( 1076 | amountOutMin: BigNumberish, 1077 | path: string[], 1078 | to: string, 1079 | deadline: BigNumberish, 1080 | overrides?: PayableOverrides & { from?: string | Promise } 1081 | ): Promise; 1082 | 1083 | swapExactTokensForETH( 1084 | amountIn: BigNumberish, 1085 | amountOutMin: BigNumberish, 1086 | path: string[], 1087 | to: string, 1088 | deadline: BigNumberish, 1089 | overrides?: Overrides & { from?: string | Promise } 1090 | ): Promise; 1091 | 1092 | swapExactTokensForTokens( 1093 | amountIn: BigNumberish, 1094 | amountOutMin: BigNumberish, 1095 | path: string[], 1096 | to: string, 1097 | deadline: BigNumberish, 1098 | overrides?: Overrides & { from?: string | Promise } 1099 | ): Promise; 1100 | 1101 | swapTokensForExactETH( 1102 | amountOut: BigNumberish, 1103 | amountInMax: BigNumberish, 1104 | path: string[], 1105 | to: string, 1106 | deadline: BigNumberish, 1107 | overrides?: Overrides & { from?: string | Promise } 1108 | ): Promise; 1109 | 1110 | swapTokensForExactTokens( 1111 | amountOut: BigNumberish, 1112 | amountInMax: BigNumberish, 1113 | path: string[], 1114 | to: string, 1115 | deadline: BigNumberish, 1116 | overrides?: Overrides & { from?: string | Promise } 1117 | ): Promise; 1118 | }; 1119 | } 1120 | --------------------------------------------------------------------------------