From 1cb63677282ea0b46c34b085e2a9b8a6d5dfefc0 Mon Sep 17 00:00:00 2001 From: William Poulin Date: Wed, 3 Jan 2024 16:50:12 -0500 Subject: [PATCH] fix(euler): Deleted app --- src/apps/euler/assets/logo.png | Bin 11483 -> 0 bytes .../common/euler.api.staking-registry.ts | 87 -- .../common/euler.d-token.token-fetcher.ts | 65 - .../common/euler.e-token.token-fetcher.ts | 77 - .../common/euler.p-token.token-fetcher.ts | 58 - .../common/euler.token-definition-resolver.ts | 102 -- .../contracts/abis/euler-dtoken-contract.json | 1193 --------------- .../contracts/abis/euler-etoken-contract.json | 1348 ---------------- .../contracts/abis/euler-ptoken-contract.json | 310 ---- .../abis/euler-staking-rewards-contract.json | 310 ---- src/apps/euler/contracts/index.ts | 4 - .../euler/contracts/viem.contract-factory.ts | 31 - .../contracts/viem/EulerDtokenContract.ts | 1207 --------------- .../contracts/viem/EulerEtokenContract.ts | 1362 ----------------- .../contracts/viem/EulerPtokenContract.ts | 324 ---- .../viem/EulerStakingRewardsContract.ts | 652 -------- src/apps/euler/contracts/viem/index.ts | 13 - .../ethereum/euler.d-token.token-fetcher.ts | 11 - .../ethereum/euler.e-token.token-fetcher.ts | 11 - .../ethereum/euler.p-token.token-fetcher.ts | 10 - .../ethereum/euler.position-presenter.ts | 28 - ...-staking-farm.contract-position-fetcher.ts | 83 - src/apps/euler/euler.module.ts | 26 - 23 files changed, 7312 deletions(-) delete mode 100644 src/apps/euler/assets/logo.png delete mode 100644 src/apps/euler/common/euler.api.staking-registry.ts delete mode 100644 src/apps/euler/common/euler.d-token.token-fetcher.ts delete mode 100644 src/apps/euler/common/euler.e-token.token-fetcher.ts delete mode 100644 src/apps/euler/common/euler.p-token.token-fetcher.ts delete mode 100644 src/apps/euler/common/euler.token-definition-resolver.ts delete mode 100644 src/apps/euler/contracts/abis/euler-dtoken-contract.json delete mode 100644 src/apps/euler/contracts/abis/euler-etoken-contract.json delete mode 100644 src/apps/euler/contracts/abis/euler-ptoken-contract.json delete mode 100644 src/apps/euler/contracts/abis/euler-staking-rewards-contract.json delete mode 100644 src/apps/euler/contracts/index.ts delete mode 100644 src/apps/euler/contracts/viem.contract-factory.ts delete mode 100644 src/apps/euler/contracts/viem/EulerDtokenContract.ts delete mode 100644 src/apps/euler/contracts/viem/EulerEtokenContract.ts delete mode 100644 src/apps/euler/contracts/viem/EulerPtokenContract.ts delete mode 100644 src/apps/euler/contracts/viem/EulerStakingRewardsContract.ts delete mode 100644 src/apps/euler/contracts/viem/index.ts delete mode 100644 src/apps/euler/ethereum/euler.d-token.token-fetcher.ts delete mode 100644 src/apps/euler/ethereum/euler.e-token.token-fetcher.ts delete mode 100644 src/apps/euler/ethereum/euler.p-token.token-fetcher.ts delete mode 100644 src/apps/euler/ethereum/euler.position-presenter.ts delete mode 100644 src/apps/euler/ethereum/euler.single-staking-farm.contract-position-fetcher.ts delete mode 100644 src/apps/euler/euler.module.ts diff --git a/src/apps/euler/assets/logo.png b/src/apps/euler/assets/logo.png deleted file mode 100644 index d124e8878574d19b401ebad98535703df210e248..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11483 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

