From 18e3d7246d9048244ec4017f93f947c6164489b3 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Fri, 24 Dec 2021 14:30:34 +0300 Subject: [PATCH 01/24] feat: gaugeClaimableTokens --- src/constants/abis/json/gauge.json | 2 +- src/pools.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/constants/abis/json/gauge.json b/src/constants/abis/json/gauge.json index c31aa910..c809f6da 100644 --- a/src/constants/abis/json/gauge.json +++ b/src/constants/abis/json/gauge.json @@ -112,7 +112,7 @@ "name": "addr" } ], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function", "gas": "1998318" }, diff --git a/src/pools.ts b/src/pools.ts index 127b6041..575ee517 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -1025,6 +1025,13 @@ export class Pool { return (await curve.contracts[this.gauge].contract.withdraw(_lpTokenAmount, curve.options)).hash; } + public gaugeClaimableTokens = async (address = ""): Promise => { + address = address || curve.signerAddress; + if (!address) throw Error("Need to connect wallet or pass address into args"); + + return ethers.utils.formatUnits(await curve.contracts[this.gauge].contract.claimable_tokens(address, curve.options)); + } + public balances = async (...addresses: string[] | string[][]): Promise> | DictInterface> => { return await this._balances( ['lpToken', 'gauge', ...this.underlyingCoins, ...this.coins], From cefaaa35c648cfddde3119bc9d6ed0a4aecb9596 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Fri, 24 Dec 2021 15:27:03 +0300 Subject: [PATCH 02/24] chore: gitignore temp.test.ts --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b5935315..f26c5d63 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules dist/**/* lib/**/* package-lock.json +test/temp.test.ts \ No newline at end of file From 83417be0f5b4821c888777cbea746f8ff15fa7f7 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Sat, 25 Dec 2021 12:21:36 +0300 Subject: [PATCH 03/24] fix: gauges for min and crveth --- src/constants/abis/abis-ethereum.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constants/abis/abis-ethereum.ts b/src/constants/abis/abis-ethereum.ts index 4cdaa113..01746256 100644 --- a/src/constants/abis/abis-ethereum.ts +++ b/src/constants/abis/abis-ethereum.ts @@ -1437,7 +1437,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { is_plain: [true, true], swap_address: '0x5a6A4D54456819380173272A5E8E9B9904BdF41B', token_address: '0x5a6A4D54456819380173272A5E8E9B9904BdF41B', - gauge_address: '0xd4b22fedca85e684919955061fdf353b9d38389b', + gauge_address: '0xd8b712d29381748dB89c36BCa0138d7c75866ddF', underlying_coins: ['MIM', 'DAI', 'USDC', 'USDT'], coins: ['MIM', '3Crv'], underlying_coin_addresses: [ @@ -1582,7 +1582,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { coins: ['WETH', 'CRV'], swap_address: '0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511', token_address: '0xEd4064f376cB8d68F770FB1Ff088a3d0F3FF5c4d', - gauge_address: '0x936734ea750bb194ddb4892b191b6bd5c43a3985', // Fake pool address to prevent old multicalls from + gauge_address: '0x1cEBdB0856dd985fAe9b8fEa2262469360B8a3a6', underlying_coin_addresses: [ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', '0xD533a949740bb3306d119CC777fa900bA034cd52', From cc0600959017191d1eb53269536874c388ad2ee2 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Sat, 25 Dec 2021 12:23:33 +0300 Subject: [PATCH 04/24] feat: gaugeClaimTokens --- src/constants/abis/json/minter.json | 166 +++++++++++++++++++++++++++- src/constants/aliases.ts | 4 +- src/curve.ts | 11 ++ src/pools.ts | 7 +- 4 files changed, 185 insertions(+), 3 deletions(-) diff --git a/src/constants/abis/json/minter.json b/src/constants/abis/json/minter.json index 8ab09278..d04eeea3 100644 --- a/src/constants/abis/json/minter.json +++ b/src/constants/abis/json/minter.json @@ -1 +1,165 @@ -[{"name":"Minted","inputs":[{"type":"address","name":"recipient","indexed":true},{"type":"address","name":"gauge","indexed":false},{"type":"uint256","name":"minted","indexed":false}],"anonymous":false,"type":"event"},{"outputs":[],"inputs":[{"type":"address","name":"_token"},{"type":"address","name":"_controller"}],"stateMutability":"nonpayable","type":"constructor"},{"name":"mint","outputs":[],"inputs":[{"type":"address","name":"gauge_addr"}],"stateMutability":"nonpayable","type":"function","gas":"100038"},{"name":"mint_many","outputs":[],"inputs":[{"type":"address[8]","name":"gauge_addrs"}],"stateMutability":"nonpayable","type":"function","gas":"408502"},{"name":"mint_for","outputs":[],"inputs":[{"type":"address","name":"gauge_addr"},{"type":"address","name":"_for"}],"stateMutability":"nonpayable","type":"function","gas":"101219"},{"name":"toggle_approve_mint","outputs":[],"inputs":[{"type":"address","name":"minting_user"}],"stateMutability":"nonpayable","type":"function","gas":"36726"},{"name":"token","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1301"},{"name":"controller","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1331"},{"name":"minted","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"},{"type":"address","name":"arg1"}],"stateMutability":"view","type":"function","gas":"1669"},{"name":"allowed_to_mint_for","outputs":[{"type":"bool","name":""}],"inputs":[{"type":"address","name":"arg0"},{"type":"address","name":"arg1"}],"stateMutability":"view","type":"function","gas":"1699"}] +[ + { + "name": "Minted", + "inputs": [ + { + "type": "address", + "name": "recipient", + "indexed": true + }, + { + "type": "address", + "name": "gauge", + "indexed": false + }, + { + "type": "uint256", + "name": "minted", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "_token" + }, + { + "type": "address", + "name": "_controller" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "name": "mint", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "gauge_addr" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "2006304" + }, + { + "name": "mint_many", + "outputs": [], + "inputs": [ + { + "type": "address[8]", + "name": "gauge_addrs" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "408502" + }, + { + "name": "mint_for", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "gauge_addr" + }, + { + "type": "address", + "name": "_for" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "101219" + }, + { + "name": "toggle_approve_mint", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "minting_user" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "36726" + }, + { + "name": "token", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1301" + }, + { + "name": "controller", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1331" + }, + { + "name": "minted", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + }, + { + "type": "address", + "name": "arg1" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "1669" + }, + { + "name": "allowed_to_mint_for", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + }, + { + "type": "address", + "name": "arg1" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "1699" + } +] diff --git a/src/constants/aliases.ts b/src/constants/aliases.ts index 4cd75e65..51768d7b 100644 --- a/src/constants/aliases.ts +++ b/src/constants/aliases.ts @@ -1,5 +1,6 @@ export const ALIASES_ETHEREUM = { "crv": "0xD533a949740bb3306d119CC777fa900bA034cd52", + "minter": "0xd061D61a4d941c39E5453435B6345Dc261C2fcE0", "voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2", "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB", "address_provider": "0x0000000022d53366457f9d5e68ec105046fc4383", @@ -9,9 +10,10 @@ export const ALIASES_ETHEREUM = { export const ALIASES_POLYGON = { "crv": "0x172370d5cd63279efa6d502dab29171933a610af", + "minter": "", "voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2", "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB", "address_provider": "0x0000000022d53366457f9d5e68ec105046fc4383", "router": "0xfA9a30350048B2BF66865ee20363067c66f67e58", "registry_exchange": "", -} \ No newline at end of file +} diff --git a/src/curve.ts b/src/curve.ts index c4f5db12..1939c35e 100644 --- a/src/curve.ts +++ b/src/curve.ts @@ -5,6 +5,7 @@ import {PoolDataInterface, DictInterface} from "./interfaces"; import ERC20Abi from './constants/abis/json/ERC20.json'; import cERC20Abi from './constants/abis/json/cERC20.json'; import yERC20Abi from './constants/abis/json/yERC20.json'; +import minterABI from './constants/abis/json/minter.json'; import gaugeABI from './constants/abis/json/gauge.json'; import votingEscrowABI from './constants/abis/json/votingescrow.json'; import addressProviderABI from './constants/abis/json/address_provider.json'; @@ -74,6 +75,7 @@ export let DECIMALS_LOWER_CASE: DictInterface; export let ALIASES = { "crv": "0xD533a949740bb3306d119CC777fa900bA034cd52", + "minter": "0xd061D61a4d941c39E5453435B6345Dc261C2fcE0", "voting_escrow": "0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2", "gauge_controller": "0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB", "address_provider": "0x0000000022d53366457f9d5e68ec105046fc4383", @@ -338,6 +340,15 @@ class Curve { multicallContract: new MulticallContract(ALIASES.crv, ERC20Abi), }; + this.contracts[ALIASES.minter] = { + contract: new Contract(ALIASES.minter, minterABI, this.signer || this.provider), + multicallContract: new MulticallContract(ALIASES.minter, minterABI), + }; + this.contracts[ALIASES.minter.toLowerCase()] = { + contract: new Contract(ALIASES.minter, minterABI, this.signer || this.provider), + multicallContract: new MulticallContract(ALIASES.minter, minterABI), + }; + this.contracts[ALIASES.voting_escrow] = { contract: new Contract(ALIASES.voting_escrow, votingEscrowABI, this.signer || this.provider), multicallContract: new MulticallContract(ALIASES.voting_escrow, votingEscrowABI), diff --git a/src/pools.ts b/src/pools.ts index 575ee517..047339ae 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -1029,7 +1029,12 @@ export class Pool { address = address || curve.signerAddress; if (!address) throw Error("Need to connect wallet or pass address into args"); - return ethers.utils.formatUnits(await curve.contracts[this.gauge].contract.claimable_tokens(address, curve.options)); + return ethers.utils.formatUnits(await curve.contracts[this.gauge].contract.claimable_tokens(address, curve.constantOptions)); + } + + public gaugeClaimTokens = async (): Promise => { + const gasLimit = (await curve.contracts[ALIASES.minter].contract.estimateGas.mint(this.gauge, curve.constantOptions)).mul(130).div(100); + return (await curve.contracts[ALIASES.minter].contract.mint(this.gauge, { ...curve.options, gasLimit })).hash; } public balances = async (...addresses: string[] | string[][]): Promise> | DictInterface> => { From 54a50901762af8aee0f41ec77fcd5ab17954c68a Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Sat, 25 Dec 2021 12:24:08 +0300 Subject: [PATCH 05/24] test: claiming crv --- test/claim/claimCrv.test.ts | 49 +++++++++++++++++++++++++++++++++++++ test/claim/deposit.ts | 25 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 test/claim/claimCrv.test.ts create mode 100644 test/claim/deposit.ts diff --git a/test/claim/claimCrv.test.ts b/test/claim/claimCrv.test.ts new file mode 100644 index 00000000..acb900df --- /dev/null +++ b/test/claim/claimCrv.test.ts @@ -0,0 +1,49 @@ +import { assert } from "chai"; +import curve from "../../src/"; + +// ---------------- +// TO MAKE THIS TEST WORKING YOU NEED TO DO THESE STEPS FIRST +// +// 1. Run +// node deposit.js +// +// 2. Go to brownie console and run: +// chain.sleep(1000000) +// chain.mine(1) +// +// ---------------- + + +const PLAIN_POOLS = ['susd', 'ren', 'sbtc', 'hbtc', '3pool', 'seth', 'steth', 'ankreth', 'link', 'reth', 'eurt']; // Without eurs +const LENDING_POOLS = ['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib']; +const META_POOLS = ['gusd', 'husd', 'usdk', 'usdn', 'musd', 'rsv', 'tbtc', 'dusd', 'pbtc', 'bbtc', 'obtc', 'ust', 'usdp', 'tusd', 'frax', 'lusd', 'busdv2', 'alusd', 'mim']; +const CRYPTO_POOLS = ['tricrypto2', 'eurtusd', 'crveth', 'cvxeth']; +const ETHEREUM_POOLS = [...PLAIN_POOLS, ...LENDING_POOLS, ...META_POOLS, ...CRYPTO_POOLS]; + +const POLYGON_POOLS = ['aave', 'ren', 'atricrypto3', 'eurtusd']; + + +describe('Claiming CRV', function() { + this.timeout(120000); + + before(async function() { + await curve.init('JsonRpc', {}, { gasPrice: 0 }); + }); + + for (const poolName of CRYPTO_POOLS) { + it(`Claims CRV from ${poolName.toUpperCase()}`, async function () { + const pool = new curve.Pool(poolName); + + const [crvBalanceBefore] = await curve.getBalances(['crv']) as string[]; + const expected = await pool.gaugeClaimableTokens(); + + console.log(crvBalanceBefore, "+", expected, "=", Number(crvBalanceBefore) + Number(expected)); + await pool.gaugeClaimTokens(); + + const [crvBalanceAfter] = await curve.getBalances(['crv']) as string[]; + console.log(crvBalanceAfter); + + assert.approximately(Number(crvBalanceAfter), Number(crvBalanceBefore) + Number(expected), 1e-3); + }); + } +}); diff --git a/test/claim/deposit.ts b/test/claim/deposit.ts new file mode 100644 index 00000000..c47a3959 --- /dev/null +++ b/test/claim/deposit.ts @@ -0,0 +1,25 @@ +import curve from "../../src"; +import {DictInterface} from "../../lib/interfaces"; + +const PLAIN_POOLS = ['susd', 'ren', 'sbtc', 'hbtc', '3pool', 'seth', 'steth', 'ankreth', 'link', 'reth', 'eurt']; // Without eurs +const LENDING_POOLS = ['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib']; +const META_POOLS = ['gusd', 'husd', 'usdk', 'usdn', 'musd', 'rsv', 'tbtc', 'dusd', 'pbtc', 'bbtc', 'obtc', 'ust', 'usdp', 'tusd', 'frax', 'lusd', 'busdv2', 'alusd', 'mim']; +const CRYPTO_POOLS = ['tricrypto2', 'eurtusd', 'crveth', 'cvxeth']; +const ETHEREUM_POOLS = [...PLAIN_POOLS, ...LENDING_POOLS, ...META_POOLS, ...CRYPTO_POOLS]; + +const POLYGON_POOLS = ['aave', 'ren', 'atricrypto3', 'eurtusd']; + +(async function () { + await curve.init('JsonRpc', {},{ gasPrice: 0 }); + + for (const poolName of CRYPTO_POOLS) { + const pool = new curve.Pool(poolName); + const amounts = pool.underlyingCoinAddresses.map(() => '10'); + + await pool.addLiquidity(amounts); + + const depositAmount: string = (await pool.lpTokenBalances() as DictInterface).lpToken; + await pool.gaugeDeposit(depositAmount); + console.log(`Deposited ${depositAmount} LP tokens to ${poolName.toUpperCase()} gauge`); + } +})() From a44c3cef01463032d662a29b2fc4fca43c2a0be4 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Sun, 26 Dec 2021 14:09:35 +0300 Subject: [PATCH 06/24] chore: gauge ABIs and reward_tokens --- src/constants/abis/abis-ethereum.ts | 73 +- src/constants/abis/json/gauge.json | 16 + src/constants/abis/json/gauge_factory.json | 959 +++++++++++++++ src/constants/abis/json/gauge_synthetix.json | 634 ++++++++++ src/constants/abis/json/gauge_v2.json | 970 ++++++++++++++++ src/constants/abis/json/gauge_v3.json | 1034 +++++++++++++++++ src/constants/abis/json/gauge_v4.json | 993 ++++++++++++++++ src/constants/abis/json/liquiditygauge.json | 1 - .../abis/json/liquiditygauge_v2.json | 1 - src/curve.ts | 20 +- src/interfaces.ts | 1 + 11 files changed, 4686 insertions(+), 16 deletions(-) create mode 100644 src/constants/abis/json/gauge_factory.json create mode 100644 src/constants/abis/json/gauge_synthetix.json create mode 100644 src/constants/abis/json/gauge_v2.json create mode 100644 src/constants/abis/json/gauge_v3.json create mode 100644 src/constants/abis/json/gauge_v4.json delete mode 100644 src/constants/abis/json/liquiditygauge.json delete mode 100644 src/constants/abis/json/liquiditygauge_v2.json diff --git a/src/constants/abis/abis-ethereum.ts b/src/constants/abis/abis-ethereum.ts index 01746256..6ad42933 100644 --- a/src/constants/abis/abis-ethereum.ts +++ b/src/constants/abis/abis-ethereum.ts @@ -1,4 +1,10 @@ // import config from '../config'; +import gaugeABI from "./json/gauge.json"; +import gaugeSynthetixABI from "./json/gauge_synthetix.json"; +import gaugeV2ABI from "./json/gauge_v2.json"; +import gaugeV3ABI from "./json/gauge_v3.json"; +import gaugeV4ABI from "./json/gauge_v4.json"; +import gaugeFactoryABI from "./json/gauge_factory.json"; import compoundDepositABI from './json/compound/deposit.json'; import compoundMigrationABI from './json/compound/migration.json'; import compoundSwapABI from './json/compound/swap.json'; @@ -108,6 +114,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { migration_abi: compoundMigrationABI, swap_abi: compoundSwapABI, old_swap_abi: compoundOldSwapABI, + gauge_abi: gaugeABI, }, usdt: { @@ -136,6 +143,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { deposit_address: '0xac795D2c97e60DF6a99ff1c814727302fD747a80', deposit_abi: usdtDepositABI, swap_abi: usdtSwapABI, + gauge_abi: gaugeABI, }, y: { @@ -170,6 +178,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { sCurveRewards_address: '0x0001FB050Fe7312791bF6475b96569D83F695C9f', aRewards_abi: aRewards_abi, aRewards_address: '0xcc9efea3ac5df6ad6a656235ef955fbfef65b862', + gauge_abi: gaugeABI, }, busd: { reference_asset: 'USD', @@ -199,6 +208,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { deposit_address: '0xb6c057591E073249F2D9D88Ba59a46CFC9B59EdB', deposit_abi: busdDepositABI, swap_abi: busdSwapABI, + gauge_abi: gaugeABI, }, susd: { @@ -231,6 +241,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: susdv2SCurveRewards_abi, sCurveRewards_address: '0xdcb6a51ea3ca5d3fd898fd6564757c7aaec3ca92', + reward_tokens: ["0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F"], + gauge_abi: gaugeSynthetixABI, }, pax: { @@ -261,6 +273,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x1bE5d71F2dA660BFdee8012dDc58D024448A0A59', '0x8E870D67F660D95d5be530380D0eC0bd388289E1', ], + gauge_abi: gaugeABI, }, ren: { @@ -289,6 +302,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { old_adapter_address: '0x9fe350DfA5F66bC086243F21A8F0932514316627', adapter_biconomy_address: '0x73aB2Bd10aD10F7174a1AD5AFAe3ce3D991C5047', adapter_address: '0x26D9980571e77FfB0349f9c801DD7ca9951Fb656', + gauge_abi: gaugeABI, }, sbtc: { @@ -321,6 +335,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { adapter_address: '0x02B3F51AC9202aA19be63d61A8C681579D6E3a51', sCurveRewards_abi: sbtcSCurveRewardsABI, sCurveRewards_address: '0x13C1542A468319688B89E323fe9A3Be3A90EBb27', + gauge_abi: gaugeSynthetixABI, }, hbtc: { @@ -345,6 +360,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x0316EB71485b0Ab14103307bf65a021042c6d380', '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', ], + gauge_abi: gaugeABI, }, '3pool': { @@ -371,6 +387,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], + gauge_abi: gaugeABI, }, gusd: { @@ -415,6 +432,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], + gauge_abi: gaugeABI, }, husd: { @@ -459,6 +477,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], + gauge_abi: gaugeABI, }, usdk: { @@ -503,6 +522,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], + gauge_abi: gaugeABI, }, usdn: { @@ -547,6 +567,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], + gauge_abi: gaugeABI, }, musd: { @@ -593,6 +614,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: musdSCurveRewards_abi, sCurveRewards_address: "0xE6E6E25EfdA5F69687aA9914f8d750C523A1D261", + reward_tokens: ["0xa3BeD4E1c75D00fa6f4E5E6922DB7261B5E9AcD2"], + gauge_abi: gaugeSynthetixABI, }, rsv: { @@ -639,6 +662,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: rsvSCurveRewards_abi, sCurveRewards_address: "0xAD4768F408dD170e62E074188D81A29AE31B8Fd8", + reward_tokens: ["0x8762db106B2c2A0bccB3A80d1Ed41273552616E8"], + gauge_abi: gaugeSynthetixABI, }, tbtc: { @@ -685,6 +710,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: tbtcSCurveRewards_abi, sCurveRewards_address: '0xAF379f0228ad0d46bB7B4f38f9dc9bCC1ad0360c', + gauge_abi: gaugeSynthetixABI, }, dusd: { @@ -731,6 +757,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: dusdSCurveRewards_abi, sCurveRewards_address: "0xd9Acb0BAeeD77C99305017821167674Cc7e82f7a", + reward_tokens: ["0x20c36f062a31865bED8a5B1e512D9a1A20AA333A"], + gauge_abi: gaugeSynthetixABI, }, pbtc: { @@ -777,7 +805,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: pbtcSCurveRewards_abi, sCurveRewards_address: "0xf7977edc1fa61aa9b5f90d70a74a3fbc46e9dad3", - reward_token: "0x89Ab32156e46F46D02ade3FEcbe5Fc4243B9AAeD", + reward_tokens: ["0x89Ab32156e46F46D02ade3FEcbe5Fc4243B9AAeD"], + gauge_abi: gaugeV2ABI, }, bbtc: { @@ -822,6 +851,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', '0xfE18be6b3Bd88A2D2A7f928d00292E7a9963CfC6', ], + gauge_abi: gaugeV2ABI, }, obtc: { @@ -868,7 +898,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: obtcSCurveRewards_abi, sCurveRewards_address: "0x7f1ae7a1fc275b5b9c3ad4497fa94e3b9424e76e", - reward_token: "0x3c9d6c1C73b31c837832c72E04D3152f051fc1A9", + reward_tokens: ["0x3c9d6c1C73b31c837832c72E04D3152f051fc1A9"], + gauge_abi: gaugeV2ABI, }, seth: { @@ -894,6 +925,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', '0x5e74c9036fb86bd7ecdcb084a0673efc32ea31cb', ], + gauge_abi: gaugeV2ABI, }, eurs: { @@ -920,7 +952,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: eursSCurveRewards_abi, sCurveRewards_address: "0xc0d8994cd78ee1980885df1a0c5470fc977b5cfe", - reward_token: "0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f", + reward_tokens: ["0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f"], + gauge_abi: gaugeV2ABI, }, ust: { @@ -965,6 +998,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], + gauge_abi: gaugeV2ABI, }, aave: { @@ -992,6 +1026,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811', ], swap_abi: aaveSwapABI, + gauge_abi: gaugeV2ABI, }, steth: { @@ -1019,7 +1054,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: stethSCurveRewards_abi, sCurveRewards_address: "0x99ac10631F69C753DDb595D074422a0922D9056B", - reward_token: "0x5a98fcbea516cf06857215779fd812ca3bef1b32", + reward_tokens: ["0x5a98fcbea516cf06857215779fd812ca3bef1b32"], + gauge_abi: gaugeV2ABI, }, saave: { @@ -1045,6 +1081,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x6c5024cd4f8a59110119c56f8933403a539555eb', ], swap_abi: saaveSwapABI, + gauge_abi: gaugeV2ABI, }, ankreth: { @@ -1072,8 +1109,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: ankrethSCurveRewards_abi, sCurveRewards_address: "0x3547DFCa04358540891149559e691B146c6B0043", - reward_token: "0xe0ad1806fd3e7edf6ff52fdb822432e847411033", reward_tokens:["0xe0ad1806fd3e7edf6ff52fdb822432e847411033", "0x8290333cef9e6d528dd5618fb97a76f268f3edd4"], + gauge_abi: gaugeV2ABI, }, usdp: { @@ -1118,6 +1155,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], + gauge_abi: gaugeV2ABI, }, ib: { @@ -1145,6 +1183,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x76eb2fe28b36b3ee97f3adae0c69606eedb2a37c', '0x48759f220ed983db51fa7a8c0d2aab8f3ce4166a', ], + gauge_abi: gaugeV2ABI, }, link: { @@ -1169,6 +1208,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x514910771AF9Ca656af840dff83E8264EcF986CA', '0xbBC455cb4F1B9e4bFC4B73970d360c8f032EfEE6', ], + gauge_abi: gaugeV2ABI, }, tusd: { reference_asset: 'USD', @@ -1213,6 +1253,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], is_factory: true, + gauge_abi: gaugeV2ABI, }, frax: { reference_asset: 'USD', @@ -1259,7 +1300,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { is_factory: true, sCurveRewards_abi: factoryRewardsABI, sCurveRewards_address: '0xBBbAf1adf4d39B2843928CCa1E65564e5ce99ccC', - reward_token: '0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0', + reward_tokens: ['0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0'], + gauge_abi: gaugeV2ABI, }, lusd: { reference_asset: 'USD', @@ -1306,7 +1348,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { is_factory: true, sCurveRewards_abi: factoryRewardsABI, sCurveRewards_address: '0xeb31da939878d1d780fdbcc244531c0fb80a2cf3', - reward_token: '0x6dea81c8171d0ba574754ef6f8b412f2ed88c54d', + reward_tokens: ['0x6dea81c8171d0ba574754ef6f8b412f2ed88c54d'], + gauge_abi: gaugeV2ABI, }, busdv2: { reference_asset: 'USD', @@ -1351,6 +1394,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], is_factory: true, + gauge_abi: gaugeV2ABI, }, reth: { reference_asset: 'ETH', @@ -1377,7 +1421,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], sCurveRewards_abi: factoryRewardsABI, sCurveRewards_address: '0x3b7382805A1d887b73e98570796C5cEFeA32A462', - reward_token: '0xef3a930e1ffffacd2fc13434ac81bd278b0ecc8d', + reward_tokens: ['0xef3a930e1ffffacd2fc13434ac81bd278b0ecc8d'], + gauge_abi: gaugeV3ABI, }, alusd: { reference_asset: 'USD', @@ -1424,7 +1469,8 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { is_factory: true, sCurveRewards_abi: factoryRewardsABI, sCurveRewards_address: '0xb76256d1091e93976c61449d6e500d9f46d827d4', - reward_token: '0xdbdb4d16eda451d0503b854cf79d55697f90c8df', + reward_tokens: ['0xdbdb4d16eda451d0503b854cf79d55697f90c8df'], + gauge_abi: gaugeV3ABI, }, mim: { reference_asset: 'USD', @@ -1469,6 +1515,10 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], is_factory: true, + sCurveRewards_abi: factoryRewardsABI, + sCurveRewards_address: '0xb76256d1091e93976c61449d6e500d9f46d827d4', //not needed anymore??? + reward_tokens: ['0x090185f2135308BaD17527004364eBcC2D37e5F6'], + gauge_abi: gaugeFactoryABI, }, tricrypto2: { reference_asset: 'CRYPTO', @@ -1497,6 +1547,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { ], deposit_abi: tricrypto2DepositABI, deposit_address: '0x3993d34e7e99Abf6B6f367309975d1360222D446', + gauge_abi: gaugeV3ABI, }, eurt: { @@ -1521,6 +1572,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xC581b735A1688071A1746c968e0798D642EDE491', '0xD71eCFF9342A5Ced620049e616c5035F1dB98620', ], + gauge_abi: gaugeV3ABI, }, eurtusd: { @@ -1566,6 +1618,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', '0xdAC17F958D2ee523a2206206994597C13D831ec7', ], + gauge_abi: gaugeV4ABI, }, crveth: { @@ -1591,6 +1644,7 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0xD533a949740bb3306d119CC777fa900bA034cd52', ], + gauge_abi: gaugeV4ABI, }, cvxeth: { @@ -1616,5 +1670,6 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', '0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b', ], + gauge_abi: gaugeV4ABI, }, }; diff --git a/src/constants/abis/json/gauge.json b/src/constants/abis/json/gauge.json index c809f6da..eaab8c4c 100644 --- a/src/constants/abis/json/gauge.json +++ b/src/constants/abis/json/gauge.json @@ -158,6 +158,22 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "name": "deposit", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "_value" + }, + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "name": "withdraw", "outputs": [], diff --git a/src/constants/abis/json/gauge_factory.json b/src/constants/abis/json/gauge_factory.json new file mode 100644 index 00000000..0f50cf2f --- /dev/null +++ b/src/constants/abis/json/gauge_factory.json @@ -0,0 +1,959 @@ +[ + { + "name": "Deposit", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "UpdateLiquidityLimit", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": false + }, + { + "name": "original_balance", + "type": "uint256", + "indexed": false + }, + { + "name": "original_supply", + "type": "uint256", + "indexed": false + }, + { + "name": "working_balance", + "type": "uint256", + "indexed": false + }, + { + "name": "working_supply", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "CommitOwnership", + "inputs": [ + { + "name": "admin", + "type": "address", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "ApplyOwnership", + "inputs": [ + { + "name": "admin", + "type": "address", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Transfer", + "inputs": [ + { + "name": "_from", + "type": "address", + "indexed": true + }, + { + "name": "_to", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Approval", + "inputs": [ + { + "name": "_owner", + "type": "address", + "indexed": true + }, + { + "name": "_spender", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [ + { + "name": "_lp_token", + "type": "address" + }, + { + "name": "_factory", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "288" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "4560" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "user_checkpoint", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "3123796" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_tokens", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3038616" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimed_reward", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3006" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_reward", + "inputs": [ + { + "name": "_user", + "type": "address" + }, + { + "name": "_reward_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "20225" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards_receiver", + "inputs": [ + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [], + "gas": "35643" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { + "name": "_addr", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "kick", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [], + "gas": "3137887" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_addr", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_addr", + "type": "address" + }, + { + "name": "_claim_rewards", + "type": "bool" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_claim_rewards", + "type": "bool" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "18062406" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "18100356" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "38121" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "increaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_added_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "40665" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "decreaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtracted_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "40689" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "add_reward", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_distributor", + "type": "address" + } + ], + "outputs": [], + "gas": "115384" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_reward_distributor", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_distributor", + "type": "address" + } + ], + "outputs": [], + "gas": "43149" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit_reward_token", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "outputs": [], + "gas": "1540007" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_killed", + "inputs": [ + { + "name": "_is_killed", + "type": "bool" + } + ], + "outputs": [], + "gas": "40499" + }, + { + "stateMutability": "view", + "type": "function", + "name": "lp_token", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "2988" + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_epoch_time", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3018" + }, + { + "stateMutability": "view", + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3263" + }, + { + "stateMutability": "view", + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3078" + }, + { + "stateMutability": "view", + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3538" + }, + { + "stateMutability": "view", + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "gas": "13368" + }, + { + "stateMutability": "view", + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "gas": "11121" + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_balances", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3413" + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_supply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3228" + }, + { + "stateMutability": "view", + "type": "function", + "name": "period", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "int128" + } + ], + "gas": "3258" + }, + { + "stateMutability": "view", + "type": "function", + "name": "period_timestamp", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3333" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3363" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3563" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3593" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_fraction", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3623" + }, + { + "stateMutability": "view", + "type": "function", + "name": "inflation_rate", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3438" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_count", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3468" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_tokens", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3543" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_data", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "token", + "type": "address" + }, + { + "name": "distributor", + "type": "address" + }, + { + "name": "period_finish", + "type": "uint256" + }, + { + "name": "rate", + "type": "uint256" + }, + { + "name": "last_update", + "type": "uint256" + }, + { + "name": "integral", + "type": "uint256" + } + ], + "gas": "14973" + }, + { + "stateMutability": "view", + "type": "function", + "name": "rewards_receiver", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3773" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral_for", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "4018" + }, + { + "stateMutability": "view", + "type": "function", + "name": "is_killed", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "3618" + }, + { + "stateMutability": "view", + "type": "function", + "name": "factory", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3648" + } +] \ No newline at end of file diff --git a/src/constants/abis/json/gauge_synthetix.json b/src/constants/abis/json/gauge_synthetix.json new file mode 100644 index 00000000..525291f4 --- /dev/null +++ b/src/constants/abis/json/gauge_synthetix.json @@ -0,0 +1,634 @@ +[ + { + "name": "Deposit", + "inputs": [ + { + "type": "address", + "name": "provider", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { + "type": "address", + "name": "provider", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "UpdateLiquidityLimit", + "inputs": [ + { + "type": "address", + "name": "user", + "indexed": false + }, + { + "type": "uint256", + "name": "original_balance", + "indexed": false + }, + { + "type": "uint256", + "name": "original_supply", + "indexed": false + }, + { + "type": "uint256", + "name": "working_balance", + "indexed": false + }, + { + "type": "uint256", + "name": "working_supply", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "lp_addr" + }, + { + "type": "address", + "name": "_minter" + }, + { + "type": "address", + "name": "_reward_contract" + }, + { + "type": "address", + "name": "_rewarded_token" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "name": "user_checkpoint", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "2311984" + }, + { + "name": "claimable_tokens", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2231138" + }, + { + "name": "claimable_reward", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "7300" + }, + { + "name": "kick", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "2317383" + }, + { + "name": "set_approve_deposit", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "addr" + }, + { + "type": "bool", + "name": "can_deposit" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "35826" + }, + { + "name": "deposit", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "_value" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "deposit", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "_value" + }, + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "withdraw", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "_value" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "withdraw", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "_value" + }, + { + "type": "bool", + "name": "claim_rewards" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "claim_rewards", + "outputs": [], + "inputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "claim_rewards", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "integrate_checkpoint", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2387" + }, + { + "name": "minter", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1511" + }, + { + "name": "crv_token", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1541" + }, + { + "name": "lp_token", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1571" + }, + { + "name": "controller", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1601" + }, + { + "name": "voting_escrow", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1631" + }, + { + "name": "balanceOf", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "1815" + }, + { + "name": "totalSupply", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1691" + }, + { + "name": "future_epoch_time", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1721" + }, + { + "name": "approved_to_deposit", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + }, + { + "type": "address", + "name": "arg1" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2059" + }, + { + "name": "working_balances", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "1935" + }, + { + "name": "working_supply", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1811" + }, + { + "name": "period", + "outputs": [ + { + "type": "int128", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1841" + }, + { + "name": "period_timestamp", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "uint256", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "1980" + }, + { + "name": "integrate_inv_supply", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "uint256", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2010" + }, + { + "name": "integrate_inv_supply_of", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2085" + }, + { + "name": "integrate_checkpoint_of", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2115" + }, + { + "name": "integrate_fraction", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2145" + }, + { + "name": "inflation_rate", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2021" + }, + { + "name": "reward_contract", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2051" + }, + { + "name": "rewarded_token", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2081" + }, + { + "name": "reward_integral", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2111" + }, + { + "name": "reward_integral_for", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2295" + }, + { + "name": "rewards_for", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2325" + }, + { + "name": "claimed_rewards_for", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2355" + } +] \ No newline at end of file diff --git a/src/constants/abis/json/gauge_v2.json b/src/constants/abis/json/gauge_v2.json new file mode 100644 index 00000000..4f676506 --- /dev/null +++ b/src/constants/abis/json/gauge_v2.json @@ -0,0 +1,970 @@ +[ + { + "name": "Deposit", + "inputs": [ + { + "type": "address", + "name": "provider", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { + "type": "address", + "name": "provider", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "UpdateLiquidityLimit", + "inputs": [ + { + "type": "address", + "name": "user", + "indexed": false + }, + { + "type": "uint256", + "name": "original_balance", + "indexed": false + }, + { + "type": "uint256", + "name": "original_supply", + "indexed": false + }, + { + "type": "uint256", + "name": "working_balance", + "indexed": false + }, + { + "type": "uint256", + "name": "working_supply", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "CommitOwnership", + "inputs": [ + { + "type": "address", + "name": "admin", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "ApplyOwnership", + "inputs": [ + { + "type": "address", + "name": "admin", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "_from", + "indexed": true + }, + { + "type": "address", + "name": "_to", + "indexed": true + }, + { + "type": "uint256", + "name": "_value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "_owner", + "indexed": true + }, + { + "type": "address", + "name": "_spender", + "indexed": true + }, + { + "type": "uint256", + "name": "_value", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "outputs": [], + "inputs": [ + { + "type": "string", + "name": "_name" + }, + { + "type": "string", + "name": "_symbol" + }, + { + "type": "address", + "name": "_lp_token" + }, + { + "type": "address", + "name": "_minter" + }, + { + "type": "address", + "name": "_admin" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "name": "decimals", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "261" + }, + { + "name": "integrate_checkpoint", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1997" + }, + { + "name": "user_checkpoint", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "2070619" + }, + { + "name": "claimable_tokens", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "1989830" + }, + { + "name": "claimable_reward", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "_addr" + }, + { + "type": "address", + "name": "_token" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "999922" + }, + { + "name": "claim_rewards", + "outputs": [], + "inputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "claim_rewards", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "_addr" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "claim_historic_rewards", + "outputs": [], + "inputs": [ + { + "type": "address[8]", + "name": "_reward_tokens" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "claim_historic_rewards", + "outputs": [], + "inputs": [ + { + "type": "address[8]", + "name": "_reward_tokens" + }, + { + "type": "address", + "name": "_addr" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "kick", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "2075807" + }, + { + "name": "set_approve_deposit", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "addr" + }, + { + "type": "bool", + "name": "can_deposit" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "35981" + }, + { + "name": "deposit", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "_value" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "deposit", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "_value" + }, + { + "type": "address", + "name": "_addr" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "name": "withdraw", + "outputs": [], + "inputs": [ + { + "type": "uint256", + "name": "_value" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "3125023" + }, + { + "name": "allowance", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "_owner" + }, + { + "type": "address", + "name": "_spender" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "1911" + }, + { + "name": "transfer", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "_to" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "12092388" + }, + { + "name": "transferFrom", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "_from" + }, + { + "type": "address", + "name": "_to" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "12129038" + }, + { + "name": "approve", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "38244" + }, + { + "name": "increaseAllowance", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_added_value" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "39488" + }, + { + "name": "decreaseAllowance", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_subtracted_value" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "39512" + }, + { + "name": "set_rewards", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "_reward_contract" + }, + { + "type": "bytes32", + "name": "_sigs" + }, + { + "type": "address[8]", + "name": "_reward_tokens" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "2268178" + }, + { + "name": "set_killed", + "outputs": [], + "inputs": [ + { + "type": "bool", + "name": "_is_killed" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "36878" + }, + { + "name": "commit_transfer_ownership", + "outputs": [], + "inputs": [ + { + "type": "address", + "name": "addr" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "gas": "38258" + }, + { + "name": "accept_transfer_ownership", + "outputs": [], + "inputs": [], + "stateMutability": "nonpayable", + "type": "function", + "gas": "38203" + }, + { + "name": "minter", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1811" + }, + { + "name": "crv_token", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1841" + }, + { + "name": "lp_token", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1871" + }, + { + "name": "controller", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1901" + }, + { + "name": "voting_escrow", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1931" + }, + { + "name": "future_epoch_time", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "1961" + }, + { + "name": "balanceOf", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2206" + }, + { + "name": "totalSupply", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2021" + }, + { + "name": "name", + "outputs": [ + { + "type": "string", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "8453" + }, + { + "name": "symbol", + "outputs": [ + { + "type": "string", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "7506" + }, + { + "name": "approved_to_deposit", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + }, + { + "type": "address", + "name": "arg1" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2541" + }, + { + "name": "working_balances", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2356" + }, + { + "name": "working_supply", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2171" + }, + { + "name": "period", + "outputs": [ + { + "type": "int128", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2201" + }, + { + "name": "period_timestamp", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "uint256", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2340" + }, + { + "name": "integrate_inv_supply", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "uint256", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2370" + }, + { + "name": "integrate_inv_supply_of", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2506" + }, + { + "name": "integrate_checkpoint_of", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2536" + }, + { + "name": "integrate_fraction", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2566" + }, + { + "name": "inflation_rate", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2381" + }, + { + "name": "reward_contract", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2411" + }, + { + "name": "reward_tokens", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [ + { + "type": "uint256", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2550" + }, + { + "name": "reward_integral", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2686" + }, + { + "name": "reward_integral_for", + "outputs": [ + { + "type": "uint256", + "name": "" + } + ], + "inputs": [ + { + "type": "address", + "name": "arg0" + }, + { + "type": "address", + "name": "arg1" + } + ], + "stateMutability": "view", + "type": "function", + "gas": "2931" + }, + { + "name": "admin", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2531" + }, + { + "name": "future_admin", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2561" + }, + { + "name": "is_killed", + "outputs": [ + { + "type": "bool", + "name": "" + } + ], + "inputs": [], + "stateMutability": "view", + "type": "function", + "gas": "2591" + } +] \ No newline at end of file diff --git a/src/constants/abis/json/gauge_v3.json b/src/constants/abis/json/gauge_v3.json new file mode 100644 index 00000000..5259f7e3 --- /dev/null +++ b/src/constants/abis/json/gauge_v3.json @@ -0,0 +1,1034 @@ +[ + { + "name": "Deposit", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "UpdateLiquidityLimit", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": false + }, + { + "name": "original_balance", + "type": "uint256", + "indexed": false + }, + { + "name": "original_supply", + "type": "uint256", + "indexed": false + }, + { + "name": "working_balance", + "type": "uint256", + "indexed": false + }, + { + "name": "working_supply", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "CommitOwnership", + "inputs": [ + { + "name": "admin", + "type": "address", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "ApplyOwnership", + "inputs": [ + { + "name": "admin", + "type": "address", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Transfer", + "inputs": [ + { + "name": "_from", + "type": "address", + "indexed": true + }, + { + "name": "_to", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Approval", + "inputs": [ + { + "name": "_owner", + "type": "address", + "indexed": true + }, + { + "name": "_spender", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [ + { + "name": "_lp_token", + "type": "address" + }, + { + "name": "_minter", + "type": "address" + }, + { + "name": "_admin", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "288" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "4624" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "user_checkpoint", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "3133638" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_tokens", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3046705" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_contract", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "2718" + }, + { + "stateMutability": "view", + "type": "function", + "name": "last_claim", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "2544" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimed_reward", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3066" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_reward", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3034" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claimable_reward_write", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "1211002" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards_receiver", + "inputs": [ + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [], + "gas": "35733" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { + "name": "_addr", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "kick", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [], + "gas": "3150326" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_addr", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_addr", + "type": "address" + }, + { + "name": "_claim_rewards", + "type": "bool" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_claim_rewards", + "type": "bool" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3238" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "17172312" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "17210262" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "38241" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "increaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_added_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "40785" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "decreaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtracted_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "40809" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards", + "inputs": [ + { + "name": "_reward_contract", + "type": "address" + }, + { + "name": "_sigs", + "type": "bytes32" + }, + { + "name": "_reward_tokens", + "type": "address[8]" + } + ], + "outputs": [], + "gas": "2743589" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_killed", + "inputs": [ + { + "name": "_is_killed", + "type": "bool" + } + ], + "outputs": [], + "gas": "38175" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "commit_transfer_ownership", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [], + "gas": "39555" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "accept_transfer_ownership", + "inputs": [], + "outputs": [], + "gas": "39500" + }, + { + "stateMutability": "view", + "type": "function", + "name": "minter", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3108" + }, + { + "stateMutability": "view", + "type": "function", + "name": "crv_token", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3138" + }, + { + "stateMutability": "view", + "type": "function", + "name": "lp_token", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3168" + }, + { + "stateMutability": "view", + "type": "function", + "name": "controller", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3198" + }, + { + "stateMutability": "view", + "type": "function", + "name": "voting_escrow", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3228" + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_epoch_time", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3258" + }, + { + "stateMutability": "view", + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3503" + }, + { + "stateMutability": "view", + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3318" + }, + { + "stateMutability": "view", + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "gas": "13650" + }, + { + "stateMutability": "view", + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "gas": "11403" + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_balances", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3623" + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_supply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3438" + }, + { + "stateMutability": "view", + "type": "function", + "name": "period", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "int128" + } + ], + "gas": "3468" + }, + { + "stateMutability": "view", + "type": "function", + "name": "period_timestamp", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3607" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3637" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3773" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3803" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_fraction", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3833" + }, + { + "stateMutability": "view", + "type": "function", + "name": "inflation_rate", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3648" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_tokens", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3787" + }, + { + "stateMutability": "view", + "type": "function", + "name": "rewards_receiver", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3923" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3953" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral_for", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "4198" + }, + { + "stateMutability": "view", + "type": "function", + "name": "admin", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3798" + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_admin", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3828" + }, + { + "stateMutability": "view", + "type": "function", + "name": "is_killed", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "3858" + } +] \ No newline at end of file diff --git a/src/constants/abis/json/gauge_v4.json b/src/constants/abis/json/gauge_v4.json new file mode 100644 index 00000000..a7043213 --- /dev/null +++ b/src/constants/abis/json/gauge_v4.json @@ -0,0 +1,993 @@ +[ + { + "name": "Deposit", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "UpdateLiquidityLimit", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": false + }, + { + "name": "original_balance", + "type": "uint256", + "indexed": false + }, + { + "name": "original_supply", + "type": "uint256", + "indexed": false + }, + { + "name": "working_balance", + "type": "uint256", + "indexed": false + }, + { + "name": "working_supply", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "CommitOwnership", + "inputs": [ + { + "name": "admin", + "type": "address", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "ApplyOwnership", + "inputs": [ + { + "name": "admin", + "type": "address", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Transfer", + "inputs": [ + { + "name": "_from", + "type": "address", + "indexed": true + }, + { + "name": "_to", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Approval", + "inputs": [ + { + "name": "_owner", + "type": "address", + "indexed": true + }, + { + "name": "_spender", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [ + { + "name": "_lp_token", + "type": "address" + }, + { + "name": "_admin", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "288" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "4560" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "user_checkpoint", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "3123352" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_tokens", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3038594" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimed_reward", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3006" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_reward", + "inputs": [ + { + "name": "_user", + "type": "address" + }, + { + "name": "_reward_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "20225" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards_receiver", + "inputs": [ + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [], + "gas": "35643" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { + "name": "_addr", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "kick", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [], + "gas": "3137443" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_addr", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_addr", + "type": "address" + }, + { + "name": "_claim_rewards", + "type": "bool" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_claim_rewards", + "type": "bool" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "18062446" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "18100396" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "39421" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "increaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_added_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "41965" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "decreaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtracted_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "41989" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "add_reward", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_distributor", + "type": "address" + } + ], + "outputs": [], + "gas": "113003" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_reward_distributor", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_distributor", + "type": "address" + } + ], + "outputs": [], + "gas": "40753" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit_reward_token", + "inputs": [ + { + "name": "_reward_token", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "outputs": [], + "gas": "1540169" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_killed", + "inputs": [ + { + "name": "_is_killed", + "type": "bool" + } + ], + "outputs": [], + "gas": "38115" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "commit_transfer_ownership", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [], + "gas": "40045" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "accept_transfer_ownership", + "inputs": [], + "outputs": [], + "gas": "39990" + }, + { + "stateMutability": "view", + "type": "function", + "name": "lp_token", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3048" + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_epoch_time", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3078" + }, + { + "stateMutability": "view", + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3323" + }, + { + "stateMutability": "view", + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3138" + }, + { + "stateMutability": "view", + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3598" + }, + { + "stateMutability": "view", + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "gas": "13428" + }, + { + "stateMutability": "view", + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "gas": "11181" + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_balances", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3473" + }, + { + "stateMutability": "view", + "type": "function", + "name": "working_supply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3288" + }, + { + "stateMutability": "view", + "type": "function", + "name": "period", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "int128" + } + ], + "gas": "3318" + }, + { + "stateMutability": "view", + "type": "function", + "name": "period_timestamp", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3393" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3423" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_inv_supply_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3623" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_checkpoint_of", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3653" + }, + { + "stateMutability": "view", + "type": "function", + "name": "integrate_fraction", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3683" + }, + { + "stateMutability": "view", + "type": "function", + "name": "inflation_rate", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3498" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_count", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3528" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_tokens", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3603" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_data", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "token", + "type": "address" + }, + { + "name": "distributor", + "type": "address" + }, + { + "name": "period_finish", + "type": "uint256" + }, + { + "name": "rate", + "type": "uint256" + }, + { + "name": "last_update", + "type": "uint256" + }, + { + "name": "integral", + "type": "uint256" + } + ], + "gas": "15033" + }, + { + "stateMutability": "view", + "type": "function", + "name": "rewards_receiver", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3833" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral_for", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "4078" + }, + { + "stateMutability": "view", + "type": "function", + "name": "admin", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3678" + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_admin", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3708" + }, + { + "stateMutability": "view", + "type": "function", + "name": "is_killed", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "3738" + } +] \ No newline at end of file diff --git a/src/constants/abis/json/liquiditygauge.json b/src/constants/abis/json/liquiditygauge.json deleted file mode 100644 index e553ee49..00000000 --- a/src/constants/abis/json/liquiditygauge.json +++ /dev/null @@ -1 +0,0 @@ -[{"name": "Deposit", "inputs": [{"type": "address", "name": "provider", "indexed": true}, {"type": "uint256", "name": "value", "indexed": false}], "anonymous": false, "type": "event"}, {"name": "Withdraw", "inputs": [{"type": "address", "name": "provider", "indexed": true}, {"type": "uint256", "name": "value", "indexed": false}], "anonymous": false, "type": "event"}, {"name": "UpdateLiquidityLimit", "inputs": [{"type": "address", "name": "user", "indexed": false}, {"type": "uint256", "name": "original_balance", "indexed": false}, {"type": "uint256", "name": "original_supply", "indexed": false}, {"type": "uint256", "name": "working_balance", "indexed": false}, {"type": "uint256", "name": "working_supply", "indexed": false}], "anonymous": false, "type": "event"}, {"outputs": [], "inputs": [{"type": "address", "name": "lp_addr"}, {"type": "address", "name": "_minter"}], "stateMutability": "nonpayable", "type": "constructor"}, {"name": "user_checkpoint", "outputs": [{"type": "bool", "name": ""}], "inputs": [{"type": "address", "name": "addr"}], "stateMutability": "nonpayable", "type": "function", "gas":"2079152"}, {"name": "claimable_tokens", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "address", "name": "addr"}], "stateMutability": "view", "type": "function", "gas":"1998318"}, {"name": "claimable_reward", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "address", "name": "addr"}], "stateMutability": "view", "type": "function", "gas":"1998318"}, {"name": "kick", "outputs": [], "inputs": [{"type": "address", "name": "addr"}], "stateMutability": "nonpayable", "type": "function", "gas":"2084532"}, {"name": "set_approve_deposit", "outputs": [], "inputs": [{"type": "address", "name": "addr"}, {"type": "bool", "name": "can_deposit"}], "stateMutability": "nonpayable", "type": "function", "gas":"35766"}, {"name": "deposit", "outputs": [], "inputs": [{"type": "uint256", "name": "_value"}], "stateMutability": "nonpayable", "type": "function"}, {"name": "deposit", "outputs": [], "inputs": [{"type": "uint256", "name": "_value"}, {"type": "address", "name": "addr"}], "stateMutability": "nonpayable", "type": "function"}, {"name": "withdraw", "outputs": [], "inputs": [{"type": "uint256", "name": "_value"}], "stateMutability": "nonpayable", "type": "function", "gas":"2208318"}, {"name": "claim_rewards", "outputs": [], "inputs": [{"type": "address", "name": "addr"}], "stateMutability": "nonpayable", "type": "function"}, {"name": "integrate_checkpoint", "outputs": [{"type": "uint256", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"2297"}, {"name": "minter", "outputs": [{"type": "address", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1421"}, {"name": "crv_token", "outputs": [{"type": "address", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1451"}, {"name": "lp_token", "outputs": [{"type": "address", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1481"}, {"name": "controller", "outputs": [{"type": "address", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1511"}, {"name": "voting_escrow", "outputs": [{"type": "address", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1541"}, {"name": "balanceOf", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "address", "name": "arg0"}], "stateMutability": "view", "type": "function", "gas":"1725"}, {"name": "totalSupply", "outputs": [{"type": "uint256", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1601"}, {"name": "future_epoch_time", "outputs": [{"type": "uint256", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1631"}, {"name": "approved_to_deposit", "outputs": [{"type": "bool", "name": ""}], "inputs": [{"type": "address", "name": "arg0"}, {"type": "address", "name": "arg1"}], "stateMutability": "view", "type": "function", "gas":"1969"}, {"name": "working_balances", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "address", "name": "arg0"}], "stateMutability": "view", "type": "function", "gas":"1845"}, {"name": "working_supply", "outputs": [{"type": "uint256", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1721"}, {"name": "period", "outputs": [{"type": "int128", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1751"}, {"name": "period_timestamp", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "uint256", "name": "arg0"}], "stateMutability": "view", "type": "function", "gas":"1890"}, {"name": "integrate_inv_supply", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "uint256", "name": "arg0"}], "stateMutability": "view", "type": "function", "gas":"1920"}, {"name": "integrate_inv_supply_of", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "address", "name": "arg0"}], "stateMutability": "view", "type": "function", "gas":"1995"}, {"name": "integrate_checkpoint_of", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "address", "name": "arg0"}], "stateMutability": "view", "type": "function", "gas":"2025"}, {"name": "integrate_fraction", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "address", "name": "arg0"}], "stateMutability": "view", "type": "function", "gas":"2055"}, {"name": "inflation_rate", "outputs": [{"type": "uint256", "name": ""}], "inputs": [], "stateMutability": "view", "type": "function", "gas":"1931"}, {"name": "claimed_rewards_for", "outputs": [{"type": "uint256", "name": ""}], "inputs": [{"type": "address", "name": "arg0"}], "stateMutability": "view", "type": "function", "gas":"2355"}] diff --git a/src/constants/abis/json/liquiditygauge_v2.json b/src/constants/abis/json/liquiditygauge_v2.json deleted file mode 100644 index 649b7e81..00000000 --- a/src/constants/abis/json/liquiditygauge_v2.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"Deposit","inputs":[{"type":"address","name":"provider","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false,"type":"event"},{"name":"Withdraw","inputs":[{"type":"address","name":"provider","indexed":true},{"type":"uint256","name":"value","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateLiquidityLimit","inputs":[{"type":"address","name":"user","indexed":false},{"type":"uint256","name":"original_balance","indexed":false},{"type":"uint256","name":"original_supply","indexed":false},{"type":"uint256","name":"working_balance","indexed":false},{"type":"uint256","name":"working_supply","indexed":false}],"anonymous":false,"type":"event"},{"name":"CommitOwnership","inputs":[{"type":"address","name":"admin","indexed":false}],"anonymous":false,"type":"event"},{"name":"ApplyOwnership","inputs":[{"type":"address","name":"admin","indexed":false}],"anonymous":false,"type":"event"},{"name":"Transfer","inputs":[{"type":"address","name":"_from","indexed":true},{"type":"address","name":"_to","indexed":true},{"type":"uint256","name":"_value","indexed":false}],"anonymous":false,"type":"event"},{"name":"Approval","inputs":[{"type":"address","name":"_owner","indexed":true},{"type":"address","name":"_spender","indexed":true},{"type":"uint256","name":"_value","indexed":false}],"anonymous":false,"type":"event"},{"outputs":[],"inputs":[{"type":"string","name":"_name"},{"type":"string","name":"_symbol"},{"type":"address","name":"_lp_token"},{"type":"address","name":"_minter"},{"type":"address","name":"_admin"}],"stateMutability":"nonpayable","type":"constructor"},{"name":"decimals","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"261"},{"name":"integrate_checkpoint","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1997"},{"name":"user_checkpoint","outputs":[{"type":"bool","name":""}],"inputs":[{"type":"address","name":"addr"}],"stateMutability":"nonpayable","type":"function","gas":"2070619"},{"name":"claimable_tokens","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"addr"}],"stateMutability":"nonpayable","type":"function","gas":"1989830"},{"name":"claimable_reward","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"_addr"},{"type":"address","name":"_token"}],"stateMutability":"nonpayable","type":"function","gas":"999922"},{"name":"claim_rewards","outputs":[],"inputs":[],"stateMutability":"nonpayable","type":"function"},{"name":"claim_rewards","outputs":[],"inputs":[{"type":"address","name":"_addr"}],"stateMutability":"nonpayable","type":"function"},{"name":"claim_historic_rewards","outputs":[],"inputs":[{"type":"address[8]","name":"_reward_tokens"}],"stateMutability":"nonpayable","type":"function"},{"name":"claim_historic_rewards","outputs":[],"inputs":[{"type":"address[8]","name":"_reward_tokens"},{"type":"address","name":"_addr"}],"stateMutability":"nonpayable","type":"function"},{"name":"kick","outputs":[],"inputs":[{"type":"address","name":"addr"}],"stateMutability":"nonpayable","type":"function","gas":"2075807"},{"name":"set_approve_deposit","outputs":[],"inputs":[{"type":"address","name":"addr"},{"type":"bool","name":"can_deposit"}],"stateMutability":"nonpayable","type":"function","gas":"35981"},{"name":"deposit","outputs":[],"inputs":[{"type":"uint256","name":"_value"}],"stateMutability":"nonpayable","type":"function"},{"name":"deposit","outputs":[],"inputs":[{"type":"uint256","name":"_value"},{"type":"address","name":"_addr"}],"stateMutability":"nonpayable","type":"function"},{"name":"withdraw","outputs":[],"inputs":[{"type":"uint256","name":"_value"}],"stateMutability":"nonpayable","type":"function","gas":"3125023"},{"name":"allowance","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"_owner"},{"type":"address","name":"_spender"}],"stateMutability":"view","type":"function","gas":"1911"},{"name":"transfer","outputs":[{"type":"bool","name":""}],"inputs":[{"type":"address","name":"_to"},{"type":"uint256","name":"_value"}],"stateMutability":"nonpayable","type":"function","gas":"12092388"},{"name":"transferFrom","outputs":[{"type":"bool","name":""}],"inputs":[{"type":"address","name":"_from"},{"type":"address","name":"_to"},{"type":"uint256","name":"_value"}],"stateMutability":"nonpayable","type":"function","gas":"12129038"},{"name":"approve","outputs":[{"type":"bool","name":""}],"inputs":[{"type":"address","name":"_spender"},{"type":"uint256","name":"_value"}],"stateMutability":"nonpayable","type":"function","gas":"38244"},{"name":"increaseAllowance","outputs":[{"type":"bool","name":""}],"inputs":[{"type":"address","name":"_spender"},{"type":"uint256","name":"_added_value"}],"stateMutability":"nonpayable","type":"function","gas":"39488"},{"name":"decreaseAllowance","outputs":[{"type":"bool","name":""}],"inputs":[{"type":"address","name":"_spender"},{"type":"uint256","name":"_subtracted_value"}],"stateMutability":"nonpayable","type":"function","gas":"39512"},{"name":"set_rewards","outputs":[],"inputs":[{"type":"address","name":"_reward_contract"},{"type":"bytes32","name":"_sigs"},{"type":"address[8]","name":"_reward_tokens"}],"stateMutability":"nonpayable","type":"function","gas":"2268178"},{"name":"set_killed","outputs":[],"inputs":[{"type":"bool","name":"_is_killed"}],"stateMutability":"nonpayable","type":"function","gas":"36878"},{"name":"commit_transfer_ownership","outputs":[],"inputs":[{"type":"address","name":"addr"}],"stateMutability":"nonpayable","type":"function","gas":"38258"},{"name":"accept_transfer_ownership","outputs":[],"inputs":[],"stateMutability":"nonpayable","type":"function","gas":"38203"},{"name":"minter","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1811"},{"name":"crv_token","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1841"},{"name":"lp_token","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1871"},{"name":"controller","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1901"},{"name":"voting_escrow","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1931"},{"name":"future_epoch_time","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"1961"},{"name":"balanceOf","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2206"},{"name":"totalSupply","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"2021"},{"name":"name","outputs":[{"type":"string","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"8453"},{"name":"symbol","outputs":[{"type":"string","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"7506"},{"name":"approved_to_deposit","outputs":[{"type":"bool","name":""}],"inputs":[{"type":"address","name":"arg0"},{"type":"address","name":"arg1"}],"stateMutability":"view","type":"function","gas":"2541"},{"name":"working_balances","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2356"},{"name":"working_supply","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"2171"},{"name":"period","outputs":[{"type":"int128","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"2201"},{"name":"period_timestamp","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"uint256","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2340"},{"name":"integrate_inv_supply","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"uint256","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2370"},{"name":"integrate_inv_supply_of","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2506"},{"name":"integrate_checkpoint_of","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2536"},{"name":"integrate_fraction","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2566"},{"name":"inflation_rate","outputs":[{"type":"uint256","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"2381"},{"name":"reward_contract","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"2411"},{"name":"reward_tokens","outputs":[{"type":"address","name":""}],"inputs":[{"type":"uint256","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2550"},{"name":"reward_integral","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"}],"stateMutability":"view","type":"function","gas":"2686"},{"name":"reward_integral_for","outputs":[{"type":"uint256","name":""}],"inputs":[{"type":"address","name":"arg0"},{"type":"address","name":"arg1"}],"stateMutability":"view","type":"function","gas":"2931"},{"name":"admin","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"2531"},{"name":"future_admin","outputs":[{"type":"address","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"2561"},{"name":"is_killed","outputs":[{"type":"bool","name":""}],"inputs":[],"stateMutability":"view","type":"function","gas":"2591"}] diff --git a/src/curve.ts b/src/curve.ts index 1939c35e..3aa0cb76 100644 --- a/src/curve.ts +++ b/src/curve.ts @@ -6,7 +6,6 @@ import ERC20Abi from './constants/abis/json/ERC20.json'; import cERC20Abi from './constants/abis/json/cERC20.json'; import yERC20Abi from './constants/abis/json/yERC20.json'; import minterABI from './constants/abis/json/minter.json'; -import gaugeABI from './constants/abis/json/gauge.json'; import votingEscrowABI from './constants/abis/json/votingescrow.json'; import addressProviderABI from './constants/abis/json/address_provider.json'; import gaugeControllerABI from './constants/abis/json/gaugecontroller.json'; @@ -240,12 +239,12 @@ class Curve { } this.contracts[pool.gauge_address] = { - contract: new Contract(pool.gauge_address, gaugeABI, this.signer || this.provider), - multicallContract: new MulticallContract(pool.gauge_address, gaugeABI), + contract: new Contract(pool.gauge_address, pool.gauge_abi, this.signer || this.provider), + multicallContract: new MulticallContract(pool.gauge_address, pool.gauge_abi), } this.contracts[pool.gauge_address.toLowerCase()] = { - contract: new Contract(pool.gauge_address, gaugeABI, this.signer || this.provider), - multicallContract: new MulticallContract(pool.gauge_address, gaugeABI), + contract: new Contract(pool.gauge_address, pool.gauge_abi, this.signer || this.provider), + multicallContract: new MulticallContract(pool.gauge_address, pool.gauge_abi), } if (pool.deposit_address && this.contracts[pool.deposit_address] === undefined) { @@ -329,6 +328,17 @@ class Curve { multicallContract: new MulticallContract(pool.crv_reward_contract, streamerABI), } } + + for (const rewardTokenAddr of pool.reward_tokens || []) { + this.contracts[rewardTokenAddr] = { + contract: new Contract(rewardTokenAddr, ERC20Abi, this.signer || this.provider), + multicallContract: new MulticallContract(rewardTokenAddr, ERC20Abi), + } + this.contracts[rewardTokenAddr.toLowerCase()] = { + contract: new Contract(rewardTokenAddr, ERC20Abi, this.signer || this.provider), + multicallContract: new MulticallContract(rewardTokenAddr, ERC20Abi), + } + } } this.contracts[ALIASES.crv] = { diff --git a/src/interfaces.ts b/src/interfaces.ts index 902994f3..31661b3a 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -25,6 +25,7 @@ export interface PoolDataInterface { underlying_coin_addresses: string[], coin_addresses: string[], swap_abi: any, + gauge_abi: any, deposit_abi?: any, old_swap_abi?: any, is_meta?: boolean, From 47c99b26430f959185965f63f4de821e19ae125b Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Sun, 26 Dec 2021 14:10:31 +0300 Subject: [PATCH 07/24] chore: gas number -> string --- src/constants/abis/json/atricrypto3/swap.json | 126 +++++++++--------- src/constants/abis/json/atricrypto3/zap.json | 16 +-- src/constants/abis/json/crveth/swap.json | 122 ++++++++--------- src/constants/abis/json/eurt/swap.json | 58 ++++---- src/constants/abis/json/eurtusd/deposit.json | 26 ++-- src/constants/abis/json/eurtusd/swap.json | 118 ++++++++-------- src/constants/abis/json/ren-polygon/swap.json | 92 ++++++------- src/constants/abis/json/reth/swap.json | 76 +++++------ .../abis/json/tricrypto2/deposit.json | 6 +- src/constants/abis/json/tricrypto2/swap.json | 120 ++++++++--------- 10 files changed, 380 insertions(+), 380 deletions(-) diff --git a/src/constants/abis/json/atricrypto3/swap.json b/src/constants/abis/json/atricrypto3/swap.json index a9ab5b6c..6f12c454 100644 --- a/src/constants/abis/json/atricrypto3/swap.json +++ b/src/constants/abis/json/atricrypto3/swap.json @@ -373,7 +373,7 @@ "type": "uint256" } ], - "gas": 1971 + "gas": "1971" }, { "stateMutability": "view", @@ -391,7 +391,7 @@ "type": "uint256" } ], - "gas": 2001 + "gas": "2001" }, { "stateMutability": "view", @@ -409,7 +409,7 @@ "type": "uint256" } ], - "gas": 2031 + "gas": "2031" }, { "stateMutability": "view", @@ -422,7 +422,7 @@ "type": "address" } ], - "gas": 378 + "gas": "378" }, { "stateMutability": "view", @@ -440,7 +440,7 @@ "type": "address" } ], - "gas": 492 + "gas": "492" }, { "stateMutability": "view", @@ -453,7 +453,7 @@ "type": "uint256" } ], - "gas": 507 + "gas": "507" }, { "stateMutability": "view", @@ -466,7 +466,7 @@ "type": "uint256" } ], - "gas": 6701 + "gas": "6701" }, { "stateMutability": "view", @@ -479,7 +479,7 @@ "type": "uint256" } ], - "gas": 10891 + "gas": "10891" }, { "stateMutability": "view", @@ -497,7 +497,7 @@ "type": "uint256" } ], - "gas": 5706 + "gas": "5706" }, { "stateMutability": "view", @@ -510,7 +510,7 @@ "type": "uint256" } ], - "gas": 6092 + "gas": "6092" }, { "stateMutability": "nonpayable", @@ -535,7 +535,7 @@ } ], "outputs": [], - "gas": 1236533 + "gas": "1236533" }, { "stateMutability": "view", @@ -561,7 +561,7 @@ "type": "uint256" } ], - "gas": 1632 + "gas": "1632" }, { "stateMutability": "view", @@ -583,7 +583,7 @@ "type": "uint256" } ], - "gas": 15892 + "gas": "15892" }, { "stateMutability": "nonpayable", @@ -600,7 +600,7 @@ } ], "outputs": [], - "gas": 1257246 + "gas": "1257246" }, { "stateMutability": "nonpayable", @@ -617,7 +617,7 @@ } ], "outputs": [], - "gas": 212087 + "gas": "212087" }, { "stateMutability": "view", @@ -639,7 +639,7 @@ "type": "uint256" } ], - "gas": 1939 + "gas": "1939" }, { "stateMutability": "view", @@ -661,7 +661,7 @@ "type": "uint256" } ], - "gas": 8142 + "gas": "8142" }, { "stateMutability": "nonpayable", @@ -682,7 +682,7 @@ } ], "outputs": [], - "gas": 1176756 + "gas": "1176756" }, { "stateMutability": "nonpayable", @@ -690,7 +690,7 @@ "name": "claim_admin_fees", "inputs": [], "outputs": [], - "gas": 352907 + "gas": "352907" }, { "stateMutability": "nonpayable", @@ -711,7 +711,7 @@ } ], "outputs": [], - "gas": 155212 + "gas": "155212" }, { "stateMutability": "nonpayable", @@ -719,7 +719,7 @@ "name": "stop_ramp_A_gamma", "inputs": [], "outputs": [], - "gas": 150657 + "gas": "150657" }, { "stateMutability": "nonpayable", @@ -756,7 +756,7 @@ } ], "outputs": [], - "gas": 294400 + "gas": "294400" }, { "stateMutability": "nonpayable", @@ -764,7 +764,7 @@ "name": "apply_new_parameters", "inputs": [], "outputs": [], - "gas": 632237 + "gas": "632237" }, { "stateMutability": "nonpayable", @@ -772,7 +772,7 @@ "name": "revert_new_parameters", "inputs": [], "outputs": [], - "gas": 21832 + "gas": "21832" }, { "stateMutability": "nonpayable", @@ -785,7 +785,7 @@ } ], "outputs": [], - "gas": 74570 + "gas": "74570" }, { "stateMutability": "nonpayable", @@ -793,7 +793,7 @@ "name": "apply_transfer_ownership", "inputs": [], "outputs": [], - "gas": 60647 + "gas": "60647" }, { "stateMutability": "nonpayable", @@ -801,7 +801,7 @@ "name": "revert_transfer_ownership", "inputs": [], "outputs": [], - "gas": 21922 + "gas": "21922" }, { "stateMutability": "nonpayable", @@ -809,7 +809,7 @@ "name": "kill_me", "inputs": [], "outputs": [], - "gas": 37845 + "gas": "37845" }, { "stateMutability": "nonpayable", @@ -817,7 +817,7 @@ "name": "unkill_me", "inputs": [], "outputs": [], - "gas": 21982 + "gas": "21982" }, { "stateMutability": "nonpayable", @@ -830,7 +830,7 @@ } ], "outputs": [], - "gas": 37115 + "gas": "37115" }, { "stateMutability": "nonpayable", @@ -843,7 +843,7 @@ } ], "outputs": [], - "gas": 37145 + "gas": "37145" }, { "stateMutability": "view", @@ -856,7 +856,7 @@ "type": "uint256" } ], - "gas": 2018 + "gas": "2018" }, { "stateMutability": "view", @@ -869,7 +869,7 @@ "type": "uint256" } ], - "gas": 2048 + "gas": "2048" }, { "stateMutability": "view", @@ -882,7 +882,7 @@ "type": "uint256" } ], - "gas": 2078 + "gas": "2078" }, { "stateMutability": "view", @@ -895,7 +895,7 @@ "type": "uint256" } ], - "gas": 2108 + "gas": "2108" }, { "stateMutability": "view", @@ -908,7 +908,7 @@ "type": "uint256" } ], - "gas": 2138 + "gas": "2138" }, { "stateMutability": "view", @@ -921,7 +921,7 @@ "type": "uint256" } ], - "gas": 2168 + "gas": "2168" }, { "stateMutability": "view", @@ -934,7 +934,7 @@ "type": "uint256" } ], - "gas": 2198 + "gas": "2198" }, { "stateMutability": "view", @@ -947,7 +947,7 @@ "type": "uint256" } ], - "gas": 2228 + "gas": "2228" }, { "stateMutability": "view", @@ -960,7 +960,7 @@ "type": "uint256" } ], - "gas": 2258 + "gas": "2258" }, { "stateMutability": "view", @@ -973,7 +973,7 @@ "type": "uint256" } ], - "gas": 2288 + "gas": "2288" }, { "stateMutability": "view", @@ -986,7 +986,7 @@ "type": "uint256" } ], - "gas": 2318 + "gas": "2318" }, { "stateMutability": "view", @@ -999,7 +999,7 @@ "type": "uint256" } ], - "gas": 2348 + "gas": "2348" }, { "stateMutability": "view", @@ -1012,7 +1012,7 @@ "type": "uint256" } ], - "gas": 2378 + "gas": "2378" }, { "stateMutability": "view", @@ -1025,7 +1025,7 @@ "type": "uint256" } ], - "gas": 2408 + "gas": "2408" }, { "stateMutability": "view", @@ -1038,7 +1038,7 @@ "type": "uint256" } ], - "gas": 2438 + "gas": "2438" }, { "stateMutability": "view", @@ -1051,7 +1051,7 @@ "type": "uint256" } ], - "gas": 2468 + "gas": "2468" }, { "stateMutability": "view", @@ -1064,7 +1064,7 @@ "type": "uint256" } ], - "gas": 2498 + "gas": "2498" }, { "stateMutability": "view", @@ -1077,7 +1077,7 @@ "type": "uint256" } ], - "gas": 2528 + "gas": "2528" }, { "stateMutability": "view", @@ -1090,7 +1090,7 @@ "type": "uint256" } ], - "gas": 2558 + "gas": "2558" }, { "stateMutability": "view", @@ -1108,7 +1108,7 @@ "type": "uint256" } ], - "gas": 2633 + "gas": "2633" }, { "stateMutability": "view", @@ -1121,7 +1121,7 @@ "type": "uint256" } ], - "gas": 2618 + "gas": "2618" }, { "stateMutability": "view", @@ -1134,7 +1134,7 @@ "type": "address" } ], - "gas": 2648 + "gas": "2648" }, { "stateMutability": "view", @@ -1147,7 +1147,7 @@ "type": "address" } ], - "gas": 2678 + "gas": "2678" }, { "stateMutability": "view", @@ -1160,7 +1160,7 @@ "type": "uint256" } ], - "gas": 2708 + "gas": "2708" }, { "stateMutability": "view", @@ -1173,7 +1173,7 @@ "type": "uint256" } ], - "gas": 2738 + "gas": "2738" }, { "stateMutability": "view", @@ -1186,7 +1186,7 @@ "type": "uint256" } ], - "gas": 2768 + "gas": "2768" }, { "stateMutability": "view", @@ -1199,7 +1199,7 @@ "type": "bool" } ], - "gas": 2798 + "gas": "2798" }, { "stateMutability": "view", @@ -1212,7 +1212,7 @@ "type": "uint256" } ], - "gas": 2828 + "gas": "2828" }, { "stateMutability": "view", @@ -1225,7 +1225,7 @@ "type": "uint256" } ], - "gas": 2858 + "gas": "2858" }, { "stateMutability": "view", @@ -1238,7 +1238,7 @@ "type": "uint256" } ], - "gas": 2888 + "gas": "2888" }, { "stateMutability": "view", @@ -1251,7 +1251,7 @@ "type": "address" } ], - "gas": 2918 + "gas": "2918" }, { "stateMutability": "view", @@ -1264,6 +1264,6 @@ "type": "address" } ], - "gas": 2948 + "gas": "2948" } ] \ No newline at end of file diff --git a/src/constants/abis/json/atricrypto3/zap.json b/src/constants/abis/json/atricrypto3/zap.json index 5f59e5d5..91900589 100644 --- a/src/constants/abis/json/atricrypto3/zap.json +++ b/src/constants/abis/json/atricrypto3/zap.json @@ -92,7 +92,7 @@ "type": "function" }, { - "gas": 8403, + "gas": "8403", "inputs": [ { "name": "i", @@ -118,7 +118,7 @@ "type": "function" }, { - "gas": 4305, + "gas": "4305", "inputs": [ { "name": "_amounts", @@ -140,7 +140,7 @@ "type": "function" }, { - "gas": 6199, + "gas": "6199", "inputs": [ { "name": "token_amount", @@ -162,7 +162,7 @@ "type": "function" }, { - "gas": 1343, + "gas": "1343", "inputs": [ { "name": "arg0", @@ -180,7 +180,7 @@ "type": "function" }, { - "gas": 1373, + "gas": "1373", "inputs": [ { "name": "arg0", @@ -198,7 +198,7 @@ "type": "function" }, { - "gas": 1358, + "gas": "1358", "inputs": [], "name": "pool", "outputs": [ @@ -211,7 +211,7 @@ "type": "function" }, { - "gas": 1388, + "gas": "1388", "inputs": [], "name": "base_pool", "outputs": [ @@ -224,7 +224,7 @@ "type": "function" }, { - "gas": 1418, + "gas": "1418", "inputs": [], "name": "token", "outputs": [ diff --git a/src/constants/abis/json/crveth/swap.json b/src/constants/abis/json/crveth/swap.json index 3eac074b..c65e51a0 100644 --- a/src/constants/abis/json/crveth/swap.json +++ b/src/constants/abis/json/crveth/swap.json @@ -372,7 +372,7 @@ "type": "address" } ], - "gas": 516 + "gas": "516" }, { "stateMutability": "view", @@ -390,7 +390,7 @@ "type": "address" } ], - "gas": 648 + "gas": "648" }, { "stateMutability": "view", @@ -403,7 +403,7 @@ "type": "uint256" } ], - "gas": 685 + "gas": "685" }, { "stateMutability": "view", @@ -416,7 +416,7 @@ "type": "uint256" } ], - "gas": 6589 + "gas": "6589" }, { "stateMutability": "view", @@ -429,7 +429,7 @@ "type": "uint256" } ], - "gas": 9833 + "gas": "9833" }, { "stateMutability": "view", @@ -442,7 +442,7 @@ "type": "uint256" } ], - "gas": 360797 + "gas": "360797" }, { "stateMutability": "payable", @@ -472,7 +472,7 @@ "type": "uint256" } ], - "gas": 16709798 + "gas": "16709798" }, { "stateMutability": "payable", @@ -502,7 +502,7 @@ "type": "uint256" } ], - "gas": 16709596 + "gas": "16709596" }, { "stateMutability": "view", @@ -528,7 +528,7 @@ "type": "uint256" } ], - "gas": 4558015 + "gas": "4558015" }, { "stateMutability": "payable", @@ -554,7 +554,7 @@ "type": "uint256" } ], - "gas": 17626221 + "gas": "17626221" }, { "stateMutability": "nonpayable", @@ -575,7 +575,7 @@ } ], "outputs": [], - "gas": 246329 + "gas": "246329" }, { "stateMutability": "view", @@ -593,7 +593,7 @@ "type": "uint256" } ], - "gas": 5182647 + "gas": "5182647" }, { "stateMutability": "view", @@ -615,7 +615,7 @@ "type": "uint256" } ], - "gas": 7384 + "gas": "7384" }, { "stateMutability": "nonpayable", @@ -645,7 +645,7 @@ "type": "uint256" } ], - "gas": 16638278 + "gas": "16638278" }, { "stateMutability": "nonpayable", @@ -653,7 +653,7 @@ "name": "claim_admin_fees", "inputs": [], "outputs": [], - "gas": 3227185 + "gas": "3227185" }, { "stateMutability": "nonpayable", @@ -674,7 +674,7 @@ } ], "outputs": [], - "gas": 153898 + "gas": "153898" }, { "stateMutability": "nonpayable", @@ -682,7 +682,7 @@ "name": "stop_ramp_A_gamma", "inputs": [], "outputs": [], - "gas": 150243 + "gas": "150243" }, { "stateMutability": "nonpayable", @@ -719,7 +719,7 @@ } ], "outputs": [], - "gas": 293384 + "gas": "293384" }, { "stateMutability": "nonpayable", @@ -727,7 +727,7 @@ "name": "apply_new_parameters", "inputs": [], "outputs": [], - "gas": 3505075 + "gas": "3505075" }, { "stateMutability": "nonpayable", @@ -735,7 +735,7 @@ "name": "revert_new_parameters", "inputs": [], "outputs": [], - "gas": 21842 + "gas": "21842" }, { "stateMutability": "nonpayable", @@ -748,7 +748,7 @@ } ], "outputs": [], - "gas": 76227 + "gas": "76227" }, { "stateMutability": "nonpayable", @@ -756,7 +756,7 @@ "name": "apply_transfer_ownership", "inputs": [], "outputs": [], - "gas": 61842 + "gas": "61842" }, { "stateMutability": "nonpayable", @@ -764,7 +764,7 @@ "name": "revert_transfer_ownership", "inputs": [], "outputs": [], - "gas": 21932 + "gas": "21932" }, { "stateMutability": "nonpayable", @@ -772,7 +772,7 @@ "name": "kill_me", "inputs": [], "outputs": [], - "gas": 37855 + "gas": "37855" }, { "stateMutability": "nonpayable", @@ -780,7 +780,7 @@ "name": "unkill_me", "inputs": [], "outputs": [], - "gas": 21992 + "gas": "21992" }, { "stateMutability": "nonpayable", @@ -793,7 +793,7 @@ } ], "outputs": [], - "gas": 37182 + "gas": "37182" }, { "stateMutability": "view", @@ -806,7 +806,7 @@ "type": "uint256" } ], - "gas": 214446 + "gas": "214446" }, { "stateMutability": "view", @@ -819,7 +819,7 @@ "type": "uint256" } ], - "gas": 2126 + "gas": "2126" }, { "stateMutability": "view", @@ -832,7 +832,7 @@ "type": "uint256" } ], - "gas": 2156 + "gas": "2156" }, { "stateMutability": "view", @@ -845,7 +845,7 @@ "type": "uint256" } ], - "gas": 2186 + "gas": "2186" }, { "stateMutability": "view", @@ -858,7 +858,7 @@ "type": "uint256" } ], - "gas": 2216 + "gas": "2216" }, { "stateMutability": "view", @@ -871,7 +871,7 @@ "type": "uint256" } ], - "gas": 2246 + "gas": "2246" }, { "stateMutability": "view", @@ -884,7 +884,7 @@ "type": "uint256" } ], - "gas": 2276 + "gas": "2276" }, { "stateMutability": "view", @@ -897,7 +897,7 @@ "type": "uint256" } ], - "gas": 2306 + "gas": "2306" }, { "stateMutability": "view", @@ -910,7 +910,7 @@ "type": "uint256" } ], - "gas": 2336 + "gas": "2336" }, { "stateMutability": "view", @@ -923,7 +923,7 @@ "type": "uint256" } ], - "gas": 2366 + "gas": "2366" }, { "stateMutability": "view", @@ -936,7 +936,7 @@ "type": "uint256" } ], - "gas": 2396 + "gas": "2396" }, { "stateMutability": "view", @@ -949,7 +949,7 @@ "type": "uint256" } ], - "gas": 2426 + "gas": "2426" }, { "stateMutability": "view", @@ -962,7 +962,7 @@ "type": "uint256" } ], - "gas": 2456 + "gas": "2456" }, { "stateMutability": "view", @@ -975,7 +975,7 @@ "type": "uint256" } ], - "gas": 2486 + "gas": "2486" }, { "stateMutability": "view", @@ -988,7 +988,7 @@ "type": "uint256" } ], - "gas": 2516 + "gas": "2516" }, { "stateMutability": "view", @@ -1001,7 +1001,7 @@ "type": "uint256" } ], - "gas": 2546 + "gas": "2546" }, { "stateMutability": "view", @@ -1014,7 +1014,7 @@ "type": "uint256" } ], - "gas": 2576 + "gas": "2576" }, { "stateMutability": "view", @@ -1027,7 +1027,7 @@ "type": "uint256" } ], - "gas": 2606 + "gas": "2606" }, { "stateMutability": "view", @@ -1040,7 +1040,7 @@ "type": "uint256" } ], - "gas": 2636 + "gas": "2636" }, { "stateMutability": "view", @@ -1053,7 +1053,7 @@ "type": "uint256" } ], - "gas": 2666 + "gas": "2666" }, { "stateMutability": "view", @@ -1066,7 +1066,7 @@ "type": "uint256" } ], - "gas": 2696 + "gas": "2696" }, { "stateMutability": "view", @@ -1079,7 +1079,7 @@ "type": "uint256" } ], - "gas": 2726 + "gas": "2726" }, { "stateMutability": "view", @@ -1092,7 +1092,7 @@ "type": "uint256" } ], - "gas": 2756 + "gas": "2756" }, { "stateMutability": "view", @@ -1110,7 +1110,7 @@ "type": "uint256" } ], - "gas": 2831 + "gas": "2831" }, { "stateMutability": "view", @@ -1123,7 +1123,7 @@ "type": "uint256" } ], - "gas": 2816 + "gas": "2816" }, { "stateMutability": "view", @@ -1136,7 +1136,7 @@ "type": "address" } ], - "gas": 2846 + "gas": "2846" }, { "stateMutability": "view", @@ -1149,7 +1149,7 @@ "type": "address" } ], - "gas": 2876 + "gas": "2876" }, { "stateMutability": "view", @@ -1162,7 +1162,7 @@ "type": "uint256" } ], - "gas": 2906 + "gas": "2906" }, { "stateMutability": "view", @@ -1175,7 +1175,7 @@ "type": "uint256" } ], - "gas": 2936 + "gas": "2936" }, { "stateMutability": "view", @@ -1188,7 +1188,7 @@ "type": "uint256" } ], - "gas": 2966 + "gas": "2966" }, { "stateMutability": "view", @@ -1201,7 +1201,7 @@ "type": "bool" } ], - "gas": 2996 + "gas": "2996" }, { "stateMutability": "view", @@ -1214,7 +1214,7 @@ "type": "uint256" } ], - "gas": 3026 + "gas": "3026" }, { "stateMutability": "view", @@ -1227,7 +1227,7 @@ "type": "uint256" } ], - "gas": 3056 + "gas": "3056" }, { "stateMutability": "view", @@ -1240,7 +1240,7 @@ "type": "uint256" } ], - "gas": 3086 + "gas": "3086" }, { "stateMutability": "view", @@ -1253,6 +1253,6 @@ "type": "address" } ], - "gas": 3116 + "gas": "3116" } ] \ No newline at end of file diff --git a/src/constants/abis/json/eurt/swap.json b/src/constants/abis/json/eurt/swap.json index 9799362c..5c9ec8f0 100644 --- a/src/constants/abis/json/eurt/swap.json +++ b/src/constants/abis/json/eurt/swap.json @@ -274,7 +274,7 @@ } ], "outputs": [], - "gas": 471502 + "gas": "471502" }, { "stateMutability": "view", @@ -287,7 +287,7 @@ "type": "uint256" } ], - "gas": 318 + "gas": "318" }, { "stateMutability": "nonpayable", @@ -309,7 +309,7 @@ "type": "bool" } ], - "gas": 77977 + "gas": "77977" }, { "stateMutability": "nonpayable", @@ -335,7 +335,7 @@ "type": "bool" } ], - "gas": 115912 + "gas": "115912" }, { "stateMutability": "nonpayable", @@ -357,7 +357,7 @@ "type": "bool" } ], - "gas": 37851 + "gas": "37851" }, { "stateMutability": "view", @@ -370,7 +370,7 @@ "type": "uint256[2]" } ], - "gas": 4707 + "gas": "4707" }, { "stateMutability": "view", @@ -383,7 +383,7 @@ "type": "uint256" } ], - "gas": 468 + "gas": "468" }, { "stateMutability": "view", @@ -396,7 +396,7 @@ "type": "uint256" } ], - "gas": 10764 + "gas": "10764" }, { "stateMutability": "view", @@ -409,7 +409,7 @@ "type": "uint256" } ], - "gas": 10726 + "gas": "10726" }, { "stateMutability": "view", @@ -422,7 +422,7 @@ "type": "uint256" } ], - "gas": 848656 + "gas": "848656" }, { "stateMutability": "view", @@ -444,7 +444,7 @@ "type": "uint256" } ], - "gas": 3336308 + "gas": "3336308" }, { "stateMutability": "nonpayable", @@ -491,7 +491,7 @@ "type": "uint256" } ], - "gas": 2117591 + "gas": "2117591" }, { "stateMutability": "nonpayable", @@ -584,7 +584,7 @@ "type": "uint256" } ], - "gas": 1100 + "gas": "1100" }, { "stateMutability": "nonpayable", @@ -626,7 +626,7 @@ } ], "outputs": [], - "gas": 162101 + "gas": "162101" }, { "stateMutability": "nonpayable", @@ -634,7 +634,7 @@ "name": "stop_ramp_A", "inputs": [], "outputs": [], - "gas": 157565 + "gas": "157565" }, { "stateMutability": "view", @@ -652,7 +652,7 @@ "type": "uint256" } ], - "gas": 7740 + "gas": "7740" }, { "stateMutability": "nonpayable", @@ -660,7 +660,7 @@ "name": "withdraw_admin_fees", "inputs": [], "outputs": [], - "gas": 33182 + "gas": "33182" }, { "stateMutability": "view", @@ -678,7 +678,7 @@ "type": "address" } ], - "gas": 3093 + "gas": "3093" }, { "stateMutability": "view", @@ -696,7 +696,7 @@ "type": "uint256" } ], - "gas": 3123 + "gas": "3123" }, { "stateMutability": "view", @@ -709,7 +709,7 @@ "type": "uint256" } ], - "gas": 3108 + "gas": "3108" }, { "stateMutability": "view", @@ -722,7 +722,7 @@ "type": "uint256" } ], - "gas": 3138 + "gas": "3138" }, { "stateMutability": "view", @@ -735,7 +735,7 @@ "type": "uint256" } ], - "gas": 3168 + "gas": "3168" }, { "stateMutability": "view", @@ -748,7 +748,7 @@ "type": "uint256" } ], - "gas": 3198 + "gas": "3198" }, { "stateMutability": "view", @@ -761,7 +761,7 @@ "type": "uint256" } ], - "gas": 3228 + "gas": "3228" }, { "stateMutability": "view", @@ -774,7 +774,7 @@ "type": "string" } ], - "gas": 13488 + "gas": "13488" }, { "stateMutability": "view", @@ -787,7 +787,7 @@ "type": "string" } ], - "gas": 11241 + "gas": "11241" }, { "stateMutability": "view", @@ -805,7 +805,7 @@ "type": "uint256" } ], - "gas": 3533 + "gas": "3533" }, { "stateMutability": "view", @@ -827,7 +827,7 @@ "type": "uint256" } ], - "gas": 3778 + "gas": "3778" }, { "stateMutability": "view", @@ -840,6 +840,6 @@ "type": "uint256" } ], - "gas": 3378 + "gas": "3378" } ] \ No newline at end of file diff --git a/src/constants/abis/json/eurtusd/deposit.json b/src/constants/abis/json/eurtusd/deposit.json index 7f9b6036..da1b4a20 100644 --- a/src/constants/abis/json/eurtusd/deposit.json +++ b/src/constants/abis/json/eurtusd/deposit.json @@ -26,7 +26,7 @@ "type": "uint256" } ], - "gas": 4244 + "gas": "4244" }, { "stateMutability": "nonpayable", @@ -43,7 +43,7 @@ } ], "outputs": [], - "gas": 26265 + "gas": "26265" }, { "stateMutability": "nonpayable", @@ -73,7 +73,7 @@ "type": "uint256" } ], - "gas": 20845 + "gas": "20845" }, { "stateMutability": "nonpayable", @@ -90,7 +90,7 @@ } ], "outputs": [], - "gas": 37086 + "gas": "37086" }, { "stateMutability": "nonpayable", @@ -111,7 +111,7 @@ } ], "outputs": [], - "gas": 13300 + "gas": "13300" }, { "stateMutability": "view", @@ -137,7 +137,7 @@ "type": "uint256" } ], - "gas": 9447 + "gas": "9447" }, { "stateMutability": "view", @@ -155,7 +155,7 @@ "type": "uint256" } ], - "gas": 4967 + "gas": "4967" }, { "stateMutability": "view", @@ -177,7 +177,7 @@ "type": "uint256" } ], - "gas": 6555 + "gas": "6555" }, { "stateMutability": "view", @@ -195,7 +195,7 @@ "type": "address" } ], - "gas": 1505 + "gas": "1505" }, { "stateMutability": "view", @@ -213,7 +213,7 @@ "type": "address" } ], - "gas": 1541 + "gas": "1541" }, { "stateMutability": "view", @@ -226,7 +226,7 @@ "type": "address" } ], - "gas": 1526 + "gas": "1526" }, { "stateMutability": "view", @@ -239,7 +239,7 @@ "type": "address" } ], - "gas": 1556 + "gas": "1556" }, { "stateMutability": "view", @@ -252,6 +252,6 @@ "type": "address" } ], - "gas": 1586 + "gas": "1586" } ] \ No newline at end of file diff --git a/src/constants/abis/json/eurtusd/swap.json b/src/constants/abis/json/eurtusd/swap.json index 6a935be2..bc9c4ac6 100644 --- a/src/constants/abis/json/eurtusd/swap.json +++ b/src/constants/abis/json/eurtusd/swap.json @@ -368,7 +368,7 @@ "type": "address" } ], - "gas": 426 + "gas": "426" }, { "stateMutability": "view", @@ -386,7 +386,7 @@ "type": "address" } ], - "gas": 558 + "gas": "558" }, { "stateMutability": "view", @@ -399,7 +399,7 @@ "type": "uint256" } ], - "gas": 595 + "gas": "595" }, { "stateMutability": "view", @@ -412,7 +412,7 @@ "type": "uint256" } ], - "gas": 6499 + "gas": "6499" }, { "stateMutability": "view", @@ -425,7 +425,7 @@ "type": "uint256" } ], - "gas": 9743 + "gas": "9743" }, { "stateMutability": "view", @@ -438,7 +438,7 @@ "type": "uint256" } ], - "gas": 360707 + "gas": "360707" }, { "stateMutability": "nonpayable", @@ -468,7 +468,7 @@ "type": "uint256" } ], - "gas": 16670379 + "gas": "16670379" }, { "stateMutability": "view", @@ -494,7 +494,7 @@ "type": "uint256" } ], - "gas": 4557895 + "gas": "4557895" }, { "stateMutability": "nonpayable", @@ -516,7 +516,7 @@ "type": "uint256" } ], - "gas": 17621237 + "gas": "17621237" }, { "stateMutability": "nonpayable", @@ -533,7 +533,7 @@ } ], "outputs": [], - "gas": 174292 + "gas": "174292" }, { "stateMutability": "view", @@ -551,7 +551,7 @@ "type": "uint256" } ], - "gas": 5182497 + "gas": "5182497" }, { "stateMutability": "view", @@ -573,7 +573,7 @@ "type": "uint256" } ], - "gas": 7264 + "gas": "7264" }, { "stateMutability": "nonpayable", @@ -599,7 +599,7 @@ "type": "uint256" } ], - "gas": 16601846 + "gas": "16601846" }, { "stateMutability": "nonpayable", @@ -607,7 +607,7 @@ "name": "claim_admin_fees", "inputs": [], "outputs": [], - "gas": 3226971 + "gas": "3226971" }, { "stateMutability": "nonpayable", @@ -628,7 +628,7 @@ } ], "outputs": [], - "gas": 153778 + "gas": "153778" }, { "stateMutability": "nonpayable", @@ -636,7 +636,7 @@ "name": "stop_ramp_A_gamma", "inputs": [], "outputs": [], - "gas": 150123 + "gas": "150123" }, { "stateMutability": "nonpayable", @@ -673,7 +673,7 @@ } ], "outputs": [], - "gas": 293264 + "gas": "293264" }, { "stateMutability": "nonpayable", @@ -681,7 +681,7 @@ "name": "apply_new_parameters", "inputs": [], "outputs": [], - "gas": 3504861 + "gas": "3504861" }, { "stateMutability": "nonpayable", @@ -689,7 +689,7 @@ "name": "revert_new_parameters", "inputs": [], "outputs": [], - "gas": 21722 + "gas": "21722" }, { "stateMutability": "nonpayable", @@ -702,7 +702,7 @@ } ], "outputs": [], - "gas": 76107 + "gas": "76107" }, { "stateMutability": "nonpayable", @@ -710,7 +710,7 @@ "name": "apply_transfer_ownership", "inputs": [], "outputs": [], - "gas": 61722 + "gas": "61722" }, { "stateMutability": "nonpayable", @@ -718,7 +718,7 @@ "name": "revert_transfer_ownership", "inputs": [], "outputs": [], - "gas": 21812 + "gas": "21812" }, { "stateMutability": "nonpayable", @@ -726,7 +726,7 @@ "name": "kill_me", "inputs": [], "outputs": [], - "gas": 37735 + "gas": "37735" }, { "stateMutability": "nonpayable", @@ -734,7 +734,7 @@ "name": "unkill_me", "inputs": [], "outputs": [], - "gas": 21872 + "gas": "21872" }, { "stateMutability": "nonpayable", @@ -747,7 +747,7 @@ } ], "outputs": [], - "gas": 37062 + "gas": "37062" }, { "stateMutability": "view", @@ -760,7 +760,7 @@ "type": "uint256" } ], - "gas": 1976 + "gas": "1976" }, { "stateMutability": "view", @@ -773,7 +773,7 @@ "type": "uint256" } ], - "gas": 2006 + "gas": "2006" }, { "stateMutability": "view", @@ -786,7 +786,7 @@ "type": "uint256" } ], - "gas": 2036 + "gas": "2036" }, { "stateMutability": "view", @@ -799,7 +799,7 @@ "type": "uint256" } ], - "gas": 2066 + "gas": "2066" }, { "stateMutability": "view", @@ -812,7 +812,7 @@ "type": "uint256" } ], - "gas": 2096 + "gas": "2096" }, { "stateMutability": "view", @@ -825,7 +825,7 @@ "type": "uint256" } ], - "gas": 2126 + "gas": "2126" }, { "stateMutability": "view", @@ -838,7 +838,7 @@ "type": "uint256" } ], - "gas": 2156 + "gas": "2156" }, { "stateMutability": "view", @@ -851,7 +851,7 @@ "type": "uint256" } ], - "gas": 2186 + "gas": "2186" }, { "stateMutability": "view", @@ -864,7 +864,7 @@ "type": "uint256" } ], - "gas": 2216 + "gas": "2216" }, { "stateMutability": "view", @@ -877,7 +877,7 @@ "type": "uint256" } ], - "gas": 2246 + "gas": "2246" }, { "stateMutability": "view", @@ -890,7 +890,7 @@ "type": "uint256" } ], - "gas": 2276 + "gas": "2276" }, { "stateMutability": "view", @@ -903,7 +903,7 @@ "type": "uint256" } ], - "gas": 2306 + "gas": "2306" }, { "stateMutability": "view", @@ -916,7 +916,7 @@ "type": "uint256" } ], - "gas": 2336 + "gas": "2336" }, { "stateMutability": "view", @@ -929,7 +929,7 @@ "type": "uint256" } ], - "gas": 2366 + "gas": "2366" }, { "stateMutability": "view", @@ -942,7 +942,7 @@ "type": "uint256" } ], - "gas": 2396 + "gas": "2396" }, { "stateMutability": "view", @@ -955,7 +955,7 @@ "type": "uint256" } ], - "gas": 2426 + "gas": "2426" }, { "stateMutability": "view", @@ -968,7 +968,7 @@ "type": "uint256" } ], - "gas": 2456 + "gas": "2456" }, { "stateMutability": "view", @@ -981,7 +981,7 @@ "type": "uint256" } ], - "gas": 2486 + "gas": "2486" }, { "stateMutability": "view", @@ -994,7 +994,7 @@ "type": "uint256" } ], - "gas": 2516 + "gas": "2516" }, { "stateMutability": "view", @@ -1007,7 +1007,7 @@ "type": "uint256" } ], - "gas": 2546 + "gas": "2546" }, { "stateMutability": "view", @@ -1020,7 +1020,7 @@ "type": "uint256" } ], - "gas": 2576 + "gas": "2576" }, { "stateMutability": "view", @@ -1033,7 +1033,7 @@ "type": "uint256" } ], - "gas": 2606 + "gas": "2606" }, { "stateMutability": "view", @@ -1051,7 +1051,7 @@ "type": "uint256" } ], - "gas": 2681 + "gas": "2681" }, { "stateMutability": "view", @@ -1064,7 +1064,7 @@ "type": "uint256" } ], - "gas": 2666 + "gas": "2666" }, { "stateMutability": "view", @@ -1077,7 +1077,7 @@ "type": "address" } ], - "gas": 2696 + "gas": "2696" }, { "stateMutability": "view", @@ -1090,7 +1090,7 @@ "type": "address" } ], - "gas": 2726 + "gas": "2726" }, { "stateMutability": "view", @@ -1103,7 +1103,7 @@ "type": "uint256" } ], - "gas": 2756 + "gas": "2756" }, { "stateMutability": "view", @@ -1116,7 +1116,7 @@ "type": "uint256" } ], - "gas": 2786 + "gas": "2786" }, { "stateMutability": "view", @@ -1129,7 +1129,7 @@ "type": "uint256" } ], - "gas": 2816 + "gas": "2816" }, { "stateMutability": "view", @@ -1142,7 +1142,7 @@ "type": "bool" } ], - "gas": 2846 + "gas": "2846" }, { "stateMutability": "view", @@ -1155,7 +1155,7 @@ "type": "uint256" } ], - "gas": 2876 + "gas": "2876" }, { "stateMutability": "view", @@ -1168,7 +1168,7 @@ "type": "uint256" } ], - "gas": 2906 + "gas": "2906" }, { "stateMutability": "view", @@ -1181,7 +1181,7 @@ "type": "uint256" } ], - "gas": 2936 + "gas": "2936" }, { "stateMutability": "view", @@ -1194,6 +1194,6 @@ "type": "address" } ], - "gas": 2966 + "gas": "2966" } ] \ No newline at end of file diff --git a/src/constants/abis/json/ren-polygon/swap.json b/src/constants/abis/json/ren-polygon/swap.json index 794c316f..ff6f5b76 100644 --- a/src/constants/abis/json/ren-polygon/swap.json +++ b/src/constants/abis/json/ren-polygon/swap.json @@ -344,7 +344,7 @@ "type": "uint256" } ], - "gas": 10374 + "gas": "10374" }, { "stateMutability": "view", @@ -357,7 +357,7 @@ "type": "uint256" } ], - "gas": 10336 + "gas": "10336" }, { "stateMutability": "view", @@ -379,7 +379,7 @@ "type": "uint256" } ], - "gas": 22089 + "gas": "22089" }, { "stateMutability": "view", @@ -397,7 +397,7 @@ "type": "uint256" } ], - "gas": 7358 + "gas": "7358" }, { "stateMutability": "view", @@ -410,7 +410,7 @@ "type": "uint256" } ], - "gas": 2237133 + "gas": "2237133" }, { "stateMutability": "view", @@ -432,7 +432,7 @@ "type": "uint256" } ], - "gas": 4445096 + "gas": "4445096" }, { "stateMutability": "nonpayable", @@ -483,7 +483,7 @@ "type": "uint256" } ], - "gas": 5357975 + "gas": "5357975" }, { "stateMutability": "view", @@ -509,7 +509,7 @@ "type": "uint256" } ], - "gas": 5358005 + "gas": "5358005" }, { "stateMutability": "nonpayable", @@ -539,7 +539,7 @@ "type": "uint256" } ], - "gas": 5525027 + "gas": "5525027" }, { "stateMutability": "nonpayable", @@ -569,7 +569,7 @@ "type": "uint256" } ], - "gas": 5541345 + "gas": "5541345" }, { "stateMutability": "nonpayable", @@ -641,7 +641,7 @@ "type": "uint256" } ], - "gas": 4008194 + "gas": "4008194" }, { "stateMutability": "nonpayable", @@ -687,7 +687,7 @@ } ], "outputs": [], - "gas": 159459 + "gas": "159459" }, { "stateMutability": "nonpayable", @@ -695,7 +695,7 @@ "name": "stop_ramp_A", "inputs": [], "outputs": [], - "gas": 154920 + "gas": "154920" }, { "stateMutability": "nonpayable", @@ -716,7 +716,7 @@ } ], "outputs": [], - "gas": 148809 + "gas": "148809" }, { "stateMutability": "nonpayable", @@ -724,7 +724,7 @@ "name": "apply_new_fee", "inputs": [], "outputs": [], - "gas": 141271 + "gas": "141271" }, { "stateMutability": "nonpayable", @@ -732,7 +732,7 @@ "name": "revert_new_parameters", "inputs": [], "outputs": [], - "gas": 23012 + "gas": "23012" }, { "stateMutability": "nonpayable", @@ -745,7 +745,7 @@ } ], "outputs": [], - "gas": 77050 + "gas": "77050" }, { "stateMutability": "nonpayable", @@ -753,7 +753,7 @@ "name": "apply_transfer_ownership", "inputs": [], "outputs": [], - "gas": 65727 + "gas": "65727" }, { "stateMutability": "nonpayable", @@ -761,7 +761,7 @@ "name": "revert_transfer_ownership", "inputs": [], "outputs": [], - "gas": 23102 + "gas": "23102" }, { "stateMutability": "nonpayable", @@ -769,7 +769,7 @@ "name": "withdraw_admin_fees", "inputs": [], "outputs": [], - "gas": 61714 + "gas": "61714" }, { "stateMutability": "nonpayable", @@ -777,7 +777,7 @@ "name": "donate_admin_fees", "inputs": [], "outputs": [], - "gas": 43291 + "gas": "43291" }, { "stateMutability": "nonpayable", @@ -785,7 +785,7 @@ "name": "kill_me", "inputs": [], "outputs": [], - "gas": 40385 + "gas": "40385" }, { "stateMutability": "nonpayable", @@ -793,7 +793,7 @@ "name": "unkill_me", "inputs": [], "outputs": [], - "gas": 23222 + "gas": "23222" }, { "stateMutability": "nonpayable", @@ -806,7 +806,7 @@ } ], "outputs": [], - "gas": 38352 + "gas": "38352" }, { "stateMutability": "nonpayable", @@ -819,7 +819,7 @@ } ], "outputs": [], - "gas": 38385 + "gas": "38385" }, { "stateMutability": "nonpayable", @@ -832,7 +832,7 @@ } ], "outputs": [], - "gas": 38415 + "gas": "38415" }, { "stateMutability": "view", @@ -850,7 +850,7 @@ "type": "address" } ], - "gas": 3397 + "gas": "3397" }, { "stateMutability": "view", @@ -868,7 +868,7 @@ "type": "address" } ], - "gas": 3427 + "gas": "3427" }, { "stateMutability": "view", @@ -886,7 +886,7 @@ "type": "uint256" } ], - "gas": 3457 + "gas": "3457" }, { "stateMutability": "view", @@ -899,7 +899,7 @@ "type": "uint256" } ], - "gas": 3378 + "gas": "3378" }, { "stateMutability": "view", @@ -912,7 +912,7 @@ "type": "uint256" } ], - "gas": 3408 + "gas": "3408" }, { "stateMutability": "view", @@ -925,7 +925,7 @@ "type": "uint256" } ], - "gas": 3438 + "gas": "3438" }, { "stateMutability": "view", @@ -938,7 +938,7 @@ "type": "address" } ], - "gas": 3468 + "gas": "3468" }, { "stateMutability": "view", @@ -951,7 +951,7 @@ "type": "address" } ], - "gas": 3498 + "gas": "3498" }, { "stateMutability": "view", @@ -964,7 +964,7 @@ "type": "uint256" } ], - "gas": 3528 + "gas": "3528" }, { "stateMutability": "view", @@ -977,7 +977,7 @@ "type": "uint256" } ], - "gas": 3558 + "gas": "3558" }, { "stateMutability": "view", @@ -990,7 +990,7 @@ "type": "uint256" } ], - "gas": 3588 + "gas": "3588" }, { "stateMutability": "view", @@ -1003,7 +1003,7 @@ "type": "uint256" } ], - "gas": 3618 + "gas": "3618" }, { "stateMutability": "view", @@ -1016,7 +1016,7 @@ "type": "uint256" } ], - "gas": 3648 + "gas": "3648" }, { "stateMutability": "view", @@ -1029,7 +1029,7 @@ "type": "uint256" } ], - "gas": 3678 + "gas": "3678" }, { "stateMutability": "view", @@ -1042,7 +1042,7 @@ "type": "uint256" } ], - "gas": 3708 + "gas": "3708" }, { "stateMutability": "view", @@ -1055,7 +1055,7 @@ "type": "uint256" } ], - "gas": 3738 + "gas": "3738" }, { "stateMutability": "view", @@ -1068,7 +1068,7 @@ "type": "uint256" } ], - "gas": 3768 + "gas": "3768" }, { "stateMutability": "view", @@ -1081,7 +1081,7 @@ "type": "address" } ], - "gas": 3798 + "gas": "3798" }, { "stateMutability": "view", @@ -1094,7 +1094,7 @@ "type": "address" } ], - "gas": 3828 + "gas": "3828" }, { "stateMutability": "view", @@ -1107,6 +1107,6 @@ "type": "address" } ], - "gas": 3858 + "gas": "3858" } ] \ No newline at end of file diff --git a/src/constants/abis/json/reth/swap.json b/src/constants/abis/json/reth/swap.json index 31e08d41..7c537e46 100644 --- a/src/constants/abis/json/reth/swap.json +++ b/src/constants/abis/json/reth/swap.json @@ -298,7 +298,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 5289 + "gas": "5289" }, { "name": "A_precise", @@ -311,7 +311,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 5251 + "gas": "5251" }, { "name": "get_virtual_price", @@ -324,7 +324,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 1007693 + "gas": "1007693" }, { "name": "calc_token_amount", @@ -346,7 +346,7 @@ ], "stateMutability": "view", "type": "function", - "gas": 2008092 + "gas": "2008092" }, { "name": "add_liquidity", @@ -368,7 +368,7 @@ ], "stateMutability": "payable", "type": "function", - "gas": 3177140 + "gas": "3177140" }, { "name": "get_dy", @@ -394,7 +394,7 @@ ], "stateMutability": "view", "type": "function", - "gas": 2444404 + "gas": "2444404" }, { "name": "exchange", @@ -424,7 +424,7 @@ ], "stateMutability": "payable", "type": "function", - "gas": 2638539 + "gas": "2638539" }, { "name": "remove_liquidity", @@ -446,7 +446,7 @@ ], "stateMutability": "nonpayable", "type": "function", - "gas": 230063 + "gas": "230063" }, { "name": "remove_liquidity_imbalance", @@ -468,7 +468,7 @@ ], "stateMutability": "nonpayable", "type": "function", - "gas": 3240360 + "gas": "3240360" }, { "name": "calc_withdraw_one_coin", @@ -490,7 +490,7 @@ ], "stateMutability": "view", "type": "function", - "gas": 1375 + "gas": "1375" }, { "name": "remove_liquidity_one_coin", @@ -516,7 +516,7 @@ ], "stateMutability": "nonpayable", "type": "function", - "gas": 3899991 + "gas": "3899991" }, { "name": "ramp_A", @@ -533,7 +533,7 @@ ], "stateMutability": "nonpayable", "type": "function", - "gas": 151774 + "gas": "151774" }, { "name": "stop_ramp_A", @@ -541,7 +541,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 148535 + "gas": "148535" }, { "name": "commit_new_fee", @@ -558,7 +558,7 @@ ], "stateMutability": "nonpayable", "type": "function", - "gas": 110371 + "gas": "110371" }, { "name": "apply_new_fee", @@ -566,7 +566,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 153055 + "gas": "153055" }, { "name": "revert_new_parameters", @@ -574,7 +574,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 21805 + "gas": "21805" }, { "name": "commit_transfer_ownership", @@ -587,7 +587,7 @@ ], "stateMutability": "nonpayable", "type": "function", - "gas": 74543 + "gas": "74543" }, { "name": "apply_transfer_ownership", @@ -595,7 +595,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 116523 + "gas": "116523" }, { "name": "revert_transfer_ownership", @@ -603,7 +603,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 21895 + "gas": "21895" }, { "name": "admin_balances", @@ -621,7 +621,7 @@ ], "stateMutability": "view", "type": "function", - "gas": 3453 + "gas": "3453" }, { "name": "withdraw_admin_fees", @@ -629,7 +629,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 133752 + "gas": "133752" }, { "name": "donate_admin_fees", @@ -637,7 +637,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 130899 + "gas": "130899" }, { "name": "kill_me", @@ -645,7 +645,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 37908 + "gas": "37908" }, { "name": "unkill_me", @@ -653,7 +653,7 @@ "inputs": [], "stateMutability": "nonpayable", "type": "function", - "gas": 22045 + "gas": "22045" }, { "name": "coins", @@ -671,7 +671,7 @@ ], "stateMutability": "view", "type": "function", - "gas": 2130 + "gas": "2130" }, { "name": "balances", @@ -689,7 +689,7 @@ ], "stateMutability": "view", "type": "function", - "gas": 2160 + "gas": "2160" }, { "name": "fee", @@ -702,7 +702,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2081 + "gas": "2081" }, { "name": "admin_fee", @@ -715,7 +715,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2111 + "gas": "2111" }, { "name": "owner", @@ -728,7 +728,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2141 + "gas": "2141" }, { "name": "initial_A", @@ -741,7 +741,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2171 + "gas": "2171" }, { "name": "future_A", @@ -754,7 +754,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2201 + "gas": "2201" }, { "name": "initial_A_time", @@ -767,7 +767,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2231 + "gas": "2231" }, { "name": "future_A_time", @@ -780,7 +780,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2261 + "gas": "2261" }, { "name": "admin_actions_deadline", @@ -793,7 +793,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2291 + "gas": "2291" }, { "name": "transfer_ownership_deadline", @@ -806,7 +806,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2321 + "gas": "2321" }, { "name": "future_fee", @@ -819,7 +819,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2351 + "gas": "2351" }, { "name": "future_admin_fee", @@ -832,7 +832,7 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2381 + "gas": "2381" }, { "name": "future_owner", @@ -845,6 +845,6 @@ "inputs": [], "stateMutability": "view", "type": "function", - "gas": 2411 + "gas": "2411" } ] diff --git a/src/constants/abis/json/tricrypto2/deposit.json b/src/constants/abis/json/tricrypto2/deposit.json index 7dd4508a..86edab55 100644 --- a/src/constants/abis/json/tricrypto2/deposit.json +++ b/src/constants/abis/json/tricrypto2/deposit.json @@ -92,7 +92,7 @@ "type": "address" } ], - "gas": 2568 + "gas": "2568" }, { "stateMutability": "view", @@ -105,7 +105,7 @@ "type": "address" } ], - "gas": 2598 + "gas": "2598" }, { "stateMutability": "view", @@ -123,6 +123,6 @@ "type": "address" } ], - "gas": 2737 + "gas": "2737" } ] diff --git a/src/constants/abis/json/tricrypto2/swap.json b/src/constants/abis/json/tricrypto2/swap.json index 2b38baf4..65a4614b 100644 --- a/src/constants/abis/json/tricrypto2/swap.json +++ b/src/constants/abis/json/tricrypto2/swap.json @@ -376,7 +376,7 @@ "type": "uint256" } ], - "gas": 3361 + "gas": "3361" }, { "stateMutability": "view", @@ -394,7 +394,7 @@ "type": "uint256" } ], - "gas": 3391 + "gas": "3391" }, { "stateMutability": "view", @@ -412,7 +412,7 @@ "type": "uint256" } ], - "gas": 3421 + "gas": "3421" }, { "stateMutability": "view", @@ -425,7 +425,7 @@ "type": "address" } ], - "gas": 468 + "gas": "468" }, { "stateMutability": "view", @@ -443,7 +443,7 @@ "type": "address" } ], - "gas": 582 + "gas": "582" }, { "stateMutability": "view", @@ -456,7 +456,7 @@ "type": "uint256" } ], - "gas": 597 + "gas": "597" }, { "stateMutability": "view", @@ -469,7 +469,7 @@ "type": "uint256" } ], - "gas": 11991 + "gas": "11991" }, { "stateMutability": "view", @@ -482,7 +482,7 @@ "type": "uint256" } ], - "gas": 21673 + "gas": "21673" }, { "stateMutability": "view", @@ -500,7 +500,7 @@ "type": "uint256" } ], - "gas": 11096 + "gas": "11096" }, { "stateMutability": "view", @@ -513,7 +513,7 @@ "type": "uint256" } ], - "gas": 11582 + "gas": "11582" }, { "stateMutability": "payable", @@ -567,7 +567,7 @@ "type": "uint256" } ], - "gas": 3122 + "gas": "3122" }, { "stateMutability": "view", @@ -589,7 +589,7 @@ "type": "uint256" } ], - "gas": 26582 + "gas": "26582" }, { "stateMutability": "nonpayable", @@ -606,7 +606,7 @@ } ], "outputs": [], - "gas": 738687 + "gas": "738687" }, { "stateMutability": "nonpayable", @@ -623,7 +623,7 @@ } ], "outputs": [], - "gas": 233981 + "gas": "233981" }, { "stateMutability": "view", @@ -645,7 +645,7 @@ "type": "uint256" } ], - "gas": 3429 + "gas": "3429" }, { "stateMutability": "view", @@ -667,7 +667,7 @@ "type": "uint256" } ], - "gas": 13432 + "gas": "13432" }, { "stateMutability": "nonpayable", @@ -688,7 +688,7 @@ } ], "outputs": [], - "gas": 648579 + "gas": "648579" }, { "stateMutability": "nonpayable", @@ -696,7 +696,7 @@ "name": "claim_admin_fees", "inputs": [], "outputs": [], - "gas": 389808 + "gas": "389808" }, { "stateMutability": "nonpayable", @@ -717,7 +717,7 @@ } ], "outputs": [], - "gas": 163102 + "gas": "163102" }, { "stateMutability": "nonpayable", @@ -725,7 +725,7 @@ "name": "stop_ramp_A_gamma", "inputs": [], "outputs": [], - "gas": 157247 + "gas": "157247" }, { "stateMutability": "nonpayable", @@ -762,7 +762,7 @@ } ], "outputs": [], - "gas": 306190 + "gas": "306190" }, { "stateMutability": "nonpayable", @@ -770,7 +770,7 @@ "name": "apply_new_parameters", "inputs": [], "outputs": [], - "gas": 683438 + "gas": "683438" }, { "stateMutability": "nonpayable", @@ -778,7 +778,7 @@ "name": "revert_new_parameters", "inputs": [], "outputs": [], - "gas": 23222 + "gas": "23222" }, { "stateMutability": "nonpayable", @@ -791,7 +791,7 @@ } ], "outputs": [], - "gas": 77260 + "gas": "77260" }, { "stateMutability": "nonpayable", @@ -799,7 +799,7 @@ "name": "apply_transfer_ownership", "inputs": [], "outputs": [], - "gas": 65937 + "gas": "65937" }, { "stateMutability": "nonpayable", @@ -807,7 +807,7 @@ "name": "revert_transfer_ownership", "inputs": [], "outputs": [], - "gas": 23312 + "gas": "23312" }, { "stateMutability": "nonpayable", @@ -815,7 +815,7 @@ "name": "kill_me", "inputs": [], "outputs": [], - "gas": 40535 + "gas": "40535" }, { "stateMutability": "nonpayable", @@ -823,7 +823,7 @@ "name": "unkill_me", "inputs": [], "outputs": [], - "gas": 23372 + "gas": "23372" }, { "stateMutability": "nonpayable", @@ -836,7 +836,7 @@ } ], "outputs": [], - "gas": 38505 + "gas": "38505" }, { "stateMutability": "view", @@ -849,7 +849,7 @@ "type": "uint256" } ], - "gas": 3378 + "gas": "3378" }, { "stateMutability": "view", @@ -862,7 +862,7 @@ "type": "uint256" } ], - "gas": 3408 + "gas": "3408" }, { "stateMutability": "view", @@ -875,7 +875,7 @@ "type": "uint256" } ], - "gas": 3438 + "gas": "3438" }, { "stateMutability": "view", @@ -888,7 +888,7 @@ "type": "uint256" } ], - "gas": 3468 + "gas": "3468" }, { "stateMutability": "view", @@ -901,7 +901,7 @@ "type": "uint256" } ], - "gas": 3498 + "gas": "3498" }, { "stateMutability": "view", @@ -914,7 +914,7 @@ "type": "uint256" } ], - "gas": 3528 + "gas": "3528" }, { "stateMutability": "view", @@ -927,7 +927,7 @@ "type": "uint256" } ], - "gas": 3558 + "gas": "3558" }, { "stateMutability": "view", @@ -940,7 +940,7 @@ "type": "uint256" } ], - "gas": 3588 + "gas": "3588" }, { "stateMutability": "view", @@ -953,7 +953,7 @@ "type": "uint256" } ], - "gas": 3618 + "gas": "3618" }, { "stateMutability": "view", @@ -966,7 +966,7 @@ "type": "uint256" } ], - "gas": 3648 + "gas": "3648" }, { "stateMutability": "view", @@ -979,7 +979,7 @@ "type": "uint256" } ], - "gas": 3678 + "gas": "3678" }, { "stateMutability": "view", @@ -992,7 +992,7 @@ "type": "uint256" } ], - "gas": 3708 + "gas": "3708" }, { "stateMutability": "view", @@ -1005,7 +1005,7 @@ "type": "uint256" } ], - "gas": 3738 + "gas": "3738" }, { "stateMutability": "view", @@ -1018,7 +1018,7 @@ "type": "uint256" } ], - "gas": 3768 + "gas": "3768" }, { "stateMutability": "view", @@ -1031,7 +1031,7 @@ "type": "uint256" } ], - "gas": 3798 + "gas": "3798" }, { "stateMutability": "view", @@ -1044,7 +1044,7 @@ "type": "uint256" } ], - "gas": 3828 + "gas": "3828" }, { "stateMutability": "view", @@ -1057,7 +1057,7 @@ "type": "uint256" } ], - "gas": 3858 + "gas": "3858" }, { "stateMutability": "view", @@ -1070,7 +1070,7 @@ "type": "uint256" } ], - "gas": 3888 + "gas": "3888" }, { "stateMutability": "view", @@ -1083,7 +1083,7 @@ "type": "uint256" } ], - "gas": 3918 + "gas": "3918" }, { "stateMutability": "view", @@ -1101,7 +1101,7 @@ "type": "uint256" } ], - "gas": 4057 + "gas": "4057" }, { "stateMutability": "view", @@ -1114,7 +1114,7 @@ "type": "uint256" } ], - "gas": 3978 + "gas": "3978" }, { "stateMutability": "view", @@ -1127,7 +1127,7 @@ "type": "address" } ], - "gas": 4008 + "gas": "4008" }, { "stateMutability": "view", @@ -1140,7 +1140,7 @@ "type": "address" } ], - "gas": 4038 + "gas": "4038" }, { "stateMutability": "view", @@ -1153,7 +1153,7 @@ "type": "uint256" } ], - "gas": 4068 + "gas": "4068" }, { "stateMutability": "view", @@ -1166,7 +1166,7 @@ "type": "uint256" } ], - "gas": 4098 + "gas": "4098" }, { "stateMutability": "view", @@ -1179,7 +1179,7 @@ "type": "uint256" } ], - "gas": 4128 + "gas": "4128" }, { "stateMutability": "view", @@ -1192,7 +1192,7 @@ "type": "bool" } ], - "gas": 4158 + "gas": "4158" }, { "stateMutability": "view", @@ -1205,7 +1205,7 @@ "type": "uint256" } ], - "gas": 4188 + "gas": "4188" }, { "stateMutability": "view", @@ -1218,7 +1218,7 @@ "type": "uint256" } ], - "gas": 4218 + "gas": "4218" }, { "stateMutability": "view", @@ -1231,7 +1231,7 @@ "type": "uint256" } ], - "gas": 4248 + "gas": "4248" }, { "stateMutability": "view", @@ -1244,6 +1244,6 @@ "type": "address" } ], - "gas": 4278 + "gas": "4278" } ] From c1f86c9d9f36a67def14f61a0d40008b6e0f2946 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Sun, 26 Dec 2021 14:11:11 +0300 Subject: [PATCH 08/24] feat: gaugeClaimableRewards --- src/pools.ts | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/pools.ts b/src/pools.ts index 047339ae..3b7f5ccd 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -19,7 +19,16 @@ import { _getStatsUrl, } from './utils'; import { DictInterface } from './interfaces'; -import { ALIASES, POOLS_DATA, curve, BTC_COINS_LOWER_CASE, ETH_COINS_LOWER_CASE, LINK_COINS_LOWER_CASE, COINS } from "./curve"; +import { + ALIASES, + POOLS_DATA, + curve, + BTC_COINS_LOWER_CASE, + ETH_COINS_LOWER_CASE, + LINK_COINS_LOWER_CASE, + COINS, + curve as _curve +} from "./curve"; import axios from "axios"; @@ -43,6 +52,7 @@ export class Pool { isCrypto: boolean; basePool: string; isFactory: boolean; + rewardTokens: string[]; estimateGas: { addLiquidityApprove: (amounts: string[]) => Promise, addLiquidity: (amounts: string[]) => Promise, @@ -97,6 +107,7 @@ export class Pool { this.isCrypto = poolData.is_crypto || false; this.isFactory = poolData.is_factory || false; this.basePool = poolData.base_pool || ''; + this.rewardTokens = poolData.reward_tokens || []; this.estimateGas = { addLiquidityApprove: this.addLiquidityApproveEstimateGas, addLiquidity: this.addLiquidityEstimateGas, @@ -1037,6 +1048,40 @@ export class Pool { return (await curve.contracts[ALIASES.minter].contract.mint(this.gauge, { ...curve.options, gasLimit })).hash; } + public gaugeClaimableRewards = async (address = ""): Promise<{token: string, symbol: string, amount: string}[]> => { + address = address || curve.signerAddress; + if (!address) throw Error("Need to connect wallet or pass address into args"); + + const gaugeContract = curve.contracts[this.gauge].contract; + const rewards = []; + if ('claimable_reward(address,address)' in gaugeContract) { + for (const rewardToken of this.rewardTokens) { + const rewardTokenContract = curve.contracts[rewardToken].contract; + const symbol = await rewardTokenContract.symbol(); + const decimals = await rewardTokenContract.decimals(); + const amount = ethers.utils.formatUnits(await gaugeContract.claimable_reward(address, rewardToken, curve.constantOptions), decimals); + rewards.push({ + token: rewardToken, + symbol: symbol, + amount: amount, + }) + } + } else if ('claimable_reward(address)' in gaugeContract && this.rewardTokens.length > 0) { + const rewardToken = this.rewardTokens[0]; + const rewardTokenContract = curve.contracts[rewardToken].contract; + const symbol = await rewardTokenContract.symbol(); + const decimals = await rewardTokenContract.decimals(); + const amount = ethers.utils.formatUnits(await gaugeContract.claimable_reward(address, curve.constantOptions), decimals); + rewards.push({ + token: rewardToken, + symbol: symbol, + amount: amount, + }) + } + + return rewards + } + public balances = async (...addresses: string[] | string[][]): Promise> | DictInterface> => { return await this._balances( ['lpToken', 'gauge', ...this.underlyingCoins, ...this.coins], From 3bc724e64c0008f4874beb72cfb00decd93d5e06 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Mon, 27 Dec 2021 11:53:10 +0300 Subject: [PATCH 09/24] chore: aave and saave rewards --- src/constants/abis/abis-ethereum.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/constants/abis/abis-ethereum.ts b/src/constants/abis/abis-ethereum.ts index 6ad42933..8a7b8dd5 100644 --- a/src/constants/abis/abis-ethereum.ts +++ b/src/constants/abis/abis-ethereum.ts @@ -63,6 +63,7 @@ import eursSCurveRewards_abi from './json/eurs/sCurveRewards.json'; import ustSwapABI from './json/ust/swap.json'; import ustDepositABI from './json/ust/deposit.json'; import aaveSwapABI from './json/aave/swap.json'; +import aaveRewardsABI from './json/aave/rewards.json'; import stethSwapABI from './json/steth/swap.json'; import stethSCurveRewards_abi from './json/steth/sCurveRewards.json'; import saaveSwapABI from './json/saave/swap.json'; @@ -1026,6 +1027,9 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811', ], swap_abi: aaveSwapABI, + sCurveRewards_abi: aaveRewardsABI, + sCurveRewards_address: "0x99ac10631F69C753DDb595D074422a0922D9056B", + reward_tokens: ["0x4da27a545c0c5b758a6ba100e3a049001de870f5"], gauge_abi: gaugeV2ABI, }, @@ -1081,6 +1085,9 @@ export const POOLS_DATA_ETHEREUM: { [index: string]: PoolDataInterface } = { '0x6c5024cd4f8a59110119c56f8933403a539555eb', ], swap_abi: saaveSwapABI, + sCurveRewards_abi: aaveRewardsABI, + sCurveRewards_address: "0xe5f41acad47849c6eb28b93913ca81893fb5a2a6", + reward_tokens: ["0x4da27a545c0c5b758a6ba100e3a049001de870f5"], gauge_abi: gaugeV2ABI, }, From 1eb97745ffbb7c0f28aeaaea9f1d590ed791733d Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Mon, 27 Dec 2021 11:54:07 +0300 Subject: [PATCH 10/24] fix: gauge ABIs methods duplication --- src/constants/abis/json/aave/rewards.json | 107 +++++++++++++++++++ src/constants/abis/json/gauge.json | 16 --- src/constants/abis/json/gauge_factory.json | 80 -------------- src/constants/abis/json/gauge_synthetix.json | 44 -------- src/constants/abis/json/gauge_v2.json | 28 ----- src/constants/abis/json/gauge_v3.json | 80 -------------- src/constants/abis/json/gauge_v4.json | 80 -------------- 7 files changed, 107 insertions(+), 328 deletions(-) create mode 100644 src/constants/abis/json/aave/rewards.json diff --git a/src/constants/abis/json/aave/rewards.json b/src/constants/abis/json/aave/rewards.json new file mode 100644 index 00000000..bb316957 --- /dev/null +++ b/src/constants/abis/json/aave/rewards.json @@ -0,0 +1,107 @@ +[ + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [], + "outputs": [], + "gas": "45372" + }, + { + "stateMutability": "view", + "type": "function", + "name": "last_claim", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "2424" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_receiver", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "2658" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_reward_receiver", + "inputs": [ + { + "name": "_reward_receiver", + "type": "address" + } + ], + "outputs": [], + "gas": "37635" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "commit_transfer_ownership", + "inputs": [ + { + "name": "_future_owner", + "type": "address" + } + ], + "outputs": [], + "gas": "37665" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "accept_transfer_ownership", + "inputs": [], + "outputs": [], + "gas": "37610" + }, + { + "stateMutability": "view", + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "2568" + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_owner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "2598" + } +] \ No newline at end of file diff --git a/src/constants/abis/json/gauge.json b/src/constants/abis/json/gauge.json index eaab8c4c..c809f6da 100644 --- a/src/constants/abis/json/gauge.json +++ b/src/constants/abis/json/gauge.json @@ -158,22 +158,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "name": "deposit", - "outputs": [], - "inputs": [ - { - "type": "uint256", - "name": "_value" - }, - { - "type": "address", - "name": "addr" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "name": "withdraw", "outputs": [], diff --git a/src/constants/abis/json/gauge_factory.json b/src/constants/abis/json/gauge_factory.json index 0f50cf2f..ecf07b52 100644 --- a/src/constants/abis/json/gauge_factory.json +++ b/src/constants/abis/json/gauge_factory.json @@ -274,34 +274,6 @@ "inputs": [], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "claim_rewards", - "inputs": [ - { - "name": "_addr", - "type": "address" - } - ], - "outputs": [] - }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "claim_rewards", - "inputs": [ - { - "name": "_addr", - "type": "address" - }, - { - "name": "_receiver", - "type": "address" - } - ], - "outputs": [] - }, { "stateMutability": "nonpayable", "type": "function", @@ -327,42 +299,6 @@ ], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "deposit", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_addr", - "type": "address" - } - ], - "outputs": [] - }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "deposit", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_addr", - "type": "address" - }, - { - "name": "_claim_rewards", - "type": "bool" - } - ], - "outputs": [] - }, { "stateMutability": "nonpayable", "type": "function", @@ -375,22 +311,6 @@ ], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "withdraw", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_claim_rewards", - "type": "bool" - } - ], - "outputs": [] - }, { "stateMutability": "nonpayable", "type": "function", diff --git a/src/constants/abis/json/gauge_synthetix.json b/src/constants/abis/json/gauge_synthetix.json index 525291f4..f0657f8e 100644 --- a/src/constants/abis/json/gauge_synthetix.json +++ b/src/constants/abis/json/gauge_synthetix.json @@ -184,22 +184,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "name": "deposit", - "outputs": [], - "inputs": [ - { - "type": "uint256", - "name": "_value" - }, - { - "type": "address", - "name": "addr" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "name": "withdraw", "outputs": [], @@ -212,22 +196,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "name": "withdraw", - "outputs": [], - "inputs": [ - { - "type": "uint256", - "name": "_value" - }, - { - "type": "bool", - "name": "claim_rewards" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "name": "claim_rewards", "outputs": [], @@ -235,18 +203,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "name": "claim_rewards", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "addr" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "name": "integrate_checkpoint", "outputs": [ diff --git a/src/constants/abis/json/gauge_v2.json b/src/constants/abis/json/gauge_v2.json index 4f676506..16860fee 100644 --- a/src/constants/abis/json/gauge_v2.json +++ b/src/constants/abis/json/gauge_v2.json @@ -251,18 +251,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "name": "claim_rewards", - "outputs": [], - "inputs": [ - { - "type": "address", - "name": "_addr" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "name": "claim_historic_rewards", "outputs": [], @@ -333,22 +321,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "name": "deposit", - "outputs": [], - "inputs": [ - { - "type": "uint256", - "name": "_value" - }, - { - "type": "address", - "name": "_addr" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, { "name": "withdraw", "outputs": [], diff --git a/src/constants/abis/json/gauge_v3.json b/src/constants/abis/json/gauge_v3.json index 5259f7e3..b9b3fc9a 100644 --- a/src/constants/abis/json/gauge_v3.json +++ b/src/constants/abis/json/gauge_v3.json @@ -326,34 +326,6 @@ "inputs": [], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "claim_rewards", - "inputs": [ - { - "name": "_addr", - "type": "address" - } - ], - "outputs": [] - }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "claim_rewards", - "inputs": [ - { - "name": "_addr", - "type": "address" - }, - { - "name": "_receiver", - "type": "address" - } - ], - "outputs": [] - }, { "stateMutability": "nonpayable", "type": "function", @@ -379,42 +351,6 @@ ], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "deposit", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_addr", - "type": "address" - } - ], - "outputs": [] - }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "deposit", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_addr", - "type": "address" - }, - { - "name": "_claim_rewards", - "type": "bool" - } - ], - "outputs": [] - }, { "stateMutability": "nonpayable", "type": "function", @@ -427,22 +363,6 @@ ], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "withdraw", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_claim_rewards", - "type": "bool" - } - ], - "outputs": [] - }, { "stateMutability": "view", "type": "function", diff --git a/src/constants/abis/json/gauge_v4.json b/src/constants/abis/json/gauge_v4.json index a7043213..ee8e9c1c 100644 --- a/src/constants/abis/json/gauge_v4.json +++ b/src/constants/abis/json/gauge_v4.json @@ -274,34 +274,6 @@ "inputs": [], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "claim_rewards", - "inputs": [ - { - "name": "_addr", - "type": "address" - } - ], - "outputs": [] - }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "claim_rewards", - "inputs": [ - { - "name": "_addr", - "type": "address" - }, - { - "name": "_receiver", - "type": "address" - } - ], - "outputs": [] - }, { "stateMutability": "nonpayable", "type": "function", @@ -327,42 +299,6 @@ ], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "deposit", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_addr", - "type": "address" - } - ], - "outputs": [] - }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "deposit", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_addr", - "type": "address" - }, - { - "name": "_claim_rewards", - "type": "bool" - } - ], - "outputs": [] - }, { "stateMutability": "nonpayable", "type": "function", @@ -375,22 +311,6 @@ ], "outputs": [] }, - { - "stateMutability": "nonpayable", - "type": "function", - "name": "withdraw", - "inputs": [ - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_claim_rewards", - "type": "bool" - } - ], - "outputs": [] - }, { "stateMutability": "nonpayable", "type": "function", From 3a1734690bdadd39a9f3fc75221807dc47eb7bd4 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Mon, 27 Dec 2021 11:59:01 +0300 Subject: [PATCH 11/24] feat: gaugeClaimRewards --- src/pools.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pools.ts b/src/pools.ts index 3b7f5ccd..82ddc2e4 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -27,7 +27,6 @@ import { ETH_COINS_LOWER_CASE, LINK_COINS_LOWER_CASE, COINS, - curve as _curve } from "./curve"; import axios from "axios"; @@ -1048,6 +1047,8 @@ export class Pool { return (await curve.contracts[ALIASES.minter].contract.mint(this.gauge, { ...curve.options, gasLimit })).hash; } + // TODO 1. Fix aave and saave error + // TODO 2. Figure out Synthetix cumulative results public gaugeClaimableRewards = async (address = ""): Promise<{token: string, symbol: string, amount: string}[]> => { address = address || curve.signerAddress; if (!address) throw Error("Need to connect wallet or pass address into args"); @@ -1082,6 +1083,14 @@ export class Pool { return rewards } + public gaugeClaimRewards = async (): Promise => { + const gaugeContract = curve.contracts[this.gauge].contract; + if (!("claim_rewards()" in gaugeContract)) throw Error (`${this.name} pool doesn't have such method`); + + const gasLimit = (await gaugeContract.estimateGas.claim_rewards(curve.constantOptions)).mul(130).div(100); + return (await gaugeContract.claim_rewards({ ...curve.options, gasLimit })).hash; + } + public balances = async (...addresses: string[] | string[][]): Promise> | DictInterface> => { return await this._balances( ['lpToken', 'gauge', ...this.underlyingCoins, ...this.coins], From d7dc72c0b58568a3d66a226ebf7648b6a9498abb Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Mon, 27 Dec 2021 15:35:55 +0300 Subject: [PATCH 12/24] feat: getRewardsApy --- src/interfaces.ts | 10 ++++++++++ src/pools.ts | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index 31661b3a..2565b610 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -52,4 +52,14 @@ export interface PoolDataInterface { reward_tokens?: string[], pool_type?: string, crv_reward_contract?: string, +} + +export interface RewardsApyInterface { + gaugeAddress: string, + tokenAddress: string, + tokenPrice: number, + name: string, + symbol: string, + decimals: string, + apy: number } \ No newline at end of file diff --git a/src/pools.ts b/src/pools.ts index 82ddc2e4..9f091e72 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -18,7 +18,7 @@ import { getEthIndex, _getStatsUrl, } from './utils'; -import { DictInterface } from './interfaces'; +import { DictInterface, RewardsApyInterface } from './interfaces'; import { ALIASES, POOLS_DATA, @@ -310,6 +310,10 @@ export class Pool { } } + public getRewardsApy = async (): Promise => { + return (await axios.get("https://api.curve.fi/api/getMainPoolsGaugeRewards")).data.data.mainPoolsGaugeRewards[this.gauge] || []; + } + public addLiquidityExpected = async (amounts: string[]): Promise => { amounts = amounts.map((a, i) => Number(a).toFixed(this.underlyingDecimals[i])); return await this.calcLpTokenAmount(amounts); From fdead4f9842a109047ebf3fe07ab28184f1e97c2 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Mon, 27 Dec 2021 17:31:08 +0300 Subject: [PATCH 13/24] chore: added crv to coins-polygon --- src/constants/coins-polygon.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/constants/coins-polygon.ts b/src/constants/coins-polygon.ts index a1320b12..ac6466b6 100644 --- a/src/constants/coins-polygon.ts +++ b/src/constants/coins-polygon.ts @@ -44,6 +44,7 @@ export const COINS_POLYGON: { [index: string]: string } = { ...LINK_COINS_POLYGON, ...EUR_COINS_POLYGON, ...USD_COINS_POLYGON, + crv: "0x172370d5cd63279efa6d502dab29171933a610af", // CRV } export const DECIMALS_POLYGON: { [index: string]: number } = { @@ -64,6 +65,8 @@ export const DECIMALS_POLYGON: { [index: string]: number } = { "0x28424507fefb6f7f8E9D3860F56504E4e5f5f390": 18, // amWETH "0x7BDF330f423Ea880FF95fC41A280fD5eCFD3D09f": 6, // EURT + + "0x172370d5cd63279efa6d502dab29171933a610af": 18, // CRV } // @ts-ignore From 1ab1eb54d85efe5b0ee79d6e56b222eb87150306 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Mon, 27 Dec 2021 17:33:33 +0300 Subject: [PATCH 14/24] feat: gaugeClaimableRewards and gaugeClaimRewards on Polygon --- src/constants/abis/abis-polygon.ts | 12 +- .../abis/json/gauge_rewards_only.json | 649 ++++++++++++++++++ src/pools.ts | 4 +- 3 files changed, 662 insertions(+), 3 deletions(-) create mode 100644 src/constants/abis/json/gauge_rewards_only.json diff --git a/src/constants/abis/abis-polygon.ts b/src/constants/abis/abis-polygon.ts index 20de45f4..037f6ce7 100644 --- a/src/constants/abis/abis-polygon.ts +++ b/src/constants/abis/abis-polygon.ts @@ -5,6 +5,7 @@ import atricrypto3Swap from './json/atricrypto3/swap.json'; import atricrypto3Zap from './json/atricrypto3/zap.json'; import eurtusdSwap from './json/eurtusd/swap.json'; import eurtusdZap from './json/eurtusd/deposit.json'; +import gaugeRewardsOnlyABI from './json/gauge_rewards_only.json'; import {PoolDataInterface} from "../../interfaces"; export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { @@ -35,8 +36,9 @@ export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { swap_abi: aaveSwapABI, sCurveRewards_abi: paaveRewardsabi, sCurveRewards_address: '0xBdFF0C27dd073C119ebcb1299a68A6A92aE607F0', - reward_token: "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270", + reward_tokens: ["0x172370d5cd63279efa6d502dab29171933a610af", "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"], crv_reward_contract: "0xC48f4653dd6a9509De44c92beb0604BEA3AEe714", + gauge_abi: gaugeRewardsOnlyABI, }, ren: { @@ -63,6 +65,8 @@ export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { ], swap_abi: renSwapABI, crv_reward_contract: "0x488E6ef919C2bB9de535C634a80afb0114DA8F62", + reward_tokens: ["0x172370d5cd63279efa6d502dab29171933a610af", "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"], + gauge_abi: gaugeRewardsOnlyABI, }, atricrypto3: { @@ -103,6 +107,8 @@ export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', // USDT ], crv_reward_contract: "0x060e386eCfBacf42Aa72171Af9EFe17b3993fC4F", + reward_tokens: ["0x172370d5cd63279efa6d502dab29171933a610af", "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"], + gauge_abi: gaugeRewardsOnlyABI, }, eurtusd: { @@ -149,5 +155,7 @@ export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', // USDT ], crv_reward_contract: "0xAF78381216a8eCC7Ad5957f3cD12a431500E0B0D", + reward_tokens: ["0x172370d5cd63279efa6d502dab29171933a610af"], + gauge_abi: gaugeRewardsOnlyABI, }, -}; \ No newline at end of file +}; diff --git a/src/constants/abis/json/gauge_rewards_only.json b/src/constants/abis/json/gauge_rewards_only.json new file mode 100644 index 00000000..77f07581 --- /dev/null +++ b/src/constants/abis/json/gauge_rewards_only.json @@ -0,0 +1,649 @@ +[ + { + "name": "Deposit", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Withdraw", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "CommitOwnership", + "inputs": [ + { + "name": "admin", + "type": "address", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "ApplyOwnership", + "inputs": [ + { + "name": "admin", + "type": "address", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Transfer", + "inputs": [ + { + "name": "_from", + "type": "address", + "indexed": true + }, + { + "name": "_to", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Approval", + "inputs": [ + { + "name": "_owner", + "type": "address", + "indexed": true + }, + { + "name": "_spender", + "type": "address", + "indexed": true + }, + { + "name": "_value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [ + { + "name": "_admin", + "type": "address" + }, + { + "name": "_lp_token", + "type": "address" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "288" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_contract", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "2628" + }, + { + "stateMutability": "view", + "type": "function", + "name": "last_claim", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "2454" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimed_reward", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "2976" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_reward", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "2944" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claimable_reward_write", + "inputs": [ + { + "name": "_addr", + "type": "address" + }, + { + "name": "_token", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "2067617" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards_receiver", + "inputs": [ + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [], + "gas": "35643" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "claim_rewards", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "deposit", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw", + "inputs": [ + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "8092597" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "8130547" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "38091" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "increaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_added_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "40635" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "decreaseAllowance", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtracted_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "gas": "40659" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_rewards", + "inputs": [ + { + "name": "_reward_contract", + "type": "address" + }, + { + "name": "_claim_sig", + "type": "bytes32" + }, + { + "name": "_reward_tokens", + "type": "address[8]" + } + ], + "outputs": [], + "gas": "4442660" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "commit_transfer_ownership", + "inputs": [ + { + "name": "addr", + "type": "address" + } + ], + "outputs": [], + "gas": "39375" + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "accept_transfer_ownership", + "inputs": [], + "outputs": [], + "gas": "39320" + }, + { + "stateMutability": "view", + "type": "function", + "name": "lp_token", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "2928" + }, + { + "stateMutability": "view", + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3173" + }, + { + "stateMutability": "view", + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "2988" + }, + { + "stateMutability": "view", + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3448" + }, + { + "stateMutability": "view", + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "gas": "13350" + }, + { + "stateMutability": "view", + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "gas": "11103" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_tokens", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3217" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_balances", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3353" + }, + { + "stateMutability": "view", + "type": "function", + "name": "rewards_receiver", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3383" + }, + { + "stateMutability": "view", + "type": "function", + "name": "claim_sig", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes" + } + ], + "gas": "11223" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3443" + }, + { + "stateMutability": "view", + "type": "function", + "name": "reward_integral_for", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "gas": "3688" + }, + { + "stateMutability": "view", + "type": "function", + "name": "admin", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3288" + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_admin", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "gas": "3318" + } +] \ No newline at end of file diff --git a/src/pools.ts b/src/pools.ts index 9f091e72..3a181151 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -1064,7 +1064,9 @@ export class Pool { const rewardTokenContract = curve.contracts[rewardToken].contract; const symbol = await rewardTokenContract.symbol(); const decimals = await rewardTokenContract.decimals(); - const amount = ethers.utils.formatUnits(await gaugeContract.claimable_reward(address, rewardToken, curve.constantOptions), decimals); + + const method = curve.chainId === 1 ? "claimable_reward" : "claimable_reward_write"; + const amount = ethers.utils.formatUnits(await gaugeContract[method](address, rewardToken, curve.constantOptions), decimals); rewards.push({ token: rewardToken, symbol: symbol, From 1ca0d9387123a2ed92decbdfddd0f288102ce490 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Mon, 27 Dec 2021 17:53:04 +0300 Subject: [PATCH 15/24] fix: disable gaugeClaimableTokens and gaugeClaimaTokens on Polygon --- src/pools.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pools.ts b/src/pools.ts index 3a181151..b18f3424 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -1040,6 +1040,8 @@ export class Pool { } public gaugeClaimableTokens = async (address = ""): Promise => { + if (curve.chainId !== 1) throw Error(`No such method on network with id ${curve.chainId}. Use gaugeClaimableRewards instead`) + address = address || curve.signerAddress; if (!address) throw Error("Need to connect wallet or pass address into args"); @@ -1047,6 +1049,8 @@ export class Pool { } public gaugeClaimTokens = async (): Promise => { + if (curve.chainId !== 1) throw Error(`No such method on network with id ${curve.chainId}. Use gaugeClaimRewards instead`) + const gasLimit = (await curve.contracts[ALIASES.minter].contract.estimateGas.mint(this.gauge, curve.constantOptions)).mul(130).div(100); return (await curve.contracts[ALIASES.minter].contract.mint(this.gauge, { ...curve.options, gasLimit })).hash; } From 1de00eecca14d37820bd773b9dc3fcd474adf5ce Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 13:15:55 +0300 Subject: [PATCH 16/24] chore: rename crv_reward_contract -> reward_contract --- src/constants/abis/abis-polygon.ts | 8 ++++---- src/curve.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/constants/abis/abis-polygon.ts b/src/constants/abis/abis-polygon.ts index 037f6ce7..0d895d6e 100644 --- a/src/constants/abis/abis-polygon.ts +++ b/src/constants/abis/abis-polygon.ts @@ -37,7 +37,7 @@ export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { sCurveRewards_abi: paaveRewardsabi, sCurveRewards_address: '0xBdFF0C27dd073C119ebcb1299a68A6A92aE607F0', reward_tokens: ["0x172370d5cd63279efa6d502dab29171933a610af", "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"], - crv_reward_contract: "0xC48f4653dd6a9509De44c92beb0604BEA3AEe714", + reward_contract: "0xC48f4653dd6a9509De44c92beb0604BEA3AEe714", gauge_abi: gaugeRewardsOnlyABI, }, @@ -64,7 +64,7 @@ export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { '0xDBf31dF14B66535aF65AaC99C32e9eA844e14501', ], swap_abi: renSwapABI, - crv_reward_contract: "0x488E6ef919C2bB9de535C634a80afb0114DA8F62", + reward_contract: "0x488E6ef919C2bB9de535C634a80afb0114DA8F62", reward_tokens: ["0x172370d5cd63279efa6d502dab29171933a610af", "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"], gauge_abi: gaugeRewardsOnlyABI, }, @@ -106,7 +106,7 @@ export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', // USDC '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', // USDT ], - crv_reward_contract: "0x060e386eCfBacf42Aa72171Af9EFe17b3993fC4F", + reward_contract: "0x060e386eCfBacf42Aa72171Af9EFe17b3993fC4F", reward_tokens: ["0x172370d5cd63279efa6d502dab29171933a610af", "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"], gauge_abi: gaugeRewardsOnlyABI, }, @@ -154,7 +154,7 @@ export const POOLS_DATA_POLYGON: { [index: string]: PoolDataInterface } = { '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', // USDC '0xc2132d05d31c914a87c6611c10748aeb04b58e8f', // USDT ], - crv_reward_contract: "0xAF78381216a8eCC7Ad5957f3cD12a431500E0B0D", + reward_contract: "0xAF78381216a8eCC7Ad5957f3cD12a431500E0B0D", reward_tokens: ["0x172370d5cd63279efa6d502dab29171933a610af"], gauge_abi: gaugeRewardsOnlyABI, }, diff --git a/src/curve.ts b/src/curve.ts index 3aa0cb76..af4a9128 100644 --- a/src/curve.ts +++ b/src/curve.ts @@ -318,14 +318,14 @@ class Curve { } } - if (pool.crv_reward_contract) { - this.contracts[pool.crv_reward_contract] = { - contract: new Contract(pool.crv_reward_contract, streamerABI, this.signer || this.provider), - multicallContract: new MulticallContract(pool.crv_reward_contract, streamerABI), + if (pool.reward_contract) { + this.contracts[pool.reward_contract] = { + contract: new Contract(pool.reward_contract, streamerABI, this.signer || this.provider), + multicallContract: new MulticallContract(pool.reward_contract, streamerABI), } - this.contracts[pool.crv_reward_contract.toLowerCase()] = { - contract: new Contract(pool.crv_reward_contract, streamerABI, this.signer || this.provider), - multicallContract: new MulticallContract(pool.crv_reward_contract, streamerABI), + this.contracts[pool.reward_contract.toLowerCase()] = { + contract: new Contract(pool.reward_contract, streamerABI, this.signer || this.provider), + multicallContract: new MulticallContract(pool.reward_contract, streamerABI), } } From 374ae82098ad6fbca9856b2e503190f23f999a60 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 13:18:32 +0300 Subject: [PATCH 17/24] feat: getRewardsApy on Polygon --- src/pools.ts | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/src/pools.ts b/src/pools.ts index b18f3424..728551b6 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -38,7 +38,7 @@ export class Pool { zap: string | null; lpToken: string; gauge: string; - crvRewardContract: string | null; + rewardContract: string | null; underlyingCoins: string[]; coins: string[]; underlyingCoinAddresses: string[]; @@ -93,7 +93,7 @@ export class Pool { this.zap = poolData.deposit_address || null; this.lpToken = poolData.token_address; this.gauge = poolData.gauge_address; - this.crvRewardContract = poolData.crv_reward_contract || null; + this.rewardContract = poolData.reward_contract || null; this.underlyingCoins = poolData.underlying_coins; this.coins = poolData.coins; this.underlyingCoinAddresses = poolData.underlying_coin_addresses; @@ -278,7 +278,7 @@ export class Pool { private getTokenApy = async (): Promise<[baseApy: string, boostedApy: string]> => { if (curve.chainId === 137) { - const rewardContract = curve.contracts[this.crvRewardContract as string].contract; + const rewardContract = curve.contracts[this.rewardContract as string].contract; const totalLiquidityUSD = await this.getTotalLiquidity(); const crvRate = await _getUsdRate(ALIASES.crv); @@ -310,8 +310,42 @@ export class Pool { } } - public getRewardsApy = async (): Promise => { - return (await axios.get("https://api.curve.fi/api/getMainPoolsGaugeRewards")).data.data.mainPoolsGaugeRewards[this.gauge] || []; + public getRewardsApy = async (): Promise => { + if (curve.chainId === 137) { + const apy: RewardsApyInterface[] = []; + for (const rewardToken of this.rewardTokens) { + const rewardContract = curve.contracts[this.rewardContract as string].contract; + + const totalLiquidityUSD = await this.getTotalLiquidity(); + const crvRate = await _getUsdRate(rewardToken); + + const inflation = toBN((await rewardContract.reward_data(ALIASES.crv, curve.constantOptions)).rate); + const baseApy = inflation.times(31536000).times(crvRate).div(Number(totalLiquidityUSD)) + + const rewardTokenContract = curve.contracts[rewardToken].contract; + const symbol = await rewardTokenContract.symbol(); + + apy.push({ + token: rewardToken, + symbol, + apy: baseApy.times(100).toFixed(4), + }) + } + + return apy + } + + const apyData = (await axios.get("https://api.curve.fi/api/getMainPoolsGaugeRewards")).data.data.mainPoolsGaugeRewards[this.gauge.toLowerCase()] || []; + const apy: RewardsApyInterface[] = []; + for (const data of apyData) { + apy.push({ + token: data.tokenAddress, + symbol: data.symbol, + apy: String(data.apy), + }) + } + + return apy } public addLiquidityExpected = async (amounts: string[]): Promise => { From e79102ad4559480e5fb8ac15d166a999f25362fd Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 13:19:36 +0300 Subject: [PATCH 18/24] chore: new RewardsApyInterface --- src/interfaces.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/interfaces.ts b/src/interfaces.ts index 2565b610..6ad65663 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -51,15 +51,11 @@ export interface PoolDataInterface { reward_token?: string, reward_tokens?: string[], pool_type?: string, - crv_reward_contract?: string, + reward_contract?: string, } export interface RewardsApyInterface { - gaugeAddress: string, - tokenAddress: string, - tokenPrice: number, - name: string, + token: string, symbol: string, - decimals: string, - apy: number + apy: string, } \ No newline at end of file From cb5f6062ff86247df7ca4fb617d33d8edff8475e Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 13:25:46 +0300 Subject: [PATCH 19/24] refactor: disable getTokenApy on Polygon --- src/pools.ts | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/src/pools.ts b/src/pools.ts index 728551b6..5a781257 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -82,6 +82,7 @@ export class Pool { getVolume: () => Promise, getBaseApy: () => Promise<[daily: string, weekly: string, monthly: string, total: string]>, getTokenApy: () => Promise<[baseApy: string, boostedApy: string]>, + getRewardsApy: () => Promise, } constructor(name: string) { @@ -137,6 +138,7 @@ export class Pool { getVolume: this.getVolume, getBaseApy: this.getBaseApy, getTokenApy: this.getTokenApy, + getRewardsApy: this.getRewardsApy, } if (this.isMeta && !this.isFake) { @@ -277,40 +279,30 @@ export class Pool { } private getTokenApy = async (): Promise<[baseApy: string, boostedApy: string]> => { - if (curve.chainId === 137) { - const rewardContract = curve.contracts[this.rewardContract as string].contract; - - const totalLiquidityUSD = await this.getTotalLiquidity(); - const crvRate = await _getUsdRate(ALIASES.crv); + if (curve.chainId === 137) throw Error(`No such method on network with id ${curve.chainId}. Use getRewardsApy instead`) - const inflation = toBN((await rewardContract.reward_data(ALIASES.crv, curve.constantOptions)).rate); - const baseApy = inflation.times(31536000).times(crvRate).div(Number(totalLiquidityUSD)) - - return [baseApy.times(100).toFixed(4), ""] - } else { - const gaugeContract = curve.contracts[this.gauge].multicallContract; - const lpTokenContract = curve.contracts[this.lpToken].multicallContract; - const gaugeControllerContract = curve.contracts[ALIASES.gauge_controller].multicallContract; + const gaugeContract = curve.contracts[this.gauge].multicallContract; + const lpTokenContract = curve.contracts[this.lpToken].multicallContract; + const gaugeControllerContract = curve.contracts[ALIASES.gauge_controller].multicallContract; - const totalLiquidityUSD = await this.getTotalLiquidity(); + const totalLiquidityUSD = await this.getTotalLiquidity(); - const [inflation, weight, workingSupply, totalSupply] = (await curve.multicallProvider.all([ - gaugeContract.inflation_rate(), - gaugeControllerContract.gauge_relative_weight(this.gauge), - gaugeContract.working_supply(), - lpTokenContract.totalSupply(), - ]) as ethers.BigNumber[]).map((value: ethers.BigNumber) => toBN(value)); + const [inflation, weight, workingSupply, totalSupply] = (await curve.multicallProvider.all([ + gaugeContract.inflation_rate(), + gaugeControllerContract.gauge_relative_weight(this.gauge), + gaugeContract.working_supply(), + lpTokenContract.totalSupply(), + ]) as ethers.BigNumber[]).map((value: ethers.BigNumber) => toBN(value)); - const rate = inflation.times(weight).times(31536000).times(0.4).div(workingSupply).times(totalSupply).div(Number(totalLiquidityUSD)); - const crvRate = await _getUsdRate(ALIASES.crv); - const baseApy = rate.times(crvRate); - const boostedApy = baseApy.times(2.5); + const rate = inflation.times(weight).times(31536000).times(0.4).div(workingSupply).times(totalSupply).div(Number(totalLiquidityUSD)); + const crvRate = await _getUsdRate(ALIASES.crv); + const baseApy = rate.times(crvRate); + const boostedApy = baseApy.times(2.5); - return [baseApy.times(100).toFixed(4), boostedApy.times(100).toFixed(4)] - } + return [baseApy.times(100).toFixed(4), boostedApy.times(100).toFixed(4)] } - public getRewardsApy = async (): Promise => { + private getRewardsApy = async (): Promise => { if (curve.chainId === 137) { const apy: RewardsApyInterface[] = []; for (const rewardToken of this.rewardTokens) { From 13bceee51a72d43a4c772d2708f536677bb21abd Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 14:03:11 +0300 Subject: [PATCH 20/24] fix: lower case gauge addresses in getRewardsApy --- src/pools.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pools.ts b/src/pools.ts index 5a781257..d0217916 100644 --- a/src/pools.ts +++ b/src/pools.ts @@ -327,7 +327,10 @@ export class Pool { return apy } - const apyData = (await axios.get("https://api.curve.fi/api/getMainPoolsGaugeRewards")).data.data.mainPoolsGaugeRewards[this.gauge.toLowerCase()] || []; + const mainPoolsGaugeRewards = (await axios.get("https://api.curve.fi/api/getMainPoolsGaugeRewards")).data.data.mainPoolsGaugeRewards; + // @ts-ignore + const mainPoolsGaugeRewardsLowerCase = Object.fromEntries(Object.entries(mainPoolsGaugeRewards).map((entry) => [entry[0].toLowerCase(), entry[1]])); + const apyData = mainPoolsGaugeRewardsLowerCase[this.gauge.toLowerCase()] || []; const apy: RewardsApyInterface[] = []; for (const data of apyData) { apy.push({ From ee1c1559db58ea38f705b35de978ea38255a9504 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 14:04:03 +0300 Subject: [PATCH 21/24] docs: getRewardsApy --- README.md | 9 +++++++++ test/readme.test.ts | 1 + 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index d79b2e79..b60ee980 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,15 @@ import curve from "@curvefi/api"; console.log(await saave.stats.getTokenApy()); // [ '0.0167', '0.0417' ] + + console.log(await saave.stats.getRewardsApy()); + // [ + // { + // token: '0x4da27a545c0c5B758a6BA100e3a049001de870f5', + // symbol: 'stkAAVE', + // apy: '0.5807714739298449' + // } + // ] })() ```` diff --git a/test/readme.test.ts b/test/readme.test.ts index d12388a5..57c7d8d5 100644 --- a/test/readme.test.ts +++ b/test/readme.test.ts @@ -42,6 +42,7 @@ const statsTest = async () => { console.log(await saave.stats.getVolume()); console.log(await saave.stats.getBaseApy()); console.log(await saave.stats.getTokenApy()); + console.log(await saave.stats.getRewardsApy()); } const poolTest = async () => { From c3978a7807c5a45485fb0859179fbee1e387c768 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 14:15:23 +0300 Subject: [PATCH 22/24] docs: rewards --- README.md | 21 +++++++++++++++++++++ test/readme.test.ts | 12 ++++++++++++ 2 files changed, 33 insertions(+) diff --git a/README.md b/README.md index b60ee980..161fa094 100644 --- a/README.md +++ b/README.md @@ -667,3 +667,24 @@ await curve.estimateGas.crossAssetExchange('DAI', "WBTC", "1000", 0.01) await curve.boosting.estimateGas.createLock('1000', 365) ``` + +## Rewards +```ts +const pool = new curve.Pool('susd'); + +// CRV +console.log(await pool.gaugeClaimableTokens()); +// 0.006296257916265276 +await pool.gaugeClaimTokens(); + +// Additional rewards +console.log(await pool.gaugeClaimableRewards()); +// [ +// { +// token: '0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F', +// symbol: 'SNX', +// amount: '0.000596325465987726' +// } +// ] +await pool.gaugeClaimRewards(); +``` diff --git a/test/readme.test.ts b/test/readme.test.ts index 57c7d8d5..bc53ba92 100644 --- a/test/readme.test.ts +++ b/test/readme.test.ts @@ -194,3 +194,15 @@ const boostingTest = async () => { console.log(await curve.boosting.getVeCrv()); console.log(await curve.boosting.getVeCrvPct()); } + +const rewardsTest = async () => { + await curve.init('JsonRpc', {}, { gasPrice: 0 }); + + const pool = new curve.Pool('susd'); + + console.log(await pool.gaugeClaimableTokens()); + console.log(await pool.gaugeClaimTokens()); + + console.log(await pool.gaugeClaimableRewards()); + console.log(await pool.gaugeClaimRewards()); +} From 53bdb0005b357d9de3ca766d70e88ba0a7726ec7 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 14:16:42 +0300 Subject: [PATCH 23/24] ci: removed to-tag from publish workflow --- .github/workflows/publish.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cd13290f..2c10b2d3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,8 +18,6 @@ jobs: - name: Changelog id: Changelog uses: scottbrenner/generate-changelog-action@master - with: - to-tag: HEAD - name: Create Release id: create_release uses: actions/create-release@v1 From 7638349ce75377ec5a3074d71d502454b970bbb4 Mon Sep 17 00:00:00 2001 From: Makeev Ivan Date: Tue, 28 Dec 2021 14:17:24 +0300 Subject: [PATCH 24/24] build: v1.15.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2a44bd97..b327f545 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@curvefi/api", - "version": "1.14.0", + "version": "1.15.0", "description": "JavaScript library for curve.fi", "main": "lib/index.js", "scripts": {