diff --git a/src/adaptors/wild-base/index.js b/src/adaptors/wild-base/index.js new file mode 100644 index 0000000000..c730c8e084 --- /dev/null +++ b/src/adaptors/wild-base/index.js @@ -0,0 +1,364 @@ +const sdk = require('@defillama/sdk4'); +const { request, gql } = require('graphql-request'); +const masterchefAbi = require('./masterchef'); +const poolAbi = require('./poolAbi'); +const axios = require('axios'); +const BigNumber = require('bignumber.js'); + +const masterchef = '0x3eAB0C9716b0aA98CdC4c3ae317d69dE301ef247'; +const WILDx = '0xbCDa0bD6Cd83558DFb0EeC9153eD9C9cfa87782E'; +const WETH = '0x4200000000000000000000000000000000000006'; + +const utils = require('../utils'); + +const getPoolDetails = async (block, poolInfo, chainString) => { + const poolDetails = []; + + // console.log(poolInfo); + for (let i = 0; i < poolInfo.length; i++) { + // SKIP LP OF WILDx STANDALONE + if (poolInfo[i].lpToken != '0xbCDa0bD6Cd83558DFb0EeC9153eD9C9cfa87782E') { + const token0Id = ( + await sdk.api.abi.call({ + target: poolInfo[i].lpToken, + abi: poolAbi.find((m) => m.name === 'token0'), + chain: chainString, + }) + ).output; + const token0Symbol = ( + await sdk.api.abi.call({ + target: token0Id, + abi: poolAbi.find((m) => m.name === 'symbol'), + chain: chainString, + }) + ).output; + const token0Decimals = ( + await sdk.api.abi.call({ + target: token0Id, + abi: poolAbi.find((m) => m.name === 'decimals'), + chain: chainString, + }) + ).output; + const token1Id = ( + await sdk.api.abi.call({ + target: poolInfo[i].lpToken, + abi: poolAbi.find((m) => m.name === 'token1'), + chain: chainString, + }) + ).output; + const token1Symbol = ( + await sdk.api.abi.call({ + target: token1Id, + abi: poolAbi.find((m) => m.name === 'symbol'), + chain: chainString, + }) + ).output; + const token1Decimals = ( + await sdk.api.abi.call({ + target: token1Id, + abi: poolAbi.find((m) => m.name === 'decimals'), + chain: chainString, + }) + ).output; + + try { + const reserves = ( + await sdk.api.abi.call({ + target: poolInfo[i].lpToken, + abi: poolAbi.find((m) => m.name === 'getReserves'), + block: block, + chain: chainString, + }) + ).output; + + const lpDecimals = ( + await sdk.api.abi.call({ + target: poolInfo[i].lpToken, + abi: poolAbi.find((m) => m.name === 'decimals'), + block: block, + chain: chainString, + }) + ).output; + + const totalSupply = ( + await sdk.api.abi.call({ + target: poolInfo[i].lpToken, + abi: poolAbi.find((m) => m.name === 'totalSupply'), + block: block, + chain: chainString, + }) + ).output; + + poolDetails.push({ + id: poolInfo[i].lpToken, + reserve0: reserves._reserve0 / (1 * 10 ** token0Decimals), + reserve1: reserves._reserve1 / (1 * 10 ** token1Decimals), + totalSupply: totalSupply, + volumeUSD: 0, + token0: { + symbol: token0Symbol, + id: token0Id, + }, + token1: { + symbol: token1Symbol, + id: token1Id, + }, + }); + } catch (e) { + poolDetails.push({ + id: poolInfo[i].lpToken, + reserve0: 0, + reserve1: 0, + totalSupply: 0, + volumeUSD: 0, + token0: { + symbol: token0Symbol, + id: token0Id, + }, + token1: { + symbol: token1Symbol, + id: token1Id, + }, + }); + } + } else { + try { + const lpDecimals = ( + await sdk.api.abi.call({ + target: poolInfo[i].lpToken, + abi: poolAbi.find((m) => m.name === 'decimals'), + block: block, + chain: chainString, + }) + ).output; + + const totalSupply = ( + await sdk.api.abi.call({ + target: poolInfo[i].lpToken, + abi: poolAbi.find((m) => m.name === 'totalSupply'), + block: block, + chain: chainString, + }) + ).output; + + const tokenId = poolInfo[i].lpToken; + const tokenSymbol = 'WILDx'; + const tokenDecimals = 18; + + poolDetails.push({ + id: poolInfo[i].lpToken, + reserve0: 0, + reserve1: 0, + totalSupply: totalSupply, + volumeUSD: 0, + token0: { + symbol: tokenSymbol, + id: tokenId, + }, + token1: { + symbol: tokenSymbol, + id: tokenId, + }, + }); + } catch (e) { + poolDetails.push({ + id: poolInfo[i].lpToken, + reserve0: 0, + reserve1: 0, + totalSupply: 0, + volumeUSD: 0, + token0: { + symbol: token0Symbol, + id: token0Id, + }, + token1: { + symbol: token1Symbol, + id: token1Id, + }, + }); + } + } + } + + return poolDetails; +}; + +const topLv = async (chainString, version, timestamp) => { + const poolLength = ( + await sdk.api.abi.call({ + target: masterchef, + abi: masterchefAbi.find((m) => m.name === 'poolLength'), + chain: chainString, + }) + ).output; + + let poolInfo = ( + await sdk.api.abi.multiCall({ + calls: [...Array(Number(poolLength)).keys()].map((i) => ({ + target: masterchef, + params: [i], + })), + abi: masterchefAbi.find((m) => m.name === 'poolInfo'), + chain: chainString, + }) + ).output.map((o) => o.output); + + const exclude = ['0x4200000000000000000000000000000000000006', '0x79474223AEdD0339780baCcE75aBDa0BE84dcBF9']; + + poolInfo = poolInfo.filter( + (obj, index, self) => + index === self.findIndex((o) => o.lpToken === obj.lpToken) && + !exclude.includes(obj.lpToken) + ); + + + const WILDxTotalAllocPoint = ( + await sdk.api.abi.call({ + target: masterchef, + abi: masterchefAbi.find((m) => m.name === 'totalAllocPoint'), + chain: chainString, + }) + ).output; + const WILDxPerSec = + ( + await sdk.api.abi.call({ + target: masterchef, + abi: masterchefAbi.find((m) => m.name === 'wildxPerBlock'), + chain: chainString, + }) + ).output / 1e18; + + const wethPriceKey = `base:${WETH}`; + const wethPrice = ( + await axios.get(`https://coins.llama.fi/prices/current/${wethPriceKey}`) + ).data.coins[wethPriceKey]?.price; + + WILDxPrice = ( + await axios.get(`https://api.dexscreener.com/latest/dex/tokens/${WILDx}`) + ).data.pairs[0]?.priceUsd; + + const WILDxPerYearUsd = WILDxPerSec * 86400 * 365 * WILDxPrice; + + const [block, blockPrior] = await utils.getBlocks(chainString, timestamp, []); + + const [_, blockPrior7d] = await utils.getBlocks( + chainString, + timestamp, + [], + 604800 + ); + + // pull data + let dataNow = await getPoolDetails(block, poolInfo, chainString); + + // pull data 24h offest + let dataPrior = await getPoolDetails(blockPrior, poolInfo, chainString); + + // pull data 7d offest + let dataPrior7d = await getPoolDetails(blockPrior7d, poolInfo, chainString); + + const dataNowOriginal = dataNow.map((el) => JSON.parse(JSON.stringify(el))); + const dataNowCopy = dataNow.map((el) => JSON.parse(JSON.stringify(el))); + + dataNowCopy.forEach((pool) => { + if (pool.token0.id == '0xbCDa0bD6Cd83558DFb0EeC9153eD9C9cfa87782E') { + pool.token0.id = pool.token1.id; + pool.token0.symbol = pool.token1.symbol; + pool.reserve0 = pool.reserve1; + } else if (pool.token1.id == '0xbCDa0bD6Cd83558DFb0EeC9153eD9C9cfa87782E') { + pool.token1.id = pool.token0.id; + pool.token1.symbol = pool.token0.symbol; + pool.reserve1 = pool.reserve0; + } + }); + + // calculate tvl + dataNow = await utils.tvl(dataNowCopy, chainString); + + const dataNowUpdated = dataNowOriginal.map((obj1) => { + const isWILDxStake = obj1.id == WILDx; + const obj2 = dataNow.find((obj2) => obj2.id === obj1.id); + if (obj2) { + return { + ...obj1, + totalValueLockedUSD: isWILDxStake + ? (poolInfo[0].totalLp / 1e18) * WILDxPrice + : obj2.totalValueLockedUSD, + price0: isWILDxStake ? WILDxPrice : obj2.price0, + price1: isWILDxStake ? WILDxPrice : obj2.price1, + }; + } + return obj1; + }); + + console.log('dataNowUpdated', dataNowUpdated); + + // calculate apy + dataNow = dataNowUpdated.map((el) => + utils.apy(el, dataPrior, dataPrior7d, version) + ); + + dataNow = dataNow.map((p) => { + const isWILDxStake = p.id == WILDx; + const symbol = isWILDxStake + ? p.token0.symbol + : utils.formatSymbol(`${p.token0.symbol}-${p.token1.symbol}`); + const underlyingTokens = [p.token0.id]; + const token0 = underlyingTokens === undefined ? '' : underlyingTokens[0]; + const token1 = underlyingTokens === undefined ? '' : underlyingTokens[1]; + const chain = chainString; + const url = isWILDxStake + ? `https://pancakeswap.finance/swap` + : `https://pancakeswap.finance/add/${token0}/${token1}`; + + const WILDxAllocPoint = poolInfo.find( + (pid) => pid.lpToken.toLowerCase() === p.id?.toLowerCase() + )?.allocPoint; + + console.log(symbol, WILDxAllocPoint); + + let totalDeposit = poolInfo.find( + (pid) => pid.lpToken.toLowerCase() === p.id?.toLowerCase() + )?.totalDeposit; + totalDeposit = new BigNumber(totalDeposit) + .dividedBy(new BigNumber(10).pow(18)) + .toFixed(18); + const ratio = totalDeposit / p.totalSupply || 1; + + const WILDxBaseApy = + (((WILDxAllocPoint / WILDxTotalAllocPoint) * WILDxPerYearUsd) / + (p.totalValueLockedUSD * ratio)) * + 100; // deducted by fee as other aggeregator and app shows + + const apyReward = 0; + + return { + pool: p.id, + chain: utils.formatChain(chainString), + project: 'wild-base', + symbol, + tvlUsd: p.totalValueLockedUSD, + apyBase: WILDxBaseApy || 0, + apyBase7d: 0, + apyReward, + rewardTokens: apyReward > 0 || isWILDxStake ? [WILDx] : [], + underlyingTokens, + url, + volumeUsd1d: p?.volumeUSD1d || 0, + volumeUsd7d: p?.volumeUSD7d || 0, + }; + }); + + return dataNow; +}; + +const main = async (timestamp = Date.now() / 1000) => { + let data = await topLv('base', 'v3', timestamp); + + return data.filter((p) => utils.keepFinite(p)); +}; + +module.exports = { + timetravel: false, + apy: main, +}; diff --git a/src/adaptors/wild-base/masterchef.js b/src/adaptors/wild-base/masterchef.js new file mode 100644 index 0000000000..b7bfcac94f --- /dev/null +++ b/src/adaptors/wild-base/masterchef.js @@ -0,0 +1,634 @@ +module.exports = [ + { + "inputs": [ + { + "internalType": "contract WILDX", + "name": "_wildx", + "type": "address" + }, + { + "internalType": "address", + "name": "_devaddr", + "type": "address" + }, + { + "internalType": "address", + "name": "_feeAddress1", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_wildxPerBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_startBlock", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "EmergencyWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "pid", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "BONUS_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "_lpToken", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_depositFeeBP", + "type": "uint16" + }, + { + "internalType": "bool", + "name": "_withUpdate", + "type": "bool" + } + ], + "name": "add", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_isCompound", + "type": "bool" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_recipient", + "type": "address" + } + ], + "name": "depositFor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_devaddr", + "type": "address" + } + ], + "name": "dev", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "devaddr", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + } + ], + "name": "emergencyWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "feeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_from", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_to", + "type": "uint256" + } + ], + "name": "getMultiplier", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_pids", + "type": "uint256[]" + }, + { + "internalType": "bool", + "name": "_isCompound", + "type": "bool" + } + ], + "name": "harvestMany", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "massUpdatePools", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_user", + "type": "address" + } + ], + "name": "pendingWildx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "poolInfo", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "lpToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allocPoint", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastRewardBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accWildxPerShare", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "depositFeeBP", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_allocPoint", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "_depositFeeBP", + "type": "uint16" + }, + { + "internalType": "uint256", + "name": "_startBlock", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_withUpdate", + "type": "bool" + } + ], + "name": "set", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_feeAddress1", + "type": "address" + } + ], + "name": "setFeeAddress1", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_wildx", + "type": "address" + } + ], + "name": "setWildX", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_newPid", + "type": "uint256" + } + ], + "name": "setWildXPoolPid", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "startBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalAllocPoint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_wildxPerBlock", + "type": "uint256" + } + ], + "name": "updateEmissionRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + } + ], + "name": "updatePool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rewardDebt", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "wildPoolPId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "wildx", + "outputs": [ + { + "internalType": "contract WILDX", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "wildxPerBlock", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_pid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +]; diff --git a/src/adaptors/wild-base/poolAbi.js b/src/adaptors/wild-base/poolAbi.js new file mode 100644 index 0000000000..777420c721 --- /dev/null +++ b/src/adaptors/wild-base/poolAbi.js @@ -0,0 +1,435 @@ +module.exports = [ + { + inputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + ], + name: 'Burn', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1', + type: 'uint256', + }, + ], + name: 'Mint', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1In', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount0Out', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount1Out', + type: 'uint256', + }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + ], + name: 'Swap', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint112', + name: 'reserve0', + type: 'uint112', + }, + { + indexed: false, + internalType: 'uint112', + name: 'reserve1', + type: 'uint112', + }, + ], + name: 'Sync', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { indexed: true, internalType: 'address', name: 'from', type: 'address' }, + { indexed: true, internalType: 'address', name: 'to', type: 'address' }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + constant: true, + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'MINIMUM_LIQUIDITY', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'PERMIT_TYPEHASH', + outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { internalType: 'address', name: '', type: 'address' }, + { internalType: 'address', name: '', type: 'address' }, + ], + name: 'allowance', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'approve', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'balanceOf', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [{ internalType: 'address', name: 'to', type: 'address' }], + name: 'burn', + outputs: [ + { internalType: 'uint256', name: 'amount0', type: 'uint256' }, + { internalType: 'uint256', name: 'amount1', type: 'uint256' }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'decimals', + outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'factory', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'getReserves', + outputs: [ + { internalType: 'uint112', name: '_reserve0', type: 'uint112' }, + { internalType: 'uint112', name: '_reserve1', type: 'uint112' }, + { internalType: 'uint32', name: '_blockTimestampLast', type: 'uint32' }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: '_token0', type: 'address' }, + { internalType: 'address', name: '_token1', type: 'address' }, + ], + name: 'initialize', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'kLast', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [{ internalType: 'address', name: 'to', type: 'address' }], + name: 'mint', + outputs: [{ internalType: 'uint256', name: 'liquidity', type: 'uint256' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [{ internalType: 'address', name: '', type: 'address' }], + name: 'nonces', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: 'owner', type: 'address' }, + { internalType: 'address', name: 'spender', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + { internalType: 'uint256', name: 'deadline', type: 'uint256' }, + { internalType: 'uint8', name: 'v', type: 'uint8' }, + { internalType: 'bytes32', name: 'r', type: 'bytes32' }, + { internalType: 'bytes32', name: 's', type: 'bytes32' }, + ], + name: 'permit', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'price0CumulativeLast', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'price1CumulativeLast', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [{ internalType: 'address', name: 'to', type: 'address' }], + name: 'skim', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'uint256', name: 'amount0Out', type: 'uint256' }, + { internalType: 'uint256', name: 'amount1Out', type: 'uint256' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'bytes', name: 'data', type: 'bytes' }, + ], + name: 'swap', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [{ internalType: 'string', name: '', type: 'string' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'sync', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'token0', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'token1', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'transfer', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { internalType: 'address', name: 'from', type: 'address' }, + { internalType: 'address', name: 'to', type: 'address' }, + { internalType: 'uint256', name: 'value', type: 'uint256' }, + ], + name: 'transferFrom', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +];