diff --git a/src/apps/mstable/ethereum/mstable.imusd.token-fetcher.ts b/src/apps/mstable/ethereum/mstable.imusd.token-fetcher.ts deleted file mode 100644 index 557a8d4bf..000000000 --- a/src/apps/mstable/ethereum/mstable.imusd.token-fetcher.ts +++ /dev/null @@ -1,37 +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 { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { GetPricePerShareParams, GetUnderlyingTokensParams } from '~position/template/app-token.template.types'; - -import { MstableViemContractFactory } from '../contracts'; -import { MstableAsset } from '../contracts/viem'; - -@PositionTemplate() -export class EthereumMstableImusdTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'imUSD'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(MstableViemContractFactory) protected readonly contractFactory: MstableViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.mstableAsset({ address, network: this.network }); - } - - async getAddresses() { - return ['0x30647a72dc82d7fbb1123ea74716ab8a317eac19']; - } - - async getUnderlyingTokenDefinitions({ contract }: GetUnderlyingTokensParams) { - return [{ address: await contract.read.asset(), network: this.network }]; - } - - async getPricePerShare({ appToken, contract }: GetPricePerShareParams) { - return [await contract.read.exchangeRate().then(v => Number(v) / 10 ** appToken.tokens[0].decimals)]; - } -} diff --git a/src/apps/mstable/mstable.module.ts b/src/apps/mstable/mstable.module.ts index 9ae791d96..76e25ed80 100644 --- a/src/apps/mstable/mstable.module.ts +++ b/src/apps/mstable/mstable.module.ts @@ -4,7 +4,6 @@ import { AbstractApp } from '~app/app.dynamic-module'; import { MstableViemContractFactory } from './contracts'; import { EthereumMstableEarnContractPositionFetcher } from './ethereum/mstable.earn.contract-position-fetcher'; -import { EthereumMstableImusdTokenFetcher } from './ethereum/mstable.imusd.token-fetcher'; import { EthereumMstableMetaVaultTokenFetcher } from './ethereum/mstable.meta-vault.token-fetcher'; import { EthereumMstableMtaV1FarmContractPositionFetcher } from './ethereum/mstable.mta-v1-farm.contract-position-fetcher'; import { EthereumMstableMtaV2FarmContractPositionFetcher } from './ethereum/mstable.mta-v2-farm.contract-position-fetcher'; @@ -16,7 +15,6 @@ import { PolygonMstableSavingsVaultContractPositionFetcher } from './polygon/mst providers: [ MstableViemContractFactory, EthereumMstableEarnContractPositionFetcher, - EthereumMstableImusdTokenFetcher, EthereumMstableMtaV1FarmContractPositionFetcher, EthereumMstableMtaV2FarmContractPositionFetcher, EthereumMstableMetaVaultTokenFetcher, diff --git a/src/apps/mycelium/arbitrum/mycelium.es-myc.token-fetcher.ts b/src/apps/mycelium/arbitrum/mycelium.es-myc.token-fetcher.ts deleted file mode 100644 index 2bf51e2aa..000000000 --- a/src/apps/mycelium/arbitrum/mycelium.es-myc.token-fetcher.ts +++ /dev/null @@ -1,36 +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 { Erc20 } from '~contract/contracts/viem'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; - -import { MyceliumViemContractFactory } from '../contracts'; - -@PositionTemplate() -export class ArbitrumMyceliumEsMycTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'esMYC'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(MyceliumViemContractFactory) protected readonly contractFactory: MyceliumViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.appToolkit.globalViemContracts.erc20({ network: this.network, address }); - } - - async getAddresses() { - return ['0x7cec785fba5ee648b48fbffc378d74c8671bb3cb']; - } - - async getUnderlyingTokenDefinitions() { - return [{ address: '0xc74fe4c715510ec2f8c61d70d397b32043f55abe', network: this.network }]; - } - - async getPricePerShare() { - return [1]; - } -} diff --git a/src/apps/mycelium/mycelium.module.ts b/src/apps/mycelium/mycelium.module.ts index 9a434d34c..a98b89bbe 100644 --- a/src/apps/mycelium/mycelium.module.ts +++ b/src/apps/mycelium/mycelium.module.ts @@ -2,7 +2,6 @@ import { Module } from '@nestjs/common'; import { AbstractApp } from '~app/app.dynamic-module'; -import { ArbitrumMyceliumEsMycTokenFetcher } from './arbitrum/mycelium.es-myc.token-fetcher'; import { ArbitrumMyceliumMlpTokenFetcher } from './arbitrum/mycelium.mlp.token-fetcher'; import { ArbitrumMycellilumPerpContractPositionFetcher } from './arbitrum/mycelium.perp.contract-position-fetcher'; import { MyceliumViemContractFactory } from './contracts'; @@ -11,7 +10,6 @@ import { MyceliumViemContractFactory } from './contracts'; providers: [ MyceliumViemContractFactory, // Arbitrum - ArbitrumMyceliumEsMycTokenFetcher, ArbitrumMyceliumMlpTokenFetcher, ArbitrumMycellilumPerpContractPositionFetcher, ], diff --git a/src/apps/origin-story/contracts/abis/origin-story-woeth.json b/src/apps/origin-story/contracts/abis/origin-story-woeth.json deleted file mode 100644 index 592e927dd..000000000 --- a/src/apps/origin-story/contracts/abis/origin-story-woeth.json +++ /dev/null @@ -1,327 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "contract ERC20", "name": "underlying_", "type": "address" }, - { "internalType": "string", "name": "name_", "type": "string" }, - { "internalType": "string", "name": "symbol_", "type": "string" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "previousGovernor", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newGovernor", "type": "address" } - ], - "name": "GovernorshipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "previousGovernor", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newGovernor", "type": "address" } - ], - "name": "PendingGovernorshipTransfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "Withdraw", - "type": "event" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } - ], - "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "asset", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "claimGovernance", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "name": "convertToAssets", - "outputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "name": "convertToShares", - "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } - ], - "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" } - ], - "name": "deposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "governor", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "addedValue", "type": "uint256" } - ], - "name": "increaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "isGovernor", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "maxDeposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "maxMint", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], - "name": "maxRedeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], - "name": "maxWithdraw", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "shares", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" } - ], - "name": "mint", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "name": "previewDeposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "name": "previewMint", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "name": "previewRedeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "name": "previewWithdraw", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "shares", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" }, - { "internalType": "address", "name": "owner", "type": "address" } - ], - "name": "redeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalAssets", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sender", "type": "address" }, - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_newGovernor", "type": "address" }], - "name": "transferGovernance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "asset_", "type": "address" }, - { "internalType": "uint256", "name": "amount_", "type": "uint256" } - ], - "name": "transferToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" }, - { "internalType": "address", "name": "owner", "type": "address" } - ], - "name": "withdraw", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/origin-story/contracts/viem.contract-factory.ts b/src/apps/origin-story/contracts/viem.contract-factory.ts index bc32f43b0..772931b00 100644 --- a/src/apps/origin-story/contracts/viem.contract-factory.ts +++ b/src/apps/origin-story/contracts/viem.contract-factory.ts @@ -3,7 +3,7 @@ import { Injectable, Inject } from '@nestjs/common'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; import { Network } from '~types/network.interface'; -import { OriginStoryWoeth__factory, Series__factory } from './viem'; +import { Series__factory } from './viem'; type ContractOpts = { address: string; network: Network }; @@ -11,9 +11,6 @@ type ContractOpts = { address: string; network: Network }; export class OriginStoryViemContractFactory { constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - originStoryWoeth({ address, network }: ContractOpts) { - return OriginStoryWoeth__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } series({ address, network }: ContractOpts) { return Series__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } diff --git a/src/apps/origin-story/contracts/viem/OriginStoryWoeth.ts b/src/apps/origin-story/contracts/viem/OriginStoryWoeth.ts deleted file mode 100644 index 3f29e4af9..000000000 --- a/src/apps/origin-story/contracts/viem/OriginStoryWoeth.ts +++ /dev/null @@ -1,806 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const originStoryWoethAbi = [ - { - inputs: [ - { - internalType: 'contract ERC20', - name: 'underlying_', - type: 'address', - }, - { - internalType: 'string', - name: 'name_', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol_', - type: 'string', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'Deposit', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousGovernor', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newGovernor', - type: 'address', - }, - ], - name: 'GovernorshipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousGovernor', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newGovernor', - type: 'address', - }, - ], - name: 'PendingGovernorshipTransfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'Withdraw', - type: 'event', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'asset', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'claimGovernance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'convertToAssets', - outputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'convertToShares', - outputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'deposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'governor', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'addedValue', - type: 'uint256', - }, - ], - name: 'increaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'isGovernor', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'maxDeposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'maxMint', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'maxRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'maxWithdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'mint', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'previewDeposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'previewMint', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'previewRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'previewWithdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'redeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalAssets', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newGovernor', - type: 'address', - }, - ], - name: 'transferGovernance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'asset_', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount_', - type: 'uint256', - }, - ], - name: 'transferToken', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'withdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type OriginStoryWoeth = typeof originStoryWoethAbi; -export type OriginStoryWoethContract = GetContractReturnType; - -export class OriginStoryWoeth__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: originStoryWoethAbi, publicClient: client }); - } -} diff --git a/src/apps/origin-story/contracts/viem/index.ts b/src/apps/origin-story/contracts/viem/index.ts index fd0261cc9..5bc0644e0 100644 --- a/src/apps/origin-story/contracts/viem/index.ts +++ b/src/apps/origin-story/contracts/viem/index.ts @@ -2,8 +2,6 @@ /* tslint:disable */ /* eslint-disable */ -export type { OriginStoryWoeth } from './OriginStoryWoeth'; export type { Series } from './Series'; -export { OriginStoryWoeth__factory } from './OriginStoryWoeth'; export { Series__factory } from './Series'; diff --git a/src/apps/origin-story/ethereum/origin-story.woeth.token-fetcher.ts b/src/apps/origin-story/ethereum/origin-story.woeth.token-fetcher.ts deleted file mode 100644 index b00436f3c..000000000 --- a/src/apps/origin-story/ethereum/origin-story.woeth.token-fetcher.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Inject } from '@nestjs/common'; -import { BigNumber } from 'ethers'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { GetPricePerShareParams, GetUnderlyingTokensParams } from '~position/template/app-token.template.types'; - -import { OriginStoryViemContractFactory } from '../contracts'; -import { OriginStoryWoeth } from '../contracts/viem'; - -@PositionTemplate() -export class EthereumOriginStoryWoethTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'wOETH'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(OriginStoryViemContractFactory) protected readonly contractFactory: OriginStoryViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.originStoryWoeth({ network: this.network, address }); - } - - async getAddresses() { - return ['0xdcee70654261af21c44c093c300ed3bb97b78192']; - } - - async getUnderlyingTokenDefinitions({ contract }: GetUnderlyingTokensParams) { - return [{ address: await contract.read.asset(), network: this.network }]; - } - - async getPricePerShare({ contract }: GetPricePerShareParams) { - const oneUnit = BigNumber.from(10).pow(18).toString(); - const pricePerShareRaw = await contract.read.convertToAssets([BigInt(oneUnit)]); - const pricePerShare = Number(pricePerShareRaw) / 10 ** 18; - return [pricePerShare]; - } -} diff --git a/src/apps/origin-story/origin-story.module.ts b/src/apps/origin-story/origin-story.module.ts index 55f49d8df..dcf9db4fe 100644 --- a/src/apps/origin-story/origin-story.module.ts +++ b/src/apps/origin-story/origin-story.module.ts @@ -4,13 +4,8 @@ import { AbstractApp } from '~app/app.dynamic-module'; import { OriginStoryViemContractFactory } from './contracts'; import { EthereumOriginStorySeriesContractPositionFetcher } from './ethereum/origin-story.series.contract-position-fetcher'; -import { EthereumOriginStoryWoethTokenFetcher } from './ethereum/origin-story.woeth.token-fetcher'; @Module({ - providers: [ - OriginStoryViemContractFactory, - EthereumOriginStorySeriesContractPositionFetcher, - EthereumOriginStoryWoethTokenFetcher, - ], + providers: [OriginStoryViemContractFactory, EthereumOriginStorySeriesContractPositionFetcher], }) export class OriginStoryAppModule extends AbstractApp() {} diff --git a/src/apps/pie-dao/ethereum/pie-dao.e-dough.token-fetcher.ts b/src/apps/pie-dao/ethereum/pie-dao.e-dough.token-fetcher.ts deleted file mode 100644 index 0425d2cd0..000000000 --- a/src/apps/pie-dao/ethereum/pie-dao.e-dough.token-fetcher.ts +++ /dev/null @@ -1,36 +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 { Erc20 } from '~contract/contracts/viem'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; - -import { PieDaoViemContractFactory } from '../contracts'; - -@PositionTemplate() -export class EthereumPieDaoEDoughTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'eDOUGH'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(PieDaoViemContractFactory) protected readonly contractFactory: PieDaoViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.appToolkit.globalViemContracts.erc20({ address, network: this.network }); - } - - getAddresses() { - return ['0x63cbd1858bd79de1a06c3c26462db360b834912d']; - } - - async getUnderlyingTokenDefinitions() { - return [{ address: '0xad32a8e6220741182940c5abf610bde99e737b2d', network: this.network }]; // DOUGH - } - - async getPricePerShare() { - return [1]; - } -} diff --git a/src/apps/pie-dao/pie-dao.module.ts b/src/apps/pie-dao/pie-dao.module.ts index cab959ce9..53e2a8b3e 100644 --- a/src/apps/pie-dao/pie-dao.module.ts +++ b/src/apps/pie-dao/pie-dao.module.ts @@ -3,7 +3,6 @@ import { Module } from '@nestjs/common'; import { AbstractApp } from '~app/app.dynamic-module'; import { PieDaoViemContractFactory } from './contracts'; -import { EthereumPieDaoEDoughTokenFetcher } from './ethereum/pie-dao.e-dough.token-fetcher'; import { EthereumPieDaoFarmMasterChefContractPositionFetcher } from './ethereum/pie-dao.farm-master-chef.contract-position-fetcher'; import { EthereumPieDaoFarmSingleStakingContractPositionFetcher } from './ethereum/pie-dao.farm-single-staking.contract-position-fetcher'; import { EthereumPieDaoVotingEscrowContractPositionFether } from './ethereum/pie-dao.voting-escrow.contract-position-fetcher'; @@ -12,7 +11,6 @@ import { EthereumPieDaoVotingEscrowContractPositionFether } from './ethereum/pie providers: [ PieDaoViemContractFactory, // Ethereum - EthereumPieDaoEDoughTokenFetcher, EthereumPieDaoFarmSingleStakingContractPositionFetcher, EthereumPieDaoFarmMasterChefContractPositionFetcher, EthereumPieDaoVotingEscrowContractPositionFether,