B$)(;iZs7VbM_kA=~fCT0VsH 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 jarXbh>z&V+(`https://name.web3.storage/name/${ipfsHash}`) - .then(ipfs => - axios - .get( - `https://${ipfs.data.value.replace('/ipfs/', '')}.ipfs.w3s.link/EulerActivatedMarkets.json`, - ) - .then(v => v.data.markets), - ); - } - - async getStakingDefinitions(opts?: GetFarmDefinitionsProps) { - const stakingDefinitions = await this.getStakingDefinitionsData(opts); - - return Promise.all( - stakingDefinitions - .filter(market => market.eulDistribution?.staking) - .map(async ({ underlying, eulDistribution }) => { - const market = await this.tokenCacheManager.getMarketByUnderlying(underlying); - - return { - tokenAddress: underlying, - eTokenAddress: market?.eTokenAddress ?? null, - vaultAddress: eulDistribution?.staking?.contractAddress ?? '', - apr: eulDistribution?.staking?.APR ?? null, - }; - }), - ); - } -} diff --git a/src/apps/euler/common/euler.d-token.token-fetcher.ts b/src/apps/euler/common/euler.d-token.token-fetcher.ts deleted file mode 100644 index 3123a73cc..000000000 --- a/src/apps/euler/common/euler.d-token.token-fetcher.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - GetUnderlyingTokensParams, - GetAddressesParams, - GetDataPropsParams, - DefaultAppTokenDataProps, -} from '~position/template/app-token.template.types'; - -import { EulerViemContractFactory } from '../contracts'; -import { EulerDtokenContract } from '../contracts/viem'; - -import { EulerTokenDefinition, EulerTokenDefinitionsResolver, EulerTokenType } from './euler.token-definition-resolver'; - -export abstract class EulerDTokenTokenFetcher extends AppTokenTemplatePositionFetcher< - EulerDtokenContract, - DefaultAppTokenDataProps, - EulerTokenDefinition -> { - isDebt = true; - abstract tokenType: EulerTokenType; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(EulerTokenDefinitionsResolver) - private readonly tokenDefinitionsResolver: EulerTokenDefinitionsResolver, - @Inject(EulerViemContractFactory) protected readonly contractFactory: EulerViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.eulerDtokenContract({ network: this.network, address }); - } - - async getDefinitions(): Promise { - return this.tokenDefinitionsResolver.getTokenDefinitions(this.tokenType); - } - - async getAddresses({ definitions }: GetAddressesParams): Promise { - return definitions.map(v => v.address); - } - - async getSymbol({ address }): Promise { - const market = await this.tokenDefinitionsResolver.getMarket(address, this.tokenType); - return `D${market!.symbol}`; - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [{ address: definition.underlyingTokenAddress, network: this.network }]; - } - - async getPricePerShare() { - return [1]; - } - - async getApy({ appToken }: GetDataPropsParams) { - const market = await this.tokenDefinitionsResolver.getMarket(appToken.address, this.tokenType); - return (Number(market!.borrowAPY) * 100) / 1e27; - } -} diff --git a/src/apps/euler/common/euler.e-token.token-fetcher.ts b/src/apps/euler/common/euler.e-token.token-fetcher.ts deleted file mode 100644 index 956aac8bb..000000000 --- a/src/apps/euler/common/euler.e-token.token-fetcher.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Inject } from '@nestjs/common'; -import { ethers } from 'ethers'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - GetUnderlyingTokensParams, - GetAddressesParams, - GetDataPropsParams, - DefaultAppTokenDataProps, - GetPricePerShareParams, -} from '~position/template/app-token.template.types'; - -import { EulerViemContractFactory } from '../contracts'; -import { EulerEtokenContract } from '../contracts/viem'; - -import { EulerTokenDefinition, EulerTokenDefinitionsResolver, EulerTokenType } from './euler.token-definition-resolver'; - -export abstract class EulerETokenTokenFetcher extends AppTokenTemplatePositionFetcher< - EulerEtokenContract, - DefaultAppTokenDataProps, - EulerTokenDefinition -> { - abstract tokenType: EulerTokenType; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(EulerTokenDefinitionsResolver) - private readonly tokenDefinitionsResolver: EulerTokenDefinitionsResolver, - @Inject(EulerViemContractFactory) protected readonly contractFactory: EulerViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.eulerEtokenContract({ network: this.network, address }); - } - - async getDefinitions(): Promise { - return this.tokenDefinitionsResolver.getTokenDefinitions(this.tokenType); - } - - async getAddresses({ definitions }: GetAddressesParams): Promise { - return definitions.map(v => v.address); - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [{ address: definition.underlyingTokenAddress, network: this.network }]; - } - - async getSymbol({ address }): Promise { - const market = await this.tokenDefinitionsResolver.getMarket(address, this.tokenType); - return `E${market!.symbol}`; - } - - async getPricePerShare({ contract, multicall, appToken }: GetPricePerShareParams) { - const oneUnit = ethers.BigNumber.from(10).pow(18).toString(); - const pricePerShareRaw = await multicall.wrap(contract).read.convertBalanceToUnderlying([BigInt(oneUnit)]); - const pricePerShare = Number(pricePerShareRaw) / 10 ** appToken.tokens[0].decimals; - return [pricePerShare]; - } - - async getLiquidity({ appToken }: GetDataPropsParams) { - return (this.isDebt ? -1 : 1) * appToken.price * appToken.supply; - } - - async getReserves({ appToken }: GetDataPropsParams) { - return [appToken.pricePerShare[0] * appToken.supply]; - } - - async getApy({ appToken }: GetDataPropsParams) { - const market = await this.tokenDefinitionsResolver.getMarket(appToken.address, this.tokenType); - return (Number(market!.supplyAPY) * 100) / 1e27; - } -} diff --git a/src/apps/euler/common/euler.p-token.token-fetcher.ts b/src/apps/euler/common/euler.p-token.token-fetcher.ts deleted file mode 100644 index 98811cbc3..000000000 --- a/src/apps/euler/common/euler.p-token.token-fetcher.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - GetUnderlyingTokensParams, - GetAddressesParams, - DefaultAppTokenDataProps, -} from '~position/template/app-token.template.types'; - -import { EulerViemContractFactory } from '../contracts'; -import { EulerPtokenContract } from '../contracts/viem'; - -import { EulerTokenDefinition, EulerTokenDefinitionsResolver, EulerTokenType } from './euler.token-definition-resolver'; - -export abstract class EulerPTokenTokenFetcher extends AppTokenTemplatePositionFetcher< - EulerPtokenContract, - DefaultAppTokenDataProps, - EulerTokenDefinition -> { - abstract tokenType: EulerTokenType; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(EulerTokenDefinitionsResolver) - private readonly tokenDefinitionsResolver: EulerTokenDefinitionsResolver, - @Inject(EulerViemContractFactory) protected readonly contractFactory: EulerViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.eulerPtokenContract({ network: this.network, address }); - } - - async getDefinitions(): Promise { - return this.tokenDefinitionsResolver.getTokenDefinitions(this.tokenType); - } - - async getAddresses({ definitions }: GetAddressesParams): Promise { - return definitions.map(v => v.address); - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [{ address: definition.underlyingTokenAddress, network: this.network }]; - } - - async getPricePerShare() { - return [1]; - } - - async getSymbol({ address }): Promise { - const market = await this.tokenDefinitionsResolver.getMarket(address, this.tokenType); - return `P${market!.symbol}`; - } -} diff --git a/src/apps/euler/common/euler.token-definition-resolver.ts b/src/apps/euler/common/euler.token-definition-resolver.ts deleted file mode 100644 index 292274f1d..000000000 --- a/src/apps/euler/common/euler.token-definition-resolver.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { Inject, Injectable } from '@nestjs/common'; -import { gql } from 'graphql-request'; -import _ from 'lodash'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { ZERO_ADDRESS } from '~app-toolkit/constants/address'; -import { gqlFetch } from '~app-toolkit/helpers/the-graph.helper'; - -export type EulerTokenDefinition = { - address: string; - underlyingTokenAddress: string; -}; - -interface EulerMarketsResponse { - eulerMarketStore: { - markets: { - id: string; - interestRate: string; - borrowAPY: string; - supplyAPY: string; - totalSupply: string; - twap: string; - name: string; - symbol: string; - decimals: string; - dTokenAddress: string; - eTokenAddress: string; - pTokenAddress: string; - }[]; - }; -} - -export const MARKET_QUERY = gql` - { - eulerMarketStore(id: "euler-market-store") { - markets(first: 1000) { - id - interestRate - borrowAPY - supplyAPY - totalSupply - twap - name - symbol - decimals - dTokenAddress - eTokenAddress - pTokenAddress - } - } - } -`; - -export enum EulerTokenType { - D_TOKEN = 'dTokenAddress', - E_TOKEN = 'eTokenAddress', - P_TOKEN = 'pTokenAddress', -} - -const brokenMarketAddress = ['0x31c8eacbffdd875c74b94b077895bd78cf1e64a3']; // RAD - -@Injectable() -export class EulerTokenDefinitionsResolver { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - private async getTokenDefinitionsData() { - const data = await gqlFetch({ - endpoint: `https://api.thegraph.com/subgraphs/name/euler-xyz/euler-mainnet?source=zapper`, - query: MARKET_QUERY, - }); - - const marketRaw = data.eulerMarketStore.markets; - - return marketRaw.filter(x => !brokenMarketAddress.includes(x.id)); - } - - async getTokenDefinitions(tokenType: EulerTokenType) { - const definitionsData = await this.getTokenDefinitionsData(); - - const tokenDefinitions = definitionsData.map(market => { - if (market[tokenType] === ZERO_ADDRESS) return null; - return { - address: market[tokenType].toLowerCase(), - underlyingTokenAddress: market.id.toLowerCase(), - }; - }); - - return _.compact(tokenDefinitions); - } - - async getMarket(tokenAddress: string, tokenType: EulerTokenType) { - const definitionsData = await this.getTokenDefinitionsData(); - - return definitionsData.find(x => x[tokenType].toLowerCase() === tokenAddress); - } - - async getMarketByUnderlying(tokenAddress: string) { - const definitionsData = await this.getTokenDefinitionsData(); - - return definitionsData.find(x => x.id.toLowerCase() === tokenAddress); - } -} diff --git a/src/apps/euler/contracts/abis/euler-dtoken-contract.json b/src/apps/euler/contracts/abis/euler-dtoken-contract.json deleted file mode 100644 index 3d10ae7aa..000000000 --- a/src/apps/euler/contracts/abis/euler-dtoken-contract.json +++ /dev/null @@ -1,1193 +0,0 @@ -[ - { - "stateMutability": "nonpayable", - "inputs": [ - { - "type": "bytes32", - "internalType": "bytes32", - "name": "moduleGitCommit_" - } - ], - "type": "constructor" - }, - { - "type": "event", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "spender" - }, - { - "name": "value", - "internalType": "uint256", - "indexed": false, - "type": "uint256" - } - ], - "name": "Approval", - "anonymous": false - }, - { - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "underlying" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "totalBalances" - }, - { - "name": "totalBorrows", - "type": "uint256", - "internalType": "uint256", - "indexed": false - }, - { - "internalType": "uint96", - "indexed": false, - "type": "uint96", - "name": "reserveBalance" - }, - { - "name": "poolSize", - "type": "uint256", - "internalType": "uint256", - "indexed": false - }, - { - "name": "interestAccumulator", - "indexed": false, - "internalType": "uint256", - "type": "uint256" - }, - { - "name": "interestRate", - "type": "int96", - "internalType": "int96", - "indexed": false - }, - { - "name": "timestamp", - "indexed": false, - "internalType": "uint256", - "type": "uint256" - } - ], - "type": "event", - "anonymous": false, - "name": "AssetStatus" - }, - { - "anonymous": false, - "name": "Borrow", - "inputs": [ - { - "name": "underlying", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "account" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256", - "indexed": false - } - ], - "type": "event" - }, - { - "name": "DelegateAverageLiquidity", - "anonymous": false, - "inputs": [ - { - "name": "account", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "name": "delegate", - "indexed": true, - "internalType": "address", - "type": "address" - } - ], - "type": "event" - }, - { - "name": "Deposit", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "underlying", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "account" - }, - { - "internalType": "uint256", - "indexed": false, - "type": "uint256", - "name": "amount" - } - ] - }, - { - "type": "event", - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "underlying" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "account" - } - ], - "name": "EnterMarket", - "anonymous": false - }, - { - "anonymous": false, - "name": "ExitMarket", - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "underlying" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "account" - } - ], - "type": "event" - }, - { - "name": "Genesis", - "anonymous": false, - "type": "event", - "inputs": [] - }, - { - "type": "event", - "inputs": [ - { - "name": "underlying", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "name": "recipient", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "name": "GovConvertReserves", - "anonymous": false - }, - { - "type": "event", - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "underlying" - }, - { - "internalType": "struct Storage.AssetConfig", - "indexed": false, - "type": "tuple", - "name": "newConfig", - "components": [ - { - "internalType": "address", - "type": "address", - "name": "eTokenAddress" - }, - { - "type": "bool", - "internalType": "bool", - "name": "borrowIsolated" - }, - { - "internalType": "uint32", - "type": "uint32", - "name": "collateralFactor" - }, - { - "name": "borrowFactor", - "internalType": "uint32", - "type": "uint32" - }, - { - "internalType": "uint24", - "type": "uint24", - "name": "twapWindow" - } - ] - } - ], - "name": "GovSetAssetConfig", - "anonymous": false - }, - { - "name": "GovSetIRM", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "underlying", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "type": "uint256", - "name": "interestRateModel" - }, - { - "indexed": false, - "internalType": "bytes", - "type": "bytes", - "name": "resetParams" - } - ] - }, - { - "name": "GovSetPricingConfig", - "anonymous": false, - "inputs": [ - { - "name": "underlying", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "type": "uint16", - "indexed": false, - "internalType": "uint16", - "name": "newPricingType" - }, - { - "type": "uint32", - "internalType": "uint32", - "indexed": false, - "name": "newPricingParameter" - } - ], - "type": "event" - }, - { - "type": "event", - "inputs": [ - { - "name": "underlying", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "newReserveFee", - "indexed": false, - "internalType": "uint32", - "type": "uint32" - } - ], - "anonymous": false, - "name": "GovSetReserveFee" - }, - { - "anonymous": false, - "name": "InstallerInstallModule", - "inputs": [ - { - "type": "uint256", - "indexed": true, - "internalType": "uint256", - "name": "moduleId" - }, - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "moduleImpl" - }, - { - "name": "moduleGitCommit", - "internalType": "bytes32", - "indexed": false, - "type": "bytes32" - } - ], - "type": "event" - }, - { - "type": "event", - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "newGovernorAdmin" - } - ], - "anonymous": false, - "name": "InstallerSetGovernorAdmin" - }, - { - "inputs": [ - { - "name": "newUpgradeAdmin", - "type": "address", - "internalType": "address", - "indexed": true - } - ], - "type": "event", - "anonymous": false, - "name": "InstallerSetUpgradeAdmin" - }, - { - "type": "event", - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "liquidator" - }, - { - "name": "violator", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "underlying" - }, - { - "type": "address", - "internalType": "address", - "indexed": false, - "name": "collateral" - }, - { - "name": "repay", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "yield" - }, - { - "name": "healthScore", - "type": "uint256", - "internalType": "uint256", - "indexed": false - }, - { - "name": "baseDiscount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "discount" - } - ], - "anonymous": false, - "name": "Liquidation" - }, - { - "type": "event", - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "underlying" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "eToken" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "dToken" - } - ], - "name": "MarketActivated", - "anonymous": false - }, - { - "name": "PTokenActivated", - "anonymous": false, - "inputs": [ - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "underlying" - }, - { - "name": "pToken", - "type": "address", - "internalType": "address", - "indexed": true - } - ], - "type": "event" - }, - { - "anonymous": false, - "name": "PTokenUnWrap", - "inputs": [ - { - "name": "underlying", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "account" - }, - { - "internalType": "uint256", - "indexed": false, - "type": "uint256", - "name": "amount" - } - ], - "type": "event" - }, - { - "name": "PTokenWrap", - "anonymous": false, - "inputs": [ - { - "name": "underlying", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "amount" - } - ], - "type": "event" - }, - { - "anonymous": false, - "name": "ProxyCreated", - "type": "event", - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "proxy" - }, - { - "indexed": false, - "internalType": "uint256", - "type": "uint256", - "name": "moduleId" - } - ] - }, - { - "name": "Repay", - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "underlying" - }, - { - "name": "account", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "name": "amount", - "internalType": "uint256", - "indexed": false, - "type": "uint256" - } - ], - "type": "event" - }, - { - "name": "RequestBorrow", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "account", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "name": "amount", - "internalType": "uint256", - "indexed": false, - "type": "uint256" - } - ] - }, - { - "name": "RequestBurn", - "anonymous": false, - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "type": "event" - }, - { - "type": "event", - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "account" - }, - { - "name": "amount", - "indexed": false, - "internalType": "uint256", - "type": "uint256" - } - ], - "name": "RequestDeposit", - "anonymous": false - }, - { - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "liquidator" - }, - { - "name": "violator", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "name": "underlying", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "name": "collateral", - "indexed": false, - "internalType": "address", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "type": "uint256", - "name": "repay" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "minYield" - } - ], - "type": "event", - "anonymous": false, - "name": "RequestLiquidate" - }, - { - "inputs": [ - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "account" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256", - "indexed": false - } - ], - "type": "event", - "name": "RequestMint", - "anonymous": false - }, - { - "name": "RequestRepay", - "anonymous": false, - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "account" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "type": "event" - }, - { - "anonymous": false, - "name": "RequestSwap", - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "accountIn" - }, - { - "name": "accountOut", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "underlyingIn" - }, - { - "internalType": "address", - "indexed": false, - "type": "address", - "name": "underlyingOut" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "amount" - }, - { - "name": "swapType", - "internalType": "uint256", - "indexed": false, - "type": "uint256" - } - ], - "type": "event" - }, - { - "inputs": [ - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "from" - }, - { - "name": "to", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "internalType": "uint256", - "indexed": false, - "type": "uint256", - "name": "amount" - } - ], - "type": "event", - "name": "RequestTransferDToken", - "anonymous": false - }, - { - "name": "RequestTransferEToken", - "anonymous": false, - "inputs": [ - { - "name": "from", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "name": "to", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "amount", - "internalType": "uint256", - "indexed": false, - "type": "uint256" - } - ], - "type": "event" - }, - { - "anonymous": false, - "name": "RequestWithdraw", - "type": "event", - "inputs": [ - { - "name": "account", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "amount" - } - ] - }, - { - "anonymous": false, - "name": "TrackAverageLiquidity", - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "account" - } - ], - "type": "event" - }, - { - "name": "Transfer", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "from", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "to" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "value" - } - ] - }, - { - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "account" - } - ], - "type": "event", - "anonymous": false, - "name": "UnTrackAverageLiquidity" - }, - { - "inputs": [ - { - "name": "underlying", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "account" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "amount" - } - ], - "type": "event", - "anonymous": false, - "name": "Withdraw" - }, - { - "inputs": [ - { - "name": "subAccountId", - "internalType": "uint256", - "type": "uint256" - }, - { - "type": "address", - "internalType": "address", - "name": "spender" - }, - { - "type": "uint256", - "internalType": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "name": "", - "internalType": "bool", - "type": "bool" - } - ], - "type": "function", - "name": "approveDebt", - "stateMutability": "nonpayable" - }, - { - "type": "function", - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "inputs": [ - { - "type": "address", - "internalType": "address", - "name": "account" - } - ], - "stateMutability": "view", - "name": "balanceOf" - }, - { - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "" - } - ], - "type": "function", - "name": "balanceOfExact", - "stateMutability": "view" - }, - { - "inputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "subAccountId" - }, - { - "type": "uint256", - "internalType": "uint256", - "name": "amount" - } - ], - "outputs": [], - "type": "function", - "name": "borrow", - "stateMutability": "nonpayable" - }, - { - "name": "debtAllowance", - "stateMutability": "view", - "outputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "" - } - ], - "inputs": [ - { - "name": "holder", - "internalType": "address", - "type": "address" - }, - { - "name": "spender", - "type": "address", - "internalType": "address" - } - ], - "type": "function" - }, - { - "outputs": [ - { - "name": "", - "type": "uint8", - "internalType": "uint8" - } - ], - "inputs": [], - "type": "function", - "name": "decimals", - "stateMutability": "pure" - }, - { - "name": "moduleGitCommit", - "stateMutability": "view", - "outputs": [ - { - "internalType": "bytes32", - "type": "bytes32", - "name": "" - } - ], - "inputs": [], - "type": "function" - }, - { - "name": "moduleId", - "stateMutability": "view", - "outputs": [ - { - "type": "uint256", - "internalType": "uint256", - "name": "" - } - ], - "inputs": [], - "type": "function" - }, - { - "name": "name", - "stateMutability": "view", - "outputs": [ - { - "type": "string", - "internalType": "string", - "name": "" - } - ], - "inputs": [], - "type": "function" - }, - { - "type": "function", - "inputs": [ - { - "type": "uint256", - "internalType": "uint256", - "name": "subAccountId" - }, - { - "name": "amount", - "internalType": "uint256", - "type": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable", - "name": "repay" - }, - { - "name": "symbol", - "stateMutability": "view", - "outputs": [ - { - "internalType": "string", - "type": "string", - "name": "" - } - ], - "inputs": [], - "type": "function" - }, - { - "type": "function", - "inputs": [], - "outputs": [ - { - "name": "", - "internalType": "uint256", - "type": "uint256" - } - ], - "stateMutability": "view", - "name": "totalSupply" - }, - { - "stateMutability": "view", - "name": "totalSupplyExact", - "type": "function", - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "inputs": [] - }, - { - "stateMutability": "nonpayable", - "name": "transfer", - "type": "function", - "outputs": [ - { - "type": "bool", - "internalType": "bool", - "name": "" - } - ], - "inputs": [ - { - "internalType": "address", - "type": "address", - "name": "to" - }, - { - "type": "uint256", - "internalType": "uint256", - "name": "amount" - } - ] - }, - { - "stateMutability": "nonpayable", - "name": "transferFrom", - "type": "function", - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "inputs": [ - { - "name": "from", - "type": "address", - "internalType": "address" - }, - { - "name": "to", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "internalType": "uint256", - "type": "uint256" - } - ] - } -] diff --git a/src/apps/euler/contracts/abis/euler-etoken-contract.json b/src/apps/euler/contracts/abis/euler-etoken-contract.json deleted file mode 100644 index c6f19bc1c..000000000 --- a/src/apps/euler/contracts/abis/euler-etoken-contract.json +++ /dev/null @@ -1,1348 +0,0 @@ -[ - { - "stateMutability": "nonpayable", - "inputs": [ - { - "internalType": "bytes32", - "type": "bytes32", - "name": "moduleGitCommit_" - } - ], - "type": "constructor" - }, - { - "name": "Approval", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "owner", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "name": "spender", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "value" - } - ] - }, - { - "anonymous": false, - "name": "AssetStatus", - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "underlying" - }, - { - "internalType": "uint256", - "indexed": false, - "type": "uint256", - "name": "totalBalances" - }, - { - "internalType": "uint256", - "indexed": false, - "type": "uint256", - "name": "totalBorrows" - }, - { - "indexed": false, - "internalType": "uint96", - "type": "uint96", - "name": "reserveBalance" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "poolSize" - }, - { - "name": "interestAccumulator", - "type": "uint256", - "internalType": "uint256", - "indexed": false - }, - { - "indexed": false, - "internalType": "int96", - "type": "int96", - "name": "interestRate" - }, - { - "name": "timestamp", - "type": "uint256", - "internalType": "uint256", - "indexed": false - } - ], - "type": "event" - }, - { - "name": "Borrow", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "underlying", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "account" - }, - { - "name": "amount", - "indexed": false, - "internalType": "uint256", - "type": "uint256" - } - ] - }, - { - "type": "event", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "delegate" - } - ], - "name": "DelegateAverageLiquidity", - "anonymous": false - }, - { - "anonymous": false, - "name": "Deposit", - "type": "event", - "inputs": [ - { - "name": "underlying", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "amount" - } - ] - }, - { - "type": "event", - "inputs": [ - { - "name": "underlying", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "account" - } - ], - "name": "EnterMarket", - "anonymous": false - }, - { - "type": "event", - "inputs": [ - { - "name": "underlying", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "account" - } - ], - "name": "ExitMarket", - "anonymous": false - }, - { - "name": "Genesis", - "anonymous": false, - "inputs": [], - "type": "event" - }, - { - "name": "GovConvertReserves", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "underlying", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "recipient", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "type": "uint256", - "name": "amount" - } - ] - }, - { - "inputs": [ - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "underlying" - }, - { - "indexed": false, - "internalType": "struct Storage.AssetConfig", - "type": "tuple", - "name": "newConfig", - "components": [ - { - "name": "eTokenAddress", - "type": "address", - "internalType": "address" - }, - { - "name": "borrowIsolated", - "internalType": "bool", - "type": "bool" - }, - { - "internalType": "uint32", - "type": "uint32", - "name": "collateralFactor" - }, - { - "internalType": "uint32", - "type": "uint32", - "name": "borrowFactor" - }, - { - "internalType": "uint24", - "type": "uint24", - "name": "twapWindow" - } - ] - } - ], - "type": "event", - "name": "GovSetAssetConfig", - "anonymous": false - }, - { - "name": "GovSetIRM", - "anonymous": false, - "inputs": [ - { - "name": "underlying", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "interestRateModel" - }, - { - "name": "resetParams", - "type": "bytes", - "indexed": false, - "internalType": "bytes" - } - ], - "type": "event" - }, - { - "inputs": [ - { - "name": "underlying", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "indexed": false, - "internalType": "uint16", - "type": "uint16", - "name": "newPricingType" - }, - { - "name": "newPricingParameter", - "type": "uint32", - "indexed": false, - "internalType": "uint32" - } - ], - "type": "event", - "name": "GovSetPricingConfig", - "anonymous": false - }, - { - "anonymous": false, - "name": "GovSetReserveFee", - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "underlying" - }, - { - "indexed": false, - "internalType": "uint32", - "type": "uint32", - "name": "newReserveFee" - } - ], - "type": "event" - }, - { - "anonymous": false, - "name": "InstallerInstallModule", - "inputs": [ - { - "name": "moduleId", - "type": "uint256", - "indexed": true, - "internalType": "uint256" - }, - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "moduleImpl" - }, - { - "internalType": "bytes32", - "indexed": false, - "type": "bytes32", - "name": "moduleGitCommit" - } - ], - "type": "event" - }, - { - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "newGovernorAdmin" - } - ], - "type": "event", - "name": "InstallerSetGovernorAdmin", - "anonymous": false - }, - { - "name": "InstallerSetUpgradeAdmin", - "anonymous": false, - "type": "event", - "inputs": [ - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "newUpgradeAdmin" - } - ] - }, - { - "inputs": [ - { - "name": "liquidator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "violator" - }, - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "underlying" - }, - { - "name": "collateral", - "internalType": "address", - "indexed": false, - "type": "address" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "repay" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "yield" - }, - { - "name": "healthScore", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "baseDiscount", - "indexed": false, - "internalType": "uint256", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "type": "uint256", - "name": "discount" - } - ], - "type": "event", - "anonymous": false, - "name": "Liquidation" - }, - { - "type": "event", - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "underlying" - }, - { - "name": "eToken", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "name": "dToken", - "internalType": "address", - "indexed": true, - "type": "address" - } - ], - "anonymous": false, - "name": "MarketActivated" - }, - { - "type": "event", - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "underlying" - }, - { - "name": "pToken", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false, - "name": "PTokenActivated" - }, - { - "inputs": [ - { - "name": "underlying", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "name": "account", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "amount" - } - ], - "type": "event", - "name": "PTokenUnWrap", - "anonymous": false - }, - { - "anonymous": false, - "name": "PTokenWrap", - "inputs": [ - { - "name": "underlying", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "account" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "amount" - } - ], - "type": "event" - }, - { - "type": "event", - "inputs": [ - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "proxy" - }, - { - "name": "moduleId", - "internalType": "uint256", - "indexed": false, - "type": "uint256" - } - ], - "name": "ProxyCreated", - "anonymous": false - }, - { - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "underlying" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "account" - }, - { - "indexed": false, - "internalType": "uint256", - "type": "uint256", - "name": "amount" - } - ], - "type": "event", - "anonymous": false, - "name": "Repay" - }, - { - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "account" - }, - { - "indexed": false, - "internalType": "uint256", - "type": "uint256", - "name": "amount" - } - ], - "type": "event", - "name": "RequestBorrow", - "anonymous": false - }, - { - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "account" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "amount" - } - ], - "type": "event", - "name": "RequestBurn", - "anonymous": false - }, - { - "type": "event", - "inputs": [ - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "account" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "amount" - } - ], - "anonymous": false, - "name": "RequestDeposit" - }, - { - "type": "event", - "inputs": [ - { - "name": "liquidator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "violator", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "name": "underlying", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "internalType": "address", - "indexed": false, - "type": "address", - "name": "collateral" - }, - { - "indexed": false, - "internalType": "uint256", - "type": "uint256", - "name": "repay" - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "minYield" - } - ], - "name": "RequestLiquidate", - "anonymous": false - }, - { - "name": "RequestMint", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "account", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ] - }, - { - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "type": "event", - "anonymous": false, - "name": "RequestRepay" - }, - { - "inputs": [ - { - "name": "accountIn", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "internalType": "address", - "indexed": true, - "type": "address", - "name": "accountOut" - }, - { - "name": "underlyingIn", - "internalType": "address", - "indexed": true, - "type": "address" - }, - { - "name": "underlyingOut", - "indexed": false, - "internalType": "address", - "type": "address" - }, - { - "internalType": "uint256", - "indexed": false, - "type": "uint256", - "name": "amount" - }, - { - "type": "uint256", - "internalType": "uint256", - "indexed": false, - "name": "swapType" - } - ], - "type": "event", - "name": "RequestSwap", - "anonymous": false - }, - { - "type": "event", - "inputs": [ - { - "name": "from", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "name": "to", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "type": "uint256", - "indexed": false, - "internalType": "uint256", - "name": "amount" - } - ], - "name": "RequestTransferDToken", - "anonymous": false - }, - { - "inputs": [ - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "from" - }, - { - "name": "to", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "name": "amount", - "internalType": "uint256", - "indexed": false, - "type": "uint256" - } - ], - "type": "event", - "name": "RequestTransferEToken", - "anonymous": false - }, - { - "anonymous": false, - "name": "RequestWithdraw", - "inputs": [ - { - "type": "address", - "indexed": true, - "internalType": "address", - "name": "account" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "type": "event" - }, - { - "name": "TrackAverageLiquidity", - "anonymous": false, - "type": "event", - "inputs": [ - { - "name": "account", - "internalType": "address", - "indexed": true, - "type": "address" - } - ] - }, - { - "anonymous": false, - "name": "Transfer", - "type": "event", - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "from" - }, - { - "name": "to", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256", - "indexed": false - } - ] - }, - { - "name": "UnTrackAverageLiquidity", - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "account" - } - ], - "type": "event" - }, - { - "anonymous": false, - "name": "Withdraw", - "type": "event", - "inputs": [ - { - "indexed": true, - "internalType": "address", - "type": "address", - "name": "underlying" - }, - { - "type": "address", - "internalType": "address", - "indexed": true, - "name": "account" - }, - { - "name": "amount", - "indexed": false, - "internalType": "uint256", - "type": "uint256" - } - ] - }, - { - "type": "function", - "inputs": [ - { - "name": "holder", - "type": "address", - "internalType": "address" - }, - { - "name": "spender", - "internalType": "address", - "type": "address" - } - ], - "outputs": [ - { - "type": "uint256", - "internalType": "uint256", - "name": "" - } - ], - "stateMutability": "view", - "name": "allowance" - }, - { - "stateMutability": "nonpayable", - "name": "approve", - "type": "function", - "inputs": [ - { - "internalType": "address", - "type": "address", - "name": "spender" - }, - { - "type": "uint256", - "internalType": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ] - }, - { - "outputs": [ - { - "internalType": "bool", - "type": "bool", - "name": "" - } - ], - "inputs": [ - { - "name": "subAccountId", - "internalType": "uint256", - "type": "uint256" - }, - { - "internalType": "address", - "type": "address", - "name": "spender" - }, - { - "type": "uint256", - "internalType": "uint256", - "name": "amount" - } - ], - "type": "function", - "name": "approveSubAccount", - "stateMutability": "nonpayable" - }, - { - "type": "function", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view", - "name": "balanceOf" - }, - { - "name": "balanceOfUnderlying", - "stateMutability": "view", - "outputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "" - } - ], - "inputs": [ - { - "name": "account", - "internalType": "address", - "type": "address" - } - ], - "type": "function" - }, - { - "stateMutability": "nonpayable", - "name": "burn", - "type": "function", - "outputs": [], - "inputs": [ - { - "name": "subAccountId", - "internalType": "uint256", - "type": "uint256" - }, - { - "type": "uint256", - "internalType": "uint256", - "name": "amount" - } - ] - }, - { - "name": "convertBalanceToUnderlying", - "stateMutability": "view", - "inputs": [ - { - "name": "balance", - "internalType": "uint256", - "type": "uint256" - } - ], - "outputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "" - } - ], - "type": "function" - }, - { - "stateMutability": "view", - "name": "convertUnderlyingToBalance", - "type": "function", - "inputs": [ - { - "name": "underlyingAmount", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "internalType": "uint256", - "type": "uint256" - } - ] - }, - { - "inputs": [], - "outputs": [ - { - "name": "", - "internalType": "uint8", - "type": "uint8" - } - ], - "type": "function", - "name": "decimals", - "stateMutability": "pure" - }, - { - "type": "function", - "inputs": [ - { - "name": "subAccountId", - "type": "uint256", - "internalType": "uint256" - }, - { - "internalType": "uint256", - "type": "uint256", - "name": "amount" - } - ], - "outputs": [], - "stateMutability": "nonpayable", - "name": "deposit" - }, - { - "name": "mint", - "stateMutability": "nonpayable", - "inputs": [ - { - "type": "uint256", - "internalType": "uint256", - "name": "subAccountId" - }, - { - "name": "amount", - "internalType": "uint256", - "type": "uint256" - } - ], - "outputs": [], - "type": "function" - }, - { - "stateMutability": "view", - "name": "moduleGitCommit", - "type": "function", - "inputs": [], - "outputs": [ - { - "internalType": "bytes32", - "type": "bytes32", - "name": "" - } - ] - }, - { - "stateMutability": "view", - "name": "moduleId", - "type": "function", - "outputs": [ - { - "type": "uint256", - "internalType": "uint256", - "name": "" - } - ], - "inputs": [] - }, - { - "inputs": [], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "type": "function", - "name": "name", - "stateMutability": "view" - }, - { - "stateMutability": "view", - "name": "reserveBalance", - "type": "function", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "inputs": [], - "outputs": [ - { - "name": "", - "internalType": "uint256", - "type": "uint256" - } - ], - "type": "function", - "name": "reserveBalanceUnderlying", - "stateMutability": "view" - }, - { - "inputs": [], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "type": "function", - "name": "symbol", - "stateMutability": "view" - }, - { - "inputs": [], - "outputs": [ - { - "type": "uint256", - "internalType": "uint256", - "name": "" - } - ], - "type": "function", - "name": "totalSupply", - "stateMutability": "view" - }, - { - "type": "function", - "outputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "" - } - ], - "inputs": [], - "stateMutability": "view", - "name": "totalSupplyUnderlying" - }, - { - "name": "touch", - "stateMutability": "nonpayable", - "inputs": [], - "outputs": [], - "type": "function" - }, - { - "stateMutability": "nonpayable", - "name": "transfer", - "type": "function", - "outputs": [ - { - "internalType": "bool", - "type": "bool", - "name": "" - } - ], - "inputs": [ - { - "name": "to", - "internalType": "address", - "type": "address" - }, - { - "type": "uint256", - "internalType": "uint256", - "name": "amount" - } - ] - }, - { - "type": "function", - "outputs": [ - { - "name": "", - "internalType": "bool", - "type": "bool" - } - ], - "inputs": [ - { - "name": "from", - "type": "address", - "internalType": "address" - }, - { - "name": "to", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "internalType": "uint256", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "name": "transferFrom" - }, - { - "type": "function", - "inputs": [ - { - "internalType": "address", - "type": "address", - "name": "from" - }, - { - "name": "to", - "internalType": "address", - "type": "address" - } - ], - "outputs": [ - { - "internalType": "bool", - "type": "bool", - "name": "" - } - ], - "stateMutability": "nonpayable", - "name": "transferFromMax" - }, - { - "stateMutability": "nonpayable", - "name": "withdraw", - "type": "function", - "inputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "subAccountId" - }, - { - "name": "amount", - "internalType": "uint256", - "type": "uint256" - } - ], - "outputs": [] - } -] diff --git a/src/apps/euler/contracts/abis/euler-ptoken-contract.json b/src/apps/euler/contracts/abis/euler-ptoken-contract.json deleted file mode 100644 index 626d0c70a..000000000 --- a/src/apps/euler/contracts/abis/euler-ptoken-contract.json +++ /dev/null @@ -1,310 +0,0 @@ -[ - { - "inputs": [ - { - "name": "euler_", - "type": "address", - "internalType": "address" - }, - { - "name": "underlying_", - "type": "address", - "internalType": "address" - } - ], - "type": "constructor", - "stateMutability": "nonpayable" - }, - { - "anonymous": false, - "name": "Approval", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address", - "indexed": true - }, - { - "name": "spender", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "name": "value", - "internalType": "uint256", - "indexed": false, - "type": "uint256" - } - ], - "type": "event" - }, - { - "inputs": [ - { - "name": "from", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "to", - "indexed": true, - "internalType": "address", - "type": "address" - }, - { - "name": "value", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "type": "event", - "name": "Transfer", - "anonymous": false - }, - { - "name": "allowance", - "stateMutability": "view", - "outputs": [ - { - "type": "uint256", - "internalType": "uint256", - "name": "" - } - ], - "inputs": [ - { - "internalType": "address", - "type": "address", - "name": "holder" - }, - { - "internalType": "address", - "type": "address", - "name": "spender" - } - ], - "type": "function" - }, - { - "stateMutability": "nonpayable", - "name": "approve", - "type": "function", - "inputs": [ - { - "type": "address", - "internalType": "address", - "name": "spender" - }, - { - "internalType": "uint256", - "type": "uint256", - "name": "amount" - } - ], - "outputs": [ - { - "internalType": "bool", - "type": "bool", - "name": "" - } - ] - }, - { - "name": "balanceOf", - "stateMutability": "view", - "outputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "" - } - ], - "inputs": [ - { - "name": "who", - "type": "address", - "internalType": "address" - } - ], - "type": "function" - }, - { - "name": "claimSurplus", - "stateMutability": "nonpayable", - "inputs": [ - { - "name": "who", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "type": "function" - }, - { - "inputs": [], - "outputs": [ - { - "type": "uint8", - "internalType": "uint8", - "name": "" - } - ], - "type": "function", - "name": "decimals", - "stateMutability": "view" - }, - { - "name": "forceUnwrap", - "stateMutability": "nonpayable", - "inputs": [ - { - "type": "address", - "internalType": "address", - "name": "who" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "type": "function" - }, - { - "name": "name", - "stateMutability": "view", - "inputs": [], - "outputs": [ - { - "name": "", - "internalType": "string", - "type": "string" - } - ], - "type": "function" - }, - { - "stateMutability": "view", - "name": "symbol", - "type": "function", - "inputs": [], - "outputs": [ - { - "name": "", - "internalType": "string", - "type": "string" - } - ] - }, - { - "stateMutability": "view", - "name": "totalSupply", - "type": "function", - "outputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "" - } - ], - "inputs": [] - }, - { - "inputs": [ - { - "name": "recipient", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "internalType": "bool", - "type": "bool" - } - ], - "type": "function", - "name": "transfer", - "stateMutability": "nonpayable" - }, - { - "inputs": [ - { - "internalType": "address", - "type": "address", - "name": "from" - }, - { - "internalType": "address", - "type": "address", - "name": "recipient" - }, - { - "name": "amount", - "internalType": "uint256", - "type": "uint256" - } - ], - "outputs": [ - { - "internalType": "bool", - "type": "bool", - "name": "" - } - ], - "type": "function", - "name": "transferFrom", - "stateMutability": "nonpayable" - }, - { - "type": "function", - "outputs": [ - { - "name": "", - "internalType": "address", - "type": "address" - } - ], - "inputs": [], - "stateMutability": "view", - "name": "underlying" - }, - { - "outputs": [], - "inputs": [ - { - "internalType": "uint256", - "type": "uint256", - "name": "amount" - } - ], - "type": "function", - "name": "unwrap", - "stateMutability": "nonpayable" - }, - { - "name": "wrap", - "stateMutability": "nonpayable", - "inputs": [ - { - "type": "uint256", - "internalType": "uint256", - "name": "amount" - } - ], - "outputs": [], - "type": "function" - } -] diff --git a/src/apps/euler/contracts/abis/euler-staking-rewards-contract.json b/src/apps/euler/contracts/abis/euler-staking-rewards-contract.json deleted file mode 100644 index 0f44bd24a..000000000 --- a/src/apps/euler/contracts/abis/euler-staking-rewards-contract.json +++ /dev/null @@ -1,310 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_owner", "type": "address" }, - { "internalType": "address", "name": "_rewardsDistribution", "type": "address" }, - { "internalType": "address", "name": "_rewardsToken", "type": "address" }, - { "internalType": "address", "name": "_stakingToken", "type": "address" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "oldOwner", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" }], - "name": "OwnerNominated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "bool", "name": "isPaused", "type": "bool" }], - "name": "PauseChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "Recovered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" }], - "name": "RewardAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "reward", "type": "uint256" } - ], - "name": "RewardPaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newDuration", "type": "uint256" }], - "name": "RewardsDurationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "Staked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "Withdrawn", - "type": "event" - }, - { "inputs": [], "name": "acceptOwnership", "outputs": [], "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": "account", "type": "address" }], - "name": "earned", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "subAccountId", "type": "uint256" }], - "name": "exit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "exit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { "inputs": [], "name": "getReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "getRewardForDuration", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastPauseTime", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastTimeRewardApplicable", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastUpdateTime", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_owner", "type": "address" }], - "name": "nominateNewOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "nominatedOwner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "reward", "type": "uint256" }], - "name": "notifyRewardAmount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "periodFinish", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "tokenAddress", "type": "address" }, - { "internalType": "uint256", "name": "tokenAmount", "type": "uint256" } - ], - "name": "recoverERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "rewardPerToken", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardPerTokenStored", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardRate", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "rewards", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardsDistribution", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardsDuration", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardsToken", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bool", "name": "_paused", "type": "bool" }], - "name": "setPaused", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_rewardsDistribution", "type": "address" }], - "name": "setRewardsDistribution", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_rewardsDuration", "type": "uint256" }], - "name": "setRewardsDuration", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "subAccountId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], - "name": "stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stakingToken", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "userRewardPerTokenPaid", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "subAccountId", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/euler/contracts/index.ts b/src/apps/euler/contracts/index.ts deleted file mode 100644 index 5dcfebdf6..000000000 --- a/src/apps/euler/contracts/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -export * from './viem.contract-factory'; diff --git a/src/apps/euler/contracts/viem.contract-factory.ts b/src/apps/euler/contracts/viem.contract-factory.ts deleted file mode 100644 index af0227142..000000000 --- a/src/apps/euler/contracts/viem.contract-factory.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Injectable, Inject } from '@nestjs/common'; - -import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { Network } from '~types/network.interface'; - -import { - EulerDtokenContract__factory, - EulerEtokenContract__factory, - EulerPtokenContract__factory, - EulerStakingRewardsContract__factory, -} from './viem'; - -type ContractOpts = { address: string; network: Network }; - -@Injectable() -export class EulerViemContractFactory { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - eulerDtokenContract({ address, network }: ContractOpts) { - return EulerDtokenContract__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - eulerEtokenContract({ address, network }: ContractOpts) { - return EulerEtokenContract__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - eulerPtokenContract({ address, network }: ContractOpts) { - return EulerPtokenContract__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - eulerStakingRewardsContract({ address, network }: ContractOpts) { - return EulerStakingRewardsContract__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } -} diff --git a/src/apps/euler/contracts/viem/EulerDtokenContract.ts b/src/apps/euler/contracts/viem/EulerDtokenContract.ts deleted file mode 100644 index c8af02e50..000000000 --- a/src/apps/euler/contracts/viem/EulerDtokenContract.ts +++ /dev/null @@ -1,1207 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const eulerDtokenContractAbi = [ - { - stateMutability: 'nonpayable', - inputs: [ - { - type: 'bytes32', - internalType: 'bytes32', - name: 'moduleGitCommit_', - }, - ], - type: 'constructor', - }, - { - type: 'event', - inputs: [ - { - name: 'owner', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'spender', - }, - { - name: 'value', - internalType: 'uint256', - indexed: false, - type: 'uint256', - }, - ], - name: 'Approval', - anonymous: false, - }, - { - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'underlying', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'totalBalances', - }, - { - name: 'totalBorrows', - type: 'uint256', - internalType: 'uint256', - indexed: false, - }, - { - internalType: 'uint96', - indexed: false, - type: 'uint96', - name: 'reserveBalance', - }, - { - name: 'poolSize', - type: 'uint256', - internalType: 'uint256', - indexed: false, - }, - { - name: 'interestAccumulator', - indexed: false, - internalType: 'uint256', - type: 'uint256', - }, - { - name: 'interestRate', - type: 'int96', - internalType: 'int96', - indexed: false, - }, - { - name: 'timestamp', - indexed: false, - internalType: 'uint256', - type: 'uint256', - }, - ], - type: 'event', - anonymous: false, - name: 'AssetStatus', - }, - { - anonymous: false, - name: 'Borrow', - inputs: [ - { - name: 'underlying', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'account', - }, - { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - indexed: false, - }, - ], - type: 'event', - }, - { - name: 'DelegateAverageLiquidity', - anonymous: false, - inputs: [ - { - name: 'account', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - name: 'delegate', - indexed: true, - internalType: 'address', - type: 'address', - }, - ], - type: 'event', - }, - { - name: 'Deposit', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'underlying', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'account', - }, - { - internalType: 'uint256', - indexed: false, - type: 'uint256', - name: 'amount', - }, - ], - }, - { - type: 'event', - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'underlying', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'account', - }, - ], - name: 'EnterMarket', - anonymous: false, - }, - { - anonymous: false, - name: 'ExitMarket', - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'underlying', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'account', - }, - ], - type: 'event', - }, - { - name: 'Genesis', - anonymous: false, - type: 'event', - inputs: [], - }, - { - type: 'event', - inputs: [ - { - name: 'underlying', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - name: 'recipient', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - name: 'GovConvertReserves', - anonymous: false, - }, - { - type: 'event', - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'underlying', - }, - { - internalType: 'struct Storage.AssetConfig', - indexed: false, - type: 'tuple', - name: 'newConfig', - components: [ - { - internalType: 'address', - type: 'address', - name: 'eTokenAddress', - }, - { - type: 'bool', - internalType: 'bool', - name: 'borrowIsolated', - }, - { - internalType: 'uint32', - type: 'uint32', - name: 'collateralFactor', - }, - { - name: 'borrowFactor', - internalType: 'uint32', - type: 'uint32', - }, - { - internalType: 'uint24', - type: 'uint24', - name: 'twapWindow', - }, - ], - }, - ], - name: 'GovSetAssetConfig', - anonymous: false, - }, - { - name: 'GovSetIRM', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'underlying', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - type: 'uint256', - name: 'interestRateModel', - }, - { - indexed: false, - internalType: 'bytes', - type: 'bytes', - name: 'resetParams', - }, - ], - }, - { - name: 'GovSetPricingConfig', - anonymous: false, - inputs: [ - { - name: 'underlying', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - type: 'uint16', - indexed: false, - internalType: 'uint16', - name: 'newPricingType', - }, - { - type: 'uint32', - internalType: 'uint32', - indexed: false, - name: 'newPricingParameter', - }, - ], - type: 'event', - }, - { - type: 'event', - inputs: [ - { - name: 'underlying', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'newReserveFee', - indexed: false, - internalType: 'uint32', - type: 'uint32', - }, - ], - anonymous: false, - name: 'GovSetReserveFee', - }, - { - anonymous: false, - name: 'InstallerInstallModule', - inputs: [ - { - type: 'uint256', - indexed: true, - internalType: 'uint256', - name: 'moduleId', - }, - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'moduleImpl', - }, - { - name: 'moduleGitCommit', - internalType: 'bytes32', - indexed: false, - type: 'bytes32', - }, - ], - type: 'event', - }, - { - type: 'event', - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'newGovernorAdmin', - }, - ], - anonymous: false, - name: 'InstallerSetGovernorAdmin', - }, - { - inputs: [ - { - name: 'newUpgradeAdmin', - type: 'address', - internalType: 'address', - indexed: true, - }, - ], - type: 'event', - anonymous: false, - name: 'InstallerSetUpgradeAdmin', - }, - { - type: 'event', - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'liquidator', - }, - { - name: 'violator', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'underlying', - }, - { - type: 'address', - internalType: 'address', - indexed: false, - name: 'collateral', - }, - { - name: 'repay', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'yield', - }, - { - name: 'healthScore', - type: 'uint256', - internalType: 'uint256', - indexed: false, - }, - { - name: 'baseDiscount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'discount', - }, - ], - anonymous: false, - name: 'Liquidation', - }, - { - type: 'event', - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'underlying', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'eToken', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'dToken', - }, - ], - name: 'MarketActivated', - anonymous: false, - }, - { - name: 'PTokenActivated', - anonymous: false, - inputs: [ - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'underlying', - }, - { - name: 'pToken', - type: 'address', - internalType: 'address', - indexed: true, - }, - ], - type: 'event', - }, - { - anonymous: false, - name: 'PTokenUnWrap', - inputs: [ - { - name: 'underlying', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'account', - }, - { - internalType: 'uint256', - indexed: false, - type: 'uint256', - name: 'amount', - }, - ], - type: 'event', - }, - { - name: 'PTokenWrap', - anonymous: false, - inputs: [ - { - name: 'underlying', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'account', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'amount', - }, - ], - type: 'event', - }, - { - anonymous: false, - name: 'ProxyCreated', - type: 'event', - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'proxy', - }, - { - indexed: false, - internalType: 'uint256', - type: 'uint256', - name: 'moduleId', - }, - ], - }, - { - name: 'Repay', - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'underlying', - }, - { - name: 'account', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - name: 'amount', - internalType: 'uint256', - indexed: false, - type: 'uint256', - }, - ], - type: 'event', - }, - { - name: 'RequestBorrow', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'account', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - name: 'amount', - internalType: 'uint256', - indexed: false, - type: 'uint256', - }, - ], - }, - { - name: 'RequestBurn', - anonymous: false, - inputs: [ - { - name: 'account', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - type: 'event', - }, - { - type: 'event', - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'account', - }, - { - name: 'amount', - indexed: false, - internalType: 'uint256', - type: 'uint256', - }, - ], - name: 'RequestDeposit', - anonymous: false, - }, - { - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'liquidator', - }, - { - name: 'violator', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - name: 'underlying', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - name: 'collateral', - indexed: false, - internalType: 'address', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - type: 'uint256', - name: 'repay', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'minYield', - }, - ], - type: 'event', - anonymous: false, - name: 'RequestLiquidate', - }, - { - inputs: [ - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'account', - }, - { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - indexed: false, - }, - ], - type: 'event', - name: 'RequestMint', - anonymous: false, - }, - { - name: 'RequestRepay', - anonymous: false, - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'account', - }, - { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - type: 'event', - }, - { - anonymous: false, - name: 'RequestSwap', - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'accountIn', - }, - { - name: 'accountOut', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'underlyingIn', - }, - { - internalType: 'address', - indexed: false, - type: 'address', - name: 'underlyingOut', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'amount', - }, - { - name: 'swapType', - internalType: 'uint256', - indexed: false, - type: 'uint256', - }, - ], - type: 'event', - }, - { - inputs: [ - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'from', - }, - { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - internalType: 'uint256', - indexed: false, - type: 'uint256', - name: 'amount', - }, - ], - type: 'event', - name: 'RequestTransferDToken', - anonymous: false, - }, - { - name: 'RequestTransferEToken', - anonymous: false, - inputs: [ - { - name: 'from', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - name: 'to', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'amount', - internalType: 'uint256', - indexed: false, - type: 'uint256', - }, - ], - type: 'event', - }, - { - anonymous: false, - name: 'RequestWithdraw', - type: 'event', - inputs: [ - { - name: 'account', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'amount', - }, - ], - }, - { - anonymous: false, - name: 'TrackAverageLiquidity', - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'account', - }, - ], - type: 'event', - }, - { - name: 'Transfer', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'to', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'value', - }, - ], - }, - { - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'account', - }, - ], - type: 'event', - anonymous: false, - name: 'UnTrackAverageLiquidity', - }, - { - inputs: [ - { - name: 'underlying', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'account', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'amount', - }, - ], - type: 'event', - anonymous: false, - name: 'Withdraw', - }, - { - inputs: [ - { - name: 'subAccountId', - internalType: 'uint256', - type: 'uint256', - }, - { - type: 'address', - internalType: 'address', - name: 'spender', - }, - { - type: 'uint256', - internalType: 'uint256', - name: 'amount', - }, - ], - outputs: [ - { - name: '', - internalType: 'bool', - type: 'bool', - }, - ], - type: 'function', - name: 'approveDebt', - stateMutability: 'nonpayable', - }, - { - type: 'function', - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - inputs: [ - { - type: 'address', - internalType: 'address', - name: 'account', - }, - ], - stateMutability: 'view', - name: 'balanceOf', - }, - { - inputs: [ - { - name: 'account', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: '', - }, - ], - type: 'function', - name: 'balanceOfExact', - stateMutability: 'view', - }, - { - inputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: 'subAccountId', - }, - { - type: 'uint256', - internalType: 'uint256', - name: 'amount', - }, - ], - outputs: [], - type: 'function', - name: 'borrow', - stateMutability: 'nonpayable', - }, - { - name: 'debtAllowance', - stateMutability: 'view', - outputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: '', - }, - ], - inputs: [ - { - name: 'holder', - internalType: 'address', - type: 'address', - }, - { - name: 'spender', - type: 'address', - internalType: 'address', - }, - ], - type: 'function', - }, - { - outputs: [ - { - name: '', - type: 'uint8', - internalType: 'uint8', - }, - ], - inputs: [], - type: 'function', - name: 'decimals', - stateMutability: 'pure', - }, - { - name: 'moduleGitCommit', - stateMutability: 'view', - outputs: [ - { - internalType: 'bytes32', - type: 'bytes32', - name: '', - }, - ], - inputs: [], - type: 'function', - }, - { - name: 'moduleId', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - internalType: 'uint256', - name: '', - }, - ], - inputs: [], - type: 'function', - }, - { - name: 'name', - stateMutability: 'view', - outputs: [ - { - type: 'string', - internalType: 'string', - name: '', - }, - ], - inputs: [], - type: 'function', - }, - { - type: 'function', - inputs: [ - { - type: 'uint256', - internalType: 'uint256', - name: 'subAccountId', - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - }, - ], - outputs: [], - stateMutability: 'nonpayable', - name: 'repay', - }, - { - name: 'symbol', - stateMutability: 'view', - outputs: [ - { - internalType: 'string', - type: 'string', - name: '', - }, - ], - inputs: [], - type: 'function', - }, - { - type: 'function', - inputs: [], - outputs: [ - { - name: '', - internalType: 'uint256', - type: 'uint256', - }, - ], - stateMutability: 'view', - name: 'totalSupply', - }, - { - stateMutability: 'view', - name: 'totalSupplyExact', - type: 'function', - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - inputs: [], - }, - { - stateMutability: 'nonpayable', - name: 'transfer', - type: 'function', - outputs: [ - { - type: 'bool', - internalType: 'bool', - name: '', - }, - ], - inputs: [ - { - internalType: 'address', - type: 'address', - name: 'to', - }, - { - type: 'uint256', - internalType: 'uint256', - name: 'amount', - }, - ], - }, - { - stateMutability: 'nonpayable', - name: 'transferFrom', - type: 'function', - outputs: [ - { - name: '', - type: 'bool', - internalType: 'bool', - }, - ], - inputs: [ - { - name: 'from', - type: 'address', - internalType: 'address', - }, - { - name: 'to', - type: 'address', - internalType: 'address', - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - }, - ], - }, -] as const; - -export type EulerDtokenContract = typeof eulerDtokenContractAbi; -export type EulerDtokenContractContract = GetContractReturnType; - -export class EulerDtokenContract__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: eulerDtokenContractAbi, publicClient: client }); - } -} diff --git a/src/apps/euler/contracts/viem/EulerEtokenContract.ts b/src/apps/euler/contracts/viem/EulerEtokenContract.ts deleted file mode 100644 index 3cce494d3..000000000 --- a/src/apps/euler/contracts/viem/EulerEtokenContract.ts +++ /dev/null @@ -1,1362 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const eulerEtokenContractAbi = [ - { - stateMutability: 'nonpayable', - inputs: [ - { - internalType: 'bytes32', - type: 'bytes32', - name: 'moduleGitCommit_', - }, - ], - type: 'constructor', - }, - { - name: 'Approval', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'owner', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - name: 'spender', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'value', - }, - ], - }, - { - anonymous: false, - name: 'AssetStatus', - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'underlying', - }, - { - internalType: 'uint256', - indexed: false, - type: 'uint256', - name: 'totalBalances', - }, - { - internalType: 'uint256', - indexed: false, - type: 'uint256', - name: 'totalBorrows', - }, - { - indexed: false, - internalType: 'uint96', - type: 'uint96', - name: 'reserveBalance', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'poolSize', - }, - { - name: 'interestAccumulator', - type: 'uint256', - internalType: 'uint256', - indexed: false, - }, - { - indexed: false, - internalType: 'int96', - type: 'int96', - name: 'interestRate', - }, - { - name: 'timestamp', - type: 'uint256', - internalType: 'uint256', - indexed: false, - }, - ], - type: 'event', - }, - { - name: 'Borrow', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'underlying', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'account', - }, - { - name: 'amount', - indexed: false, - internalType: 'uint256', - type: 'uint256', - }, - ], - }, - { - type: 'event', - inputs: [ - { - name: 'account', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'delegate', - }, - ], - name: 'DelegateAverageLiquidity', - anonymous: false, - }, - { - anonymous: false, - name: 'Deposit', - type: 'event', - inputs: [ - { - name: 'underlying', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'account', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'amount', - }, - ], - }, - { - type: 'event', - inputs: [ - { - name: 'underlying', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'account', - }, - ], - name: 'EnterMarket', - anonymous: false, - }, - { - type: 'event', - inputs: [ - { - name: 'underlying', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'account', - }, - ], - name: 'ExitMarket', - anonymous: false, - }, - { - name: 'Genesis', - anonymous: false, - inputs: [], - type: 'event', - }, - { - name: 'GovConvertReserves', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'underlying', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'recipient', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - type: 'uint256', - name: 'amount', - }, - ], - }, - { - inputs: [ - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'underlying', - }, - { - indexed: false, - internalType: 'struct Storage.AssetConfig', - type: 'tuple', - name: 'newConfig', - components: [ - { - name: 'eTokenAddress', - type: 'address', - internalType: 'address', - }, - { - name: 'borrowIsolated', - internalType: 'bool', - type: 'bool', - }, - { - internalType: 'uint32', - type: 'uint32', - name: 'collateralFactor', - }, - { - internalType: 'uint32', - type: 'uint32', - name: 'borrowFactor', - }, - { - internalType: 'uint24', - type: 'uint24', - name: 'twapWindow', - }, - ], - }, - ], - type: 'event', - name: 'GovSetAssetConfig', - anonymous: false, - }, - { - name: 'GovSetIRM', - anonymous: false, - inputs: [ - { - name: 'underlying', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'interestRateModel', - }, - { - name: 'resetParams', - type: 'bytes', - indexed: false, - internalType: 'bytes', - }, - ], - type: 'event', - }, - { - inputs: [ - { - name: 'underlying', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - indexed: false, - internalType: 'uint16', - type: 'uint16', - name: 'newPricingType', - }, - { - name: 'newPricingParameter', - type: 'uint32', - indexed: false, - internalType: 'uint32', - }, - ], - type: 'event', - name: 'GovSetPricingConfig', - anonymous: false, - }, - { - anonymous: false, - name: 'GovSetReserveFee', - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'underlying', - }, - { - indexed: false, - internalType: 'uint32', - type: 'uint32', - name: 'newReserveFee', - }, - ], - type: 'event', - }, - { - anonymous: false, - name: 'InstallerInstallModule', - inputs: [ - { - name: 'moduleId', - type: 'uint256', - indexed: true, - internalType: 'uint256', - }, - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'moduleImpl', - }, - { - internalType: 'bytes32', - indexed: false, - type: 'bytes32', - name: 'moduleGitCommit', - }, - ], - type: 'event', - }, - { - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'newGovernorAdmin', - }, - ], - type: 'event', - name: 'InstallerSetGovernorAdmin', - anonymous: false, - }, - { - name: 'InstallerSetUpgradeAdmin', - anonymous: false, - type: 'event', - inputs: [ - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'newUpgradeAdmin', - }, - ], - }, - { - inputs: [ - { - name: 'liquidator', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'violator', - }, - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'underlying', - }, - { - name: 'collateral', - internalType: 'address', - indexed: false, - type: 'address', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'repay', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'yield', - }, - { - name: 'healthScore', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - { - name: 'baseDiscount', - indexed: false, - internalType: 'uint256', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - type: 'uint256', - name: 'discount', - }, - ], - type: 'event', - anonymous: false, - name: 'Liquidation', - }, - { - type: 'event', - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'underlying', - }, - { - name: 'eToken', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - name: 'dToken', - internalType: 'address', - indexed: true, - type: 'address', - }, - ], - anonymous: false, - name: 'MarketActivated', - }, - { - type: 'event', - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'underlying', - }, - { - name: 'pToken', - type: 'address', - indexed: true, - internalType: 'address', - }, - ], - anonymous: false, - name: 'PTokenActivated', - }, - { - inputs: [ - { - name: 'underlying', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - name: 'account', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'amount', - }, - ], - type: 'event', - name: 'PTokenUnWrap', - anonymous: false, - }, - { - anonymous: false, - name: 'PTokenWrap', - inputs: [ - { - name: 'underlying', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'account', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'amount', - }, - ], - type: 'event', - }, - { - type: 'event', - inputs: [ - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'proxy', - }, - { - name: 'moduleId', - internalType: 'uint256', - indexed: false, - type: 'uint256', - }, - ], - name: 'ProxyCreated', - anonymous: false, - }, - { - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'underlying', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'account', - }, - { - indexed: false, - internalType: 'uint256', - type: 'uint256', - name: 'amount', - }, - ], - type: 'event', - anonymous: false, - name: 'Repay', - }, - { - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'account', - }, - { - indexed: false, - internalType: 'uint256', - type: 'uint256', - name: 'amount', - }, - ], - type: 'event', - name: 'RequestBorrow', - anonymous: false, - }, - { - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'account', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'amount', - }, - ], - type: 'event', - name: 'RequestBurn', - anonymous: false, - }, - { - type: 'event', - inputs: [ - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'account', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'amount', - }, - ], - anonymous: false, - name: 'RequestDeposit', - }, - { - type: 'event', - inputs: [ - { - name: 'liquidator', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'violator', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - name: 'underlying', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - internalType: 'address', - indexed: false, - type: 'address', - name: 'collateral', - }, - { - indexed: false, - internalType: 'uint256', - type: 'uint256', - name: 'repay', - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'minYield', - }, - ], - name: 'RequestLiquidate', - anonymous: false, - }, - { - name: 'RequestMint', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'account', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - }, - { - inputs: [ - { - name: 'account', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - type: 'event', - anonymous: false, - name: 'RequestRepay', - }, - { - inputs: [ - { - name: 'accountIn', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - internalType: 'address', - indexed: true, - type: 'address', - name: 'accountOut', - }, - { - name: 'underlyingIn', - internalType: 'address', - indexed: true, - type: 'address', - }, - { - name: 'underlyingOut', - indexed: false, - internalType: 'address', - type: 'address', - }, - { - internalType: 'uint256', - indexed: false, - type: 'uint256', - name: 'amount', - }, - { - type: 'uint256', - internalType: 'uint256', - indexed: false, - name: 'swapType', - }, - ], - type: 'event', - name: 'RequestSwap', - anonymous: false, - }, - { - type: 'event', - inputs: [ - { - name: 'from', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - name: 'to', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - type: 'uint256', - indexed: false, - internalType: 'uint256', - name: 'amount', - }, - ], - name: 'RequestTransferDToken', - anonymous: false, - }, - { - inputs: [ - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'from', - }, - { - name: 'to', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - name: 'amount', - internalType: 'uint256', - indexed: false, - type: 'uint256', - }, - ], - type: 'event', - name: 'RequestTransferEToken', - anonymous: false, - }, - { - anonymous: false, - name: 'RequestWithdraw', - inputs: [ - { - type: 'address', - indexed: true, - internalType: 'address', - name: 'account', - }, - { - name: 'amount', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - type: 'event', - }, - { - name: 'TrackAverageLiquidity', - anonymous: false, - type: 'event', - inputs: [ - { - name: 'account', - internalType: 'address', - indexed: true, - type: 'address', - }, - ], - }, - { - anonymous: false, - name: 'Transfer', - type: 'event', - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'from', - }, - { - name: 'to', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - name: 'value', - type: 'uint256', - internalType: 'uint256', - indexed: false, - }, - ], - }, - { - name: 'UnTrackAverageLiquidity', - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'account', - }, - ], - type: 'event', - }, - { - anonymous: false, - name: 'Withdraw', - type: 'event', - inputs: [ - { - indexed: true, - internalType: 'address', - type: 'address', - name: 'underlying', - }, - { - type: 'address', - internalType: 'address', - indexed: true, - name: 'account', - }, - { - name: 'amount', - indexed: false, - internalType: 'uint256', - type: 'uint256', - }, - ], - }, - { - type: 'function', - inputs: [ - { - name: 'holder', - type: 'address', - internalType: 'address', - }, - { - name: 'spender', - internalType: 'address', - type: 'address', - }, - ], - outputs: [ - { - type: 'uint256', - internalType: 'uint256', - name: '', - }, - ], - stateMutability: 'view', - name: 'allowance', - }, - { - stateMutability: 'nonpayable', - name: 'approve', - type: 'function', - inputs: [ - { - internalType: 'address', - type: 'address', - name: 'spender', - }, - { - type: 'uint256', - internalType: 'uint256', - name: 'amount', - }, - ], - outputs: [ - { - name: '', - type: 'bool', - internalType: 'bool', - }, - ], - }, - { - outputs: [ - { - internalType: 'bool', - type: 'bool', - name: '', - }, - ], - inputs: [ - { - name: 'subAccountId', - internalType: 'uint256', - type: 'uint256', - }, - { - internalType: 'address', - type: 'address', - name: 'spender', - }, - { - type: 'uint256', - internalType: 'uint256', - name: 'amount', - }, - ], - type: 'function', - name: 'approveSubAccount', - stateMutability: 'nonpayable', - }, - { - type: 'function', - inputs: [ - { - name: 'account', - type: 'address', - internalType: 'address', - }, - ], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - stateMutability: 'view', - name: 'balanceOf', - }, - { - name: 'balanceOfUnderlying', - stateMutability: 'view', - outputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: '', - }, - ], - inputs: [ - { - name: 'account', - internalType: 'address', - type: 'address', - }, - ], - type: 'function', - }, - { - stateMutability: 'nonpayable', - name: 'burn', - type: 'function', - outputs: [], - inputs: [ - { - name: 'subAccountId', - internalType: 'uint256', - type: 'uint256', - }, - { - type: 'uint256', - internalType: 'uint256', - name: 'amount', - }, - ], - }, - { - name: 'convertBalanceToUnderlying', - stateMutability: 'view', - inputs: [ - { - name: 'balance', - internalType: 'uint256', - type: 'uint256', - }, - ], - outputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: '', - }, - ], - type: 'function', - }, - { - stateMutability: 'view', - name: 'convertUnderlyingToBalance', - type: 'function', - inputs: [ - { - name: 'underlyingAmount', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - internalType: 'uint256', - type: 'uint256', - }, - ], - }, - { - inputs: [], - outputs: [ - { - name: '', - internalType: 'uint8', - type: 'uint8', - }, - ], - type: 'function', - name: 'decimals', - stateMutability: 'pure', - }, - { - type: 'function', - inputs: [ - { - name: 'subAccountId', - type: 'uint256', - internalType: 'uint256', - }, - { - internalType: 'uint256', - type: 'uint256', - name: 'amount', - }, - ], - outputs: [], - stateMutability: 'nonpayable', - name: 'deposit', - }, - { - name: 'mint', - stateMutability: 'nonpayable', - inputs: [ - { - type: 'uint256', - internalType: 'uint256', - name: 'subAccountId', - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - }, - ], - outputs: [], - type: 'function', - }, - { - stateMutability: 'view', - name: 'moduleGitCommit', - type: 'function', - inputs: [], - outputs: [ - { - internalType: 'bytes32', - type: 'bytes32', - name: '', - }, - ], - }, - { - stateMutability: 'view', - name: 'moduleId', - type: 'function', - outputs: [ - { - type: 'uint256', - internalType: 'uint256', - name: '', - }, - ], - inputs: [], - }, - { - inputs: [], - outputs: [ - { - name: '', - type: 'string', - internalType: 'string', - }, - ], - type: 'function', - name: 'name', - stateMutability: 'view', - }, - { - stateMutability: 'view', - name: 'reserveBalance', - type: 'function', - inputs: [], - outputs: [ - { - name: '', - type: 'uint256', - internalType: 'uint256', - }, - ], - }, - { - inputs: [], - outputs: [ - { - name: '', - internalType: 'uint256', - type: 'uint256', - }, - ], - type: 'function', - name: 'reserveBalanceUnderlying', - stateMutability: 'view', - }, - { - inputs: [], - outputs: [ - { - name: '', - type: 'string', - internalType: 'string', - }, - ], - type: 'function', - name: 'symbol', - stateMutability: 'view', - }, - { - inputs: [], - outputs: [ - { - type: 'uint256', - internalType: 'uint256', - name: '', - }, - ], - type: 'function', - name: 'totalSupply', - stateMutability: 'view', - }, - { - type: 'function', - outputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: '', - }, - ], - inputs: [], - stateMutability: 'view', - name: 'totalSupplyUnderlying', - }, - { - name: 'touch', - stateMutability: 'nonpayable', - inputs: [], - outputs: [], - type: 'function', - }, - { - stateMutability: 'nonpayable', - name: 'transfer', - type: 'function', - outputs: [ - { - internalType: 'bool', - type: 'bool', - name: '', - }, - ], - inputs: [ - { - name: 'to', - internalType: 'address', - type: 'address', - }, - { - type: 'uint256', - internalType: 'uint256', - name: 'amount', - }, - ], - }, - { - type: 'function', - outputs: [ - { - name: '', - internalType: 'bool', - type: 'bool', - }, - ], - inputs: [ - { - name: 'from', - type: 'address', - internalType: 'address', - }, - { - name: 'to', - type: 'address', - internalType: 'address', - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - name: 'transferFrom', - }, - { - type: 'function', - inputs: [ - { - internalType: 'address', - type: 'address', - name: 'from', - }, - { - name: 'to', - internalType: 'address', - type: 'address', - }, - ], - outputs: [ - { - internalType: 'bool', - type: 'bool', - name: '', - }, - ], - stateMutability: 'nonpayable', - name: 'transferFromMax', - }, - { - stateMutability: 'nonpayable', - name: 'withdraw', - type: 'function', - inputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: 'subAccountId', - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - }, - ], - outputs: [], - }, -] as const; - -export type EulerEtokenContract = typeof eulerEtokenContractAbi; -export type EulerEtokenContractContract = GetContractReturnType; - -export class EulerEtokenContract__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: eulerEtokenContractAbi, publicClient: client }); - } -} diff --git a/src/apps/euler/contracts/viem/EulerPtokenContract.ts b/src/apps/euler/contracts/viem/EulerPtokenContract.ts deleted file mode 100644 index 78a8e805f..000000000 --- a/src/apps/euler/contracts/viem/EulerPtokenContract.ts +++ /dev/null @@ -1,324 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const eulerPtokenContractAbi = [ - { - inputs: [ - { - name: 'euler_', - type: 'address', - internalType: 'address', - }, - { - name: 'underlying_', - type: 'address', - internalType: 'address', - }, - ], - type: 'constructor', - stateMutability: 'nonpayable', - }, - { - anonymous: false, - name: 'Approval', - inputs: [ - { - name: 'owner', - type: 'address', - internalType: 'address', - indexed: true, - }, - { - name: 'spender', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - name: 'value', - internalType: 'uint256', - indexed: false, - type: 'uint256', - }, - ], - type: 'event', - }, - { - inputs: [ - { - name: 'from', - type: 'address', - indexed: true, - internalType: 'address', - }, - { - name: 'to', - indexed: true, - internalType: 'address', - type: 'address', - }, - { - name: 'value', - type: 'uint256', - indexed: false, - internalType: 'uint256', - }, - ], - type: 'event', - name: 'Transfer', - anonymous: false, - }, - { - name: 'allowance', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - internalType: 'uint256', - name: '', - }, - ], - inputs: [ - { - internalType: 'address', - type: 'address', - name: 'holder', - }, - { - internalType: 'address', - type: 'address', - name: 'spender', - }, - ], - type: 'function', - }, - { - stateMutability: 'nonpayable', - name: 'approve', - type: 'function', - inputs: [ - { - type: 'address', - internalType: 'address', - name: 'spender', - }, - { - internalType: 'uint256', - type: 'uint256', - name: 'amount', - }, - ], - outputs: [ - { - internalType: 'bool', - type: 'bool', - name: '', - }, - ], - }, - { - name: 'balanceOf', - stateMutability: 'view', - outputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: '', - }, - ], - inputs: [ - { - name: 'who', - type: 'address', - internalType: 'address', - }, - ], - type: 'function', - }, - { - name: 'claimSurplus', - stateMutability: 'nonpayable', - inputs: [ - { - name: 'who', - type: 'address', - internalType: 'address', - }, - ], - outputs: [], - type: 'function', - }, - { - inputs: [], - outputs: [ - { - type: 'uint8', - internalType: 'uint8', - name: '', - }, - ], - type: 'function', - name: 'decimals', - stateMutability: 'view', - }, - { - name: 'forceUnwrap', - stateMutability: 'nonpayable', - inputs: [ - { - type: 'address', - internalType: 'address', - name: 'who', - }, - { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [], - type: 'function', - }, - { - name: 'name', - stateMutability: 'view', - inputs: [], - outputs: [ - { - name: '', - internalType: 'string', - type: 'string', - }, - ], - type: 'function', - }, - { - stateMutability: 'view', - name: 'symbol', - type: 'function', - inputs: [], - outputs: [ - { - name: '', - internalType: 'string', - type: 'string', - }, - ], - }, - { - stateMutability: 'view', - name: 'totalSupply', - type: 'function', - outputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: '', - }, - ], - inputs: [], - }, - { - inputs: [ - { - name: 'recipient', - type: 'address', - internalType: 'address', - }, - { - name: 'amount', - type: 'uint256', - internalType: 'uint256', - }, - ], - outputs: [ - { - name: '', - internalType: 'bool', - type: 'bool', - }, - ], - type: 'function', - name: 'transfer', - stateMutability: 'nonpayable', - }, - { - inputs: [ - { - internalType: 'address', - type: 'address', - name: 'from', - }, - { - internalType: 'address', - type: 'address', - name: 'recipient', - }, - { - name: 'amount', - internalType: 'uint256', - type: 'uint256', - }, - ], - outputs: [ - { - internalType: 'bool', - type: 'bool', - name: '', - }, - ], - type: 'function', - name: 'transferFrom', - stateMutability: 'nonpayable', - }, - { - type: 'function', - outputs: [ - { - name: '', - internalType: 'address', - type: 'address', - }, - ], - inputs: [], - stateMutability: 'view', - name: 'underlying', - }, - { - outputs: [], - inputs: [ - { - internalType: 'uint256', - type: 'uint256', - name: 'amount', - }, - ], - type: 'function', - name: 'unwrap', - stateMutability: 'nonpayable', - }, - { - name: 'wrap', - stateMutability: 'nonpayable', - inputs: [ - { - type: 'uint256', - internalType: 'uint256', - name: 'amount', - }, - ], - outputs: [], - type: 'function', - }, -] as const; - -export type EulerPtokenContract = typeof eulerPtokenContractAbi; -export type EulerPtokenContractContract = GetContractReturnType; - -export class EulerPtokenContract__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: eulerPtokenContractAbi, publicClient: client }); - } -} diff --git a/src/apps/euler/contracts/viem/EulerStakingRewardsContract.ts b/src/apps/euler/contracts/viem/EulerStakingRewardsContract.ts deleted file mode 100644 index f4fa8243d..000000000 --- a/src/apps/euler/contracts/viem/EulerStakingRewardsContract.ts +++ /dev/null @@ -1,652 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const eulerStakingRewardsContractAbi = [ - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardsDistribution', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardsToken', - type: 'address', - }, - { - internalType: 'address', - name: '_stakingToken', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'oldOwner', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnerNominated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - name: 'PauseChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'token', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Recovered', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'RewardAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'RewardPaid', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newDuration', - type: 'uint256', - }, - ], - name: 'RewardsDurationUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Staked', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Withdrawn', - type: 'event', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - 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: 'account', - type: 'address', - }, - ], - name: 'earned', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'subAccountId', - type: 'uint256', - }, - ], - name: 'exit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'exit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getReward', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getRewardForDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lastPauseTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lastTimeRewardApplicable', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lastUpdateTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address', - }, - ], - name: 'nominateNewOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'nominatedOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'reward', - type: 'uint256', - }, - ], - name: 'notifyRewardAmount', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'paused', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'periodFinish', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'tokenAddress', - type: 'address', - }, - { - internalType: 'uint256', - name: 'tokenAmount', - type: 'uint256', - }, - ], - name: 'recoverERC20', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'rewardPerToken', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardPerTokenStored', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'rewards', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardsDistribution', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardsDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardsToken', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: '_paused', - type: 'bool', - }, - ], - name: 'setPaused', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_rewardsDistribution', - type: 'address', - }, - ], - name: 'setRewardsDistribution', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_rewardsDuration', - type: 'uint256', - }, - ], - name: 'setRewardsDuration', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'subAccountId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'stake', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'stake', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'stakingToken', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'userRewardPerTokenPaid', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'withdraw', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'subAccountId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'withdraw', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type EulerStakingRewardsContract = typeof eulerStakingRewardsContractAbi; -export type EulerStakingRewardsContractContract = GetContractReturnType; - -export class EulerStakingRewardsContract__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: eulerStakingRewardsContractAbi, publicClient: client }); - } -} diff --git a/src/apps/euler/contracts/viem/index.ts b/src/apps/euler/contracts/viem/index.ts deleted file mode 100644 index 3fee9bf21..000000000 --- a/src/apps/euler/contracts/viem/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -export type { EulerDtokenContract } from './EulerDtokenContract'; -export type { EulerEtokenContract } from './EulerEtokenContract'; -export type { EulerPtokenContract } from './EulerPtokenContract'; -export type { EulerStakingRewardsContract } from './EulerStakingRewardsContract'; - -export { EulerDtokenContract__factory } from './EulerDtokenContract'; -export { EulerEtokenContract__factory } from './EulerEtokenContract'; -export { EulerPtokenContract__factory } from './EulerPtokenContract'; -export { EulerStakingRewardsContract__factory } from './EulerStakingRewardsContract'; diff --git a/src/apps/euler/ethereum/euler.d-token.token-fetcher.ts b/src/apps/euler/ethereum/euler.d-token.token-fetcher.ts deleted file mode 100644 index 39cbfd879..000000000 --- a/src/apps/euler/ethereum/euler.d-token.token-fetcher.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { EulerDTokenTokenFetcher } from '../common/euler.d-token.token-fetcher'; -import { EulerTokenType } from '../common/euler.token-definition-resolver'; - -@PositionTemplate() -export class EthereumEulerDTokenTokenFetcher extends EulerDTokenTokenFetcher { - groupLabel = 'Lending'; - tokenType = EulerTokenType.D_TOKEN; - isDebt = true; -} diff --git a/src/apps/euler/ethereum/euler.e-token.token-fetcher.ts b/src/apps/euler/ethereum/euler.e-token.token-fetcher.ts deleted file mode 100644 index 60bfe362e..000000000 --- a/src/apps/euler/ethereum/euler.e-token.token-fetcher.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { EulerETokenTokenFetcher } from '../common/euler.e-token.token-fetcher'; -import { EulerTokenType } from '../common/euler.token-definition-resolver'; - -@PositionTemplate() -export class EthereumEulerETokenTokenFetcher extends EulerETokenTokenFetcher { - groupLabel = 'Lending'; - tokenType = EulerTokenType.E_TOKEN; - isDebt = false; -} diff --git a/src/apps/euler/ethereum/euler.p-token.token-fetcher.ts b/src/apps/euler/ethereum/euler.p-token.token-fetcher.ts deleted file mode 100644 index 1c7fa3923..000000000 --- a/src/apps/euler/ethereum/euler.p-token.token-fetcher.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { EulerPTokenTokenFetcher } from '../common/euler.p-token.token-fetcher'; -import { EulerTokenType } from '../common/euler.token-definition-resolver'; - -@PositionTemplate() -export class EthereumEulerPTokenTokenFetcher extends EulerPTokenTokenFetcher { - groupLabel = 'Lending'; - tokenType = EulerTokenType.P_TOKEN; -} diff --git a/src/apps/euler/ethereum/euler.position-presenter.ts b/src/apps/euler/ethereum/euler.position-presenter.ts deleted file mode 100644 index 3ae855dfa..000000000 --- a/src/apps/euler/ethereum/euler.position-presenter.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { PresenterTemplate } from '~app-toolkit/decorators/presenter-template.decorator'; -import { PresentationConfig } from '~app/app.interface'; -import { PositionPresenterTemplate } from '~position/template/position-presenter.template'; - -@PresenterTemplate() -export class EthereumEulerPositionPresenter extends PositionPresenterTemplate { - explorePresentationConfig?: PresentationConfig = { - tabs: [ - { - label: 'Lending', - viewType: 'split', - views: [ - { - viewType: 'list', - label: 'Supply', - groupIds: ['e-token'], - }, - { - viewType: 'list', - label: 'Borrow', - groupIds: ['d-token'], - }, - ], - }, - { viewType: 'list', label: 'Farms', groupIds: ['single-staking-farm'] }, - ], - }; -} diff --git a/src/apps/euler/ethereum/euler.single-staking-farm.contract-position-fetcher.ts b/src/apps/euler/ethereum/euler.single-staking-farm.contract-position-fetcher.ts deleted file mode 100644 index 5bb92e4fa..000000000 --- a/src/apps/euler/ethereum/euler.single-staking-farm.contract-position-fetcher.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { EulerApiStakingRegistry } from '~apps/euler/common/euler.api.staking-registry'; -import { EulerViemContractFactory } from '~apps/euler/contracts'; -import { GetDataPropsParams, GetTokenBalancesParams } from '~position/template/contract-position.template.types'; -import { - SingleStakingFarmDataProps, - SingleStakingFarmDefinition, - SingleStakingFarmTemplateContractPositionFetcher, -} from '~position/template/single-staking.template.contract-position-fetcher'; - -import { EulerStakingRewardsContract } from '../contracts/viem'; - -@PositionTemplate() -export class EthereumEulerSingleStakingFarmContractPositionFetcher extends SingleStakingFarmTemplateContractPositionFetcher { - groupLabel = 'Farms'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(EulerViemContractFactory) protected readonly contractFactory: EulerViemContractFactory, - @Inject(EulerApiStakingRegistry) protected readonly stakingCacheManager: EulerApiStakingRegistry, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.eulerStakingRewardsContract({ address, network: this.network }); - } - - async getFarmDefinitions(): Promise { - const multicall = this.appToolkit.getViemMulticall(this.network); - const markets = await this.stakingCacheManager.getStakingDefinitions({ network: this.network }); - - return await Promise.all( - markets.map(async market => { - const vaultContract = this.contractFactory.eulerStakingRewardsContract({ - address: market.vaultAddress.toLowerCase(), - network: this.network, - }); - const [stakedTokenAddress, rewardTokenAddress] = await Promise.all([ - multicall.wrap(vaultContract).read.stakingToken(), - multicall.wrap(vaultContract).read.rewardsToken(), - ]); - - return { - address: market.vaultAddress, - stakedTokenAddress, - rewardTokenAddresses: [rewardTokenAddress], - }; - }), - ); - } - - getRewardRates({ contract }: GetDataPropsParams) { - return contract.read.rewardRate(); - } - - async getIsActive({ - contract, - }: GetDataPropsParams< - EulerStakingRewardsContract, - SingleStakingFarmDataProps, - SingleStakingFarmDefinition - >): Promise { - return (await contract.read.periodFinish()) > Math.floor(Date.now() / 1000); - } - - getStakedTokenBalance({ - address, - contract, - }: GetTokenBalancesParams) { - return contract.read.balanceOf([address]); - } - - getRewardTokenBalances({ - address, - contract, - }: GetTokenBalancesParams) { - return contract.read.earned([address]); - } -} diff --git a/src/apps/euler/euler.module.ts b/src/apps/euler/euler.module.ts deleted file mode 100644 index 658c906a4..000000000 --- a/src/apps/euler/euler.module.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Module } from '@nestjs/common'; - -import { AbstractApp } from '~app/app.dynamic-module'; -import { EulerApiStakingRegistry } from '~apps/euler/common/euler.api.staking-registry'; - -import { EulerTokenDefinitionsResolver } from './common/euler.token-definition-resolver'; -import { EulerViemContractFactory } from './contracts'; -import { EthereumEulerDTokenTokenFetcher } from './ethereum/euler.d-token.token-fetcher'; -import { EthereumEulerETokenTokenFetcher } from './ethereum/euler.e-token.token-fetcher'; -import { EthereumEulerPTokenTokenFetcher } from './ethereum/euler.p-token.token-fetcher'; -import { EthereumEulerPositionPresenter } from './ethereum/euler.position-presenter'; -import { EthereumEulerSingleStakingFarmContractPositionFetcher } from './ethereum/euler.single-staking-farm.contract-position-fetcher'; - -@Module({ - providers: [ - EthereumEulerDTokenTokenFetcher, - EthereumEulerETokenTokenFetcher, - EthereumEulerPTokenTokenFetcher, - EthereumEulerPositionPresenter, - EthereumEulerSingleStakingFarmContractPositionFetcher, - EulerViemContractFactory, - EulerTokenDefinitionsResolver, - EulerApiStakingRegistry, - ], -}) -export class EulerAppModule extends AbstractApp() {}