diff --git a/src/apps/aura/aura.definition.ts b/src/apps/aura/aura.definition.ts index 64e9b8b90..22f555190 100644 --- a/src/apps/aura/aura.definition.ts +++ b/src/apps/aura/aura.definition.ts @@ -23,8 +23,8 @@ export const AURA_DEFINITION = appDefinition({ label: 'auraBAL', }, - staking: { - id: 'staking', + auraBalStaking: { + id: 'aura-bal-staking', type: GroupType.POSITION, label: 'Staked auraBAL', }, @@ -35,10 +35,10 @@ export const AURA_DEFINITION = appDefinition({ label: 'Deposit', }, - pool: { - id: 'pool', + lpFarm: { + id: 'lp-farm', type: GroupType.POSITION, - label: 'Balancer Pools', + label: 'Liquidity Pool Staking', }, locker: { diff --git a/src/apps/aura/aura.module.ts b/src/apps/aura/aura.module.ts index 6ed996191..0c531ddd9 100644 --- a/src/apps/aura/aura.module.ts +++ b/src/apps/aura/aura.module.ts @@ -1,37 +1,30 @@ import { Register } from '~app-toolkit/decorators'; import { AbstractApp } from '~app/app.dynamic-module'; -import { BalancerV2AppModule } from '~apps/balancer-v2'; -import { SynthetixAppModule } from '~apps/synthetix'; import { AuraAppDefinition, AURA_DEFINITION } from './aura.definition'; +import { AuraBalancerPoolResolver } from './common/aura.balancer-pool.resolver'; import { AuraContractFactory } from './contracts'; -import { EthereumAuraBalTokenFetcher } from './ethereum/aura.aura-bal.token-fetcher'; -import { EthereumAuraBalanceFetcher } from './ethereum/aura.balance-fetcher'; +import { EthereumAuraAuraBalStakingContractPositionFetcher } from './ethereum/aura.aura-bal-staking.contract-position-fetcher'; +import { EthereumAuraAuraBalTokenFetcher } from './ethereum/aura.aura-bal.token-fetcher'; import { EthereumAuraChefContractPositionFetcher } from './ethereum/aura.chef.contract-position-fetcher'; import { EthereumAuraDepositTokenFetcher } from './ethereum/aura.deposit.token-fetcher'; import { EthereumAuraLockerContractPositionFetcher } from './ethereum/aura.locker.contract-position-fetcher'; -import { EthereumAuraPoolContractPositionFetcher } from './ethereum/aura.pool.contract-position-fetcher'; -import { EthereumAuraStakingContractPositionFetcher } from './ethereum/aura.staking.contract-position-fetcher'; -import { AuraBalancerPoolsHelper } from './helpers/aura.balancer-pools-helper'; -import { AuraBaseRewardPoolHelper } from './helpers/aura.base-reward-pool-helper'; +import { EthereumAuraLpFarmContractPositionFetcher } from './ethereum/aura.lp-farm.contract-position-fetcher'; @Register.AppModule({ appId: AURA_DEFINITION.id, - imports: [SynthetixAppModule, BalancerV2AppModule], providers: [ AuraAppDefinition, AuraContractFactory, + // helpers + AuraBalancerPoolResolver, // Ethereum - EthereumAuraBalanceFetcher, - EthereumAuraBalTokenFetcher, + EthereumAuraAuraBalTokenFetcher, EthereumAuraDepositTokenFetcher, EthereumAuraChefContractPositionFetcher, - EthereumAuraPoolContractPositionFetcher, + EthereumAuraLpFarmContractPositionFetcher, EthereumAuraLockerContractPositionFetcher, - EthereumAuraStakingContractPositionFetcher, - // Helpers - AuraBalancerPoolsHelper, - AuraBaseRewardPoolHelper, + EthereumAuraAuraBalStakingContractPositionFetcher, ], }) export class AuraAppModule extends AbstractApp() {} diff --git a/src/apps/aura/aura.types.ts b/src/apps/aura/aura.types.ts deleted file mode 100644 index c736704ae..000000000 --- a/src/apps/aura/aura.types.ts +++ /dev/null @@ -1,25 +0,0 @@ -export type AuraBaseRewardPoolDataProps = { - extraRewards: { address: string; rewardToken: string }[]; - rewardToken: string; -}; - -export type BalancerPool = { - id: string; - address: string; - name: string; - poolType: string; - swapFee: number; - symbol: string; - tokensList: string; - totalLiquidity: number; - totalSwapVolume: number; - totalSwapFee: number; - totalShares: number; - tokens: { - address: string; - symbol: string; - decimals: number; - balance: number; - weight: number; - }[]; -}; diff --git a/src/apps/aura/helpers/aura.balancer-pools-helper.ts b/src/apps/aura/common/aura.balancer-pool.resolver.ts similarity index 71% rename from src/apps/aura/helpers/aura.balancer-pools-helper.ts rename to src/apps/aura/common/aura.balancer-pool.resolver.ts index 6e9aa58d3..1e486f96b 100644 --- a/src/apps/aura/helpers/aura.balancer-pools-helper.ts +++ b/src/apps/aura/common/aura.balancer-pool.resolver.ts @@ -4,11 +4,31 @@ import { gql } from 'graphql-request'; import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; import { Cache } from '~cache/cache.decorator'; -import { Network } from '~types'; - -import { AURA_DEFINITION } from '../aura.definition'; -import { BalancerPool } from '../aura.types'; -import { AuraContractFactory } from '../index'; +import { Network } from '~types/network.interface'; + +import AURA_DEFINITION from '../aura.definition'; +import { AuraContractFactory } from '../contracts'; + +export type BalancerPool = { + id: string; + address: string; + name: string; + poolType: string; + swapFee: number; + symbol: string; + tokensList: string; + totalLiquidity: number; + totalSwapVolume: number; + totalSwapFee: number; + totalShares: number; + tokens: { + address: string; + symbol: string; + decimals: number; + balance: number; + weight: number; + }[]; +}; type GetPoolResponse = { pool: { @@ -30,7 +50,7 @@ type GetPoolResponse = { balance: string; weight: string; }[]; - } | null; + }; }; type GetBPTOutParams = { balancerPool: BalancerPool; maxAmountsIn: BigNumber[]; sender?: string; recipient?: string }; @@ -61,30 +81,32 @@ const GET_POOL_QUERY = gql` `; const BALANCER_VAULT = '0xba12222222228d8ba445958a75a0704d566bf2c8'; - const network = Network.ETHEREUM_MAINNET; @Injectable() -export class AuraBalancerPoolsHelper { +export class AuraBalancerPoolResolver { constructor( @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(AuraContractFactory) private readonly auraContractFactory: AuraContractFactory, + @Inject(AuraContractFactory) private readonly contractFactory: AuraContractFactory, ) {} @Cache({ - key: (poolId: string) => `apps-v3:${AURA_DEFINITION.id}:balancer-pools-${poolId}`, - ttl: 15 * 60, // 15 minutes + key: (poolId: string) => `studio:${AURA_DEFINITION.id}:balancer-pools-${poolId}`, + ttl: 15 * 60, }) - async getBalancerPool(poolId: string): Promise { + private async getBalancerPoolData(poolId: string) { + const endpoint = `https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2`; const { pool } = await this.appToolkit.helpers.theGraphHelper.request({ - endpoint: 'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-v2', + endpoint, query: GET_POOL_QUERY, variables: { id: poolId }, }); - if (!pool) { - return null; - } + return pool; + } + + async getBalancerPool(poolId: string): Promise { + const balancerPoolData = await this.getBalancerPoolData(poolId); const { id, @@ -99,7 +121,7 @@ export class AuraBalancerPoolsHelper { totalSwapFee, totalShares, tokens, - } = pool; + } = balancerPoolData; return { id, @@ -131,7 +153,7 @@ export class AuraBalancerPoolsHelper { }: GetBPTOutParams) { const { id, tokens } = balancerPool; - const balancerHelpers = this.auraContractFactory.auraBalancerHelpers({ + const balancerHelpers = this.contractFactory.auraBalancerHelpers({ address: '0x5addcca35b7a0d07c74063c48700c8590e87864e', network, }); diff --git a/src/apps/aura/common/aura.farm.contract-position-fetcher.ts b/src/apps/aura/common/aura.farm.contract-position-fetcher.ts new file mode 100644 index 000000000..6aa7cdcb0 --- /dev/null +++ b/src/apps/aura/common/aura.farm.contract-position-fetcher.ts @@ -0,0 +1,166 @@ +import { Inject } from '@nestjs/common'; +import { BigNumber, BigNumberish } from 'ethers'; +import { range } from 'lodash'; + +import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; +import { isClaimable } from '~position/position.utils'; +import { + GetDataPropsParams, + GetTokenBalancesParams, + GetTokenDefinitionsParams, +} from '~position/template/contract-position.template.types'; +import { + SingleStakingFarmDataProps, + SingleStakingFarmDynamicTemplateContractPositionFetcher, +} from '~position/template/single-staking.dynamic.template.contract-position-fetcher'; + +import { AuraBaseRewardPool, AuraContractFactory } from '../contracts'; + +export type AuraPoolSingleStakingFarmDataProps = { + liquidity: number; + apy: number; + isActive: boolean; + extraRewards: { + address: string; + rewardToken: string; + }[]; +}; + +// AURA is minted whenever BAL is claimed +// See: https://docs.convexfinance.com/convexfinanceintegration/cvx-minting +export const claimedBalToMintedAura = (claimedBalAmount: string, currentAuraSupply: string) => { + const claimedBalAmountBN = BigNumber.from(claimedBalAmount); + const currentAuraSupplyBN = BigNumber.from(currentAuraSupply); + + // All values are static/immutable + const maxSupply = BigNumber.from(10).pow(26); + const initMintAmount = BigNumber.from(10).pow(25).mul(5); + const emissionsMaxSupply = BigNumber.from(10).pow(25).mul(5); + const totalCliffs = BigNumber.from(500); + const reductionPerCliff = emissionsMaxSupply.div(totalCliffs); + + const emissionsMinted = currentAuraSupplyBN.sub(initMintAmount); + + // e.g. reductionPerCliff = 5e25 / 500 = 1e23 + // e.g. cliff = 1e25 / 1e23 = 100 + const cliff = emissionsMinted.div(reductionPerCliff); + + // e.g. 100 < 500 + if (cliff.lt(totalCliffs)) { + // e.g. (new) reduction = (500 - 100) * 2.5 + 700 = 1700; + // e.g. (new) reduction = (500 - 250) * 2.5 + 700 = 1325; + // e.g. (new) reduction = (500 - 400) * 2.5 + 700 = 950; + const reduction = totalCliffs.sub(cliff).mul(5).div(2).add(700); + // e.g. (new) amount = 1e19 * 1700 / 500 = 34e18; + // e.g. (new) amount = 1e19 * 1325 / 500 = 26.5e18; + // e.g. (new) amount = 1e19 * 950 / 500 = 19e17; + let amount = claimedBalAmountBN.mul(reduction).div(totalCliffs); + + // e.g. amtTillMax = 5e25 - 1e25 = 4e25 + const amtTillMax = maxSupply.sub(emissionsMinted); + if (amount.gt(amtTillMax)) { + amount = amtTillMax; + } + + return amount; + } + + return BigNumber.from(0); +}; + +export abstract class AuraFarmContractPositionFetcher extends SingleStakingFarmDynamicTemplateContractPositionFetcher { + constructor( + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(AuraContractFactory) + protected readonly contractFactory: AuraContractFactory, + ) { + super(appToolkit); + } + + getContract(address: string): AuraBaseRewardPool { + return this.contractFactory.auraBaseRewardPool({ network: this.network, address }); + } + + async getStakedTokenAddress({ contract }: GetTokenDefinitionsParams) { + return contract.stakingToken(); + } + + async getRewardTokenAddresses({ contract, multicall }: GetTokenDefinitionsParams) { + // BAL rewarded, AURA minted + const primaryRewardTokenAddresses = [ + '0xba100000625a3754423978a60c9317c58a424e3d', // BAL + '0xc0c293ce456ff0ed870add98a0828dd4d2903dbf', // AURA + ]; + + // Extra rewards + const extraRewardTokenAddresses = await Promise.all( + range(0, Number(await contract.extraRewardsLength())).map(async v => { + const vbpAddress = await contract.extraRewards(v); + const vbp = this.contractFactory.auraVirtualBalanceRewardPool({ address: vbpAddress, network: this.network }); + return multicall.wrap(vbp).rewardToken(); + }), + ); + + return [...primaryRewardTokenAddresses, ...extraRewardTokenAddresses]; + } + + async getRewardRates({ + contract, + multicall, + contractPosition, + }: GetDataPropsParams): Promise { + const auraToken = contractPosition.tokens.find(v => v.symbol === 'AURA')!; + const auraTokenContract = this.contractFactory.erc20(auraToken); + const auraSupplyRaw = await multicall.wrap(auraTokenContract).totalSupply(); + + const balRewardRate = await multicall.wrap(contract).rewardRate(); + const auraRewardRate = claimedBalToMintedAura(balRewardRate.toString(), auraSupplyRaw.toString()); + + const numExtraRewards = await multicall.wrap(contract).extraRewardsLength().then(Number); + const extraRewardRates = await Promise.all( + range(0, numExtraRewards).map(async v => { + const vbpAddress = await multicall.wrap(contract).extraRewards(v); + const vbp = this.contractFactory.auraVirtualBalanceRewardPool({ address: vbpAddress, network: this.network }); + return multicall.wrap(vbp).rewardRate(); + }), + ); + + return [balRewardRate, auraRewardRate, ...extraRewardRates]; + } + + getStakedTokenBalance({ address, contract }: GetTokenBalancesParams) { + return contract.balanceOf(address); + } + + async getRewardTokenBalances({ + address, + contract, + contractPosition, + multicall, + }: GetTokenBalancesParams) { + const rewardTokens = contractPosition.tokens.filter(isClaimable); + const [, auraRewardToken, ...extraRewards] = rewardTokens; + + const auraTokenContract = multicall.wrap(this.contractFactory.erc20(auraRewardToken)); + const currentAuraSupply = await auraTokenContract.totalSupply(); + + const balBalanceBN = await contract.earned(address); + const balBalanceRaw = balBalanceBN.toString(); + const auraBalanceRaw = claimedBalToMintedAura(balBalanceRaw, currentAuraSupply.toString()); + + const extraRewardBalances = await Promise.all( + extraRewards.map(async (_, i) => { + const extraRewardAddress = await contract.extraRewards(i); + const extraRewardContract = this.contractFactory.auraVirtualBalanceRewardPool({ + address: extraRewardAddress, + network: this.network, + }); + + const earnedBN = await multicall.wrap(extraRewardContract).earned(address); + return earnedBN.toString(); + }), + ); + + return [balBalanceRaw, auraBalanceRaw, ...extraRewardBalances]; + } +} diff --git a/src/apps/aura/contracts/abis/aura-bal-token.json b/src/apps/aura/contracts/abis/aura-bal-token.json new file mode 100644 index 000000000..3d08c8c87 --- /dev/null +++ b/src/apps/aura/contracts/abis/aura-bal-token.json @@ -0,0 +1,160 @@ +[ + { + "inputs": [ + { "internalType": "string", "name": "_nameArg", "type": "string" }, + { "internalType": "string", "name": "_symbolArg", "type": "string" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_from", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_to", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "operator", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_operator", "type": "address" }], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/aura/contracts/abis/aura-booster.json b/src/apps/aura/contracts/abis/aura-booster.json new file mode 100644 index 000000000..08d390e84 --- /dev/null +++ b/src/apps/aura/contracts/abis/aura-booster.json @@ -0,0 +1,573 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "_staker", "type": "address" }, + { "internalType": "address", "name": "_minter", "type": "address" }, + { "internalType": "address", "name": "_crv", "type": "address" }, + { "internalType": "address", "name": "_voteOwnership", "type": "address" }, + { "internalType": "address", "name": "_voteParameter", "type": "address" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newArbitrator", "type": "address" }], + "name": "ArbitratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "poolid", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Deposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "rewardFactory", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "stashFactory", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "tokenFactory", "type": "address" } + ], + "name": "FactoriesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "feeDistro", "type": "address" }, + { "indexed": false, "internalType": "bool", "name": "active", "type": "bool" } + ], + "name": "FeeInfoChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "feeDistro", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "lockFees", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "feeToken", "type": "address" } + ], + "name": "FeeInfoUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newFeeManager", "type": "address" }], + "name": "FeeManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "lockIncentive", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "stakerIncentive", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "earmarkIncentive", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "platformFee", "type": "uint256" } + ], + "name": "FeesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "OwnerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "lpToken", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "gauge", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "rewardPool", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "stash", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "pid", "type": "uint256" } + ], + "name": "PoolAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newPoolManager", "type": "address" }], + "name": "PoolManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "poolId", "type": "uint256" }], + "name": "PoolShutdown", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "address", "name": "lockRewards", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "stakerRewards", "type": "address" } + ], + "name": "RewardContractsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newTreasury", "type": "address" }], + "name": "TreasuryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "address", "name": "newVoteDelegate", "type": "address" }], + "name": "VoteDelegateUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": true, "internalType": "uint256", "name": "poolid", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "inputs": [], + "name": "FEE_DENOMINATOR", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MaxFees", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_lptoken", "type": "address" }, + { "internalType": "address", "name": "_gauge", "type": "address" }, + { "internalType": "uint256", "name": "_stashVersion", "type": "uint256" } + ], + "name": "addPool", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_pid", "type": "uint256" }, + { "internalType": "address", "name": "_gauge", "type": "address" } + ], + "name": "claimRewards", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "crv", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_pid", "type": "uint256" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "bool", "name": "_stake", "type": "bool" } + ], + "name": "deposit", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_pid", "type": "uint256" }, + { "internalType": "bool", "name": "_stake", "type": "bool" } + ], + "name": "depositAll", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_feeToken", "type": "address" }], + "name": "earmarkFees", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "earmarkIncentive", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_pid", "type": "uint256" }], + "name": "earmarkRewards", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "feeManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "feeTokens", + "outputs": [ + { "internalType": "address", "name": "distro", "type": "address" }, + { "internalType": "address", "name": "rewards", "type": "address" }, + { "internalType": "bool", "name": "active", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "gaugeMap", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isShutdown", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockIncentive", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lockRewards", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minter", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "platformFee", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "poolInfo", + "outputs": [ + { "internalType": "address", "name": "lptoken", "type": "address" }, + { "internalType": "address", "name": "token", "type": "address" }, + { "internalType": "address", "name": "gauge", "type": "address" }, + { "internalType": "address", "name": "crvRewards", "type": "address" }, + { "internalType": "address", "name": "stash", "type": "address" }, + { "internalType": "bool", "name": "shutdown", "type": "bool" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolLength", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolManager", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardArbitrator", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_pid", "type": "uint256" }, + { "internalType": "address", "name": "_address", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "rewardClaimed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardFactory", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_arb", "type": "address" }], + "name": "setArbitrator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_rfactory", "type": "address" }, + { "internalType": "address", "name": "_sfactory", "type": "address" }, + { "internalType": "address", "name": "_tfactory", "type": "address" } + ], + "name": "setFactories", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_feeToken", "type": "address" }, + { "internalType": "address", "name": "_feeDistro", "type": "address" } + ], + "name": "setFeeInfo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_feeM", "type": "address" }], + "name": "setFeeManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_lockFees", "type": "uint256" }, + { "internalType": "uint256", "name": "_stakerFees", "type": "uint256" }, + { "internalType": "uint256", "name": "_callerFees", "type": "uint256" }, + { "internalType": "uint256", "name": "_platform", "type": "uint256" } + ], + "name": "setFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_pid", "type": "uint256" }], + "name": "setGaugeRedirect", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], + "name": "setOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_poolM", "type": "address" }], + "name": "setPoolManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_rewards", "type": "address" }, + { "internalType": "address", "name": "_stakerRewards", "type": "address" } + ], + "name": "setRewardContracts", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_treasury", "type": "address" }], + "name": "setTreasury", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes32", "name": "_hash", "type": "bytes32" }, + { "internalType": "bool", "name": "valid", "type": "bool" } + ], + "name": "setVote", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_voteDelegate", "type": "address" }], + "name": "setVoteDelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_pid", "type": "uint256" }], + "name": "shutdownPool", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "shutdownSystem", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "staker", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakerIncentive", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakerRewards", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stashFactory", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokenFactory", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "treasury", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_feeToken", "type": "address" }, + { "internalType": "bool", "name": "_active", "type": "bool" } + ], + "name": "updateFeeInfo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_voteId", "type": "uint256" }, + { "internalType": "address", "name": "_votingAddress", "type": "address" }, + { "internalType": "bool", "name": "_support", "type": "bool" } + ], + "name": "vote", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "voteDelegate", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address[]", "name": "_gauge", "type": "address[]" }, + { "internalType": "uint256[]", "name": "_weight", "type": "uint256[]" } + ], + "name": "voteGaugeWeight", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "voteOwnership", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "voteParameter", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_pid", "type": "uint256" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "withdraw", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_pid", "type": "uint256" }], + "name": "withdrawAll", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_pid", "type": "uint256" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "address", "name": "_to", "type": "address" } + ], + "name": "withdrawTo", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/aura/contracts/abis/aura-deposit-token.json b/src/apps/aura/contracts/abis/aura-deposit-token.json new file mode 100644 index 000000000..820498569 --- /dev/null +++ b/src/apps/aura/contracts/abis/aura-deposit-token.json @@ -0,0 +1,155 @@ +[ + { + "inputs": [ + { "internalType": "address", "name": "_operator", "type": "address" }, + { "internalType": "address", "name": "_lptoken", "type": "address" }, + { "internalType": "string", "name": "_namePostfix", "type": "string" }, + { "internalType": "string", "name": "_symbolPrefix", "type": "string" } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_from", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } + ], + "name": "decreaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "addedValue", "type": "uint256" } + ], + "name": "increaseAllowance", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_to", "type": "address" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "operator", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "sender", "type": "address" }, + { "internalType": "address", "name": "recipient", "type": "address" }, + { "internalType": "uint256", "name": "amount", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/aura/contracts/ethers/AuraBalToken.ts b/src/apps/aura/contracts/ethers/AuraBalToken.ts new file mode 100644 index 000000000..736236a88 --- /dev/null +++ b/src/apps/aura/contracts/ethers/AuraBalToken.ts @@ -0,0 +1,508 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; + +export interface AuraBalTokenInterface extends utils.Interface { + functions: { + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'burn(address,uint256)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'mint(address,uint256)': FunctionFragment; + 'name()': FunctionFragment; + 'operator()': FunctionFragment; + 'setOperator(address)': FunctionFragment; + 'symbol()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'allowance' + | 'approve' + | 'balanceOf' + | 'burn' + | 'decimals' + | 'decreaseAllowance' + | 'increaseAllowance' + | 'mint' + | 'name' + | 'operator' + | 'setOperator' + | 'symbol' + | 'totalSupply' + | 'transfer' + | 'transferFrom', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'allowance', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'approve', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'burn', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData( + functionFragment: 'decreaseAllowance', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'increaseAllowance', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'mint', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'operator', values?: undefined): string; + encodeFunctionData(functionFragment: 'setOperator', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData( + functionFragment: 'transfer', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'transferFrom', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'operator', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setOperator', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface AuraBalToken extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: AuraBalTokenInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mint( + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + operator(overrides?: CallOverrides): Promise<[string]>; + + setOperator( + _operator: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mint( + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + operator(overrides?: CallOverrides): Promise; + + setOperator( + _operator: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + callStatic: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + mint(_to: PromiseOrValue, _amount: PromiseOrValue, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + operator(overrides?: CallOverrides): Promise; + + setOperator(_operator: PromiseOrValue, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + Approval( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + + 'Transfer(address,address,uint256)'( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + Transfer( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + }; + + estimateGas: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mint( + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + operator(overrides?: CallOverrides): Promise; + + setOperator( + _operator: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; + + populateTransaction: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mint( + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + operator(overrides?: CallOverrides): Promise; + + setOperator( + _operator: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; +} diff --git a/src/apps/aura/contracts/ethers/AuraBooster.ts b/src/apps/aura/contracts/ethers/AuraBooster.ts new file mode 100644 index 000000000..7af5f1077 --- /dev/null +++ b/src/apps/aura/contracts/ethers/AuraBooster.ts @@ -0,0 +1,1650 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; + +export interface AuraBoosterInterface extends utils.Interface { + functions: { + 'FEE_DENOMINATOR()': FunctionFragment; + 'MaxFees()': FunctionFragment; + 'addPool(address,address,uint256)': FunctionFragment; + 'claimRewards(uint256,address)': FunctionFragment; + 'crv()': FunctionFragment; + 'deposit(uint256,uint256,bool)': FunctionFragment; + 'depositAll(uint256,bool)': FunctionFragment; + 'earmarkFees(address)': FunctionFragment; + 'earmarkIncentive()': FunctionFragment; + 'earmarkRewards(uint256)': FunctionFragment; + 'feeManager()': FunctionFragment; + 'feeTokens(address)': FunctionFragment; + 'gaugeMap(address)': FunctionFragment; + 'isShutdown()': FunctionFragment; + 'lockIncentive()': FunctionFragment; + 'lockRewards()': FunctionFragment; + 'minter()': FunctionFragment; + 'owner()': FunctionFragment; + 'platformFee()': FunctionFragment; + 'poolInfo(uint256)': FunctionFragment; + 'poolLength()': FunctionFragment; + 'poolManager()': FunctionFragment; + 'rewardArbitrator()': FunctionFragment; + 'rewardClaimed(uint256,address,uint256)': FunctionFragment; + 'rewardFactory()': FunctionFragment; + 'setArbitrator(address)': FunctionFragment; + 'setFactories(address,address,address)': FunctionFragment; + 'setFeeInfo(address,address)': FunctionFragment; + 'setFeeManager(address)': FunctionFragment; + 'setFees(uint256,uint256,uint256,uint256)': FunctionFragment; + 'setGaugeRedirect(uint256)': FunctionFragment; + 'setOwner(address)': FunctionFragment; + 'setPoolManager(address)': FunctionFragment; + 'setRewardContracts(address,address)': FunctionFragment; + 'setTreasury(address)': FunctionFragment; + 'setVote(bytes32,bool)': FunctionFragment; + 'setVoteDelegate(address)': FunctionFragment; + 'shutdownPool(uint256)': FunctionFragment; + 'shutdownSystem()': FunctionFragment; + 'staker()': FunctionFragment; + 'stakerIncentive()': FunctionFragment; + 'stakerRewards()': FunctionFragment; + 'stashFactory()': FunctionFragment; + 'tokenFactory()': FunctionFragment; + 'treasury()': FunctionFragment; + 'updateFeeInfo(address,bool)': FunctionFragment; + 'vote(uint256,address,bool)': FunctionFragment; + 'voteDelegate()': FunctionFragment; + 'voteGaugeWeight(address[],uint256[])': FunctionFragment; + 'voteOwnership()': FunctionFragment; + 'voteParameter()': FunctionFragment; + 'withdraw(uint256,uint256)': FunctionFragment; + 'withdrawAll(uint256)': FunctionFragment; + 'withdrawTo(uint256,uint256,address)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'FEE_DENOMINATOR' + | 'MaxFees' + | 'addPool' + | 'claimRewards' + | 'crv' + | 'deposit' + | 'depositAll' + | 'earmarkFees' + | 'earmarkIncentive' + | 'earmarkRewards' + | 'feeManager' + | 'feeTokens' + | 'gaugeMap' + | 'isShutdown' + | 'lockIncentive' + | 'lockRewards' + | 'minter' + | 'owner' + | 'platformFee' + | 'poolInfo' + | 'poolLength' + | 'poolManager' + | 'rewardArbitrator' + | 'rewardClaimed' + | 'rewardFactory' + | 'setArbitrator' + | 'setFactories' + | 'setFeeInfo' + | 'setFeeManager' + | 'setFees' + | 'setGaugeRedirect' + | 'setOwner' + | 'setPoolManager' + | 'setRewardContracts' + | 'setTreasury' + | 'setVote' + | 'setVoteDelegate' + | 'shutdownPool' + | 'shutdownSystem' + | 'staker' + | 'stakerIncentive' + | 'stakerRewards' + | 'stashFactory' + | 'tokenFactory' + | 'treasury' + | 'updateFeeInfo' + | 'vote' + | 'voteDelegate' + | 'voteGaugeWeight' + | 'voteOwnership' + | 'voteParameter' + | 'withdraw' + | 'withdrawAll' + | 'withdrawTo', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'FEE_DENOMINATOR', values?: undefined): string; + encodeFunctionData(functionFragment: 'MaxFees', values?: undefined): string; + encodeFunctionData( + functionFragment: 'addPool', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'claimRewards', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'crv', values?: undefined): string; + encodeFunctionData( + functionFragment: 'deposit', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'depositAll', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'earmarkFees', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'earmarkIncentive', values?: undefined): string; + encodeFunctionData(functionFragment: 'earmarkRewards', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'feeManager', values?: undefined): string; + encodeFunctionData(functionFragment: 'feeTokens', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'gaugeMap', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'isShutdown', values?: undefined): string; + encodeFunctionData(functionFragment: 'lockIncentive', values?: undefined): string; + encodeFunctionData(functionFragment: 'lockRewards', values?: undefined): string; + encodeFunctionData(functionFragment: 'minter', values?: undefined): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'platformFee', values?: undefined): string; + encodeFunctionData(functionFragment: 'poolInfo', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'poolLength', values?: undefined): string; + encodeFunctionData(functionFragment: 'poolManager', values?: undefined): string; + encodeFunctionData(functionFragment: 'rewardArbitrator', values?: undefined): string; + encodeFunctionData( + functionFragment: 'rewardClaimed', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'rewardFactory', values?: undefined): string; + encodeFunctionData(functionFragment: 'setArbitrator', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'setFactories', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'setFeeInfo', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setFeeManager', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'setFees', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string; + encodeFunctionData(functionFragment: 'setGaugeRedirect', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setOwner', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setPoolManager', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'setRewardContracts', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'setTreasury', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setVote', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setVoteDelegate', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'shutdownPool', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'shutdownSystem', values?: undefined): string; + encodeFunctionData(functionFragment: 'staker', values?: undefined): string; + encodeFunctionData(functionFragment: 'stakerIncentive', values?: undefined): string; + encodeFunctionData(functionFragment: 'stakerRewards', values?: undefined): string; + encodeFunctionData(functionFragment: 'stashFactory', values?: undefined): string; + encodeFunctionData(functionFragment: 'tokenFactory', values?: undefined): string; + encodeFunctionData(functionFragment: 'treasury', values?: undefined): string; + encodeFunctionData( + functionFragment: 'updateFeeInfo', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'vote', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'voteDelegate', values?: undefined): string; + encodeFunctionData( + functionFragment: 'voteGaugeWeight', + values: [PromiseOrValue[], PromiseOrValue[]], + ): string; + encodeFunctionData(functionFragment: 'voteOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'voteParameter', values?: undefined): string; + encodeFunctionData( + functionFragment: 'withdraw', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'withdrawAll', values: [PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'withdrawTo', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + + decodeFunctionResult(functionFragment: 'FEE_DENOMINATOR', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'MaxFees', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addPool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'claimRewards', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'crv', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'deposit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'depositAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'earmarkFees', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'earmarkIncentive', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'earmarkRewards', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'feeManager', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'feeTokens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'gaugeMap', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isShutdown', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lockIncentive', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lockRewards', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'minter', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'platformFee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'poolInfo', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'poolLength', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'poolManager', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rewardArbitrator', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rewardClaimed', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rewardFactory', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setArbitrator', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setFactories', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setFeeInfo', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setFeeManager', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setFees', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setGaugeRedirect', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setPoolManager', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setRewardContracts', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setTreasury', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setVote', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setVoteDelegate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'shutdownPool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'shutdownSystem', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'staker', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stakerIncentive', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stakerRewards', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stashFactory', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'tokenFactory', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'treasury', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'updateFeeInfo', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'vote', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'voteDelegate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'voteGaugeWeight', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'voteOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'voteParameter', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdraw', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdrawAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdrawTo', data: BytesLike): Result; + + events: { + 'ArbitratorUpdated(address)': EventFragment; + 'Deposited(address,uint256,uint256)': EventFragment; + 'FactoriesUpdated(address,address,address)': EventFragment; + 'FeeInfoChanged(address,bool)': EventFragment; + 'FeeInfoUpdated(address,address,address)': EventFragment; + 'FeeManagerUpdated(address)': EventFragment; + 'FeesUpdated(uint256,uint256,uint256,uint256)': EventFragment; + 'OwnerUpdated(address)': EventFragment; + 'PoolAdded(address,address,address,address,address,uint256)': EventFragment; + 'PoolManagerUpdated(address)': EventFragment; + 'PoolShutdown(uint256)': EventFragment; + 'RewardContractsUpdated(address,address)': EventFragment; + 'TreasuryUpdated(address)': EventFragment; + 'VoteDelegateUpdated(address)': EventFragment; + 'Withdrawn(address,uint256,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'ArbitratorUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Deposited'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FactoriesUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FeeInfoChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FeeInfoUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FeeManagerUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FeesUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnerUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PoolAdded'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PoolManagerUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PoolShutdown'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RewardContractsUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'TreasuryUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'VoteDelegateUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Withdrawn'): EventFragment; +} + +export interface ArbitratorUpdatedEventObject { + newArbitrator: string; +} +export type ArbitratorUpdatedEvent = TypedEvent<[string], ArbitratorUpdatedEventObject>; + +export type ArbitratorUpdatedEventFilter = TypedEventFilter; + +export interface DepositedEventObject { + user: string; + poolid: BigNumber; + amount: BigNumber; +} +export type DepositedEvent = TypedEvent<[string, BigNumber, BigNumber], DepositedEventObject>; + +export type DepositedEventFilter = TypedEventFilter; + +export interface FactoriesUpdatedEventObject { + rewardFactory: string; + stashFactory: string; + tokenFactory: string; +} +export type FactoriesUpdatedEvent = TypedEvent<[string, string, string], FactoriesUpdatedEventObject>; + +export type FactoriesUpdatedEventFilter = TypedEventFilter; + +export interface FeeInfoChangedEventObject { + feeDistro: string; + active: boolean; +} +export type FeeInfoChangedEvent = TypedEvent<[string, boolean], FeeInfoChangedEventObject>; + +export type FeeInfoChangedEventFilter = TypedEventFilter; + +export interface FeeInfoUpdatedEventObject { + feeDistro: string; + lockFees: string; + feeToken: string; +} +export type FeeInfoUpdatedEvent = TypedEvent<[string, string, string], FeeInfoUpdatedEventObject>; + +export type FeeInfoUpdatedEventFilter = TypedEventFilter; + +export interface FeeManagerUpdatedEventObject { + newFeeManager: string; +} +export type FeeManagerUpdatedEvent = TypedEvent<[string], FeeManagerUpdatedEventObject>; + +export type FeeManagerUpdatedEventFilter = TypedEventFilter; + +export interface FeesUpdatedEventObject { + lockIncentive: BigNumber; + stakerIncentive: BigNumber; + earmarkIncentive: BigNumber; + platformFee: BigNumber; +} +export type FeesUpdatedEvent = TypedEvent<[BigNumber, BigNumber, BigNumber, BigNumber], FeesUpdatedEventObject>; + +export type FeesUpdatedEventFilter = TypedEventFilter; + +export interface OwnerUpdatedEventObject { + newOwner: string; +} +export type OwnerUpdatedEvent = TypedEvent<[string], OwnerUpdatedEventObject>; + +export type OwnerUpdatedEventFilter = TypedEventFilter; + +export interface PoolAddedEventObject { + lpToken: string; + gauge: string; + token: string; + rewardPool: string; + stash: string; + pid: BigNumber; +} +export type PoolAddedEvent = TypedEvent<[string, string, string, string, string, BigNumber], PoolAddedEventObject>; + +export type PoolAddedEventFilter = TypedEventFilter; + +export interface PoolManagerUpdatedEventObject { + newPoolManager: string; +} +export type PoolManagerUpdatedEvent = TypedEvent<[string], PoolManagerUpdatedEventObject>; + +export type PoolManagerUpdatedEventFilter = TypedEventFilter; + +export interface PoolShutdownEventObject { + poolId: BigNumber; +} +export type PoolShutdownEvent = TypedEvent<[BigNumber], PoolShutdownEventObject>; + +export type PoolShutdownEventFilter = TypedEventFilter; + +export interface RewardContractsUpdatedEventObject { + lockRewards: string; + stakerRewards: string; +} +export type RewardContractsUpdatedEvent = TypedEvent<[string, string], RewardContractsUpdatedEventObject>; + +export type RewardContractsUpdatedEventFilter = TypedEventFilter; + +export interface TreasuryUpdatedEventObject { + newTreasury: string; +} +export type TreasuryUpdatedEvent = TypedEvent<[string], TreasuryUpdatedEventObject>; + +export type TreasuryUpdatedEventFilter = TypedEventFilter; + +export interface VoteDelegateUpdatedEventObject { + newVoteDelegate: string; +} +export type VoteDelegateUpdatedEvent = TypedEvent<[string], VoteDelegateUpdatedEventObject>; + +export type VoteDelegateUpdatedEventFilter = TypedEventFilter; + +export interface WithdrawnEventObject { + user: string; + poolid: BigNumber; + amount: BigNumber; +} +export type WithdrawnEvent = TypedEvent<[string, BigNumber, BigNumber], WithdrawnEventObject>; + +export type WithdrawnEventFilter = TypedEventFilter; + +export interface AuraBooster extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: AuraBoosterInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + FEE_DENOMINATOR(overrides?: CallOverrides): Promise<[BigNumber]>; + + MaxFees(overrides?: CallOverrides): Promise<[BigNumber]>; + + addPool( + _lptoken: PromiseOrValue, + _gauge: PromiseOrValue, + _stashVersion: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + claimRewards( + _pid: PromiseOrValue, + _gauge: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + crv(overrides?: CallOverrides): Promise<[string]>; + + deposit( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + depositAll( + _pid: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earmarkFees( + _feeToken: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earmarkIncentive(overrides?: CallOverrides): Promise<[BigNumber]>; + + earmarkRewards( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + feeManager(overrides?: CallOverrides): Promise<[string]>; + + feeTokens( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, string, boolean] & { + distro: string; + rewards: string; + active: boolean; + } + >; + + gaugeMap(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + + isShutdown(overrides?: CallOverrides): Promise<[boolean]>; + + lockIncentive(overrides?: CallOverrides): Promise<[BigNumber]>; + + lockRewards(overrides?: CallOverrides): Promise<[string]>; + + minter(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + platformFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + poolInfo( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, string, string, string, string, boolean] & { + lptoken: string; + token: string; + gauge: string; + crvRewards: string; + stash: string; + shutdown: boolean; + } + >; + + poolLength(overrides?: CallOverrides): Promise<[BigNumber]>; + + poolManager(overrides?: CallOverrides): Promise<[string]>; + + rewardArbitrator(overrides?: CallOverrides): Promise<[string]>; + + rewardClaimed( + _pid: PromiseOrValue, + _address: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + rewardFactory(overrides?: CallOverrides): Promise<[string]>; + + setArbitrator( + _arb: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFactories( + _rfactory: PromiseOrValue, + _sfactory: PromiseOrValue, + _tfactory: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFeeInfo( + _feeToken: PromiseOrValue, + _feeDistro: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFeeManager( + _feeM: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFees( + _lockFees: PromiseOrValue, + _stakerFees: PromiseOrValue, + _callerFees: PromiseOrValue, + _platform: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setGaugeRedirect( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setPoolManager( + _poolM: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setRewardContracts( + _rewards: PromiseOrValue, + _stakerRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setTreasury( + _treasury: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setVote( + _hash: PromiseOrValue, + valid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setVoteDelegate( + _voteDelegate: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + shutdownPool( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + shutdownSystem(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + staker(overrides?: CallOverrides): Promise<[string]>; + + stakerIncentive(overrides?: CallOverrides): Promise<[BigNumber]>; + + stakerRewards(overrides?: CallOverrides): Promise<[string]>; + + stashFactory(overrides?: CallOverrides): Promise<[string]>; + + tokenFactory(overrides?: CallOverrides): Promise<[string]>; + + treasury(overrides?: CallOverrides): Promise<[string]>; + + updateFeeInfo( + _feeToken: PromiseOrValue, + _active: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + vote( + _voteId: PromiseOrValue, + _votingAddress: PromiseOrValue, + _support: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voteDelegate(overrides?: CallOverrides): Promise<[string]>; + + voteGaugeWeight( + _gauge: PromiseOrValue[], + _weight: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voteOwnership(overrides?: CallOverrides): Promise<[string]>; + + voteParameter(overrides?: CallOverrides): Promise<[string]>; + + withdraw( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + withdrawAll( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + withdrawTo( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _to: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; + + FEE_DENOMINATOR(overrides?: CallOverrides): Promise; + + MaxFees(overrides?: CallOverrides): Promise; + + addPool( + _lptoken: PromiseOrValue, + _gauge: PromiseOrValue, + _stashVersion: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + claimRewards( + _pid: PromiseOrValue, + _gauge: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + crv(overrides?: CallOverrides): Promise; + + deposit( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + depositAll( + _pid: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earmarkFees( + _feeToken: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earmarkIncentive(overrides?: CallOverrides): Promise; + + earmarkRewards( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + feeManager(overrides?: CallOverrides): Promise; + + feeTokens( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, string, boolean] & { + distro: string; + rewards: string; + active: boolean; + } + >; + + gaugeMap(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + isShutdown(overrides?: CallOverrides): Promise; + + lockIncentive(overrides?: CallOverrides): Promise; + + lockRewards(overrides?: CallOverrides): Promise; + + minter(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + platformFee(overrides?: CallOverrides): Promise; + + poolInfo( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, string, string, string, string, boolean] & { + lptoken: string; + token: string; + gauge: string; + crvRewards: string; + stash: string; + shutdown: boolean; + } + >; + + poolLength(overrides?: CallOverrides): Promise; + + poolManager(overrides?: CallOverrides): Promise; + + rewardArbitrator(overrides?: CallOverrides): Promise; + + rewardClaimed( + _pid: PromiseOrValue, + _address: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + rewardFactory(overrides?: CallOverrides): Promise; + + setArbitrator( + _arb: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFactories( + _rfactory: PromiseOrValue, + _sfactory: PromiseOrValue, + _tfactory: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFeeInfo( + _feeToken: PromiseOrValue, + _feeDistro: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFeeManager( + _feeM: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFees( + _lockFees: PromiseOrValue, + _stakerFees: PromiseOrValue, + _callerFees: PromiseOrValue, + _platform: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setGaugeRedirect( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setPoolManager( + _poolM: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setRewardContracts( + _rewards: PromiseOrValue, + _stakerRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setTreasury( + _treasury: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setVote( + _hash: PromiseOrValue, + valid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setVoteDelegate( + _voteDelegate: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + shutdownPool( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + shutdownSystem(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + staker(overrides?: CallOverrides): Promise; + + stakerIncentive(overrides?: CallOverrides): Promise; + + stakerRewards(overrides?: CallOverrides): Promise; + + stashFactory(overrides?: CallOverrides): Promise; + + tokenFactory(overrides?: CallOverrides): Promise; + + treasury(overrides?: CallOverrides): Promise; + + updateFeeInfo( + _feeToken: PromiseOrValue, + _active: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + vote( + _voteId: PromiseOrValue, + _votingAddress: PromiseOrValue, + _support: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voteDelegate(overrides?: CallOverrides): Promise; + + voteGaugeWeight( + _gauge: PromiseOrValue[], + _weight: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voteOwnership(overrides?: CallOverrides): Promise; + + voteParameter(overrides?: CallOverrides): Promise; + + withdraw( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + withdrawAll( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + withdrawTo( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _to: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + callStatic: { + FEE_DENOMINATOR(overrides?: CallOverrides): Promise; + + MaxFees(overrides?: CallOverrides): Promise; + + addPool( + _lptoken: PromiseOrValue, + _gauge: PromiseOrValue, + _stashVersion: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + claimRewards( + _pid: PromiseOrValue, + _gauge: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + crv(overrides?: CallOverrides): Promise; + + deposit( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + depositAll( + _pid: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + earmarkFees(_feeToken: PromiseOrValue, overrides?: CallOverrides): Promise; + + earmarkIncentive(overrides?: CallOverrides): Promise; + + earmarkRewards(_pid: PromiseOrValue, overrides?: CallOverrides): Promise; + + feeManager(overrides?: CallOverrides): Promise; + + feeTokens( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, string, boolean] & { + distro: string; + rewards: string; + active: boolean; + } + >; + + gaugeMap(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + isShutdown(overrides?: CallOverrides): Promise; + + lockIncentive(overrides?: CallOverrides): Promise; + + lockRewards(overrides?: CallOverrides): Promise; + + minter(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + platformFee(overrides?: CallOverrides): Promise; + + poolInfo( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, string, string, string, string, boolean] & { + lptoken: string; + token: string; + gauge: string; + crvRewards: string; + stash: string; + shutdown: boolean; + } + >; + + poolLength(overrides?: CallOverrides): Promise; + + poolManager(overrides?: CallOverrides): Promise; + + rewardArbitrator(overrides?: CallOverrides): Promise; + + rewardClaimed( + _pid: PromiseOrValue, + _address: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + rewardFactory(overrides?: CallOverrides): Promise; + + setArbitrator(_arb: PromiseOrValue, overrides?: CallOverrides): Promise; + + setFactories( + _rfactory: PromiseOrValue, + _sfactory: PromiseOrValue, + _tfactory: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + setFeeInfo( + _feeToken: PromiseOrValue, + _feeDistro: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + setFeeManager(_feeM: PromiseOrValue, overrides?: CallOverrides): Promise; + + setFees( + _lockFees: PromiseOrValue, + _stakerFees: PromiseOrValue, + _callerFees: PromiseOrValue, + _platform: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + setGaugeRedirect(_pid: PromiseOrValue, overrides?: CallOverrides): Promise; + + setOwner(_owner: PromiseOrValue, overrides?: CallOverrides): Promise; + + setPoolManager(_poolM: PromiseOrValue, overrides?: CallOverrides): Promise; + + setRewardContracts( + _rewards: PromiseOrValue, + _stakerRewards: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + setTreasury(_treasury: PromiseOrValue, overrides?: CallOverrides): Promise; + + setVote( + _hash: PromiseOrValue, + valid: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + setVoteDelegate(_voteDelegate: PromiseOrValue, overrides?: CallOverrides): Promise; + + shutdownPool(_pid: PromiseOrValue, overrides?: CallOverrides): Promise; + + shutdownSystem(overrides?: CallOverrides): Promise; + + staker(overrides?: CallOverrides): Promise; + + stakerIncentive(overrides?: CallOverrides): Promise; + + stakerRewards(overrides?: CallOverrides): Promise; + + stashFactory(overrides?: CallOverrides): Promise; + + tokenFactory(overrides?: CallOverrides): Promise; + + treasury(overrides?: CallOverrides): Promise; + + updateFeeInfo( + _feeToken: PromiseOrValue, + _active: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + vote( + _voteId: PromiseOrValue, + _votingAddress: PromiseOrValue, + _support: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + voteDelegate(overrides?: CallOverrides): Promise; + + voteGaugeWeight( + _gauge: PromiseOrValue[], + _weight: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise; + + voteOwnership(overrides?: CallOverrides): Promise; + + voteParameter(overrides?: CallOverrides): Promise; + + withdraw( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + withdrawAll(_pid: PromiseOrValue, overrides?: CallOverrides): Promise; + + withdrawTo( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _to: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + }; + + filters: { + 'ArbitratorUpdated(address)'(newArbitrator?: null): ArbitratorUpdatedEventFilter; + ArbitratorUpdated(newArbitrator?: null): ArbitratorUpdatedEventFilter; + + 'Deposited(address,uint256,uint256)'( + user?: PromiseOrValue | null, + poolid?: PromiseOrValue | null, + amount?: null, + ): DepositedEventFilter; + Deposited( + user?: PromiseOrValue | null, + poolid?: PromiseOrValue | null, + amount?: null, + ): DepositedEventFilter; + + 'FactoriesUpdated(address,address,address)'( + rewardFactory?: null, + stashFactory?: null, + tokenFactory?: null, + ): FactoriesUpdatedEventFilter; + FactoriesUpdated(rewardFactory?: null, stashFactory?: null, tokenFactory?: null): FactoriesUpdatedEventFilter; + + 'FeeInfoChanged(address,bool)'(feeDistro?: null, active?: null): FeeInfoChangedEventFilter; + FeeInfoChanged(feeDistro?: null, active?: null): FeeInfoChangedEventFilter; + + 'FeeInfoUpdated(address,address,address)'( + feeDistro?: null, + lockFees?: null, + feeToken?: null, + ): FeeInfoUpdatedEventFilter; + FeeInfoUpdated(feeDistro?: null, lockFees?: null, feeToken?: null): FeeInfoUpdatedEventFilter; + + 'FeeManagerUpdated(address)'(newFeeManager?: null): FeeManagerUpdatedEventFilter; + FeeManagerUpdated(newFeeManager?: null): FeeManagerUpdatedEventFilter; + + 'FeesUpdated(uint256,uint256,uint256,uint256)'( + lockIncentive?: null, + stakerIncentive?: null, + earmarkIncentive?: null, + platformFee?: null, + ): FeesUpdatedEventFilter; + FeesUpdated( + lockIncentive?: null, + stakerIncentive?: null, + earmarkIncentive?: null, + platformFee?: null, + ): FeesUpdatedEventFilter; + + 'OwnerUpdated(address)'(newOwner?: null): OwnerUpdatedEventFilter; + OwnerUpdated(newOwner?: null): OwnerUpdatedEventFilter; + + 'PoolAdded(address,address,address,address,address,uint256)'( + lpToken?: null, + gauge?: null, + token?: null, + rewardPool?: null, + stash?: null, + pid?: null, + ): PoolAddedEventFilter; + PoolAdded( + lpToken?: null, + gauge?: null, + token?: null, + rewardPool?: null, + stash?: null, + pid?: null, + ): PoolAddedEventFilter; + + 'PoolManagerUpdated(address)'(newPoolManager?: null): PoolManagerUpdatedEventFilter; + PoolManagerUpdated(newPoolManager?: null): PoolManagerUpdatedEventFilter; + + 'PoolShutdown(uint256)'(poolId?: null): PoolShutdownEventFilter; + PoolShutdown(poolId?: null): PoolShutdownEventFilter; + + 'RewardContractsUpdated(address,address)'( + lockRewards?: null, + stakerRewards?: null, + ): RewardContractsUpdatedEventFilter; + RewardContractsUpdated(lockRewards?: null, stakerRewards?: null): RewardContractsUpdatedEventFilter; + + 'TreasuryUpdated(address)'(newTreasury?: null): TreasuryUpdatedEventFilter; + TreasuryUpdated(newTreasury?: null): TreasuryUpdatedEventFilter; + + 'VoteDelegateUpdated(address)'(newVoteDelegate?: null): VoteDelegateUpdatedEventFilter; + VoteDelegateUpdated(newVoteDelegate?: null): VoteDelegateUpdatedEventFilter; + + 'Withdrawn(address,uint256,uint256)'( + user?: PromiseOrValue | null, + poolid?: PromiseOrValue | null, + amount?: null, + ): WithdrawnEventFilter; + Withdrawn( + user?: PromiseOrValue | null, + poolid?: PromiseOrValue | null, + amount?: null, + ): WithdrawnEventFilter; + }; + + estimateGas: { + FEE_DENOMINATOR(overrides?: CallOverrides): Promise; + + MaxFees(overrides?: CallOverrides): Promise; + + addPool( + _lptoken: PromiseOrValue, + _gauge: PromiseOrValue, + _stashVersion: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + claimRewards( + _pid: PromiseOrValue, + _gauge: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + crv(overrides?: CallOverrides): Promise; + + deposit( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + depositAll( + _pid: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earmarkFees( + _feeToken: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earmarkIncentive(overrides?: CallOverrides): Promise; + + earmarkRewards( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + feeManager(overrides?: CallOverrides): Promise; + + feeTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + gaugeMap(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + isShutdown(overrides?: CallOverrides): Promise; + + lockIncentive(overrides?: CallOverrides): Promise; + + lockRewards(overrides?: CallOverrides): Promise; + + minter(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + platformFee(overrides?: CallOverrides): Promise; + + poolInfo(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + poolLength(overrides?: CallOverrides): Promise; + + poolManager(overrides?: CallOverrides): Promise; + + rewardArbitrator(overrides?: CallOverrides): Promise; + + rewardClaimed( + _pid: PromiseOrValue, + _address: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + rewardFactory(overrides?: CallOverrides): Promise; + + setArbitrator( + _arb: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFactories( + _rfactory: PromiseOrValue, + _sfactory: PromiseOrValue, + _tfactory: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFeeInfo( + _feeToken: PromiseOrValue, + _feeDistro: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFeeManager( + _feeM: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFees( + _lockFees: PromiseOrValue, + _stakerFees: PromiseOrValue, + _callerFees: PromiseOrValue, + _platform: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setGaugeRedirect( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setPoolManager( + _poolM: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setRewardContracts( + _rewards: PromiseOrValue, + _stakerRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setTreasury( + _treasury: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setVote( + _hash: PromiseOrValue, + valid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setVoteDelegate( + _voteDelegate: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + shutdownPool( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + shutdownSystem(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + staker(overrides?: CallOverrides): Promise; + + stakerIncentive(overrides?: CallOverrides): Promise; + + stakerRewards(overrides?: CallOverrides): Promise; + + stashFactory(overrides?: CallOverrides): Promise; + + tokenFactory(overrides?: CallOverrides): Promise; + + treasury(overrides?: CallOverrides): Promise; + + updateFeeInfo( + _feeToken: PromiseOrValue, + _active: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + vote( + _voteId: PromiseOrValue, + _votingAddress: PromiseOrValue, + _support: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voteDelegate(overrides?: CallOverrides): Promise; + + voteGaugeWeight( + _gauge: PromiseOrValue[], + _weight: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voteOwnership(overrides?: CallOverrides): Promise; + + voteParameter(overrides?: CallOverrides): Promise; + + withdraw( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + withdrawAll( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + withdrawTo( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _to: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; + + populateTransaction: { + FEE_DENOMINATOR(overrides?: CallOverrides): Promise; + + MaxFees(overrides?: CallOverrides): Promise; + + addPool( + _lptoken: PromiseOrValue, + _gauge: PromiseOrValue, + _stashVersion: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + claimRewards( + _pid: PromiseOrValue, + _gauge: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + crv(overrides?: CallOverrides): Promise; + + deposit( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + depositAll( + _pid: PromiseOrValue, + _stake: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earmarkFees( + _feeToken: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + earmarkIncentive(overrides?: CallOverrides): Promise; + + earmarkRewards( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + feeManager(overrides?: CallOverrides): Promise; + + feeTokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + gaugeMap(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + isShutdown(overrides?: CallOverrides): Promise; + + lockIncentive(overrides?: CallOverrides): Promise; + + lockRewards(overrides?: CallOverrides): Promise; + + minter(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + platformFee(overrides?: CallOverrides): Promise; + + poolInfo(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + + poolLength(overrides?: CallOverrides): Promise; + + poolManager(overrides?: CallOverrides): Promise; + + rewardArbitrator(overrides?: CallOverrides): Promise; + + rewardClaimed( + _pid: PromiseOrValue, + _address: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + rewardFactory(overrides?: CallOverrides): Promise; + + setArbitrator( + _arb: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFactories( + _rfactory: PromiseOrValue, + _sfactory: PromiseOrValue, + _tfactory: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFeeInfo( + _feeToken: PromiseOrValue, + _feeDistro: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFeeManager( + _feeM: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setFees( + _lockFees: PromiseOrValue, + _stakerFees: PromiseOrValue, + _callerFees: PromiseOrValue, + _platform: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setGaugeRedirect( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setPoolManager( + _poolM: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setRewardContracts( + _rewards: PromiseOrValue, + _stakerRewards: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setTreasury( + _treasury: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setVote( + _hash: PromiseOrValue, + valid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + setVoteDelegate( + _voteDelegate: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + shutdownPool( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + shutdownSystem(overrides?: Overrides & { from?: PromiseOrValue }): Promise; + + staker(overrides?: CallOverrides): Promise; + + stakerIncentive(overrides?: CallOverrides): Promise; + + stakerRewards(overrides?: CallOverrides): Promise; + + stashFactory(overrides?: CallOverrides): Promise; + + tokenFactory(overrides?: CallOverrides): Promise; + + treasury(overrides?: CallOverrides): Promise; + + updateFeeInfo( + _feeToken: PromiseOrValue, + _active: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + vote( + _voteId: PromiseOrValue, + _votingAddress: PromiseOrValue, + _support: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voteDelegate(overrides?: CallOverrides): Promise; + + voteGaugeWeight( + _gauge: PromiseOrValue[], + _weight: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + voteOwnership(overrides?: CallOverrides): Promise; + + voteParameter(overrides?: CallOverrides): Promise; + + withdraw( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + withdrawAll( + _pid: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + withdrawTo( + _pid: PromiseOrValue, + _amount: PromiseOrValue, + _to: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; +} diff --git a/src/apps/aura/contracts/ethers/AuraDepositToken.ts b/src/apps/aura/contracts/ethers/AuraDepositToken.ts new file mode 100644 index 000000000..bfb73cc88 --- /dev/null +++ b/src/apps/aura/contracts/ethers/AuraDepositToken.ts @@ -0,0 +1,482 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent, PromiseOrValue } from './common'; + +export interface AuraDepositTokenInterface extends utils.Interface { + functions: { + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'burn(address,uint256)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'mint(address,uint256)': FunctionFragment; + 'name()': FunctionFragment; + 'operator()': FunctionFragment; + 'symbol()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'allowance' + | 'approve' + | 'balanceOf' + | 'burn' + | 'decimals' + | 'decreaseAllowance' + | 'increaseAllowance' + | 'mint' + | 'name' + | 'operator' + | 'symbol' + | 'totalSupply' + | 'transfer' + | 'transferFrom', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'allowance', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData( + functionFragment: 'approve', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'burn', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData( + functionFragment: 'decreaseAllowance', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'increaseAllowance', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData(functionFragment: 'mint', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'operator', values?: undefined): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData( + functionFragment: 'transfer', + values: [PromiseOrValue, PromiseOrValue], + ): string; + encodeFunctionData( + functionFragment: 'transferFrom', + values: [PromiseOrValue, PromiseOrValue, PromiseOrValue], + ): string; + + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'operator', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface AuraDepositToken extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: AuraDepositTokenInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mint( + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + operator(overrides?: CallOverrides): Promise<[string]>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mint( + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + operator(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + callStatic: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + mint(_to: PromiseOrValue, _amount: PromiseOrValue, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + operator(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + Approval( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null, + ): ApprovalEventFilter; + + 'Transfer(address,address,uint256)'( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + Transfer( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null, + ): TransferEventFilter; + }; + + estimateGas: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mint( + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + operator(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; + + populateTransaction: { + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides, + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + balanceOf(account: PromiseOrValue, overrides?: CallOverrides): Promise; + + burn( + _from: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + mint( + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + operator(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise; + }; +} diff --git a/src/apps/aura/contracts/ethers/factories/AuraBalToken__factory.ts b/src/apps/aura/contracts/ethers/factories/AuraBalToken__factory.ts new file mode 100644 index 000000000..f84452187 --- /dev/null +++ b/src/apps/aura/contracts/ethers/factories/AuraBalToken__factory.ts @@ -0,0 +1,368 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { AuraBalToken, AuraBalTokenInterface } from '../AuraBalToken'; + +const _abi = [ + { + inputs: [ + { + internalType: 'string', + name: '_nameArg', + type: 'string', + }, + { + internalType: 'string', + name: '_symbolArg', + type: 'string', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_from', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'operator', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_operator', + type: 'address', + }, + ], + name: 'setOperator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class AuraBalToken__factory { + static readonly abi = _abi; + static createInterface(): AuraBalTokenInterface { + return new utils.Interface(_abi) as AuraBalTokenInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): AuraBalToken { + return new Contract(address, _abi, signerOrProvider) as AuraBalToken; + } +} diff --git a/src/apps/aura/contracts/ethers/factories/AuraBooster__factory.ts b/src/apps/aura/contracts/ethers/factories/AuraBooster__factory.ts new file mode 100644 index 000000000..d25e795c3 --- /dev/null +++ b/src/apps/aura/contracts/ethers/factories/AuraBooster__factory.ts @@ -0,0 +1,1308 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { AuraBooster, AuraBoosterInterface } from '../AuraBooster'; + +const _abi = [ + { + inputs: [ + { + internalType: 'address', + name: '_staker', + type: 'address', + }, + { + internalType: 'address', + name: '_minter', + type: 'address', + }, + { + internalType: 'address', + name: '_crv', + type: 'address', + }, + { + internalType: 'address', + name: '_voteOwnership', + type: 'address', + }, + { + internalType: 'address', + name: '_voteParameter', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newArbitrator', + type: 'address', + }, + ], + name: 'ArbitratorUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'poolid', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Deposited', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'rewardFactory', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'stashFactory', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'tokenFactory', + type: 'address', + }, + ], + name: 'FactoriesUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'feeDistro', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'active', + type: 'bool', + }, + ], + name: 'FeeInfoChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'feeDistro', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'lockFees', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'feeToken', + type: 'address', + }, + ], + name: 'FeeInfoUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newFeeManager', + type: 'address', + }, + ], + name: 'FeeManagerUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'lockIncentive', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'stakerIncentive', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'earmarkIncentive', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'platformFee', + type: 'uint256', + }, + ], + name: 'FeesUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnerUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'lpToken', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'gauge', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'rewardPool', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'stash', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'pid', + type: 'uint256', + }, + ], + name: 'PoolAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newPoolManager', + type: 'address', + }, + ], + name: 'PoolManagerUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'poolId', + type: 'uint256', + }, + ], + name: 'PoolShutdown', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'lockRewards', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'stakerRewards', + type: 'address', + }, + ], + name: 'RewardContractsUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newTreasury', + type: 'address', + }, + ], + name: 'TreasuryUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'newVoteDelegate', + type: 'address', + }, + ], + name: 'VoteDelegateUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'poolid', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Withdrawn', + type: 'event', + }, + { + inputs: [], + name: 'FEE_DENOMINATOR', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'MaxFees', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_lptoken', + type: 'address', + }, + { + internalType: 'address', + name: '_gauge', + type: 'address', + }, + { + internalType: 'uint256', + name: '_stashVersion', + type: 'uint256', + }, + ], + name: 'addPool', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + { + internalType: 'address', + name: '_gauge', + type: 'address', + }, + ], + name: 'claimRewards', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'crv', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + { + internalType: 'bool', + name: '_stake', + type: 'bool', + }, + ], + name: 'deposit', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + { + internalType: 'bool', + name: '_stake', + type: 'bool', + }, + ], + name: 'depositAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_feeToken', + type: 'address', + }, + ], + name: 'earmarkFees', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'earmarkIncentive', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + ], + name: 'earmarkRewards', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'feeManager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'feeTokens', + outputs: [ + { + internalType: 'address', + name: 'distro', + type: 'address', + }, + { + internalType: 'address', + name: 'rewards', + type: 'address', + }, + { + internalType: 'bool', + name: 'active', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'gaugeMap', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isShutdown', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'lockIncentive', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'lockRewards', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minter', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'platformFee', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'poolInfo', + outputs: [ + { + internalType: 'address', + name: 'lptoken', + type: 'address', + }, + { + internalType: 'address', + name: 'token', + type: 'address', + }, + { + internalType: 'address', + name: 'gauge', + type: 'address', + }, + { + internalType: 'address', + name: 'crvRewards', + type: 'address', + }, + { + internalType: 'address', + name: 'stash', + type: 'address', + }, + { + internalType: 'bool', + name: 'shutdown', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'poolLength', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'poolManager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'rewardArbitrator', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + { + internalType: 'address', + name: '_address', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'rewardClaimed', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'rewardFactory', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_arb', + type: 'address', + }, + ], + name: 'setArbitrator', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_rfactory', + type: 'address', + }, + { + internalType: 'address', + name: '_sfactory', + type: 'address', + }, + { + internalType: 'address', + name: '_tfactory', + type: 'address', + }, + ], + name: 'setFactories', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_feeToken', + type: 'address', + }, + { + internalType: 'address', + name: '_feeDistro', + type: 'address', + }, + ], + name: 'setFeeInfo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_feeM', + type: 'address', + }, + ], + name: 'setFeeManager', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_lockFees', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_stakerFees', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_callerFees', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_platform', + type: 'uint256', + }, + ], + name: 'setFees', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + ], + name: 'setGaugeRedirect', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + ], + name: 'setOwner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_poolM', + type: 'address', + }, + ], + name: 'setPoolManager', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_rewards', + type: 'address', + }, + { + internalType: 'address', + name: '_stakerRewards', + type: 'address', + }, + ], + name: 'setRewardContracts', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_treasury', + type: 'address', + }, + ], + name: 'setTreasury', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '_hash', + type: 'bytes32', + }, + { + internalType: 'bool', + name: 'valid', + type: 'bool', + }, + ], + name: 'setVote', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_voteDelegate', + type: 'address', + }, + ], + name: 'setVoteDelegate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + ], + name: 'shutdownPool', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'shutdownSystem', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'staker', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'stakerIncentive', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'stakerRewards', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'stashFactory', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'tokenFactory', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'treasury', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_feeToken', + type: 'address', + }, + { + internalType: 'bool', + name: '_active', + type: 'bool', + }, + ], + name: 'updateFeeInfo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_voteId', + type: 'uint256', + }, + { + internalType: 'address', + name: '_votingAddress', + type: 'address', + }, + { + internalType: 'bool', + name: '_support', + type: 'bool', + }, + ], + name: 'vote', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'voteDelegate', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: '_gauge', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: '_weight', + type: 'uint256[]', + }, + ], + name: 'voteGaugeWeight', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'voteOwnership', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'voteParameter', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + ], + name: 'withdrawAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_pid', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + { + internalType: 'address', + name: '_to', + type: 'address', + }, + ], + name: 'withdrawTo', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class AuraBooster__factory { + static readonly abi = _abi; + static createInterface(): AuraBoosterInterface { + return new utils.Interface(_abi) as AuraBoosterInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): AuraBooster { + return new Contract(address, _abi, signerOrProvider) as AuraBooster; + } +} diff --git a/src/apps/aura/contracts/ethers/factories/AuraDepositToken__factory.ts b/src/apps/aura/contracts/ethers/factories/AuraDepositToken__factory.ts new file mode 100644 index 000000000..21b0d8794 --- /dev/null +++ b/src/apps/aura/contracts/ethers/factories/AuraDepositToken__factory.ts @@ -0,0 +1,365 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { AuraDepositToken, AuraDepositTokenInterface } from '../AuraDepositToken'; + +const _abi = [ + { + inputs: [ + { + internalType: 'address', + name: '_operator', + type: 'address', + }, + { + internalType: 'address', + name: '_lptoken', + type: 'address', + }, + { + internalType: 'string', + name: '_namePostfix', + type: 'string', + }, + { + internalType: 'string', + name: '_symbolPrefix', + type: 'string', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_from', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'operator', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class AuraDepositToken__factory { + static readonly abi = _abi; + static createInterface(): AuraDepositTokenInterface { + return new utils.Interface(_abi) as AuraDepositTokenInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): AuraDepositToken { + return new Contract(address, _abi, signerOrProvider) as AuraDepositToken; + } +} diff --git a/src/apps/aura/contracts/ethers/factories/index.ts b/src/apps/aura/contracts/ethers/factories/index.ts index 42ee8e376..db8ec6b5c 100644 --- a/src/apps/aura/contracts/ethers/factories/index.ts +++ b/src/apps/aura/contracts/ethers/factories/index.ts @@ -1,8 +1,11 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export { AuraBalToken__factory } from './AuraBalToken__factory'; export { AuraBalancerHelpers__factory } from './AuraBalancerHelpers__factory'; export { AuraBaseRewardPool__factory } from './AuraBaseRewardPool__factory'; +export { AuraBooster__factory } from './AuraBooster__factory'; +export { AuraDepositToken__factory } from './AuraDepositToken__factory'; export { AuraLocker__factory } from './AuraLocker__factory'; export { AuraMasterchef__factory } from './AuraMasterchef__factory'; export { AuraToken__factory } from './AuraToken__factory'; diff --git a/src/apps/aura/contracts/ethers/index.ts b/src/apps/aura/contracts/ethers/index.ts index 37e264780..2e9985625 100644 --- a/src/apps/aura/contracts/ethers/index.ts +++ b/src/apps/aura/contracts/ethers/index.ts @@ -1,15 +1,21 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export type { AuraBalToken } from './AuraBalToken'; export type { AuraBalancerHelpers } from './AuraBalancerHelpers'; export type { AuraBaseRewardPool } from './AuraBaseRewardPool'; +export type { AuraBooster } from './AuraBooster'; +export type { AuraDepositToken } from './AuraDepositToken'; export type { AuraLocker } from './AuraLocker'; export type { AuraMasterchef } from './AuraMasterchef'; export type { AuraToken } from './AuraToken'; export type { AuraVirtualBalanceRewardPool } from './AuraVirtualBalanceRewardPool'; export * as factories from './factories'; +export { AuraBalToken__factory } from './factories/AuraBalToken__factory'; export { AuraBalancerHelpers__factory } from './factories/AuraBalancerHelpers__factory'; export { AuraBaseRewardPool__factory } from './factories/AuraBaseRewardPool__factory'; +export { AuraBooster__factory } from './factories/AuraBooster__factory'; +export { AuraDepositToken__factory } from './factories/AuraDepositToken__factory'; export { AuraLocker__factory } from './factories/AuraLocker__factory'; export { AuraMasterchef__factory } from './factories/AuraMasterchef__factory'; export { AuraToken__factory } from './factories/AuraToken__factory'; diff --git a/src/apps/aura/contracts/index.ts b/src/apps/aura/contracts/index.ts index 40897eea8..4a7015320 100644 --- a/src/apps/aura/contracts/index.ts +++ b/src/apps/aura/contracts/index.ts @@ -4,8 +4,11 @@ import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { ContractFactory } from '~contract/contracts'; import { Network } from '~types/network.interface'; +import { AuraBalToken__factory } from './ethers'; import { AuraBalancerHelpers__factory } from './ethers'; import { AuraBaseRewardPool__factory } from './ethers'; +import { AuraBooster__factory } from './ethers'; +import { AuraDepositToken__factory } from './ethers'; import { AuraLocker__factory } from './ethers'; import { AuraMasterchef__factory } from './ethers'; import { AuraToken__factory } from './ethers'; @@ -20,12 +23,21 @@ export class AuraContractFactory extends ContractFactory { super((network: Network) => appToolkit.getNetworkProvider(network)); } + auraBalToken({ address, network }: ContractOpts) { + return AuraBalToken__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } auraBalancerHelpers({ address, network }: ContractOpts) { return AuraBalancerHelpers__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } auraBaseRewardPool({ address, network }: ContractOpts) { return AuraBaseRewardPool__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } + auraBooster({ address, network }: ContractOpts) { + return AuraBooster__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } + auraDepositToken({ address, network }: ContractOpts) { + return AuraDepositToken__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } auraLocker({ address, network }: ContractOpts) { return AuraLocker__factory.connect(address, this.appToolkit.getNetworkProvider(network)); } @@ -40,8 +52,11 @@ export class AuraContractFactory extends ContractFactory { } } +export type { AuraBalToken } from './ethers'; export type { AuraBalancerHelpers } from './ethers'; export type { AuraBaseRewardPool } from './ethers'; +export type { AuraBooster } from './ethers'; +export type { AuraDepositToken } from './ethers'; export type { AuraLocker } from './ethers'; export type { AuraMasterchef } from './ethers'; export type { AuraToken } from './ethers'; diff --git a/src/apps/aura/ethereum/aura.aura-bal-staking.contract-position-fetcher.ts b/src/apps/aura/ethereum/aura.aura-bal-staking.contract-position-fetcher.ts new file mode 100644 index 000000000..3c7c5af82 --- /dev/null +++ b/src/apps/aura/ethereum/aura.aura-bal-staking.contract-position-fetcher.ts @@ -0,0 +1,12 @@ +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; + +import { AuraFarmContractPositionFetcher } from '../common/aura.farm.contract-position-fetcher'; + +@PositionTemplate() +export class EthereumAuraAuraBalStakingContractPositionFetcher extends AuraFarmContractPositionFetcher { + groupLabel = 'auraBAL Staking'; + + getFarmAddresses() { + return ['0x5e5ea2048475854a5702f5b8468a51ba1296efcc']; + } +} diff --git a/src/apps/aura/ethereum/aura.aura-bal.token-fetcher.ts b/src/apps/aura/ethereum/aura.aura-bal.token-fetcher.ts index 5d6a11423..07161735c 100644 --- a/src/apps/aura/ethereum/aura.aura-bal.token-fetcher.ts +++ b/src/apps/aura/ethereum/aura.aura-bal.token-fetcher.ts @@ -1,53 +1,66 @@ import { Inject } from '@nestjs/common'; import { BigNumber, utils } from 'ethers'; -import { compact } from 'lodash'; import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { Register } from '~app-toolkit/decorators'; -import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; -import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; -import { ContractType } from '~position/contract.interface'; -import { PositionFetcher } from '~position/position-fetcher.interface'; -import { AppTokenPosition } from '~position/position.interface'; -import { Network } from '~types/network.interface'; - -import { AURA_DEFINITION } from '../aura.definition'; -import { BalancerPool } from '../aura.types'; -import { AuraBalancerPoolsHelper } from '../helpers/aura.balancer-pools-helper'; - -const appId = AURA_DEFINITION.id; -const groupId = AURA_DEFINITION.groups.auraBal.id; -const network = Network.ETHEREUM_MAINNET; - -const AURA_BAL_ADDRESS = '0x616e8bfa43f920657b3497dbf40d6b1a02d4608d'; -const STABLE_POOL_ID = '0x3dd0843a028c86e0b760b1a76929d1c5ef93a2dd000200000000000000000249'; - -@Register.TokenPositionFetcher({ appId, groupId, network }) -export class EthereumAuraBalTokenFetcher implements PositionFetcher { +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; +import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; +import { GetDataPropsParams, DefaultAppTokenDataProps } from '~position/template/app-token.template.types'; + +import { AuraBalancerPoolResolver } from '../common/aura.balancer-pool.resolver'; +import { AuraBalToken, AuraContractFactory } from '../contracts'; + +export type AuraBalTokenDefinition = { + address: string; +}; + +@PositionTemplate() +export class EthereumAuraAuraBalTokenFetcher extends AppTokenTemplatePositionFetcher< + AuraBalToken, + DefaultAppTokenDataProps, + AuraBalTokenDefinition +> { + groupLabel = 'auraBAL'; + + AURA_BAL_ADDRESS = '0x616e8bfa43f920657b3497dbf40d6b1a02d4608d'; + BAL_WETH_ADDRESS = '0x5c6ee304399dbdb9c8ef030ab642b10820db8f56'; + POOL_ID = '0x3dd0843a028c86e0b760b1a76929d1c5ef93a2dd000200000000000000000249'; + constructor( - @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(AuraBalancerPoolsHelper) private readonly auraBalancerPoolsHelper: AuraBalancerPoolsHelper, - ) {} + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(AuraContractFactory) protected readonly contractFactory: AuraContractFactory, + @Inject(AuraBalancerPoolResolver) + private readonly balancerPoolResolver: AuraBalancerPoolResolver, + ) { + super(appToolkit); + } + + getContract(address: string): AuraBalToken { + return this.contractFactory.auraBalToken({ network: this.network, address }); + } - async getPositions() { - const balancerPool = await this.auraBalancerPoolsHelper.getBalancerPool(STABLE_POOL_ID); - if (!balancerPool) return []; + async getAddresses(): Promise { + return [this.AURA_BAL_ADDRESS]; + } - const auraBAL = await this.getAuraBAL(balancerPool); - return compact([auraBAL]); + async getUnderlyingTokenAddresses() { + return [this.BAL_WETH_ADDRESS]; } - private async getAuraBALPrice(balancerPool: BalancerPool) { + async getPrice(): Promise { + const balancerPool = await this.balancerPoolResolver.getBalancerPool(this.POOL_ID); + const { tokens, totalLiquidity, totalShares } = balancerPool; - const auraBAL = tokens.find(token => token.address === AURA_BAL_ADDRESS); - if (!auraBAL) return null; + const auraBAL = tokens.find(token => token.address === this.AURA_BAL_ADDRESS); + if (!auraBAL) return 0; // Single-sided join: add 100 auraBAL const auraBALAmount = utils.parseUnits('100', auraBAL.decimals); - const maxAmountsIn = tokens.map(token => (token.address === AURA_BAL_ADDRESS ? auraBALAmount : BigNumber.from(0))); + const maxAmountsIn = tokens.map(token => + token.address === this.AURA_BAL_ADDRESS ? auraBALAmount : BigNumber.from(0), + ); - const { bptOut } = await this.auraBalancerPoolsHelper.getBPTOut({ balancerPool, maxAmountsIn }); + const { bptOut } = await this.balancerPoolResolver.getBPTOut({ balancerPool, maxAmountsIn }); const bptPerAuraBALRaw = bptOut.mul(utils.parseEther('1')).div(auraBALAmount); const bptPerAuraBAL = Number(bptPerAuraBALRaw) / 10 ** 18; @@ -56,45 +69,15 @@ export class EthereumAuraBalTokenFetcher implements PositionFetcher token.address === AURA_BAL_ADDRESS); - if (!tokenData) return null; - - const { address, symbol, decimals } = tokenData; - const contract = this.appToolkit.globalContracts.erc20({ address, network }); - const totalSupplyRaw = await contract.totalSupply(); - - const supply = Number(totalSupplyRaw) / 10 ** decimals; - const price = await this.getAuraBALPrice(balancerPool); - if (!price) return null; - - const liquidity = price * supply; - - const token: AppTokenPosition = { - type: ContractType.APP_TOKEN, - appId, - groupId, - address, - tokens: [], - price, - pricePerShare: 1, - symbol, - decimals, - supply, - network, - dataProps: {}, - displayProps: { - label: symbol, - images: [getTokenImg(address)], - statsItems: [ - { - label: 'Liquidity', - value: buildDollarDisplayItem(liquidity), - }, - ], - }, - }; - - return token; + async getLiquidity({ appToken }: GetDataPropsParams) { + return appToken.supply * appToken.price; + } + + async getReserves({ appToken }: GetDataPropsParams) { + return [appToken.pricePerShare[0] * appToken.supply]; + } + + async getApy() { + return 0; } } diff --git a/src/apps/aura/ethereum/aura.balance-fetcher.ts b/src/apps/aura/ethereum/aura.balance-fetcher.ts deleted file mode 100644 index ece63bb7d..000000000 --- a/src/apps/aura/ethereum/aura.balance-fetcher.ts +++ /dev/null @@ -1,211 +0,0 @@ -import { Inject } from '@nestjs/common'; -import { BigNumber } from 'ethers'; -import { compact } from 'lodash'; - -import { drillBalance } from '~app-toolkit'; -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { Register } from '~app-toolkit/decorators'; -import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; -import { BalanceFetcher } from '~balance/balance-fetcher.interface'; -import { isClaimable, isSupplied, isLocked } from '~position/position.utils'; -import { Network } from '~types/network.interface'; - -import { AURA_DEFINITION } from '../aura.definition'; -import { AuraBaseRewardPoolDataProps } from '../aura.types'; -import { AuraContractFactory, AuraMasterchef, AuraVirtualBalanceRewardPool } from '../contracts'; -import { AuraBaseRewardPoolHelper } from '../helpers/aura.base-reward-pool-helper'; - -const appId = AURA_DEFINITION.id; -const groups = AURA_DEFINITION.groups; -const network = Network.ETHEREUM_MAINNET; - -type GetBaseRewardPoolBalancesParams = { - address: string; - groupId: string; -}; - -@Register.BalanceFetcher(appId, network) -export class EthereumAuraBalanceFetcher implements BalanceFetcher { - constructor( - @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(AuraContractFactory) private readonly auraContractFactory: AuraContractFactory, - @Inject(AuraBaseRewardPoolHelper) private readonly auraBaseRewardPoolHelper: AuraBaseRewardPoolHelper, - ) {} - - async getBaseRewardPoolBalances({ address, groupId }: GetBaseRewardPoolBalancesParams) { - return this.appToolkit.helpers.contractPositionBalanceHelper.getContractPositionBalances( - { - appId, - groupId, - network, - address, - resolveBalances: async ({ address, contractPosition, multicall }) => { - const stakedToken = contractPosition.tokens.find(isSupplied); - const claimableTokens = contractPosition.tokens.filter(isClaimable); - - const rewardToken = claimableTokens.find( - ({ address }) => address.toLowerCase() === contractPosition.dataProps.rewardToken.toLowerCase(), - ); - const auraToken = claimableTokens.find( - ({ address }) => address.toLowerCase() === AURA_DEFINITION.token!.address, - ); - const extraRewardTokens = compact( - claimableTokens.filter(({ address }) => - contractPosition.dataProps.extraRewards.find( - extraReward => extraReward.rewardToken.toLowerCase() === address.toLowerCase(), - ), - ), - ); - - const baseRewardPool = this.auraContractFactory.auraBaseRewardPool(contractPosition); - - const extraRewardPools: AuraVirtualBalanceRewardPool[] = contractPosition.dataProps.extraRewards - .filter(({ rewardToken }) => - extraRewardTokens.find(token => token.address.toLowerCase() === rewardToken.toLowerCase()), - ) - .map(({ address }) => this.auraContractFactory.auraVirtualBalanceRewardPool({ address, network })); - - const [stakedBalanceRaw, rewardBalanceRaw, ...extraRewardBalancesRaw] = await Promise.all([ - multicall.wrap(baseRewardPool).balanceOf(address), - multicall.wrap(baseRewardPool).earned(address), - ...extraRewardPools.map(virtualBalanceRewardPool => - multicall.wrap(virtualBalanceRewardPool).earned(address), - ), - ]); - - const auraRewardBalanceRaw = await this.auraBaseRewardPoolHelper.getAuraMintedForRewardToken({ - rewardTokenAmount: rewardBalanceRaw, - network, - }); - - return compact([ - stakedToken ? drillBalance(stakedToken, stakedBalanceRaw.toString()) : null, - rewardToken ? drillBalance(rewardToken, rewardBalanceRaw.toString()) : null, - auraToken ? drillBalance(auraToken, auraRewardBalanceRaw.toString()) : null, - ...extraRewardBalancesRaw.map((balanceRaw, index) => { - const extraRewardToken = extraRewardTokens[index]; - return extraRewardToken ? drillBalance(extraRewardToken, balanceRaw.toString()) : null; - }), - ]); - }, - }, - ); - } - - async getChefBalances(address: string) { - return this.appToolkit.helpers.masterChefContractPositionBalanceHelper.getBalances({ - appId, - groupId: groups.chef.id, - network, - address, - resolveChefContract: ({ contractAddress, network }) => - this.auraContractFactory.auraMasterchef({ address: contractAddress, network }), - resolveStakedTokenBalance: this.appToolkit.helpers.masterChefDefaultStakedBalanceStrategy.build({ - resolveStakedBalance: ({ contract, multicall, contractPosition }) => - multicall - .wrap(contract) - .userInfo(contractPosition.dataProps.poolIndex, address) - .then(v => v.amount), - }), - resolveClaimableTokenBalances: this.appToolkit.helpers.masterChefDefaultClaimableBalanceStrategy.build({ - resolveClaimableBalance: async ({ contract, contractPosition, multicall, address }) => { - const provider = this.appToolkit.getNetworkProvider(network); - const block = await provider.getBlockNumber(); - - const { poolIndex } = contractPosition.dataProps; - const [poolInfo, userInfo, totalAllocPoint, rewardPerBlock, endBlock] = await Promise.all([ - multicall.wrap(contract).poolInfo(poolIndex), - multicall.wrap(contract).userInfo(poolIndex, address), - multicall.wrap(contract).totalAllocPoint(), - multicall.wrap(contract).rewardPerBlock(), - multicall.wrap(contract).endBlock(), - ]); - - if (userInfo.amount.eq(0)) { - return 0; - } - - const lpToken = this.appToolkit.globalContracts.erc20({ address: poolInfo.lpToken, network }); - const lpSupply = await lpToken.balanceOf(contract.address); - - let { accCvxPerShare } = poolInfo; - if (poolInfo.lastRewardBlock.lt(block) && lpSupply.gt(0)) { - const clampedTo = Math.min(block, Number(endBlock)); - const clampedFrom = Math.min(Number(poolInfo.lastRewardBlock), Number(endBlock)); - const multiplier = BigNumber.from(clampedTo - clampedFrom); - const reward = multiplier.mul(rewardPerBlock).mul(poolInfo.allocPoint).div(totalAllocPoint); - accCvxPerShare = accCvxPerShare.add(reward.mul(10 ** 12).div(lpSupply)); - } - - return userInfo.amount - .mul(accCvxPerShare) - .div(10 ** 12) - .sub(userInfo.rewardDebt); - }, - }), - }); - } - - async getLockerBalances(address: string) { - const auraLockerAddress = '0x3fa73f1e5d8a792c80f426fc8f84fbf7ce9bbcac'; - - return this.appToolkit.helpers.contractPositionBalanceHelper.getContractPositionBalances({ - network, - appId, - address, - groupId: groups.locker.id, - resolveBalances: async ({ address, contractPosition, multicall, network }) => { - const auraLocker = this.auraContractFactory.auraLocker({ - address: auraLockerAddress, - network, - }); - - const [lockedBalances, claimableRewards] = await Promise.all([ - multicall.wrap(auraLocker).lockedBalances(address), - multicall.wrap(auraLocker).claimableRewards(address), - ]); - - const { unlockable, locked } = lockedBalances; - - const lockedToken = contractPosition.tokens.find(isLocked); - const suppliedToken = contractPosition.tokens.find(isSupplied); // Same as locked (ie AURA), but unlocked - const claimableTokens = contractPosition.tokens.filter(isClaimable); - - return compact([ - lockedToken ? drillBalance(lockedToken, locked.toString()) : null, - suppliedToken ? drillBalance(suppliedToken, unlockable.toString()) : null, - ...claimableRewards.map(({ token, amount }) => { - const claimableToken = claimableTokens.find(t => t.address.toLowerCase() === token.toLowerCase()); - return claimableToken ? drillBalance(claimableToken, amount.toString()) : null; - }), - ]); - }, - }); - } - - private async getStakingBalances(address: string) { - return this.getBaseRewardPoolBalances({ address, groupId: groups.staking.id }); - } - - private async getPoolsBalances(address: string) { - return this.getBaseRewardPoolBalances({ address, groupId: groups.pool.id }); - } - - async getBalances(address: string) { - const groupBalances = await Promise.all([ - this.getLockerBalances(address), - this.getChefBalances(address), - this.getStakingBalances(address), - this.getPoolsBalances(address), - ]); - - return presentBalanceFetcherResponse( - groupBalances - .filter(assets => assets.length > 0) - .map(assets => ({ - assets, - label: groups[assets[0].groupId].label, - })), - ); - } -} diff --git a/src/apps/aura/ethereum/aura.chef.contract-position-fetcher.ts b/src/apps/aura/ethereum/aura.chef.contract-position-fetcher.ts index baa2675a6..a1dae93cc 100644 --- a/src/apps/aura/ethereum/aura.chef.contract-position-fetcher.ts +++ b/src/apps/aura/ethereum/aura.chef.contract-position-fetcher.ts @@ -1,60 +1,102 @@ import { Inject } from '@nestjs/common'; +import { BigNumber, BigNumberish } from 'ethers'; import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { Register } from '~app-toolkit/decorators'; -import { BALANCER_V2_DEFINITION } from '~apps/balancer-v2'; -import { PositionFetcher } from '~position/position-fetcher.interface'; -import { ContractPosition } from '~position/position.interface'; -import { Network } from '~types/network.interface'; +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; +import { RewardRateUnit } from '~app-toolkit/helpers/master-chef/master-chef.contract-position-helper'; +import { + GetMasterChefDataPropsParams, + GetMasterChefTokenBalancesParams, + MasterChefTemplateContractPositionFetcher, +} from '~position/template/master-chef.template.contract-position-fetcher'; -import { AURA_DEFINITION } from '../aura.definition'; import { AuraContractFactory, AuraMasterchef } from '../contracts'; -const appId = AURA_DEFINITION.id; -const groupId = AURA_DEFINITION.groups.chef.id; -const network = Network.ETHEREUM_MAINNET; +@PositionTemplate() +export class EthereumAuraChefContractPositionFetcher extends MasterChefTemplateContractPositionFetcher { + chefAddress = '0x1ab80f7fb46b25b7e0b2cfac23fc88ac37aaf4e9'; + groupLabel = 'Farms'; + rewardRateUnit = RewardRateUnit.SECOND; -@Register.ContractPositionFetcher({ appId, groupId, network }) -export class EthereumAuraChefContractPositionFetcher implements PositionFetcher { constructor( - @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(AuraContractFactory) private readonly auraContractFactory: AuraContractFactory, - ) {} - - async getPositions() { - return this.appToolkit.helpers.masterChefContractPositionHelper.getContractPositions({ - address: '0x1ab80f7fb46b25b7e0b2cfac23fc88ac37aaf4e9', - network, - appId, - groupId, - dependencies: [ - { appId: AURA_DEFINITION.id, network, groupIds: [AURA_DEFINITION.groups.auraBal.id] }, - { appId: BALANCER_V2_DEFINITION.id, network, groupIds: [BALANCER_V2_DEFINITION.groups.pool.id] }, - ], - resolvePoolIndexIsValid: async ({ contract, poolIndex, multicall }) => - // pid 0 is deprecated - poolIndex > 0 && poolIndex < Number(await multicall.wrap(contract).poolLength()), - resolveLiquidity: ({ depositTokenAddress, address, multicall }) => - multicall - .wrap(this.appToolkit.globalContracts.erc20({ network, address: depositTokenAddress })) - .balanceOf(address), - resolveDepositTokenAddress: ({ contract, multicall, poolIndex }) => - multicall - .wrap(contract) - .poolInfo(poolIndex) - .then(v => v.lpToken), - resolveRewardRate: async ({ contract, multicall, poolIndex }) => { - const [rewardPerBlock, totalAllocPoint, { allocPoint }] = await Promise.all([ - multicall.wrap(contract).rewardPerBlock(), - multicall.wrap(contract).totalAllocPoint(), - multicall.wrap(contract).poolInfo(poolIndex), - ]); - - return rewardPerBlock.mul(allocPoint.mul(1000).div(totalAllocPoint)).div(1000); - }, - resolvePoolLength: ({ multicall, contract }) => multicall.wrap(contract).poolLength(), - resolveContract: ({ address, network }) => this.auraContractFactory.auraMasterchef({ address, network }), - resolveRewardTokenAddresses: ({ multicall, contract }) => multicall.wrap(contract).cvx(), - }); + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(AuraContractFactory) private readonly contractFactory: AuraContractFactory, + ) { + super(appToolkit); + } + + getContract(address: string): AuraMasterchef { + return this.contractFactory.auraMasterchef({ address, network: this.network }); + } + + async getPoolLength(contract: AuraMasterchef): Promise { + return contract.poolLength(); + } + + async getStakedTokenAddress(contract: AuraMasterchef, poolIndex: number): Promise { + return contract.poolInfo(poolIndex).then(v => v.lpToken); + } + + async getRewardTokenAddress(contract: AuraMasterchef): Promise { + return contract.cvx(); + } + + async getTotalAllocPoints({ contract }: GetMasterChefDataPropsParams) { + return contract.totalAllocPoint(); + } + + async getTotalRewardRate({ contract }: GetMasterChefDataPropsParams) { + return contract.rewardPerBlock(); + } + + async getPoolAllocPoints({ contract, definition }: GetMasterChefDataPropsParams) { + return contract.poolInfo(definition.poolIndex).then(v => v.allocPoint); + } + + async getStakedTokenBalance({ + address, + contract, + contractPosition, + }: GetMasterChefTokenBalancesParams): Promise { + return contract.userInfo(contractPosition.dataProps.poolIndex, address).then(v => v.amount); + } + + async getRewardTokenBalance({ + address, + contract, + contractPosition, + }: GetMasterChefTokenBalancesParams): Promise { + const provider = this.appToolkit.getNetworkProvider(this.network); + const block = await provider.getBlockNumber(); + + const { poolIndex } = contractPosition.dataProps; + const [poolInfo, userInfo, totalAllocPoint, rewardPerBlock, endBlock] = await Promise.all([ + contract.poolInfo(poolIndex), + contract.userInfo(poolIndex, address), + contract.totalAllocPoint(), + contract.rewardPerBlock(), + contract.endBlock(), + ]); + + if (userInfo.amount.eq(0)) { + return 0; + } + + const lpToken = this.appToolkit.globalContracts.erc20({ address: poolInfo.lpToken, network: this.network }); + const lpSupply = await lpToken.balanceOf(contract.address); + + let { accCvxPerShare } = poolInfo; + if (poolInfo.lastRewardBlock.lt(block) && lpSupply.gt(0)) { + const clampedTo = Math.min(block, Number(endBlock)); + const clampedFrom = Math.min(Number(poolInfo.lastRewardBlock), Number(endBlock)); + const multiplier = BigNumber.from(clampedTo - clampedFrom); + const reward = multiplier.mul(rewardPerBlock).mul(poolInfo.allocPoint).div(totalAllocPoint); + accCvxPerShare = accCvxPerShare.add(reward.mul(10 ** 12).div(lpSupply)); + } + + return userInfo.amount + .mul(accCvxPerShare) + .div(10 ** 12) + .sub(userInfo.rewardDebt); } } diff --git a/src/apps/aura/ethereum/aura.deposit.token-fetcher.ts b/src/apps/aura/ethereum/aura.deposit.token-fetcher.ts index 6b6b65fb5..23844ed5e 100644 --- a/src/apps/aura/ethereum/aura.deposit.token-fetcher.ts +++ b/src/apps/aura/ethereum/aura.deposit.token-fetcher.ts @@ -1,108 +1,86 @@ import { Inject } from '@nestjs/common'; -import { gql } from 'graphql-request'; -import { compact } from 'lodash'; +import { range } from 'lodash'; import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { Register } from '~app-toolkit/decorators'; -import { getImagesFromToken, getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { BALANCER_V2_DEFINITION } from '~apps/balancer-v2'; -import { ContractType } from '~position/contract.interface'; -import { PositionFetcher } from '~position/position-fetcher.interface'; -import { AppTokenPosition } from '~position/position.interface'; -import { Network } from '~types/network.interface'; - -import { AURA_DEFINITION } from '../aura.definition'; - -type Pools = { - pools: { - depositToken: { - id: string; - symbol: string; - name: string; - decimals: number; - }; - lpToken: { - id: string; - symbol: string; - name: string; - decimals: number; - }; - totalSupply: string; - }[]; +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; +import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; +import { + GetDataPropsParams, + DefaultAppTokenDataProps, + GetDefinitionsParams, + GetAddressesParams, + GetUnderlyingTokensParams, + GetDisplayPropsParams, +} from '~position/template/app-token.template.types'; + +import { AuraContractFactory, AuraDepositToken } from '../contracts'; + +type AuraDepositTokenDefinition = { + address: string; + poolIndex: number; }; -const appId = AURA_DEFINITION.id; -const groupId = AURA_DEFINITION.groups.deposit.id; -const network = Network.ETHEREUM_MAINNET; - -const QUERY = gql` - { - pools(where: { isFactoryPool: true }) { - depositToken { - id - symbol - name - decimals - } - lpToken { - id - symbol - decimals - name - } - totalSupply - rewardPool - } +@PositionTemplate() +export class EthereumAuraDepositTokenFetcher extends AppTokenTemplatePositionFetcher< + AuraDepositToken, + DefaultAppTokenDataProps, + AuraDepositTokenDefinition +> { + groupLabel = 'Deposits'; + + BOOSTER_ADDRESS = '0x7818a1da7bd1e64c199029e86ba244a9798eee10'; + + constructor( + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(AuraContractFactory) protected readonly contractFactory: AuraContractFactory, + ) { + super(appToolkit); } -`; -@Register.TokenPositionFetcher({ appId, groupId, network }) -export class EthereumAuraDepositTokenFetcher implements PositionFetcher { - constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + getContract(address: string): AuraDepositToken { + return this.contractFactory.auraDepositToken({ address, network: this.network }); + } - async getPositions() { - const appTokens = await this.appToolkit.getAppTokenPositions( - { appId: BALANCER_V2_DEFINITION.id, groupIds: [BALANCER_V2_DEFINITION.groups.pool.id], network }, - { appId: AURA_DEFINITION.id, groupIds: [AURA_DEFINITION.groups.chef.id], network }, - ); + async getDefinitions({ multicall }: GetDefinitionsParams): Promise { + const boosterContract = this.contractFactory.auraBooster({ address: this.BOOSTER_ADDRESS, network: this.network }); + const numOfPools = await boosterContract.poolLength(); - const { pools } = await this.appToolkit.helpers.theGraphHelper.request({ - endpoint: 'https://api.thegraph.com/subgraphs/name/aurafinance/aura', - query: QUERY, - }); - - // Aura platform deposit tokens (e.g. aBPT tokens) - const depositTokens = pools.map( - ({ depositToken, lpToken: { id: lpTokenAddress }, totalSupply }) => { - const address = depositToken.id.toLowerCase(); - const { decimals, symbol } = depositToken; - - const lpToken = appTokens.find(token => token.address.toLowerCase() === lpTokenAddress.toLowerCase()); - if (!lpToken) return null; - - const supply = Number(totalSupply) / 10 ** decimals; - - return { - type: ContractType.APP_TOKEN, - appId, - groupId, - network, - address, - decimals, - symbol, - supply, - price: lpToken.price, - pricePerShare: 1, - tokens: [lpToken], - dataProps: {}, - displayProps: { - label: getLabelFromToken(lpToken), - images: getImagesFromToken(lpToken), - }, - }; - }, + const definitions = await Promise.all( + range(0, Number(numOfPools)).flatMap(async poolIndex => { + const poolInfo = await multicall.wrap(boosterContract).poolInfo(poolIndex); + return { address: poolInfo.token.toLowerCase(), poolIndex }; + }), ); - return compact(depositTokens); + return definitions; + } + + async getAddresses({ definitions }: GetAddressesParams) { + return definitions.map(v => v.address); + } + + async getUnderlyingTokenAddresses({ + definition, + }: GetUnderlyingTokensParams) { + const boosterContract = this.contractFactory.auraBooster({ address: this.BOOSTER_ADDRESS, network: this.network }); + const poolInfo = await boosterContract.poolInfo(definition.poolIndex); + return poolInfo.lptoken; + } + + async getLiquidity({ appToken }: GetDataPropsParams) { + return appToken.supply * appToken.price; + } + + async getReserves({ appToken }: GetDataPropsParams) { + return [appToken.pricePerShare[0] * appToken.supply]; + } + + async getApy(_params: GetDataPropsParams) { + return 0; + } + + async getLabel({ appToken }: GetDisplayPropsParams) { + return getLabelFromToken(appToken.tokens[0]!); } } diff --git a/src/apps/aura/ethereum/aura.locker.contract-position-fetcher.ts b/src/apps/aura/ethereum/aura.locker.contract-position-fetcher.ts index 0a3fb85ed..0e141ff4c 100644 --- a/src/apps/aura/ethereum/aura.locker.contract-position-fetcher.ts +++ b/src/apps/aura/ethereum/aura.locker.contract-position-fetcher.ts @@ -1,142 +1,62 @@ import { Inject } from '@nestjs/common'; -import { BigNumber } from 'ethers'; -import { gql } from 'graphql-request'; -import { compact } from 'lodash'; +import { BigNumberish } from 'ethers'; import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { Register } from '~app-toolkit/decorators'; +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; +import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { DefaultDataProps } from '~position/display.interface'; +import { MetaType } from '~position/position.interface'; +import { isSupplied } from '~position/position.utils'; +import { ContractPositionTemplatePositionFetcher } from '~position/template/contract-position.template.position-fetcher'; import { - buildDollarDisplayItem, - buildPercentageDisplayItem, -} from '~app-toolkit/helpers/presentation/display-item.present'; -import { getTokenImg } from '~app-toolkit/helpers/presentation/image.present'; -import { SynthetixSingleStakingRoiStrategy } from '~apps/synthetix'; -import { ContractType } from '~position/contract.interface'; -import { PositionFetcher } from '~position/position-fetcher.interface'; -import { ContractPosition } from '~position/position.interface'; -import { claimable, locked, supplied } from '~position/position.utils'; -import { Network } from '~types/network.interface'; + GetDisplayPropsParams, + GetTokenBalancesParams, + GetTokenDefinitionsParams, +} from '~position/template/contract-position.template.types'; -import { AURA_DEFINITION } from '../aura.definition'; import { AuraContractFactory, AuraLocker } from '../contracts'; -const appId = AURA_DEFINITION.id; -const groupId = AURA_DEFINITION.groups.locker.id; -const network = Network.ETHEREUM_MAINNET; +@PositionTemplate() +export class EthereumAuraLockerContractPositionFetcher extends ContractPositionTemplatePositionFetcher { + groupLabel = 'Vote Locked AURA'; -type AuraLockerQuery = { - auraLocker: { - totalSupply: string; - rewardData: { - token: { id: string }; - rewardRate: string; - }[]; - }; -}; - -const AURA_LOCKER_QUERY = gql` - { - auraLocker(id: "auraLocker") { - totalSupply - rewardData { - rewardRate - token { - id - } - } - } - } -`; - -@Register.ContractPositionFetcher({ appId, groupId, network }) -export class EthereumAuraLockerContractPositionFetcher implements PositionFetcher { constructor( - @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(AuraContractFactory) private readonly auraContractFactory: AuraContractFactory, - @Inject(SynthetixSingleStakingRoiStrategy) private readonly roiStrategy: SynthetixSingleStakingRoiStrategy, - ) {} - - async getPositions() { - const address = '0x3fa73f1e5d8a792c80f426fc8f84fbf7ce9bbcac'; - - const contract = this.auraContractFactory.auraLocker({ address, network }); - const multicall = this.appToolkit.getMulticall(network); - - const baseTokens = await this.appToolkit.getBaseTokenPrices(network); - const appTokens = await this.appToolkit.getAppTokenPositions({ - appId, - groupIds: [AURA_DEFINITION.groups.chef.id], - network, - }); - - const allTokens = [...baseTokens, ...appTokens]; - - const auraToken = allTokens.find(t => t.address.toLowerCase() === AURA_DEFINITION.token!.address.toLowerCase()); - if (!auraToken) return []; - - const { totalSupply, rewardData } = await this.getAuraLockerData(); - - const rewardTokenMatches = compact( - rewardData.map(({ address, rewardRate }) => { - const token = allTokens.find(token => token.address.toLowerCase() === address); - return token ? { token, rewardRate } : null; - }), - ); + @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, + @Inject(AuraContractFactory) protected readonly contractFactory: AuraContractFactory, + ) { + super(appToolkit); + } - const lockedToken = locked(auraToken); - const unlockedToken = supplied(auraToken); - const rewardTokens = rewardTokenMatches.map(({ token }) => claimable(token)); - const tokens = [lockedToken, unlockedToken, ...rewardTokens]; + getContract(address: string): AuraLocker { + return this.contractFactory.auraLocker({ network: this.network, address }); + } - const liquidity = (Number(totalSupply) / 10 ** lockedToken.decimals) * lockedToken.price; + async getDefinitions() { + return [{ address: '0x3fa73f1e5d8a792c80f426fc8f84fbf7ce9bbcac' }]; + } - const roisStrategy = this.roiStrategy.build({ - resolveRewardRates: async () => rewardTokenMatches.map(({ rewardRate }) => rewardRate), - }); - const rois = await roisStrategy({ - contract, - multicall, - rewardTokens, - address, - network, - stakedToken: lockedToken, - liquidity, - }); + async getTokenDefinitions({ contract }: GetTokenDefinitionsParams) { + const stakedTokenAddress = await contract.stakingToken(); + const rewardTokenAddress = await contract.rewardTokens(0); - const position: ContractPosition = { - type: ContractType.POSITION, - appId, - groupId, - address, - network, - tokens, - dataProps: { - liquidity, - rois, - }, - displayProps: { - label: 'Vote-locked Aura (vlAURA)', - images: [getTokenImg(lockedToken.address, network)], - statsItems: [ - { label: 'APR', value: buildPercentageDisplayItem(rois.yearlyROI * 100) }, - { label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }, - ], - }, - }; + return [ + { metaType: MetaType.SUPPLIED, address: stakedTokenAddress }, + { metaType: MetaType.CLAIMABLE, address: rewardTokenAddress }, + ]; + } - return [position]; + async getLabel({ contractPosition }: GetDisplayPropsParams) { + const suppliedToken = contractPosition.tokens.find(isSupplied)!; + return `Voting Escrow ${getLabelFromToken(suppliedToken)}`; } - private async getAuraLockerData() { - const { - auraLocker: { rewardData, totalSupply }, - } = await this.appToolkit.helpers.theGraphHelper.request({ - endpoint: 'https://api.thegraph.com/subgraphs/name/aurafinance/aura', - query: AURA_LOCKER_QUERY, - }); - return { - totalSupply: BigNumber.from(totalSupply), - rewardData: rewardData.map(({ token: { id }, rewardRate }) => ({ address: id.toLowerCase(), rewardRate })), - }; + async getTokenBalancesPerPosition({ + address, + contract, + }: GetTokenBalancesParams): Promise { + return Promise.all([ + contract.lockedBalances(address).then(v => v.total), + contract.claimableRewards(address).then(v => v[0].amount), + ]); } } diff --git a/src/apps/aura/ethereum/aura.lp-farm.contract-position-fetcher.ts b/src/apps/aura/ethereum/aura.lp-farm.contract-position-fetcher.ts new file mode 100644 index 000000000..9cefc81a5 --- /dev/null +++ b/src/apps/aura/ethereum/aura.lp-farm.contract-position-fetcher.ts @@ -0,0 +1,17 @@ +import { range } from 'lodash'; + +import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; + +import { AuraFarmContractPositionFetcher } from '../common/aura.farm.contract-position-fetcher'; + +@PositionTemplate() +export class EthereumAuraLpFarmContractPositionFetcher extends AuraFarmContractPositionFetcher { + groupLabel = 'Liquidity Pool Staking'; + + async getFarmAddresses() { + const address = '0x7818a1da7bd1e64c199029e86ba244a9798eee10'; + const contract = this.contractFactory.auraBooster({ address, network: this.network }); + const numPools = await contract.poolLength().then(Number); + return Promise.all(range(0, numPools).map(v => contract.poolInfo(v).then(p => p.crvRewards))); + } +} diff --git a/src/apps/aura/ethereum/aura.pool.contract-position-fetcher.ts b/src/apps/aura/ethereum/aura.pool.contract-position-fetcher.ts deleted file mode 100644 index d34bcd1c0..000000000 --- a/src/apps/aura/ethereum/aura.pool.contract-position-fetcher.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Inject } from '@nestjs/common'; -import { gql } from 'graphql-request'; -import { compact } from 'lodash'; - -import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { Register } from '~app-toolkit/decorators'; -import { AuraBaseRewardPoolHelper } from '~apps/aura/helpers/aura.base-reward-pool-helper'; -import { BALANCER_V2_DEFINITION } from '~apps/balancer-v2'; -import { PositionFetcher } from '~position/position-fetcher.interface'; -import { ContractPosition } from '~position/position.interface'; -import { Network } from '~types/network.interface'; - -import { AURA_DEFINITION } from '../aura.definition'; - -const appId = AURA_DEFINITION.id; -const groupId = AURA_DEFINITION.groups.pool.id; -const network = Network.ETHEREUM_MAINNET; - -type RewardPools = { - pools: { - rewardPool: string; - }[]; -}; - -const REWARD_POOLS_QUERY = gql` - { - pools(where: { isFactoryPool: true }) { - rewardPool - } - } -`; - -@Register.ContractPositionFetcher({ appId, groupId, network }) -export class EthereumAuraPoolContractPositionFetcher implements PositionFetcher { - constructor( - @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(AuraBaseRewardPoolHelper) private readonly auraBaseRewardPoolHelper: AuraBaseRewardPoolHelper, - ) {} - - async getPositions() { - const rewardPools = await this.getRewardPools(); - - return this.auraBaseRewardPoolHelper.getBaseRewardPoolContractPositions({ - appId, - network, - groupId, - dependencies: [ - { appId: BALANCER_V2_DEFINITION.id, network, groupIds: [BALANCER_V2_DEFINITION.groups.pool.id] }, - { - appId: AURA_DEFINITION.id, - network, - groupIds: [AURA_DEFINITION.groups.auraBal.id, AURA_DEFINITION.groups.deposit.id], - }, - ], - rewardPools, - }); - } - - private async getRewardPools() { - const { pools } = await this.appToolkit.helpers.theGraphHelper.request({ - endpoint: 'https://api.thegraph.com/subgraphs/name/aurafinance/aura', - query: REWARD_POOLS_QUERY, - }); - return compact(pools.map(pool => pool.rewardPool)); - } -} diff --git a/src/apps/aura/ethereum/aura.staking.contract-position-fetcher.ts b/src/apps/aura/ethereum/aura.staking.contract-position-fetcher.ts deleted file mode 100644 index 1e4c91603..000000000 --- a/src/apps/aura/ethereum/aura.staking.contract-position-fetcher.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { Register } from '~app-toolkit/decorators'; -import { AuraBaseRewardPoolHelper } from '~apps/aura/helpers/aura.base-reward-pool-helper'; -import { BALANCER_V2_DEFINITION } from '~apps/balancer-v2'; -import { PositionFetcher } from '~position/position-fetcher.interface'; -import { ContractPosition } from '~position/position.interface'; -import { Network } from '~types/network.interface'; - -import { AURA_DEFINITION } from '../aura.definition'; - -const appId = AURA_DEFINITION.id; -const groupId = AURA_DEFINITION.groups.staking.id; -const network = Network.ETHEREUM_MAINNET; - -@Register.ContractPositionFetcher({ appId, groupId, network }) -export class EthereumAuraStakingContractPositionFetcher implements PositionFetcher { - constructor(@Inject(AuraBaseRewardPoolHelper) private readonly auraBaseRewardPoolHelper: AuraBaseRewardPoolHelper) {} - - async getPositions() { - return this.auraBaseRewardPoolHelper.getBaseRewardPoolContractPositions({ - appId, - network, - groupId, - dependencies: [ - { appId: BALANCER_V2_DEFINITION.id, network, groupIds: [BALANCER_V2_DEFINITION.groups.pool.id] }, - { appId: AURA_DEFINITION.id, network, groupIds: [AURA_DEFINITION.groups.auraBal.id] }, - ], - rewardPools: ['0x5e5ea2048475854a5702f5b8468a51ba1296efcc'], - }); - } -} diff --git a/src/apps/aura/helpers/aura.base-reward-pool-helper.ts b/src/apps/aura/helpers/aura.base-reward-pool-helper.ts deleted file mode 100644 index 7c955db22..000000000 --- a/src/apps/aura/helpers/aura.base-reward-pool-helper.ts +++ /dev/null @@ -1,210 +0,0 @@ -import { Inject, Injectable } from '@nestjs/common'; -import { BigNumber } from 'ethers'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { AURA_DEFINITION, AuraContractFactory } from '~apps/aura'; -import { AuraBaseRewardPoolDataProps } from '~apps/aura/aura.types'; -import { AuraBaseRewardPool } from '~apps/aura/contracts'; -import { SynthetixSingleStakingIsActiveStrategy, SynthetixSingleStakingRoiStrategy } from '~apps/synthetix'; -import { ContractPosition } from '~position/position.interface'; -import { AppGroupsDefinition } from '~position/position.service'; -import { Network } from '~types'; - -type GetRewardsDataPropsParams = { - network: Network; - rewardPools: string[]; -}; - -type GetBaseRewardPoolContractPositionsParams = { - appId: string; - groupId: string; - network: Network; - dependencies: AppGroupsDefinition[]; - rewardPools: string[]; -}; - -type GetAuraMintedForRewardTokenParams = { - rewardTokenAmount: BigNumber; - network: Network; -}; - -type GetAuraRewardRateParams = { - rewardRate: BigNumber; - network: Network; -}; - -@Injectable() -export class AuraBaseRewardPoolHelper { - constructor( - @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, - @Inject(AuraContractFactory) private readonly auraContractFactory: AuraContractFactory, - @Inject(SynthetixSingleStakingIsActiveStrategy) - private readonly isActiveStrategy: SynthetixSingleStakingIsActiveStrategy, - @Inject(SynthetixSingleStakingRoiStrategy) private readonly roiStrategy: SynthetixSingleStakingRoiStrategy, - ) {} - - async getBaseRewardPoolContractPositions({ - appId, - groupId, - network, - dependencies, - rewardPools, - }: GetBaseRewardPoolContractPositionsParams) { - // Get the reward tokens and extra rewards up front because we need some - // extra dataProps in order to resolve earned rewards across base reward - // pools and virtual reward pools - const rewardsDataProps = await this.getRewardsDataProps({ rewardPools, network }); - - const contractPositions: ContractPosition[] = - await this.appToolkit.helpers.singleStakingFarmContractPositionHelper.getContractPositions({ - network, - appId, - groupId, - dependencies, - resolveFarmContract: ({ address, network }) => - this.auraContractFactory.auraBaseRewardPool({ address, network }), - resolveFarmAddresses: () => rewardPools, - resolveLiquidity: ({ contract, multicall }) => multicall.wrap(contract).totalSupply(), - resolveIsActive: this.isActiveStrategy.build({ - resolvePeriodFinish: ({ contract, multicall }) => multicall.wrap(contract).periodFinish(), - }), - resolveRewardTokenAddresses: async ({ contract }) => { - const rewards = rewardsDataProps.find(r => r.rewardPool === contract.address)!; - const { rewardToken, extraRewards } = rewards; - return [rewardToken, AURA_DEFINITION.token!.address, ...extraRewards.map(r => r.rewardToken)]; - }, - resolveStakedTokenAddress: ({ contract, multicall }) => multicall.wrap(contract).stakingToken(), - resolveRois: opts => { - const strategy = this.roiStrategy.build({ - resolveRewardRates: async ({ contract, multicall }) => { - // Platform reward (e.g. BAL) - const rewardRate = await contract.rewardRate(); - - const { extraRewards } = rewardsDataProps.find(r => r.rewardPool === contract.address)!; - - // AURA reward and extra rewards - const otherRewardRates = await Promise.all([ - this.getAuraRewardRate({ network, rewardRate }), - ...extraRewards.map(({ address }) => - multicall - .wrap(this.auraContractFactory.auraVirtualBalanceRewardPool({ address, network })) - .rewardRate(), - ), - ]); - - return [rewardRate, ...otherRewardRates]; - }, - }); - return strategy(opts); - }, - }); - - return contractPositions.map>( - ({ dataProps, ...contractPosition }) => { - const { extraRewards, rewardToken } = rewardsDataProps.find(r => r.rewardPool === contractPosition.address)!; - return { - ...contractPosition, - dataProps: { ...dataProps, extraRewards, rewardToken }, - }; - }, - ); - } - - async getAuraMintedForRewardToken({ rewardTokenAmount, network }: GetAuraMintedForRewardTokenParams) { - // All values are static/immutable - const maxSupply = BigNumber.from(10).pow(26); - const initMintAmount = BigNumber.from(10).pow(25).mul(5); - const emissionsMaxSupply = BigNumber.from(10).pow(25).mul(5); - const totalCliffs = BigNumber.from(500); - const reductionPerCliff = emissionsMaxSupply.div(totalCliffs); - - const contract = this.auraContractFactory.auraToken({ address: AURA_DEFINITION.token!.address, network }); - const totalSupply = await contract.totalSupply(); - - const emissionsMinted = totalSupply.sub(initMintAmount); - - // e.g. reductionPerCliff = 5e25 / 500 = 1e23 - // e.g. cliff = 1e25 / 1e23 = 100 - const cliff = emissionsMinted.div(reductionPerCliff); - - // e.g. 100 < 500 - if (cliff.lt(totalCliffs)) { - // e.g. (new) reduction = (500 - 100) * 2.5 + 700 = 1700; - // e.g. (new) reduction = (500 - 250) * 2.5 + 700 = 1325; - // e.g. (new) reduction = (500 - 400) * 2.5 + 700 = 950; - const reduction = totalCliffs.sub(cliff).mul(5).div(2).add(700); - // e.g. (new) amount = 1e19 * 1700 / 500 = 34e18; - // e.g. (new) amount = 1e19 * 1325 / 500 = 26.5e18; - // e.g. (new) amount = 1e19 * 950 / 500 = 19e17; - let amount = rewardTokenAmount.mul(reduction).div(totalCliffs); - - // e.g. amtTillMax = 5e25 - 1e25 = 4e25 - const amtTillMax = maxSupply.sub(emissionsMinted); - if (amount.gt(amtTillMax)) { - amount = amtTillMax; - } - - return amount; - } - - return BigNumber.from(0); - } - - private async getAuraRewardRate({ rewardRate, network }: GetAuraRewardRateParams) { - if (rewardRate.eq(0)) { - return BigNumber.from(0); - } - - // Annualise rewardRate to get an amount of reward token earned per year - const secondsPerYear = 86400 * 7 * 365; - const rewardTokenAmount = rewardRate.mul(secondsPerYear); - - // Get the AURA amount minted for that period - const auraRewardRate = await this.getAuraMintedForRewardToken({ rewardTokenAmount, network }); - - // Get per-second value (i.e. the AURA reward rate) - if (auraRewardRate.gt(0)) { - return auraRewardRate.div(secondsPerYear); - } - return auraRewardRate; - } - - private async getRewardsDataProps({ - rewardPools, - network, - }: GetRewardsDataPropsParams): Promise< - { rewardPool: string; rewardToken: string; extraRewards: { address: string; rewardToken: string }[] }[] - > { - const multicall = this.appToolkit.getMulticall(network); - - return Promise.all( - rewardPools.map(async rewardPool => { - const contract = this.auraContractFactory.auraBaseRewardPool({ address: rewardPool, network }); - - const extraRewardsLength = Number(await contract.extraRewardsLength()); - - let extraRewards: { address: string; rewardToken: string }[] = []; - - if (extraRewardsLength > 0) { - const indexes = [...Array(extraRewardsLength).keys()]; - const extraRewardsAddresses = await Promise.all( - indexes.map(index => multicall.wrap(contract).extraRewards(index)), - ); - const extraRewardTokens = await Promise.all( - extraRewardsAddresses - .map(address => this.auraContractFactory.auraVirtualBalanceRewardPool({ address, network })) - .map(contract => multicall.wrap(contract).rewardToken()), - ); - extraRewards = extraRewardsAddresses.map((address, index) => ({ - address: address.toLowerCase(), - rewardToken: extraRewardTokens[index].toLowerCase(), - })); - } - - const rewardToken = (await multicall.wrap(contract).rewardToken()).toLowerCase(); - - return { rewardPool, rewardToken, extraRewards }; - }), - ); - } -}