diff --git a/src/apps/across/across.module.ts b/src/apps/across/across.module.ts index 7a1cd8a9a..690c1310c 100644 --- a/src/apps/across/across.module.ts +++ b/src/apps/across/across.module.ts @@ -3,10 +3,9 @@ import { Module } from '@nestjs/common'; import { AbstractApp } from '~app/app.dynamic-module'; import { AcrossViemContractFactory } from './contracts'; -import { EthereumAcrossPoolV2TokenFetcher } from './ethereum/across.pool-v2.token-fetcher'; import { EthereumStakingContractPositionFetcher } from './ethereum/across.staking.contract-position-fetcher'; @Module({ - providers: [AcrossViemContractFactory, EthereumAcrossPoolV2TokenFetcher, EthereumStakingContractPositionFetcher], + providers: [AcrossViemContractFactory, EthereumStakingContractPositionFetcher], }) export class AcrossAppModule extends AbstractApp() {} diff --git a/src/apps/across/common/across.pool-v2.token-fetcher.ts b/src/apps/across/common/across.pool-v2.token-fetcher.ts deleted file mode 100644 index b8c7902c8..000000000 --- a/src/apps/across/common/across.pool-v2.token-fetcher.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Inject } from '@nestjs/common'; -import { BigNumber } from 'ethers'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - DefaultAppTokenDataProps, - GetAddressesParams, - GetDisplayPropsParams, - GetPricePerShareParams, - GetUnderlyingTokensParams, -} from '~position/template/app-token.template.types'; - -import { AcrossViemContractFactory } from '../contracts'; -import { AcrossPoolV2 } from '../contracts/viem'; - -export type AcrossPoolV2TokenDefinition = { - address: string; - underlyingTokenAddress: string; -}; - -export abstract class AcrossPoolV2TokenFetcher extends AppTokenTemplatePositionFetcher< - AcrossPoolV2, - DefaultAppTokenDataProps, - AcrossPoolV2TokenDefinition -> { - abstract hubAddress: string; - abstract poolDefinitions: AcrossPoolV2TokenDefinition[]; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(AcrossViemContractFactory) protected readonly contractFactory: AcrossViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.acrossPoolV2({ network: this.network, address }); - } - - async getDefinitions(): Promise { - return this.poolDefinitions; - } - - async getAddresses({ definitions }: GetAddressesParams) { - return definitions.map(v => v.address); - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [{ address: definition.underlyingTokenAddress, network: this.network }]; - } - - async getPricePerShare({ appToken, multicall }: GetPricePerShareParams) { - const hub = this.contractFactory.acrossHubPoolV2({ address: this.hubAddress, network: this.network }); - const poolInfo = await multicall.wrap(hub).read.pooledTokens([appToken.tokens[0].address]); - const reserveRaw = BigNumber.from(poolInfo[4]).add(poolInfo[3]).sub(poolInfo[5]); - const reserve = Number(reserveRaw) / 10 ** appToken.tokens[0].decimals; - return [reserve / appToken.supply]; - } - - async getLabel({ appToken }: GetDisplayPropsParams): Promise { - return getLabelFromToken(appToken.tokens[0]); - } -} diff --git a/src/apps/across/contracts/abis/across-hub-pool-v-2.json b/src/apps/across/contracts/abis/across-hub-pool-v-2.json deleted file mode 100644 index 79f539f84..000000000 --- a/src/apps/across/contracts/abis/across-hub-pool-v-2.json +++ /dev/null @@ -1,588 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "contract LpTokenFactoryInterface", "name": "_lpTokenFactory", "type": "address" }, - { "internalType": "contract FinderInterface", "name": "_finder", "type": "address" }, - { "internalType": "contract WETH9", "name": "_weth", "type": "address" }, - { "internalType": "address", "name": "_timer", "type": "address" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "newBondToken", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "newBondAmount", "type": "uint256" } - ], - "name": "BondSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "l2ChainId", "type": "uint256" }, - { "indexed": false, "internalType": "address", "name": "adapter", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "spokePool", "type": "address" } - ], - "name": "CrossChainContractsSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "poolRebalanceRoot", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "relayerRefundRoot", "type": "bytes32" }, - { "indexed": false, "internalType": "bytes32", "name": "slowRelayRoot", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "proposer", "type": "address" } - ], - "name": "EmergencyRootBundleDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "bytes32", "name": "newIdentifier", "type": "bytes32" }], - "name": "IdentifierSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "l1Token", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "lpToken", "type": "address" } - ], - "name": "L1TokenEnabledForLiquidityProvision", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "l1Token", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "lpToken", "type": "address" } - ], - "name": "L2TokenDisabledForLiquidityProvision", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "l1Token", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lpTokensMinted", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "liquidityProvider", "type": "address" } - ], - "name": "LiquidityAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "l1Token", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lpTokensBurnt", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "liquidityProvider", "type": "address" } - ], - "name": "LiquidityRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "newLiveness", "type": "uint256" }], - "name": "LivenessSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": true, "internalType": "bool", "name": "isPaused", "type": "bool" }], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint32", "name": "challengePeriodEndTimestamp", "type": "uint32" }, - { "indexed": false, "internalType": "uint8", "name": "poolRebalanceLeafCount", "type": "uint8" }, - { "indexed": false, "internalType": "uint256[]", "name": "bundleEvaluationBlockNumbers", "type": "uint256[]" }, - { "indexed": true, "internalType": "bytes32", "name": "poolRebalanceRoot", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "relayerRefundRoot", "type": "bytes32" }, - { "indexed": false, "internalType": "bytes32", "name": "slowRelayRoot", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "proposer", "type": "address" } - ], - "name": "ProposeRootBundle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "newProtocolFeeCaptureAddress", "type": "address" }, - { "indexed": true, "internalType": "uint256", "name": "newProtocolFeeCapturePct", "type": "uint256" } - ], - "name": "ProtocolFeeCaptureSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "l1Token", "type": "address" }, - { "indexed": true, "internalType": "uint256", "name": "accumulatedFees", "type": "uint256" } - ], - "name": "ProtocolFeesCapturedClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "disputer", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "requestTime", "type": "uint256" } - ], - "name": "RootBundleCanceled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "disputer", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "requestTime", "type": "uint256" } - ], - "name": "RootBundleDisputed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "groupIndex", "type": "uint256" }, - { "indexed": true, "internalType": "uint256", "name": "leafId", "type": "uint256" }, - { "indexed": true, "internalType": "uint256", "name": "chainId", "type": "uint256" }, - { "indexed": false, "internalType": "address[]", "name": "l1Tokens", "type": "address[]" }, - { "indexed": false, "internalType": "uint256[]", "name": "bundleLpFees", "type": "uint256[]" }, - { "indexed": false, "internalType": "int256[]", "name": "netSendAmounts", "type": "int256[]" }, - { "indexed": false, "internalType": "int256[]", "name": "runningBalances", "type": "int256[]" }, - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" } - ], - "name": "RootBundleExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "originChainId", "type": "uint256" }, - { "indexed": true, "internalType": "uint256", "name": "destinationChainId", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "originToken", "type": "address" }, - { "indexed": false, "internalType": "bool", "name": "depositsEnabled", "type": "bool" } - ], - "name": "SetEnableDepositRoute", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "destinationChainId", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "l1Token", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "destinationToken", "type": "address" } - ], - "name": "SetPoolRebalanceRoute", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "chainId", "type": "uint256" }, - { "indexed": false, "internalType": "bytes", "name": "message", "type": "bytes" } - ], - "name": "SpokePoolAdminFunctionTriggered", - "type": "event" - }, - { "stateMutability": "payable", "type": "fallback" }, - { - "inputs": [ - { "internalType": "address", "name": "l1Token", "type": "address" }, - { "internalType": "uint256", "name": "l1TokenAmount", "type": "uint256" } - ], - "name": "addLiquidity", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "bondAmount", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "bondToken", - "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "l1Token", "type": "address" }], - "name": "claimProtocolFeesCaptured", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "name": "crossChainContracts", - "outputs": [ - { "internalType": "address", "name": "adapter", "type": "address" }, - { "internalType": "address", "name": "spokePool", "type": "address" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "l1Token", "type": "address" }], - "name": "disableL1TokenForLiquidityProvision", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "disputeRootBundle", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "emergencyDeleteProposal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "l1Token", "type": "address" }], - "name": "enableL1TokenForLiquidityProvision", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "l1Token", "type": "address" }], - "name": "exchangeRateCurrent", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "chainId", "type": "uint256" }, - { "internalType": "uint256", "name": "groupIndex", "type": "uint256" }, - { "internalType": "uint256[]", "name": "bundleLpFees", "type": "uint256[]" }, - { "internalType": "int256[]", "name": "netSendAmounts", "type": "int256[]" }, - { "internalType": "int256[]", "name": "runningBalances", "type": "int256[]" }, - { "internalType": "uint8", "name": "leafId", "type": "uint8" }, - { "internalType": "address[]", "name": "l1Tokens", "type": "address[]" }, - { "internalType": "bytes32[]", "name": "proof", "type": "bytes32[]" } - ], - "name": "executeRootBundle", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "finder", - "outputs": [{ "internalType": "contract FinderInterface", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentTime", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "l1Token", "type": "address" }, - { "internalType": "int256", "name": "haircutAmount", "type": "int256" } - ], - "name": "haircutReserves", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "identifier", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "l1Token", "type": "address" }], - "name": "liquidityUtilizationCurrent", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "l1Token", "type": "address" }, - { "internalType": "uint256", "name": "relayedAmount", "type": "uint256" } - ], - "name": "liquidityUtilizationPostRelay", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "liveness", - "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "loadEthForL2Calls", "outputs": [], "stateMutability": "payable", "type": "function" }, - { - "inputs": [], - "name": "lpFeeRatePerSecond", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lpTokenFactory", - "outputs": [{ "internalType": "contract LpTokenFactoryInterface", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes[]", "name": "data", "type": "bytes[]" }], - "name": "multicall", - "outputs": [{ "internalType": "bytes[]", "name": "results", "type": "bytes[]" }], - "stateMutability": "payable", - "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": [ - { "internalType": "uint256", "name": "destinationChainId", "type": "uint256" }, - { "internalType": "address", "name": "l1Token", "type": "address" } - ], - "name": "poolRebalanceRoute", - "outputs": [{ "internalType": "address", "name": "destinationToken", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "pooledTokens", - "outputs": [ - { "internalType": "address", "name": "lpToken", "type": "address" }, - { "internalType": "bool", "name": "isEnabled", "type": "bool" }, - { "internalType": "uint32", "name": "lastLpFeeUpdate", "type": "uint32" }, - { "internalType": "int256", "name": "utilizedReserves", "type": "int256" }, - { "internalType": "uint256", "name": "liquidReserves", "type": "uint256" }, - { "internalType": "uint256", "name": "undistributedLpFees", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256[]", "name": "bundleEvaluationBlockNumbers", "type": "uint256[]" }, - { "internalType": "uint8", "name": "poolRebalanceLeafCount", "type": "uint8" }, - { "internalType": "bytes32", "name": "poolRebalanceRoot", "type": "bytes32" }, - { "internalType": "bytes32", "name": "relayerRefundRoot", "type": "bytes32" }, - { "internalType": "bytes32", "name": "slowRelayRoot", "type": "bytes32" } - ], - "name": "proposeRootBundle", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "protocolFeeCaptureAddress", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "protocolFeeCapturePct", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "chainId", "type": "uint256" }, - { "internalType": "bytes", "name": "functionData", "type": "bytes" } - ], - "name": "relaySpokePoolAdminFunction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "l1Token", "type": "address" }, - { "internalType": "uint256", "name": "lpTokenAmount", "type": "uint256" }, - { "internalType": "bool", "name": "sendEth", "type": "bool" } - ], - "name": "removeLiquidity", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "rootBundleProposal", - "outputs": [ - { "internalType": "bytes32", "name": "poolRebalanceRoot", "type": "bytes32" }, - { "internalType": "bytes32", "name": "relayerRefundRoot", "type": "bytes32" }, - { "internalType": "bytes32", "name": "slowRelayRoot", "type": "bytes32" }, - { "internalType": "uint256", "name": "claimedBitMap", "type": "uint256" }, - { "internalType": "address", "name": "proposer", "type": "address" }, - { "internalType": "uint8", "name": "unclaimedPoolRebalanceLeafCount", "type": "uint8" }, - { "internalType": "uint32", "name": "challengePeriodEndTimestamp", "type": "uint32" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "contract IERC20", "name": "newBondToken", "type": "address" }, - { "internalType": "uint256", "name": "newBondAmount", "type": "uint256" } - ], - "name": "setBond", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "l2ChainId", "type": "uint256" }, - { "internalType": "address", "name": "adapter", "type": "address" }, - { "internalType": "address", "name": "spokePool", "type": "address" } - ], - "name": "setCrossChainContracts", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "time", "type": "uint256" }], - "name": "setCurrentTime", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "originChainId", "type": "uint256" }, - { "internalType": "uint256", "name": "destinationChainId", "type": "uint256" }, - { "internalType": "address", "name": "originToken", "type": "address" }, - { "internalType": "bool", "name": "depositsEnabled", "type": "bool" } - ], - "name": "setDepositRoute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes32", "name": "newIdentifier", "type": "bytes32" }], - "name": "setIdentifier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint32", "name": "newLiveness", "type": "uint32" }], - "name": "setLiveness", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bool", "name": "pause", "type": "bool" }], - "name": "setPaused", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "destinationChainId", "type": "uint256" }, - { "internalType": "address", "name": "l1Token", "type": "address" }, - { "internalType": "address", "name": "destinationToken", "type": "address" } - ], - "name": "setPoolRebalanceRoute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "newProtocolFeeCaptureAddress", "type": "address" }, - { "internalType": "uint256", "name": "newProtocolFeeCapturePct", "type": "uint256" } - ], - "name": "setProtocolFeeCapture", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "l1Token", "type": "address" }], - "name": "sync", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "timerAddress", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "unclaimedAccumulatedProtocolFees", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "weth", - "outputs": [{ "internalType": "contract WETH9", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { "stateMutability": "payable", "type": "receive" } -] diff --git a/src/apps/across/contracts/abis/across-pool-v-2.json b/src/apps/across/contracts/abis/across-pool-v-2.json deleted file mode 100644 index f52047032..000000000 --- a/src/apps/across/contracts/abis/across-pool-v-2.json +++ /dev/null @@ -1,259 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "string", "name": "_tokenName", "type": "string" }, - { "internalType": "string", "name": "_tokenSymbol", "type": "string" }, - { "internalType": "uint8", "name": "_tokenDecimals", "type": "uint8" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "roleId", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "newMember", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "manager", "type": "address" } - ], - "name": "AddedSharedMember", - "type": "event" - }, - { - "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": "uint256", "name": "roleId", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "oldMember", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "manager", "type": "address" } - ], - "name": "RemovedSharedMember", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "uint256", "name": "roleId", "type": "uint256" }, - { "indexed": true, "internalType": "address", "name": "newMember", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "manager", "type": "address" } - ], - "name": "ResetExclusiveMember", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], - "name": "addBurner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "roleId", "type": "uint256" }, - { "internalType": "address", "name": "newMember", "type": "address" } - ], - "name": "addMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], - "name": "addMinter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } - ], - "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "value", "type": "uint256" }], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "burnFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } - ], - "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "roleId", "type": "uint256" }], - "name": "getMember", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "roleId", "type": "uint256" }, - { "internalType": "address", "name": "memberToCheck", "type": "address" } - ], - "name": "holdsRole", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "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": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "mint", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "roleId", "type": "uint256" }, - { "internalType": "address", "name": "memberToRemove", "type": "address" } - ], - "name": "removeMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "roleId", "type": "uint256" }], - "name": "renounceMembership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "roleId", "type": "uint256" }, - { "internalType": "address", "name": "newMember", "type": "address" } - ], - "name": "resetMember", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], - "name": "resetOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/across/contracts/viem.contract-factory.ts b/src/apps/across/contracts/viem.contract-factory.ts index 3de7608f2..335c0dcfb 100644 --- a/src/apps/across/contracts/viem.contract-factory.ts +++ b/src/apps/across/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 { AcrossHubPoolV2__factory, AcrossPoolV2__factory, AcrossStaking__factory } from './viem'; +import { AcrossStaking__factory } from './viem'; type ContractOpts = { address: string; network: Network }; @@ -11,12 +11,6 @@ type ContractOpts = { address: string; network: Network }; export class AcrossViemContractFactory { constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - acrossHubPoolV2({ address, network }: ContractOpts) { - return AcrossHubPoolV2__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - acrossPoolV2({ address, network }: ContractOpts) { - return AcrossPoolV2__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } acrossStaking({ address, network }: ContractOpts) { return AcrossStaking__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } diff --git a/src/apps/across/contracts/viem/AcrossHubPoolV2.ts b/src/apps/across/contracts/viem/AcrossHubPoolV2.ts deleted file mode 100644 index 2e4242f31..000000000 --- a/src/apps/across/contracts/viem/AcrossHubPoolV2.ts +++ /dev/null @@ -1,1368 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const acrossHubPoolV2Abi = [ - { - inputs: [ - { - internalType: 'contract LpTokenFactoryInterface', - name: '_lpTokenFactory', - type: 'address', - }, - { - internalType: 'contract FinderInterface', - name: '_finder', - type: 'address', - }, - { - internalType: 'contract WETH9', - name: '_weth', - type: 'address', - }, - { - internalType: 'address', - name: '_timer', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'newBondToken', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'newBondAmount', - type: 'uint256', - }, - ], - name: 'BondSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'l2ChainId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address', - name: 'adapter', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'spokePool', - type: 'address', - }, - ], - name: 'CrossChainContractsSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'poolRebalanceRoot', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'relayerRefundRoot', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'slowRelayRoot', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'proposer', - type: 'address', - }, - ], - name: 'EmergencyRootBundleDeleted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bytes32', - name: 'newIdentifier', - type: 'bytes32', - }, - ], - name: 'IdentifierSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'lpToken', - type: 'address', - }, - ], - name: 'L1TokenEnabledForLiquidityProvision', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: 'lpToken', - type: 'address', - }, - ], - name: 'L2TokenDisabledForLiquidityProvision', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'lpTokensMinted', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'liquidityProvider', - type: 'address', - }, - ], - name: 'LiquidityAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'lpTokensBurnt', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'liquidityProvider', - type: 'address', - }, - ], - name: 'LiquidityRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newLiveness', - type: 'uint256', - }, - ], - name: 'LivenessSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousOwner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bool', - name: 'isPaused', - type: 'bool', - }, - ], - name: 'Paused', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint32', - name: 'challengePeriodEndTimestamp', - type: 'uint32', - }, - { - indexed: false, - internalType: 'uint8', - name: 'poolRebalanceLeafCount', - type: 'uint8', - }, - { - indexed: false, - internalType: 'uint256[]', - name: 'bundleEvaluationBlockNumbers', - type: 'uint256[]', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'poolRebalanceRoot', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'relayerRefundRoot', - type: 'bytes32', - }, - { - indexed: false, - internalType: 'bytes32', - name: 'slowRelayRoot', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'proposer', - type: 'address', - }, - ], - name: 'ProposeRootBundle', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'newProtocolFeeCaptureAddress', - type: 'address', - }, - { - indexed: true, - internalType: 'uint256', - name: 'newProtocolFeeCapturePct', - type: 'uint256', - }, - ], - name: 'ProtocolFeeCaptureSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - indexed: true, - internalType: 'uint256', - name: 'accumulatedFees', - type: 'uint256', - }, - ], - name: 'ProtocolFeesCapturedClaimed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'disputer', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'requestTime', - type: 'uint256', - }, - ], - name: 'RootBundleCanceled', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'disputer', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'requestTime', - type: 'uint256', - }, - ], - name: 'RootBundleDisputed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'groupIndex', - type: 'uint256', - }, - { - indexed: true, - internalType: 'uint256', - name: 'leafId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'address[]', - name: 'l1Tokens', - type: 'address[]', - }, - { - indexed: false, - internalType: 'uint256[]', - name: 'bundleLpFees', - type: 'uint256[]', - }, - { - indexed: false, - internalType: 'int256[]', - name: 'netSendAmounts', - type: 'int256[]', - }, - { - indexed: false, - internalType: 'int256[]', - name: 'runningBalances', - type: 'int256[]', - }, - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - ], - name: 'RootBundleExecuted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'originChainId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'uint256', - name: 'destinationChainId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'originToken', - type: 'address', - }, - { - indexed: false, - internalType: 'bool', - name: 'depositsEnabled', - type: 'bool', - }, - ], - name: 'SetEnableDepositRoute', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'destinationChainId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'destinationToken', - type: 'address', - }, - ], - name: 'SetPoolRebalanceRoute', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - { - indexed: false, - internalType: 'bytes', - name: 'message', - type: 'bytes', - }, - ], - name: 'SpokePoolAdminFunctionTriggered', - type: 'event', - }, - { - stateMutability: 'payable', - type: 'fallback', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'l1TokenAmount', - type: 'uint256', - }, - ], - name: 'addLiquidity', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'bondAmount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'bondToken', - outputs: [ - { - internalType: 'contract IERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - ], - name: 'claimProtocolFeesCaptured', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'crossChainContracts', - outputs: [ - { - internalType: 'address', - name: 'adapter', - type: 'address', - }, - { - internalType: 'address', - name: 'spokePool', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - ], - name: 'disableL1TokenForLiquidityProvision', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'disputeRootBundle', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'emergencyDeleteProposal', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - ], - name: 'enableL1TokenForLiquidityProvision', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - ], - name: 'exchangeRateCurrent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'groupIndex', - type: 'uint256', - }, - { - internalType: 'uint256[]', - name: 'bundleLpFees', - type: 'uint256[]', - }, - { - internalType: 'int256[]', - name: 'netSendAmounts', - type: 'int256[]', - }, - { - internalType: 'int256[]', - name: 'runningBalances', - type: 'int256[]', - }, - { - internalType: 'uint8', - name: 'leafId', - type: 'uint8', - }, - { - internalType: 'address[]', - name: 'l1Tokens', - type: 'address[]', - }, - { - internalType: 'bytes32[]', - name: 'proof', - type: 'bytes32[]', - }, - ], - name: 'executeRootBundle', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'finder', - outputs: [ - { - internalType: 'contract FinderInterface', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getCurrentTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - internalType: 'int256', - name: 'haircutAmount', - type: 'int256', - }, - ], - name: 'haircutReserves', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'identifier', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - ], - name: 'liquidityUtilizationCurrent', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'relayedAmount', - type: 'uint256', - }, - ], - name: 'liquidityUtilizationPostRelay', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'liveness', - outputs: [ - { - internalType: 'uint32', - name: '', - type: 'uint32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'loadEthForL2Calls', - outputs: [], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'lpFeeRatePerSecond', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lpTokenFactory', - outputs: [ - { - internalType: 'contract LpTokenFactoryInterface', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes[]', - name: 'data', - type: 'bytes[]', - }, - ], - name: 'multicall', - outputs: [ - { - internalType: 'bytes[]', - name: 'results', - type: 'bytes[]', - }, - ], - stateMutability: 'payable', - 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: [ - { - internalType: 'uint256', - name: 'destinationChainId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - ], - name: 'poolRebalanceRoute', - outputs: [ - { - internalType: 'address', - name: 'destinationToken', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'pooledTokens', - outputs: [ - { - internalType: 'address', - name: 'lpToken', - type: 'address', - }, - { - internalType: 'bool', - name: 'isEnabled', - type: 'bool', - }, - { - internalType: 'uint32', - name: 'lastLpFeeUpdate', - type: 'uint32', - }, - { - internalType: 'int256', - name: 'utilizedReserves', - type: 'int256', - }, - { - internalType: 'uint256', - name: 'liquidReserves', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'undistributedLpFees', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: 'bundleEvaluationBlockNumbers', - type: 'uint256[]', - }, - { - internalType: 'uint8', - name: 'poolRebalanceLeafCount', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'poolRebalanceRoot', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'relayerRefundRoot', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'slowRelayRoot', - type: 'bytes32', - }, - ], - name: 'proposeRootBundle', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'protocolFeeCaptureAddress', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'protocolFeeCapturePct', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'chainId', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'functionData', - type: 'bytes', - }, - ], - name: 'relaySpokePoolAdminFunction', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'lpTokenAmount', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'sendEth', - type: 'bool', - }, - ], - name: 'removeLiquidity', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'rootBundleProposal', - outputs: [ - { - internalType: 'bytes32', - name: 'poolRebalanceRoot', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'relayerRefundRoot', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 'slowRelayRoot', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'claimedBitMap', - type: 'uint256', - }, - { - internalType: 'address', - name: 'proposer', - type: 'address', - }, - { - internalType: 'uint8', - name: 'unclaimedPoolRebalanceLeafCount', - type: 'uint8', - }, - { - internalType: 'uint32', - name: 'challengePeriodEndTimestamp', - type: 'uint32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20', - name: 'newBondToken', - type: 'address', - }, - { - internalType: 'uint256', - name: 'newBondAmount', - type: 'uint256', - }, - ], - name: 'setBond', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'l2ChainId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'adapter', - type: 'address', - }, - { - internalType: 'address', - name: 'spokePool', - type: 'address', - }, - ], - name: 'setCrossChainContracts', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'time', - type: 'uint256', - }, - ], - name: 'setCurrentTime', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'originChainId', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'destinationChainId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'originToken', - type: 'address', - }, - { - internalType: 'bool', - name: 'depositsEnabled', - type: 'bool', - }, - ], - name: 'setDepositRoute', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'newIdentifier', - type: 'bytes32', - }, - ], - name: 'setIdentifier', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint32', - name: 'newLiveness', - type: 'uint32', - }, - ], - name: 'setLiveness', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: 'pause', - type: 'bool', - }, - ], - name: 'setPaused', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'destinationChainId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - { - internalType: 'address', - name: 'destinationToken', - type: 'address', - }, - ], - name: 'setPoolRebalanceRoute', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newProtocolFeeCaptureAddress', - type: 'address', - }, - { - internalType: 'uint256', - name: 'newProtocolFeeCapturePct', - type: 'uint256', - }, - ], - name: 'setProtocolFeeCapture', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'l1Token', - type: 'address', - }, - ], - name: 'sync', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'timerAddress', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'unclaimedAccumulatedProtocolFees', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'weth', - outputs: [ - { - internalType: 'contract WETH9', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - stateMutability: 'payable', - type: 'receive', - }, -] as const; - -export type AcrossHubPoolV2 = typeof acrossHubPoolV2Abi; -export type AcrossHubPoolV2Contract = GetContractReturnType; - -export class AcrossHubPoolV2__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: acrossHubPoolV2Abi, publicClient: client }); - } -} diff --git a/src/apps/across/contracts/viem/AcrossPoolV2.ts b/src/apps/across/contracts/viem/AcrossPoolV2.ts deleted file mode 100644 index 4227ef6c5..000000000 --- a/src/apps/across/contracts/viem/AcrossPoolV2.ts +++ /dev/null @@ -1,592 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const acrossPoolV2Abi = [ - { - inputs: [ - { - internalType: 'string', - name: '_tokenName', - type: 'string', - }, - { - internalType: 'string', - name: '_tokenSymbol', - type: 'string', - }, - { - internalType: 'uint8', - name: '_tokenDecimals', - type: 'uint8', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'roleId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'newMember', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'manager', - type: 'address', - }, - ], - name: 'AddedSharedMember', - type: 'event', - }, - { - 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: 'uint256', - name: 'roleId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'oldMember', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'manager', - type: 'address', - }, - ], - name: 'RemovedSharedMember', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'uint256', - name: 'roleId', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'newMember', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'manager', - type: 'address', - }, - ], - name: 'ResetExclusiveMember', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'addBurner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'roleId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'newMember', - type: 'address', - }, - ], - name: 'addMember', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'addMinter', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'burn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'burnFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'roleId', - type: 'uint256', - }, - ], - name: 'getMember', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'roleId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'memberToCheck', - type: 'address', - }, - ], - name: 'holdsRole', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - 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: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'mint', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'roleId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'memberToRemove', - type: 'address', - }, - ], - name: 'removeMember', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'roleId', - type: 'uint256', - }, - ], - name: 'renounceMembership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'roleId', - type: 'uint256', - }, - { - internalType: 'address', - name: 'newMember', - type: 'address', - }, - ], - name: 'resetMember', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'resetOwner', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type AcrossPoolV2 = typeof acrossPoolV2Abi; -export type AcrossPoolV2Contract = GetContractReturnType; - -export class AcrossPoolV2__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: acrossPoolV2Abi, publicClient: client }); - } -} diff --git a/src/apps/across/contracts/viem/index.ts b/src/apps/across/contracts/viem/index.ts index d486dbf82..1c33e587a 100644 --- a/src/apps/across/contracts/viem/index.ts +++ b/src/apps/across/contracts/viem/index.ts @@ -2,10 +2,6 @@ /* tslint:disable */ /* eslint-disable */ -export type { AcrossHubPoolV2 } from './AcrossHubPoolV2'; -export type { AcrossPoolV2 } from './AcrossPoolV2'; export type { AcrossStaking } from './AcrossStaking'; -export { AcrossHubPoolV2__factory } from './AcrossHubPoolV2'; -export { AcrossPoolV2__factory } from './AcrossPoolV2'; export { AcrossStaking__factory } from './AcrossStaking'; diff --git a/src/apps/across/ethereum/across.pool-v2.token-fetcher.ts b/src/apps/across/ethereum/across.pool-v2.token-fetcher.ts deleted file mode 100644 index cfb362cf0..000000000 --- a/src/apps/across/ethereum/across.pool-v2.token-fetcher.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { AcrossPoolV2TokenFetcher } from '../common/across.pool-v2.token-fetcher'; - -@PositionTemplate() -export class EthereumAcrossPoolV2TokenFetcher extends AcrossPoolV2TokenFetcher { - groupLabel = 'Pools V2'; - hubAddress = '0xc186fa914353c44b2e33ebe05f21846f1048beda'; - - poolDefinitions = [ - { - address: '0x28f77208728b0a45cab24c4868334581fe86f95b', - underlyingTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', // ETH/WETH - }, - { - address: '0xc9b09405959f63f72725828b5d449488b02be1ca', - underlyingTokenAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // UDSC - }, - { - address: '0x4fabacac8c41466117d6a38f46d08ddd4948a0cb', - underlyingTokenAddress: '0x6b175474e89094c44da98b954eedeac495271d0f', // DAI - }, - { - address: '0x59c1427c658e97a7d568541dac780b2e5c8affb4', - underlyingTokenAddress: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', // WBTC - }, - { - address: '0x9306b6f45263f8cb6a18eff127313d10d06fccb5', - underlyingTokenAddress: '0x42bbfa2e77757c645eeaad1655e0911a7553efbc', // BOBA - }, - { - address: '0xb9921d28466304103a233fcd071833e498f12853', - underlyingTokenAddress: '0x04fa0d235c4abf4bcf4787af4cf447de572ef828', // UMA - }, - { - address: '0xb0c8fef534223b891d4a430e49537143829c4817', - underlyingTokenAddress: '0x44108f0223a3c3028f5fe7aec7f9bb2e66bef82f', // ACX - }, - { - address: '0xfacd2ec4647df2cb758f684c2aaab56a93288f9e', - underlyingTokenAddress: '0xba100000625a3754423978a60c9317c58a424e3d', // BALANCER - }, - ]; -} diff --git a/src/apps/angle/angle.module.ts b/src/apps/angle/angle.module.ts index 5b38167b1..b0fa9a3f9 100644 --- a/src/apps/angle/angle.module.ts +++ b/src/apps/angle/angle.module.ts @@ -5,7 +5,6 @@ import { AbstractApp } from '~app/app.dynamic-module'; import { ArbitrumAngleVaultsContractPositionFetcher } from './arbitrum/angle.vault.contract-position-fetcher'; import { AnglePositionResolver } from './common/angle.position-resolver'; import { AngleViemContractFactory } from './contracts'; -import { EthereumAngleSanTokenTokenFetcher } from './ethereum/angle.san-token.token-fetcher'; import { EthereumAngleVaultsContractPositionFetcher } from './ethereum/angle.vault.contract-position-fetcher'; import { EthereumAngleVeAngleContractPositionFetcher } from './ethereum/angle.voting-escrow.contract-position-fetcher'; @@ -16,7 +15,6 @@ import { EthereumAngleVeAngleContractPositionFetcher } from './ethereum/angle.vo // Arbitrum ArbitrumAngleVaultsContractPositionFetcher, // Ethereum - EthereumAngleSanTokenTokenFetcher, EthereumAngleVeAngleContractPositionFetcher, EthereumAngleVaultsContractPositionFetcher, ], diff --git a/src/apps/angle/contracts/abis/angle-san-token.json b/src/apps/angle/contracts/abis/angle-san-token.json deleted file mode 100644 index 00f863321..000000000 --- a/src/apps/angle/contracts/abis/angle-san-token.json +++ /dev/null @@ -1,218 +0,0 @@ -[ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } - ], - "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "address", "name": "burner", "type": "address" }, - { "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "burnFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], - "name": "burnNoRedeem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "address", "name": "burner", "type": "address" } - ], - "name": "burnSelf", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimal", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "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": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "addedValue", "type": "uint256" } - ], - "name": "increaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "string", "name": "name_", "type": "string" }, - { "internalType": "string", "name": "symbol_", "type": "string" }, - { "internalType": "address", "name": "_poolManager", "type": "address" } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], - "name": "nonces", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "poolManager", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "stableMaster", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sender", "type": "address" }, - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/angle/contracts/viem.contract-factory.ts b/src/apps/angle/contracts/viem.contract-factory.ts index 81ec469fe..adf10b29a 100644 --- a/src/apps/angle/contracts/viem.contract-factory.ts +++ b/src/apps/angle/contracts/viem.contract-factory.ts @@ -7,7 +7,6 @@ import { AngleLiquidityGauge__factory, AnglePerpetualManager__factory, AnglePoolManager__factory, - AngleSanToken__factory, AngleStablemaster__factory, AngleVaultManager__factory, AngleVeAngle__factory, @@ -28,9 +27,6 @@ export class AngleViemContractFactory { anglePoolManager({ address, network }: ContractOpts) { return AnglePoolManager__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } - angleSanToken({ address, network }: ContractOpts) { - return AngleSanToken__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } angleStablemaster({ address, network }: ContractOpts) { return AngleStablemaster__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } diff --git a/src/apps/angle/contracts/viem/AngleSanToken.ts b/src/apps/angle/contracts/viem/AngleSanToken.ts deleted file mode 100644 index c854e4057..000000000 --- a/src/apps/angle/contracts/viem/AngleSanToken.ts +++ /dev/null @@ -1,500 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const angleSanTokenAbi = [ - { - inputs: [], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'burner', - type: 'address', - }, - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'burnFrom', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'burnNoRedeem', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'burner', - type: 'address', - }, - ], - name: 'burnSelf', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimal', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - 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: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'addedValue', - type: 'uint256', - }, - ], - name: 'increaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'string', - name: 'name_', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol_', - type: 'string', - }, - { - internalType: 'address', - name: '_poolManager', - type: 'address', - }, - ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'mint', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'nonces', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, - ], - name: 'permit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'poolManager', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'stableMaster', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type AngleSanToken = typeof angleSanTokenAbi; -export type AngleSanTokenContract = GetContractReturnType; - -export class AngleSanToken__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: angleSanTokenAbi, publicClient: client }); - } -} diff --git a/src/apps/angle/contracts/viem/index.ts b/src/apps/angle/contracts/viem/index.ts index 7971d6f76..0c283002d 100644 --- a/src/apps/angle/contracts/viem/index.ts +++ b/src/apps/angle/contracts/viem/index.ts @@ -5,7 +5,6 @@ export type { AngleLiquidityGauge } from './AngleLiquidityGauge'; export type { AnglePerpetualManager } from './AnglePerpetualManager'; export type { AnglePoolManager } from './AnglePoolManager'; -export type { AngleSanToken } from './AngleSanToken'; export type { AngleStablemaster } from './AngleStablemaster'; export type { AngleVaultManager } from './AngleVaultManager'; export type { AngleVeAngle } from './AngleVeAngle'; @@ -13,7 +12,6 @@ export type { AngleVeAngle } from './AngleVeAngle'; export { AngleLiquidityGauge__factory } from './AngleLiquidityGauge'; export { AnglePerpetualManager__factory } from './AnglePerpetualManager'; export { AnglePoolManager__factory } from './AnglePoolManager'; -export { AngleSanToken__factory } from './AngleSanToken'; export { AngleStablemaster__factory } from './AngleStablemaster'; export { AngleVaultManager__factory } from './AngleVaultManager'; export { AngleVeAngle__factory } from './AngleVeAngle'; diff --git a/src/apps/angle/ethereum/angle.san-token.token-fetcher.ts b/src/apps/angle/ethereum/angle.san-token.token-fetcher.ts deleted file mode 100644 index 2575334e3..000000000 --- a/src/apps/angle/ethereum/angle.san-token.token-fetcher.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - DefaultAppTokenDataProps, - DefaultAppTokenDefinition, - GetDisplayPropsParams, - GetPricePerShareParams, - GetUnderlyingTokensParams, -} from '~position/template/app-token.template.types'; - -import { AngleViemContractFactory } from '../contracts'; -import { AngleSanToken } from '../contracts/viem'; - -@PositionTemplate() -export class EthereumAngleSanTokenTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'Yield Bearing'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(AngleViemContractFactory) protected readonly contractFactory: AngleViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.angleSanToken({ address, network: this.network }); - } - - async getAddresses() { - // https://raw.githubusercontent.com/AngleProtocol/angle-token-list/main/ERC20_LIST.json - return [ - '0x9c215206da4bf108ae5aeef9da7cad3352a36dad', - '0x30c955906735e48d73080fd20cb488518a6333c8', - '0x5d8d3ac6d21c016f9c935030480b7057b21ec804', - '0xb3b209bb213a5da5b947c56f2c770b3e1015f1fe', - '0x7b8e89b0ce7bac2cfec92a371da899ea8cbdb450', - ]; - } - - async getUnderlyingTokenDefinitions({ contract, multicall }: GetUnderlyingTokensParams) { - const [stableMasterAddress, poolManagerAddress] = await Promise.all([ - contract.read.stableMaster(), - contract.read.poolManager(), - ]); - - const stableMaster = this.contractFactory.angleStablemaster({ - address: stableMasterAddress, - network: this.network, - }); - - const collateralMap = await multicall.wrap(stableMaster).read.collateralMap([poolManagerAddress]); - return [{ address: collateralMap[0], network: this.network }]; - } - - async getPricePerShare({ contract, multicall }: GetPricePerShareParams) { - const [stableMasterAddress, poolManagerAddress] = await Promise.all([ - contract.read.stableMaster(), - contract.read.poolManager(), - ]); - - const stableMaster = this.contractFactory.angleStablemaster({ - address: stableMasterAddress, - network: this.network, - }); - - const collateralMap = await multicall.wrap(stableMaster).read.collateralMap([poolManagerAddress]); - const pricePerShare = Number(collateralMap[5]) / 10 ** 18; - - return [pricePerShare]; - } - - async getLabel({ - appToken, - }: GetDisplayPropsParams): Promise { - return `san${getLabelFromToken(appToken.tokens[0])} / EUR`; - } -} diff --git a/src/apps/beanstalk/beanstalk.module.ts b/src/apps/beanstalk/beanstalk.module.ts index d7a4596af..5c0af4f1b 100644 --- a/src/apps/beanstalk/beanstalk.module.ts +++ b/src/apps/beanstalk/beanstalk.module.ts @@ -6,7 +6,6 @@ import { BeanstalkBalanceResolver } from './common/beanstalk.balance-resolver'; import { BeanstalkViemContractFactory } from './contracts'; import { EthereumBeanstalkSiloDepositContractPositionFetcher } from './ethereum/beanstalk.silo-deposit.contract-position-fetcher'; import { EthereumBeanstalkSiloEarnedContractPositionFetcher } from './ethereum/beanstalk.silo-earned.contract-position-fetcher'; -import { EthereumBeanstalkUnripeAssetsTokenFetcher } from './ethereum/beanstalk.unripe-assets.token-fetcher'; @Module({ providers: [ @@ -14,7 +13,6 @@ import { EthereumBeanstalkUnripeAssetsTokenFetcher } from './ethereum/beanstalk. BeanstalkBalanceResolver, EthereumBeanstalkSiloDepositContractPositionFetcher, EthereumBeanstalkSiloEarnedContractPositionFetcher, - EthereumBeanstalkUnripeAssetsTokenFetcher, ], }) export class BeanstalkAppModule extends AbstractApp() {} diff --git a/src/apps/beanstalk/ethereum/beanstalk.unripe-assets.token-fetcher.ts b/src/apps/beanstalk/ethereum/beanstalk.unripe-assets.token-fetcher.ts deleted file mode 100644 index 7335dbc15..000000000 --- a/src/apps/beanstalk/ethereum/beanstalk.unripe-assets.token-fetcher.ts +++ /dev/null @@ -1,74 +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 { - GetAddressesParams, - GetUnderlyingTokensParams, - DefaultAppTokenDataProps, - GetPricePerShareParams, -} from '~position/template/app-token.template.types'; - -import { BeanstalkViemContractFactory } from '../contracts'; -import { BeanstalkToken } from '../contracts/viem'; - -export type BeanstalkUnripeAssetsTokenDefinition = { - address: string; - underlyingTokenAddress: string; -}; - -@PositionTemplate() -export class EthereumBeanstalkUnripeAssetsTokenFetcher extends AppTokenTemplatePositionFetcher< - BeanstalkToken, - DefaultAppTokenDataProps, - BeanstalkUnripeAssetsTokenDefinition -> { - groupLabel = 'Unripe Assets'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(BeanstalkViemContractFactory) private readonly contractFactory: BeanstalkViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.beanstalkToken({ address, network: this.network }); - } - - async getDefinitions(): Promise { - return [ - { - address: '0x1bea0050e63e05fbb5d8ba2f10cf5800b6224449', // urBEAN - underlyingTokenAddress: '0xbea0000029ad1c77d3d5d23ba2d8893db9d1efab', // BEAN - }, - { - address: '0x1bea3ccd22f4ebd3d37d731ba31eeca95713716d', // urBEAN3CRVLP - underlyingTokenAddress: '0xc9c32cd16bf7efb85ff14e0c8603cc90f6f2ee49', // BEAN3CRVLP - }, - ]; - } - - async getAddresses({ definitions }: GetAddressesParams): Promise { - return definitions.map(v => v.address); - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [{ address: definition.underlyingTokenAddress, network: this.network }]; - } - - async getPricePerShare({ appToken, multicall }: GetPricePerShareParams) { - const beanstalkContract = this.contractFactory.beanstalk({ - address: '0xc1e088fc1323b20bcbee9bd1b9fc9546db5624c5', - network: this.network, - }); - - const rateRaw = await multicall.wrap(beanstalkContract).read.getPercentPenalty([appToken.address]); - const rate = Number(rateRaw) / 10 ** 6; - - return [rate]; - } -} diff --git a/src/apps/clearpool/assets/logo.png b/src/apps/clearpool/assets/logo.png deleted file mode 100644 index 88ba1e327..000000000 Binary files a/src/apps/clearpool/assets/logo.png and /dev/null differ diff --git a/src/apps/clearpool/clearpool.module.ts b/src/apps/clearpool/clearpool.module.ts deleted file mode 100644 index 5b8b03cff..000000000 --- a/src/apps/clearpool/clearpool.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Module } from '@nestjs/common'; - -import { AbstractApp } from '~app/app.dynamic-module'; - -import { ClearpoolPoolDefinitionsResolver } from './common/clearpool.pool-definition-resolver'; -import { ClearpoolViemContractFactory } from './contracts'; -import { EthereumClearpoolPoolTokenFetcher } from './ethereum/clearpool.pool.token-fetcher'; -import { PolygonClearpoolPoolTokenFetcher } from './polygon/clearpool.pool.token-fetcher'; - -@Module({ - providers: [ - ClearpoolViemContractFactory, - ClearpoolPoolDefinitionsResolver, - // Ethereum - EthereumClearpoolPoolTokenFetcher, - // Polygon - PolygonClearpoolPoolTokenFetcher, - ], -}) -export class ClearpoolAppModule extends AbstractApp() {} diff --git a/src/apps/clearpool/common/clearpool.pool-definition-resolver.ts b/src/apps/clearpool/common/clearpool.pool-definition-resolver.ts deleted file mode 100644 index 2dc83948b..000000000 --- a/src/apps/clearpool/common/clearpool.pool-definition-resolver.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Injectable } from '@nestjs/common'; -import Axios from 'axios'; - -import { Cache } from '~cache/cache.decorator'; -import { Network, NETWORK_IDS } from '~types/network.interface'; - -export type ClearpoolApiPoolResponse = { - address: string; - currencyName: string; - currencyAddress: string; - borrowerName: string; - poolSize: string; - utilization: string; - cpoolAPR: number; - supplyAPR: number; - APR: number; -}[]; - -@Injectable() -export class ClearpoolPoolDefinitionsResolver { - @Cache({ - key: network => `studio:clearpool:${network}:pool-data`, - ttl: 5 * 60, // 60 minutes - }) - private async getPoolDefinitionsData(network: Network) { - const { data } = await Axios.get( - `https://app.clearpool.finance/api/${NETWORK_IDS[network]}/pools`, - ); - return data; - } - - async getPoolDefinitions(network: Network) { - const definitionsData = await this.getPoolDefinitionsData(network); - - return definitionsData.map(x => x.address.toLowerCase()); - } -} diff --git a/src/apps/clearpool/common/clearpool.pool.token-fetcher.ts b/src/apps/clearpool/common/clearpool.pool.token-fetcher.ts deleted file mode 100644 index 7b13d7b44..000000000 --- a/src/apps/clearpool/common/clearpool.pool.token-fetcher.ts +++ /dev/null @@ -1,57 +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 { - GetDataPropsParams, - GetDisplayPropsParams, - GetPricePerShareParams, - GetUnderlyingTokensParams, -} from '~position/template/app-token.template.types'; - -import { ClearpoolViemContractFactory } from '../contracts'; -import { ClearpoolPool } from '../contracts/viem'; - -import { ClearpoolPoolDefinitionsResolver } from './clearpool.pool-definition-resolver'; - -export abstract class ClearpoolPoolTokenFetcher extends AppTokenTemplatePositionFetcher { - constructor( - @Inject(APP_TOOLKIT) protected appToolkit: IAppToolkit, - @Inject(ClearpoolViemContractFactory) protected clearpoolContractFactory: ClearpoolViemContractFactory, - @Inject(ClearpoolPoolDefinitionsResolver) - protected poolDefinitionResolver: ClearpoolPoolDefinitionsResolver, - ) { - super(appToolkit); - } - - async getAddresses() { - return this.poolDefinitionResolver.getPoolDefinitions(this.network); - } - - getContract(address: string) { - return this.clearpoolContractFactory.clearpoolPool({ address, network: this.network }); - } - - async getUnderlyingTokenDefinitions({ contract }: GetUnderlyingTokensParams) { - return [{ address: await contract.read.currency(), network: this.network }]; - } - - async getPricePerShare({ contract }: GetPricePerShareParams) { - return contract.read.getCurrentExchangeRate().then(v => [Number(v) / 10 ** 18]); - } - - async getLiquidity({ appToken, contract }: GetDataPropsParams) { - const poolSizeRaw = await contract.read.poolSize(); - const reserve = Number(poolSizeRaw) / 10 ** 6; - return reserve * appToken.tokens[0].price; - } - - async getReserves({ contract }: GetDataPropsParams) { - const poolSizeRaw = await contract.read.poolSize(); - return [Number(poolSizeRaw) / 10 ** 6]; - } - - getLabel({ contract }: GetDisplayPropsParams) { - return contract.read.name(); - } -} diff --git a/src/apps/clearpool/contracts/abis/clearpool-pool.json b/src/apps/clearpool/contracts/abis/clearpool-pool.json deleted file mode 100644 index 0d2975950..000000000 --- a/src/apps/clearpool/contracts/abis/clearpool-pool.json +++ /dev/null @@ -1,1195 +0,0 @@ -[ - { - "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": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "Borrowed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "Closed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "currencyAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "Provided", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "redeemer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "currencyAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "Redeemed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Repaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "newRewardPerSecond", - "type": "uint256" - } - ], - "name": "RewardPerSecondSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "RewardWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "accumulativeRewardOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "allowWithdrawalAfterNoAuction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "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": "availableToBorrow", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "availableToWithdraw", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "borrow", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "borrows", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "cash", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "close", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "currency", - "outputs": [ - { - "internalType": "contract IERC20Upgradeable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "debtClaimed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "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": [], - "name": "enteredProvisionalDefault", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "enteredZeroUtilization", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "factory", - "outputs": [ - { - "internalType": "contract IPoolFactory", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "forceDefault", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getBorrowRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCurrentExchangeRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSupplyRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getUtilizationRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "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": [ - { - "internalType": "address", - "name": "manager_", - "type": "address" - }, - { - "internalType": "contract IERC20Upgradeable", - "name": "currency_", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "insurance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "insuranceFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "interest", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "interestRateModel", - "outputs": [ - { - "internalType": "contract IInterestRateModel", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "lastAccrual", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxInactivePeriod", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "ownerOfDebt", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "periodToStartAuction", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolSize", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "principal", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "processAuctionStart", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "processDebtClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currencyAmount", - "type": "uint256" - } - ], - "name": "provide", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currencyAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "provideWithPermit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "provisionalDefaultUtilization", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "redeem", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currencyAmount", - "type": "uint256" - } - ], - "name": "redeemCurrency", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "closeNow", - "type": "bool" - } - ], - "name": "repay", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "reserveFactor", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "reserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "rewardPerSecond", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "insuranceFactor_", - "type": "uint256" - } - ], - "name": "setInsuranceFactor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IInterestRateModel", - "name": "interestRateModel_", - "type": "address" - } - ], - "name": "setInterestRateModel", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "manager_", - "type": "address" - } - ], - "name": "setManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxInactivePeriod_", - "type": "uint256" - } - ], - "name": "setMaxInactivePeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "periodToStartAuction_", - "type": "uint256" - } - ], - "name": "setPeriodToStartAuction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "provisionalDefaultUtilization_", - "type": "uint256" - } - ], - "name": "setProvisionalDefaultUtilization", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "reserveFactor_", - "type": "uint256" - } - ], - "name": "setReserveFactor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "rewardPerSecond_", - "type": "uint256" - } - ], - "name": "setRewardPerSecond", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "symbol_", - "type": "string" - } - ], - "name": "setSymbol", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "warningGracePeriod_", - "type": "uint256" - } - ], - "name": "setWarningGracePeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "warningUtilization_", - "type": "uint256" - } - ], - "name": "setWarningUtilization", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "state", - "outputs": [ - { - "internalType": "enum PoolBaseInfo.State", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "transferReserves", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "warningGracePeriod", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "warningUtilization", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "withdrawReward", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "withdrawableRewardOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "withdrawnRewardOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/clearpool/contracts/index.ts b/src/apps/clearpool/contracts/index.ts deleted file mode 100644 index 5dcfebdf6..000000000 --- a/src/apps/clearpool/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/clearpool/contracts/viem.contract-factory.ts b/src/apps/clearpool/contracts/viem.contract-factory.ts deleted file mode 100644 index 7f2c3ff1a..000000000 --- a/src/apps/clearpool/contracts/viem.contract-factory.ts +++ /dev/null @@ -1,17 +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 { ClearpoolPool__factory } from './viem'; - -type ContractOpts = { address: string; network: Network }; - -@Injectable() -export class ClearpoolViemContractFactory { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - clearpoolPool({ address, network }: ContractOpts) { - return ClearpoolPool__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } -} diff --git a/src/apps/clearpool/contracts/viem/ClearpoolPool.ts b/src/apps/clearpool/contracts/viem/ClearpoolPool.ts deleted file mode 100644 index cd8e80c8a..000000000 --- a/src/apps/clearpool/contracts/viem/ClearpoolPool.ts +++ /dev/null @@ -1,1209 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const clearpoolPoolAbi = [ - { - 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: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - indexed: true, - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'Borrowed', - type: 'event', - }, - { - anonymous: false, - inputs: [], - name: 'Closed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'provider', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'currencyAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'tokens', - type: 'uint256', - }, - ], - name: 'Provided', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'redeemer', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'currencyAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'tokens', - type: 'uint256', - }, - ], - name: 'Redeemed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'Repaid', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'newRewardPerSecond', - type: 'uint256', - }, - ], - name: 'RewardPerSecondSet', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'RewardWithdrawn', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'accumulativeRewardOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'allowWithdrawalAfterNoAuction', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - 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: 'availableToBorrow', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'availableToWithdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'borrow', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'borrows', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'cash', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'close', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'currency', - outputs: [ - { - internalType: 'contract IERC20Upgradeable', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'debtClaimed', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - 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: [], - name: 'enteredProvisionalDefault', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'enteredZeroUtilization', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'factory', - outputs: [ - { - internalType: 'contract IPoolFactory', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'forceDefault', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getBorrowRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getCurrentExchangeRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getSupplyRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getUtilizationRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - 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: [ - { - internalType: 'address', - name: 'manager_', - type: 'address', - }, - { - internalType: 'contract IERC20Upgradeable', - name: 'currency_', - type: 'address', - }, - ], - name: 'initialize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'insurance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'insuranceFactor', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'interest', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'interestRateModel', - outputs: [ - { - internalType: 'contract IInterestRateModel', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'lastAccrual', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'manager', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maxInactivePeriod', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'ownerOfDebt', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'periodToStartAuction', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'poolSize', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'principal', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'processAuctionStart', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'processDebtClaim', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'currencyAmount', - type: 'uint256', - }, - ], - name: 'provide', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'currencyAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, - ], - name: 'provideWithPermit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'provisionalDefaultUtilization', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokens', - type: 'uint256', - }, - ], - name: 'redeem', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'currencyAmount', - type: 'uint256', - }, - ], - name: 'redeemCurrency', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'closeNow', - type: 'bool', - }, - ], - name: 'repay', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'reserveFactor', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'reserves', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'rewardPerSecond', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'insuranceFactor_', - type: 'uint256', - }, - ], - name: 'setInsuranceFactor', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IInterestRateModel', - name: 'interestRateModel_', - type: 'address', - }, - ], - name: 'setInterestRateModel', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'manager_', - type: 'address', - }, - ], - name: 'setManager', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'maxInactivePeriod_', - type: 'uint256', - }, - ], - name: 'setMaxInactivePeriod', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'periodToStartAuction_', - type: 'uint256', - }, - ], - name: 'setPeriodToStartAuction', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'provisionalDefaultUtilization_', - type: 'uint256', - }, - ], - name: 'setProvisionalDefaultUtilization', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'reserveFactor_', - type: 'uint256', - }, - ], - name: 'setReserveFactor', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'rewardPerSecond_', - type: 'uint256', - }, - ], - name: 'setRewardPerSecond', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'string', - name: 'symbol_', - type: 'string', - }, - ], - name: 'setSymbol', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'warningGracePeriod_', - type: 'uint256', - }, - ], - name: 'setWarningGracePeriod', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'warningUtilization_', - type: 'uint256', - }, - ], - name: 'setWarningUtilization', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'state', - outputs: [ - { - internalType: 'enum PoolBaseInfo.State', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'transferReserves', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'version', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [], - name: 'warningGracePeriod', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'warningUtilization', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'withdrawReward', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'withdrawableRewardOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'withdrawnRewardOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type ClearpoolPool = typeof clearpoolPoolAbi; -export type ClearpoolPoolContract = GetContractReturnType; - -export class ClearpoolPool__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: clearpoolPoolAbi, publicClient: client }); - } -} diff --git a/src/apps/clearpool/contracts/viem/index.ts b/src/apps/clearpool/contracts/viem/index.ts deleted file mode 100644 index 3aba269c5..000000000 --- a/src/apps/clearpool/contracts/viem/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -export type { ClearpoolPool } from './ClearpoolPool'; - -export { ClearpoolPool__factory } from './ClearpoolPool'; diff --git a/src/apps/clearpool/ethereum/clearpool.pool.token-fetcher.ts b/src/apps/clearpool/ethereum/clearpool.pool.token-fetcher.ts deleted file mode 100644 index ab531f3ac..000000000 --- a/src/apps/clearpool/ethereum/clearpool.pool.token-fetcher.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { ClearpoolPoolTokenFetcher } from '../common/clearpool.pool.token-fetcher'; - -@PositionTemplate() -export class EthereumClearpoolPoolTokenFetcher extends ClearpoolPoolTokenFetcher { - groupLabel = 'Pool'; -} diff --git a/src/apps/clearpool/polygon/clearpool.pool.token-fetcher.ts b/src/apps/clearpool/polygon/clearpool.pool.token-fetcher.ts deleted file mode 100644 index e7a7a84ec..000000000 --- a/src/apps/clearpool/polygon/clearpool.pool.token-fetcher.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { ClearpoolPoolTokenFetcher } from '../common/clearpool.pool.token-fetcher'; - -@PositionTemplate() -export class PolygonClearpoolPoolTokenFetcher extends ClearpoolPoolTokenFetcher { - groupLabel = 'Pool'; -} diff --git a/src/apps/dystopia/dystopia.module.ts b/src/apps/dystopia/dystopia.module.ts index b24a121a2..47c6f34b4 100644 --- a/src/apps/dystopia/dystopia.module.ts +++ b/src/apps/dystopia/dystopia.module.ts @@ -4,13 +4,11 @@ import { AbstractApp } from '~app/app.dynamic-module'; import { DystopiaViemContractFactory } from './contracts'; import { PolygonDystopiaStakingContractPositionFetcher } from './polygon/dystopia.farm.contract-position-fetcher'; -import { PolygonDystopiaPairsTokenFetcher } from './polygon/dystopia.pool.token-fetcher'; import { PolygonDystopiaVotingEscrowContractPositionFetcher } from './polygon/dystopia.voting-escrow.contract-position-fetcher'; @Module({ providers: [ DystopiaViemContractFactory, - PolygonDystopiaPairsTokenFetcher, PolygonDystopiaStakingContractPositionFetcher, PolygonDystopiaVotingEscrowContractPositionFetcher, ], diff --git a/src/apps/dystopia/polygon/dystopia.farm.contract-position-fetcher.ts b/src/apps/dystopia/polygon/dystopia.farm.contract-position-fetcher.ts index 504ace8ed..e30e3478c 100644 --- a/src/apps/dystopia/polygon/dystopia.farm.contract-position-fetcher.ts +++ b/src/apps/dystopia/polygon/dystopia.farm.contract-position-fetcher.ts @@ -1,4 +1,5 @@ import { Inject } from '@nestjs/common'; +import { gql } from 'graphql-request'; import { filter, range } from 'lodash'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; @@ -18,7 +19,25 @@ import { import { DystopiaViemContractFactory } from '../contracts'; import { DystopiaGauge } from '../contracts/viem'; -import { DYSTOPIA_QUERY, DystopiaQueryResponse } from './dystopia.pool.token-fetcher'; +export const DYSTOPIA_QUERY = gql` + query fetchDystopiaPairs { + pairs(first: 1000) { + id + gauge { + id + } + } + } +`; + +export interface DystopiaQueryResponse { + pairs: { + id: string; + gauge: { + id: string; + }; + }[]; +} @PositionTemplate() export class PolygonDystopiaStakingContractPositionFetcher extends SingleStakingFarmDynamicTemplateContractPositionFetcher { diff --git a/src/apps/dystopia/polygon/dystopia.pool.token-fetcher.ts b/src/apps/dystopia/polygon/dystopia.pool.token-fetcher.ts deleted file mode 100644 index 90cc54ca3..000000000 --- a/src/apps/dystopia/polygon/dystopia.pool.token-fetcher.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Inject } from '@nestjs/common'; -import { gql } from 'graphql-request'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; -import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { gqlFetch } from '~app-toolkit/helpers/the-graph.helper'; -import { DefaultDataProps } from '~position/display.interface'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - GetDisplayPropsParams, - GetPricePerShareParams, - GetUnderlyingTokensParams, -} from '~position/template/app-token.template.types'; - -import { DystopiaViemContractFactory } from '../contracts'; -import { DystopiaPair } from '../contracts/viem'; - -export const DYSTOPIA_QUERY = gql` - query fetchDystopiaPairs { - pairs(first: 1000) { - id - gauge { - id - } - } - } -`; - -export interface DystopiaQueryResponse { - pairs: { - id: string; - gauge: { - id: string; - }; - }[]; -} - -@PositionTemplate() -export class PolygonDystopiaPairsTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'Pools'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(DystopiaViemContractFactory) private readonly contractFactory: DystopiaViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.dystopiaPair({ address, network: this.network }); - } - - async getAddresses() { - const data = await gqlFetch({ - endpoint: 'https://api.thegraph.com/subgraphs/name/dystopia-exchange/dystopia?source=zapper', - query: DYSTOPIA_QUERY, - }); - return data.pairs.map(v => v.id); - } - - async getUnderlyingTokenDefinitions({ contract }: GetUnderlyingTokensParams) { - return [ - { address: await contract.read.token0(), network: this.network }, - { address: await contract.read.token1(), network: this.network }, - ]; - } - - async getPricePerShare({ appToken, contract }: GetPricePerShareParams) { - const [token0, token1] = appToken.tokens; - const [reserve0, reserve1] = await Promise.all([contract.read.reserve0(), contract.read.reserve1()]); - const reserves = [Number(reserve0) / 10 ** token0.decimals, Number(reserve1) / 10 ** token1.decimals]; - const pricePerShare = reserves.map(r => r / appToken.supply); - return pricePerShare; - } - - async getLabel({ appToken }: GetDisplayPropsParams): Promise { - return appToken.tokens.map(v => getLabelFromToken(v)).join(' / '); - } - - async getSecondaryLabel({ appToken }: GetDisplayPropsParams) { - const { liquidity, reserves } = appToken.dataProps; - const reservePercentages = appToken.tokens.map((t, i) => reserves[i] * (t.price / liquidity)); - return reservePercentages.map(p => `${Math.round(p * 100)}%`).join(' / '); - } - - async getStatsItems({ appToken }: GetDisplayPropsParams) { - const { reserves, liquidity } = appToken.dataProps; - const reservesDisplay = reserves.map(v => (v < 0.01 ? '<0.01' : v.toFixed(2))).join(' / '); - - return [ - { label: 'Liquidity', value: buildDollarDisplayItem(liquidity) }, - { label: 'Reserves', value: reservesDisplay }, - ]; - } -} diff --git a/src/apps/furucombo/assets/logo.png b/src/apps/furucombo/assets/logo.png deleted file mode 100644 index 3f944afda..000000000 Binary files a/src/apps/furucombo/assets/logo.png and /dev/null differ diff --git a/src/apps/furucombo/contracts/abis/furucombo-fund-share-token.json b/src/apps/furucombo/contracts/abis/furucombo-fund-share-token.json deleted file mode 100644 index 879db2061..000000000 --- a/src/apps/furucombo/contracts/abis/furucombo-fund-share-token.json +++ /dev/null @@ -1,567 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "string", - "name": "name_", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol_", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals_", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "enum Errors.Code", - "name": "errorCode", - "type": "uint8" - } - ], - "name": "RevertCode", - "type": "error" - }, - { - "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": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender_", - "type": "address" - }, - { - "internalType": "address", - "name": "from_", - "type": "address" - }, - { - "internalType": "address", - "name": "to_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" - } - ], - "name": "approvedMove", - "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" - }, - { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "grossTotalShare", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "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": [ - { - "internalType": "address", - "name": "account_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from_", - "type": "address" - }, - { - "internalType": "address", - "name": "to_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" - } - ], - "name": "move", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "netTotalShare", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner_", - "type": "address" - }, - { - "internalType": "address", - "name": "spender_", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount_", - "type": "uint256" - } - ], - "name": "setApproval", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/furucombo/contracts/index.ts b/src/apps/furucombo/contracts/index.ts deleted file mode 100644 index 5dcfebdf6..000000000 --- a/src/apps/furucombo/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/furucombo/contracts/viem.contract-factory.ts b/src/apps/furucombo/contracts/viem.contract-factory.ts deleted file mode 100644 index ba683a9c9..000000000 --- a/src/apps/furucombo/contracts/viem.contract-factory.ts +++ /dev/null @@ -1,17 +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 { FurucomboFundShareToken__factory } from './viem'; - -type ContractOpts = { address: string; network: Network }; - -@Injectable() -export class FurucomboViemContractFactory { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - furucomboFundShareToken({ address, network }: ContractOpts) { - return FurucomboFundShareToken__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } -} diff --git a/src/apps/furucombo/contracts/viem/FurucomboFundShareToken.ts b/src/apps/furucombo/contracts/viem/FurucomboFundShareToken.ts deleted file mode 100644 index d63471524..000000000 --- a/src/apps/furucombo/contracts/viem/FurucomboFundShareToken.ts +++ /dev/null @@ -1,581 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const furucomboFundShareTokenAbi = [ - { - inputs: [ - { - internalType: 'string', - name: 'name_', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol_', - type: 'string', - }, - { - internalType: 'uint8', - name: 'decimals_', - type: 'uint8', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [ - { - internalType: 'enum Errors.Code', - name: 'errorCode', - type: 'uint8', - }, - ], - name: 'RevertCode', - type: 'error', - }, - { - 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: 'previousOwner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender_', - type: 'address', - }, - { - internalType: 'address', - name: 'from_', - type: 'address', - }, - { - internalType: 'address', - name: 'to_', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount_', - type: 'uint256', - }, - ], - name: 'approvedMove', - 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', - }, - { - internalType: 'uint256', - name: 'amount_', - type: 'uint256', - }, - ], - name: 'burn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'grossTotalShare', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - 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: [ - { - internalType: 'address', - name: 'account_', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount_', - type: 'uint256', - }, - ], - name: 'mint', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from_', - type: 'address', - }, - { - internalType: 'address', - name: 'to_', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount_', - type: 'uint256', - }, - ], - name: 'move', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'netTotalShare', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'nonces', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, - ], - name: 'permit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner_', - type: 'address', - }, - { - internalType: 'address', - name: 'spender_', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount_', - type: 'uint256', - }, - ], - name: 'setApproval', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type FurucomboFundShareToken = typeof furucomboFundShareTokenAbi; -export type FurucomboFundShareTokenContract = GetContractReturnType; - -export class FurucomboFundShareToken__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: furucomboFundShareTokenAbi, publicClient: client }); - } -} diff --git a/src/apps/furucombo/contracts/viem/index.ts b/src/apps/furucombo/contracts/viem/index.ts deleted file mode 100644 index 63a672e9f..000000000 --- a/src/apps/furucombo/contracts/viem/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -export type { FurucomboFundShareToken } from './FurucomboFundShareToken'; - -export { FurucomboFundShareToken__factory } from './FurucomboFundShareToken'; diff --git a/src/apps/furucombo/furucombo.module.ts b/src/apps/furucombo/furucombo.module.ts deleted file mode 100644 index 9468ef75a..000000000 --- a/src/apps/furucombo/furucombo.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common'; - -import { AbstractApp } from '~app/app.dynamic-module'; - -import { FurucomboViemContractFactory } from './contracts'; -import { PolygonFurucomboFundTokenFetcher } from './polygon/furucombo.fund.token-fetcher'; - -@Module({ - providers: [FurucomboViemContractFactory, PolygonFurucomboFundTokenFetcher], -}) -export class FurucomboAppModule extends AbstractApp() {} diff --git a/src/apps/furucombo/polygon/furucombo.fund.token-fetcher.ts b/src/apps/furucombo/polygon/furucombo.fund.token-fetcher.ts deleted file mode 100644 index d8d860025..000000000 --- a/src/apps/furucombo/polygon/furucombo.fund.token-fetcher.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { Inject } from '@nestjs/common'; -import Axios from 'axios'; - -import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { getImagesFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { CacheOnInterval } from '~cache/cache-on-interval.decorator'; -import { DisplayProps } from '~position/display.interface'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - GetUnderlyingTokensParams, - GetPricePerShareParams, - GetDataPropsParams, - GetDisplayPropsParams, - GetAddressesParams, - DefaultAppTokenDataProps, -} from '~position/template/app-token.template.types'; -import { NETWORK_IDS } from '~types/network.interface'; - -import { FurucomboViemContractFactory } from '../contracts'; -import { FurucomboFundShareToken } from '../contracts/viem'; - -interface FurucomboFund { - address: string; - name: string; - token: { - address: string; - }; - stakingToken: { - address: string; - }; - liquidity: string; - apy: string; - tokenPrice: string; - stakingTokenPrice: string; - fundVault: string; -} - -type FurucomboFundDefinition = { - address: string; - vaultAddress: string; - stakingTokenAddress: string; - name: string; - apy: string; - liquidity: string; - price: string; -}; - -@PositionTemplate() -export class PolygonFurucomboFundTokenFetcher extends AppTokenTemplatePositionFetcher< - FurucomboFundShareToken, - DefaultAppTokenDataProps, - FurucomboFundDefinition -> { - groupLabel = 'Funds'; - minLiquidity = 0; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(FurucomboViemContractFactory) protected readonly contractFactory: FurucomboViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.furucomboFundShareToken({ address, network: this.network }); - } - - @CacheOnInterval({ - key: `studio:furucombo:fund:ethereum:funds`, - timeout: 15 * 60 * 1000, - failOnMissingData: false, - }) - async getFurucomboFunds() { - const { data } = await Axios.get<{ investables: FurucomboFund[] }>('https://api.furucombo.app/v1/investables', { - params: { chainId: NETWORK_IDS[this.network], category: 'fund', protocol: 'furucombo' }, - }); - - return data.investables; - } - - async getDefinitions(): Promise { - const funds = await this.getFurucomboFunds(); - - return funds.map(v => ({ - address: v.token.address.toLowerCase(), - vaultAddress: v.fundVault.toLowerCase(), - stakingTokenAddress: v.stakingToken.address.toLowerCase(), - name: v.name, - apy: v.apy, - price: v.tokenPrice, - liquidity: v.liquidity, - })); - } - - async getAddresses({ definitions }: GetAddressesParams): Promise { - return definitions.map(v => v.address); - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [{ address: definition.stakingTokenAddress, network: this.network }]; - } - - async getPricePerShare({ - appToken, - definition, - }: GetPricePerShareParams) { - return [Number(definition.price) / appToken.tokens[0].price]; - } - - async getLiquidity({ - definition, - }: GetDataPropsParams) { - return Number(definition.liquidity); - } - - async getReserves({ - definition, - appToken, - }: GetDataPropsParams) { - return [Number(definition.liquidity) / appToken.tokens[0].price]; - } - - async getApy({ - definition, - }: GetDataPropsParams) { - return Number(definition.apy) * 100; - } - - async getLabel({ - definition, - }: GetDisplayPropsParams): Promise< - DisplayProps['label'] - > { - return definition.name; - } - - async getImages({ - appToken, - }: GetDisplayPropsParams): Promise { - return appToken.tokens.flatMap(t => getImagesFromToken(t)); - } -} diff --git a/src/apps/jones-dao/arbitrum/jones-dao.strategy.token-fetcher.ts b/src/apps/jones-dao/arbitrum/jones-dao.strategy.token-fetcher.ts deleted file mode 100644 index a0ce86301..000000000 --- a/src/apps/jones-dao/arbitrum/jones-dao.strategy.token-fetcher.ts +++ /dev/null @@ -1,57 +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 { GetAddressesParams, GetUnderlyingTokensParams } from '~position/template/app-token.template.types'; - -import { JonesDaoViemContractFactory } from '../contracts'; -import { JonesStrategyToken } from '../contracts/viem'; - -export type JonesDaoStrategyTokenDefinition = { - address: string; - underlyingTokenAddress: string; -}; - -@PositionTemplate() -export class ArbitrumJonesDaoStrategyTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'Advanced Strategies'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(JonesDaoViemContractFactory) protected readonly contractFactory: JonesDaoViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.jonesStrategyToken({ network: this.network, address }); - } - - async getDefinitions(): Promise { - return [ - { - address: '0x17ff154a329e37282eb9a76c3ae848fc277f24c7', - underlyingTokenAddress: '0x7241bc8035b65865156ddb5edef3eb32874a3af6', // jGLP - }, - { - address: '0xa485a0bc44988b95245d5f20497ccaff58a73e99', - underlyingTokenAddress: '0xe66998533a1992ece9ea99cdf47686f4fc8458e0', // jUSDC - }, - ]; - } - - async getAddresses({ definitions }: GetAddressesParams) { - return definitions.map(v => v.address); - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [{ address: definition.underlyingTokenAddress, network: this.network }]; - } - - async getPricePerShare() { - return [1]; - } -} diff --git a/src/apps/jones-dao/arbitrum/jones-dao.vault.token-fetcher.ts b/src/apps/jones-dao/arbitrum/jones-dao.vault.token-fetcher.ts deleted file mode 100644 index 06dae86f1..000000000 --- a/src/apps/jones-dao/arbitrum/jones-dao.vault.token-fetcher.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { ZERO_ADDRESS } from '~app-toolkit/constants/address'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - DefaultAppTokenDataProps, - GetAddressesParams, - GetUnderlyingTokensParams, -} from '~position/template/app-token.template.types'; - -import { JonesDaoViemContractFactory } from '../contracts'; -import { JonesVault } from '../contracts/viem/JonesVault'; - -export type JonesDaoVaultTokenDefinition = { - address: string; - underlyingTokenAddress: string; -}; - -@PositionTemplate() -export class ArbitrumJonesDaoVaultTokenFetcher extends AppTokenTemplatePositionFetcher< - JonesVault, - DefaultAppTokenDataProps, - JonesDaoVaultTokenDefinition -> { - groupLabel = 'Vaults'; - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(JonesDaoViemContractFactory) protected readonly contractFactory: JonesDaoViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.jonesVault({ network: this.network, address }); - } - - async getDefinitions(): Promise { - return [ - { - address: '0x662d0f9ff837a51cf89a1fe7e0882a906dac08a3', // jETH - underlyingTokenAddress: ZERO_ADDRESS, - }, - { - address: '0x5375616bb6c52a90439ff96882a986d8fcdce421', // jgOHM - underlyingTokenAddress: '0x8d9ba570d6cb60c7e3e0f31343efe75ab8e65fb1', // gOHM - }, - { - address: '0xf018865b26ffab9cd1735dcca549d95b0cb9ea19', // jDPX - underlyingTokenAddress: '0x6c2c06790b3e3e3c38e12ee22f8183b37a13ee55', // DPX - }, - { - address: '0x1f6fa7a58701b3773b08a1a16d06b656b0eccb23', // jrDPX - underlyingTokenAddress: '0x32eb7902d4134bf98a28b963d26de779af92a212', // rDPX - }, - ]; - } - - async getAddresses({ definitions }: GetAddressesParams) { - return definitions.map(v => v.address); - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [{ address: definition.underlyingTokenAddress, network: this.network }]; - } - - async getPricePerShare() { - return [1]; - } -} diff --git a/src/apps/jones-dao/contracts/abis/jones-strategy-token.json b/src/apps/jones-dao/contracts/abis/jones-strategy-token.json deleted file mode 100644 index 1deff0a8e..000000000 --- a/src/apps/jones-dao/contracts/abis/jones-strategy-token.json +++ /dev/null @@ -1,583 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "uint256", "name": "_stableRetentionPercentage", "type": "uint256" }, - { "internalType": "uint256", "name": "_glpRetentionPercentage", "type": "uint256" }, - { "internalType": "contract IIncentiveReceiver", "name": "_incentiveReceiver", "type": "address" }, - { "internalType": "contract IJonesGlpRewardTracker", "name": "_tracker", "type": "address" }, - { "internalType": "contract GlpJonesRewards", "name": "_jonesRewards", "type": "address" }, - { "internalType": "contract IERC20", "name": "_asset", "type": "address" }, - { "internalType": "contract IERC20Metadata", "name": "_vaultToken", "type": "address" }, - { "internalType": "string", "name": "_name", "type": "string" }, - { "internalType": "string", "name": "_symbol", "type": "string" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { "inputs": [], "name": "AddressCannotBeZeroAddress", "type": "error" }, - { "inputs": [], "name": "AmountCannotBeZero", "type": "error" }, - { "inputs": [], "name": "AmountExceedsStakedAmount", "type": "error" }, - { "inputs": [], "name": "CallerIsNotAllowed", "type": "error" }, - { "inputs": [], "name": "CallerIsNotGovernor", "type": "error" }, - { "inputs": [], "name": "CallerIsNotKeeper", "type": "error" }, - { "inputs": [], "name": "CallerIsNotOperator", "type": "error" }, - { "inputs": [], "name": "RetentionPercentageOutOfRange", "type": "error" }, - { - "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": false, "internalType": "uint256", "name": "_rewards", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "_totalAssets", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "_retentions", "type": "uint256" } - ], - "name": "Compound", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "_caller", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "receiver", "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": false, "internalType": "address", "name": "_oldGovernor", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "_newGovernor", "type": "address" } - ], - "name": "GovernorUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_newKeeper", "type": "address" }], - "name": "KeeperAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_operator", "type": "address" }], - "name": "KeeperRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_newOperator", "type": "address" }], - "name": "OperatorAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_operator", "type": "address" }], - "name": "OperatorRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "RoleRevoked", - "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": false, "internalType": "uint256", "name": "_assets", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "_shares", "type": "uint256" } - ], - "name": "Withdraw", - "type": "event" - }, - { - "inputs": [], - "name": "BASIS_POINTS", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "GOVERNOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "KEEPER", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPERATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_newKeeper", "type": "address" }], - "name": "addKeeper", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_newOperator", "type": "address" }], - "name": "addOperator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "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": "contract IERC20", "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": "compound", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } - ], - "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_assets", "type": "uint256" }, - { "internalType": "address", "name": "_receiver", "type": "address" } - ], - "name": "deposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_to", "type": "address" }], - "name": "emergencyGlpWithdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_to", "type": "address" }], - "name": "emergencyStableWithdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], - "name": "getRoleAdmin", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glp", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glpRetentionPercentage", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmxRouter", - "outputs": [{ "internalType": "contract IGmxRewardRouter", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "hasRole", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "incentiveReceiver", - "outputs": [{ "internalType": "contract IIncentiveReceiver", "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": "jonesRewards", - "outputs": [{ "internalType": "contract GlpJonesRewards", "name": "", "type": "address" }], - "stateMutability": "view", - "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": "previewRedeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "receiptBalance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_shares", "type": "uint256" }, - { "internalType": "address", "name": "_receiver", "type": "address" } - ], - "name": "redeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_operator", "type": "address" }], - "name": "removeKeeper", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_operator", "type": "address" }], - "name": "removeOperator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [{ "internalType": "contract JonesGlpVaultRouter", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract IERC20Metadata", "name": "_asset", "type": "address" }], - "name": "setAsset", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract IGmxRewardRouter", "name": "_gmxRouter", "type": "address" }], - "name": "setGmxRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract IIncentiveReceiver", "name": "_incentiveReceiver", "type": "address" }], - "name": "setIncentiveReceiver", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract GlpJonesRewards", "name": "_jonesRewards", "type": "address" }], - "name": "setJonesRewards", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_stableRetentionPercentage", "type": "uint256" }, - { "internalType": "uint256", "name": "_glpRetentionPercentage", "type": "uint256" } - ], - "name": "setNewRetentions", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract IJonesGlpRewardTracker", "name": "_tracker", "type": "address" }], - "name": "setRewardTracker", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract JonesGlpVaultRouter", "name": "_router", "type": "address" }], - "name": "setRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract IERC20Metadata", "name": "_vaultToken", "type": "address" }], - "name": "setVaultToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stableRetentionPercentage", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], - "name": "supportsInterface", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "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": "totalAssetsDeposits", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "assets", "type": "uint256" } - ], - "name": "totalAssetsToDeposits", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tracker", - "outputs": [{ "internalType": "contract IJonesGlpRewardTracker", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "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": "updateGovernor", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "usdc", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "vaultToken", - "outputs": [{ "internalType": "contract IERC20Metadata", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "weth", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/jones-dao/contracts/abis/jones-strategy-vault.json b/src/apps/jones-dao/contracts/abis/jones-strategy-vault.json deleted file mode 100644 index 8c21c56fd..000000000 --- a/src/apps/jones-dao/contracts/abis/jones-strategy-vault.json +++ /dev/null @@ -1,587 +0,0 @@ -[ - { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, - { "inputs": [], "name": "CallerIsNotBorrower", "type": "error" }, - { "inputs": [], "name": "CallerIsNotGovernor", "type": "error" }, - { "inputs": [], "name": "CallerIsNotOperator", "type": "error" }, - { "inputs": [], "name": "ErrorEmergencyPaused", "type": "error" }, - { "inputs": [], "name": "ErrorNotEmergencyPaused", "type": "error" }, - { "inputs": [], "name": "ErrorNotPaused", "type": "error" }, - { "inputs": [], "name": "ErrorPaused", "type": "error" }, - { - "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": false, "internalType": "address", "name": "_borrower", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" } - ], - "name": "AssetsBorrowed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "_borrower", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" } - ], - "name": "AssetsRepayed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_newBorrower", "type": "address" }], - "name": "BorrowerAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_borrower", "type": "address" }], - "name": "BorrowerRemoved", - "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": false, "internalType": "address", "name": "_account", "type": "address" }], - "name": "EmergencyPaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_account", "type": "address" }], - "name": "EmergencyUnpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "_oldGovernor", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "_newGovernor", "type": "address" } - ], - "name": "GovernorUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_newOperator", "type": "address" }], - "name": "OperatorAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_operator", "type": "address" }], - "name": "OperatorRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_account", "type": "address" }], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "_oldPriceOracle", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "_newPriceOracle", "type": "address" } - ], - "name": "PriceOracleUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "RoleRevoked", - "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": false, "internalType": "address", "name": "_account", "type": "address" }], - "name": "Unpaused", - "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": [], - "name": "BORROWER", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "GOVERNOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "OPERATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_newBorrower", "type": "address" }], - "name": "addBorrower", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_newOperator", "type": "address" }], - "name": "addOperator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "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": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], - "name": "borrow", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "_user", "type": "address" }, - { "internalType": "uint256", "name": "_amount", "type": "uint256" } - ], - "name": "burn", - "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": "emergencyPaused", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], - "name": "getRoleAdmin", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "hasRole", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "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": [{ "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": [], - "name": "paused", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "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": [], - "name": "priceOracle", - "outputs": [{ "internalType": "contract IAggregatorV3", "name": "", "type": "address" }], - "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": [{ "internalType": "address", "name": "_borrower", "type": "address" }], - "name": "removeBorrower", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_operator", "type": "address" }], - "name": "removeOperator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], - "name": "repay", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_receiver", "type": "address" }], - "name": "setExcessReceiver", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract IAggregatorV3", "name": "_newPriceOracle", "type": "address" }], - "name": "setPriceAggregator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "contract IJonesGlpLeverageStrategy", "name": "_strategy", "type": "address" }], - "name": "setStrategyAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "strategy", - "outputs": [{ "internalType": "contract IJonesGlpLeverageStrategy", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], - "name": "supportsInterface", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "togglePause", "outputs": [], "stateMutability": "nonpayable", "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": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "from", "type": "address" }, - { "internalType": "address", "name": "to", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "tvl", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_newGovernor", "type": "address" }], - "name": "updateGovernor", - "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/jones-dao/contracts/abis/jones-vault.json b/src/apps/jones-dao/contracts/abis/jones-vault.json deleted file mode 100644 index 351275d4b..000000000 --- a/src/apps/jones-dao/contracts/abis/jones-vault.json +++ /dev/null @@ -1,266 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_multisigAddr", "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": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, - { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "sender", "type": "address" } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTER_ROLE", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } - ], - "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "amount", "type": "uint256" }], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "account", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "burnFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "subtractedValue", "type": "uint256" } - ], - "name": "decreaseAllowance", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], - "name": "getRoleAdmin", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_minterContract", "type": "address" }], - "name": "giveMinterRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "hasRole", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "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": [ - { "internalType": "address", "name": "_to", "type": "address" }, - { "internalType": "uint256", "name": "_amount", "type": "uint256" } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_minterContract", "type": "address" }], - "name": "revokeMinterRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], - "name": "supportsInterface", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transfer", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sender", "type": "address" }, - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "transferFrom", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/jones-dao/contracts/viem.contract-factory.ts b/src/apps/jones-dao/contracts/viem.contract-factory.ts index 72ee72085..c13be11df 100644 --- a/src/apps/jones-dao/contracts/viem.contract-factory.ts +++ b/src/apps/jones-dao/contracts/viem.contract-factory.ts @@ -8,9 +8,6 @@ import { JonesMillinerV2__factory, JonesStakingRewards__factory, JonesStakingRewardsFactory__factory, - JonesStrategyToken__factory, - JonesStrategyVault__factory, - JonesVault__factory, } from './viem'; type ContractOpts = { address: string; network: Network }; @@ -31,13 +28,4 @@ export class JonesDaoViemContractFactory { jonesStakingRewardsFactory({ address, network }: ContractOpts) { return JonesStakingRewardsFactory__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } - jonesStrategyToken({ address, network }: ContractOpts) { - return JonesStrategyToken__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - jonesStrategyVault({ address, network }: ContractOpts) { - return JonesStrategyVault__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - jonesVault({ address, network }: ContractOpts) { - return JonesVault__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } } diff --git a/src/apps/jones-dao/contracts/viem/JonesStrategyToken.ts b/src/apps/jones-dao/contracts/viem/JonesStrategyToken.ts deleted file mode 100644 index affa25a79..000000000 --- a/src/apps/jones-dao/contracts/viem/JonesStrategyToken.ts +++ /dev/null @@ -1,1309 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const jonesStrategyTokenAbi = [ - { - inputs: [ - { - internalType: 'uint256', - name: '_stableRetentionPercentage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_glpRetentionPercentage', - type: 'uint256', - }, - { - internalType: 'contract IIncentiveReceiver', - name: '_incentiveReceiver', - type: 'address', - }, - { - internalType: 'contract IJonesGlpRewardTracker', - name: '_tracker', - type: 'address', - }, - { - internalType: 'contract GlpJonesRewards', - name: '_jonesRewards', - type: 'address', - }, - { - internalType: 'contract IERC20', - name: '_asset', - type: 'address', - }, - { - internalType: 'contract IERC20Metadata', - name: '_vaultToken', - type: 'address', - }, - { - internalType: 'string', - name: '_name', - type: 'string', - }, - { - internalType: 'string', - name: '_symbol', - type: 'string', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'AddressCannotBeZeroAddress', - type: 'error', - }, - { - inputs: [], - name: 'AmountCannotBeZero', - type: 'error', - }, - { - inputs: [], - name: 'AmountExceedsStakedAmount', - type: 'error', - }, - { - inputs: [], - name: 'CallerIsNotAllowed', - type: 'error', - }, - { - inputs: [], - name: 'CallerIsNotGovernor', - type: 'error', - }, - { - inputs: [], - name: 'CallerIsNotKeeper', - type: 'error', - }, - { - inputs: [], - name: 'CallerIsNotOperator', - type: 'error', - }, - { - inputs: [], - name: 'RetentionPercentageOutOfRange', - type: 'error', - }, - { - 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: false, - internalType: 'uint256', - name: '_rewards', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: '_totalAssets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: '_retentions', - type: 'uint256', - }, - ], - name: 'Compound', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: '_caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'receiver', - 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: false, - internalType: 'address', - name: '_oldGovernor', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: '_newGovernor', - type: 'address', - }, - ], - name: 'GovernorUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_newKeeper', - type: 'address', - }, - ], - name: 'KeeperAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_operator', - type: 'address', - }, - ], - name: 'KeeperRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_newOperator', - type: 'address', - }, - ], - name: 'OperatorAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_operator', - type: 'address', - }, - ], - name: 'OperatorRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'previousAdminRole', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'newAdminRole', - type: 'bytes32', - }, - ], - name: 'RoleAdminChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'RoleGranted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'RoleRevoked', - 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: false, - internalType: 'uint256', - name: '_assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: '_shares', - type: 'uint256', - }, - ], - name: 'Withdraw', - type: 'event', - }, - { - inputs: [], - name: 'BASIS_POINTS', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'GOVERNOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'KEEPER', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'OPERATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newKeeper', - type: 'address', - }, - ], - name: 'addKeeper', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newOperator', - type: 'address', - }, - ], - name: 'addOperator', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - 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: 'contract IERC20', - 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: 'compound', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_assets', - type: 'uint256', - }, - { - internalType: 'address', - name: '_receiver', - type: 'address', - }, - ], - name: 'deposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_to', - type: 'address', - }, - ], - name: 'emergencyGlpWithdraw', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_to', - type: 'address', - }, - ], - name: 'emergencyStableWithdraw', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - ], - name: 'getRoleAdmin', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'glp', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'glpRetentionPercentage', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'gmxRouter', - outputs: [ - { - internalType: 'contract IGmxRewardRouter', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'grantRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'hasRole', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'incentiveReceiver', - outputs: [ - { - internalType: 'contract IIncentiveReceiver', - 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: 'jonesRewards', - outputs: [ - { - internalType: 'contract GlpJonesRewards', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - 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: 'previewRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'receiptBalance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_shares', - type: 'uint256', - }, - { - internalType: 'address', - name: '_receiver', - type: 'address', - }, - ], - name: 'redeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_operator', - type: 'address', - }, - ], - name: 'removeKeeper', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_operator', - type: 'address', - }, - ], - name: 'removeOperator', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'renounceRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'revokeRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'router', - outputs: [ - { - internalType: 'contract JonesGlpVaultRouter', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20Metadata', - name: '_asset', - type: 'address', - }, - ], - name: 'setAsset', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IGmxRewardRouter', - name: '_gmxRouter', - type: 'address', - }, - ], - name: 'setGmxRouter', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IIncentiveReceiver', - name: '_incentiveReceiver', - type: 'address', - }, - ], - name: 'setIncentiveReceiver', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract GlpJonesRewards', - name: '_jonesRewards', - type: 'address', - }, - ], - name: 'setJonesRewards', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_stableRetentionPercentage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_glpRetentionPercentage', - type: 'uint256', - }, - ], - name: 'setNewRetentions', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IJonesGlpRewardTracker', - name: '_tracker', - type: 'address', - }, - ], - name: 'setRewardTracker', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract JonesGlpVaultRouter', - name: '_router', - type: 'address', - }, - ], - name: 'setRouter', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20Metadata', - name: '_vaultToken', - type: 'address', - }, - ], - name: 'setVaultToken', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'stableRetentionPercentage', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'interfaceId', - type: 'bytes4', - }, - ], - name: 'supportsInterface', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - 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: 'totalAssetsDeposits', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'totalAssetsToDeposits', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'tracker', - outputs: [ - { - internalType: 'contract IJonesGlpRewardTracker', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - 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: 'updateGovernor', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'usdc', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'vaultToken', - outputs: [ - { - internalType: 'contract IERC20Metadata', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'weth', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type JonesStrategyToken = typeof jonesStrategyTokenAbi; -export type JonesStrategyTokenContract = GetContractReturnType; - -export class JonesStrategyToken__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: jonesStrategyTokenAbi, publicClient: client }); - } -} diff --git a/src/apps/jones-dao/contracts/viem/JonesStrategyVault.ts b/src/apps/jones-dao/contracts/viem/JonesStrategyVault.ts deleted file mode 100644 index 6d275809b..000000000 --- a/src/apps/jones-dao/contracts/viem/JonesStrategyVault.ts +++ /dev/null @@ -1,1371 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const jonesStrategyVaultAbi = [ - { - inputs: [], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'CallerIsNotBorrower', - type: 'error', - }, - { - inputs: [], - name: 'CallerIsNotGovernor', - type: 'error', - }, - { - inputs: [], - name: 'CallerIsNotOperator', - type: 'error', - }, - { - inputs: [], - name: 'ErrorEmergencyPaused', - type: 'error', - }, - { - inputs: [], - name: 'ErrorNotEmergencyPaused', - type: 'error', - }, - { - inputs: [], - name: 'ErrorNotPaused', - type: 'error', - }, - { - inputs: [], - name: 'ErrorPaused', - type: 'error', - }, - { - 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: false, - internalType: 'address', - name: '_borrower', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'AssetsBorrowed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_borrower', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'AssetsRepayed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_newBorrower', - type: 'address', - }, - ], - name: 'BorrowerAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_borrower', - type: 'address', - }, - ], - name: 'BorrowerRemoved', - 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: false, - internalType: 'address', - name: '_account', - type: 'address', - }, - ], - name: 'EmergencyPaused', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_account', - type: 'address', - }, - ], - name: 'EmergencyUnpaused', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_oldGovernor', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: '_newGovernor', - type: 'address', - }, - ], - name: 'GovernorUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_newOperator', - type: 'address', - }, - ], - name: 'OperatorAdded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_operator', - type: 'address', - }, - ], - name: 'OperatorRemoved', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_account', - type: 'address', - }, - ], - name: 'Paused', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_oldPriceOracle', - type: 'address', - }, - { - indexed: false, - internalType: 'address', - name: '_newPriceOracle', - type: 'address', - }, - ], - name: 'PriceOracleUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'previousAdminRole', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'newAdminRole', - type: 'bytes32', - }, - ], - name: 'RoleAdminChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'RoleGranted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'RoleRevoked', - 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: false, - internalType: 'address', - name: '_account', - type: 'address', - }, - ], - name: 'Unpaused', - 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: [], - name: 'BORROWER', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'GOVERNOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'OPERATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newBorrower', - type: 'address', - }, - ], - name: 'addBorrower', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newOperator', - type: 'address', - }, - ], - name: 'addOperator', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - 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: [ - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'borrow', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_user', - type: 'address', - }, - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'burn', - 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: 'emergencyPaused', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - ], - name: 'getRoleAdmin', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'grantRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'hasRole', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - 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: [ - { - 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: [], - name: 'paused', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - 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: [], - name: 'priceOracle', - outputs: [ - { - internalType: 'contract IAggregatorV3', - name: '', - type: 'address', - }, - ], - 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: [ - { - internalType: 'address', - name: '_borrower', - type: 'address', - }, - ], - name: 'removeBorrower', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_operator', - type: 'address', - }, - ], - name: 'removeOperator', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'renounceRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'repay', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'revokeRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_receiver', - type: 'address', - }, - ], - name: 'setExcessReceiver', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IAggregatorV3', - name: '_newPriceOracle', - type: 'address', - }, - ], - name: 'setPriceAggregator', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IJonesGlpLeverageStrategy', - name: '_strategy', - type: 'address', - }, - ], - name: 'setStrategyAddress', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'strategy', - outputs: [ - { - internalType: 'contract IJonesGlpLeverageStrategy', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'interfaceId', - type: 'bytes4', - }, - ], - name: 'supportsInterface', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'togglePause', - outputs: [], - stateMutability: 'nonpayable', - 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: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'tvl', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newGovernor', - type: 'address', - }, - ], - name: 'updateGovernor', - 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 JonesStrategyVault = typeof jonesStrategyVaultAbi; -export type JonesStrategyVaultContract = GetContractReturnType; - -export class JonesStrategyVault__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: jonesStrategyVaultAbi, publicClient: client }); - } -} diff --git a/src/apps/jones-dao/contracts/viem/JonesVault.ts b/src/apps/jones-dao/contracts/viem/JonesVault.ts deleted file mode 100644 index ea97005cf..000000000 --- a/src/apps/jones-dao/contracts/viem/JonesVault.ts +++ /dev/null @@ -1,599 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const jonesVaultAbi = [ - { - inputs: [ - { - internalType: 'address', - name: '_multisigAddr', - 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: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'previousAdminRole', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'bytes32', - name: 'newAdminRole', - type: 'bytes32', - }, - ], - name: 'RoleAdminChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'RoleGranted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address', - }, - ], - name: 'RoleRevoked', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MINTER_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'burn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'burnFrom', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - ], - name: 'getRoleAdmin', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_minterContract', - type: 'address', - }, - ], - name: 'giveMinterRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'grantRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'hasRole', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - 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: [ - { - internalType: 'address', - name: '_to', - type: 'address', - }, - { - internalType: 'uint256', - name: '_amount', - type: 'uint256', - }, - ], - name: 'mint', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'renounceRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_minterContract', - type: 'address', - }, - ], - name: 'revokeMinterRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'revokeRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'interfaceId', - type: 'bytes4', - }, - ], - name: 'supportsInterface', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type JonesVault = typeof jonesVaultAbi; -export type JonesVaultContract = GetContractReturnType; - -export class JonesVault__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: jonesVaultAbi, publicClient: client }); - } -} diff --git a/src/apps/jones-dao/contracts/viem/index.ts b/src/apps/jones-dao/contracts/viem/index.ts index 7eb153cc0..4f6804fbd 100644 --- a/src/apps/jones-dao/contracts/viem/index.ts +++ b/src/apps/jones-dao/contracts/viem/index.ts @@ -6,14 +6,8 @@ export type { JonesMetavault } from './JonesMetavault'; export type { JonesMillinerV2 } from './JonesMillinerV2'; export type { JonesStakingRewardsFactory } from './JonesStakingRewardsFactory'; export type { JonesStakingRewards } from './JonesStakingRewards'; -export type { JonesStrategyToken } from './JonesStrategyToken'; -export type { JonesStrategyVault } from './JonesStrategyVault'; -export type { JonesVault } from './JonesVault'; export { JonesMetavault__factory } from './JonesMetavault'; export { JonesMillinerV2__factory } from './JonesMillinerV2'; export { JonesStakingRewardsFactory__factory } from './JonesStakingRewardsFactory'; export { JonesStakingRewards__factory } from './JonesStakingRewards'; -export { JonesStrategyToken__factory } from './JonesStrategyToken'; -export { JonesStrategyVault__factory } from './JonesStrategyVault'; -export { JonesVault__factory } from './JonesVault'; diff --git a/src/apps/jones-dao/jones-dao.module.ts b/src/apps/jones-dao/jones-dao.module.ts index b086a9f8c..59aebdffa 100644 --- a/src/apps/jones-dao/jones-dao.module.ts +++ b/src/apps/jones-dao/jones-dao.module.ts @@ -5,8 +5,6 @@ import { AbstractApp } from '~app/app.dynamic-module'; import { ArbitrumJonesDaoFarmContractPositionFetcher } from './arbitrum/jones-dao.farm.contract-position-fetcher'; import { ArbitrumJonesDaoMetavaultTokenFetcher } from './arbitrum/jones-dao.metavault.contract-position-fetcher'; import { ArbitrumJonesDaoMillinerV2ContractPositionFetcher } from './arbitrum/jones-dao.milliner-v2.contract-position-fetcher'; -import { ArbitrumJonesDaoStrategyTokenFetcher } from './arbitrum/jones-dao.strategy.token-fetcher'; -import { ArbitrumJonesDaoVaultTokenFetcher } from './arbitrum/jones-dao.vault.token-fetcher'; import { JonesDaoViemContractFactory } from './contracts'; @Module({ @@ -14,9 +12,7 @@ import { JonesDaoViemContractFactory } from './contracts'; JonesDaoViemContractFactory, ArbitrumJonesDaoFarmContractPositionFetcher, ArbitrumJonesDaoMillinerV2ContractPositionFetcher, - ArbitrumJonesDaoVaultTokenFetcher, ArbitrumJonesDaoMetavaultTokenFetcher, - ArbitrumJonesDaoStrategyTokenFetcher, ], }) export class JonesDaoAppModule extends AbstractApp() {} diff --git a/src/apps/plutus/arbitrum/plutus.vault.token-fetcher.ts b/src/apps/plutus/arbitrum/plutus.vault.token-fetcher.ts deleted file mode 100644 index 77cae2804..000000000 --- a/src/apps/plutus/arbitrum/plutus.vault.token-fetcher.ts +++ /dev/null @@ -1,68 +0,0 @@ -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 { - DefaultAppTokenDataProps, - GetAddressesParams, - GetDataPropsParams, - GetUnderlyingTokensParams, -} from '~position/template/app-token.template.types'; - -export type PlutusVaultAppTokenDefinition = { - address: string; - underlyingTokenAddress: string; -}; - -@PositionTemplate() -export class ArbitrumPlutusVaultTokenFetcher extends AppTokenTemplatePositionFetcher< - Erc20, - DefaultAppTokenDataProps, - PlutusVaultAppTokenDefinition -> { - groupLabel = 'Vault'; - - getContract(address: string) { - return this.appToolkit.globalViemContracts.erc20({ address, network: this.network }); - } - - async getDefinitions(): Promise { - return [ - { - address: '0xe7f6c3c1f0018e4c08acc52965e5cbff99e34a44', // plsJONES - underlyingTokenAddress: '0xe8ee01ae5959d3231506fcdef2d5f3e85987a39c', - }, - { - address: '0x530f1cbb2ebd71bec58d351dcd3768148986a467', // plsGLP - underlyingTokenAddress: '0x4277f8f2c384827b5273592ff7cebd9f2c1ac258', - }, - { - address: '0x7a5d193fe4ed9098f7eadc99797087c96b002907', // plsARB - underlyingTokenAddress: '0x912ce59144191c1204e64559fe8253a0e49e6548', - }, - ]; - } - - 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 getLiquidity({ appToken }: GetDataPropsParams) { - return appToken.supply * appToken.price; - } - - async getReserves({ appToken }: GetDataPropsParams) { - return [appToken.pricePerShare[0] * appToken.supply]; - } - - async getApy() { - return 0; - } -} diff --git a/src/apps/plutus/plutus.module.ts b/src/apps/plutus/plutus.module.ts index 9fac4b75b..f322f592a 100644 --- a/src/apps/plutus/plutus.module.ts +++ b/src/apps/plutus/plutus.module.ts @@ -17,7 +17,6 @@ import { ArbitrumPlutusPlsDpxTokenFetcher } from './arbitrum/plutus.pls-dpx.toke import { ArbitrumPlutusPlsRdntTokenFetcher } from './arbitrum/plutus.pls-rdnt.token-fetcher'; import { ArbitrumPlutusPlsSpaTokenFetcher } from './arbitrum/plutus.pls-spa.token-fetcher'; import { ArbitrumPlutusTgeClaimableContractPositionFetcher } from './arbitrum/plutus.tge-claimable.contract-position-fetcher'; -import { ArbitrumPlutusVaultTokenFetcher } from './arbitrum/plutus.vault.token-fetcher'; import { PlutusViemContractFactory } from './contracts'; @Module({ @@ -33,7 +32,6 @@ import { PlutusViemContractFactory } from './contracts'; ArbitrumPlutusFarmPlsJonesContractPositionFetcher, ArbitrumPlutusFarmPlsLpContractPositionFetcher, ArbitrumPlutusLockContractPositionFetcher, - ArbitrumPlutusVaultTokenFetcher, ArbitrumPlutusTgeClaimableContractPositionFetcher, ArbitrumPlutusFarmPlsRdntContractPositionFetcher, // plsASSETs diff --git a/src/apps/tempus/assets/logo.png b/src/apps/tempus/assets/logo.png deleted file mode 100644 index be5c85830..000000000 Binary files a/src/apps/tempus/assets/logo.png and /dev/null differ diff --git a/src/apps/tempus/common/tempus.amm.token-fetcher.ts b/src/apps/tempus/common/tempus.amm.token-fetcher.ts deleted file mode 100644 index 73ba9fd21..000000000 --- a/src/apps/tempus/common/tempus.amm.token-fetcher.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - GetUnderlyingTokensParams, - DefaultAppTokenDefinition, - GetPricePerShareParams, - GetDisplayPropsParams, -} from '~position/template/app-token.template.types'; - -import { TempusViemContractFactory } from '../contracts'; -import { TempusAmm } from '../contracts/viem'; - -import { getTempusData } from './tempus.datasource'; - -export abstract class TempusAmmTokenFetcher extends AppTokenTemplatePositionFetcher { - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(TempusViemContractFactory) protected readonly contractFactory: TempusViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.tempusAmm({ address, network: this.network }); - } - - async getAddresses() { - const data = await getTempusData(this.network); - return data.tempusPools.map(v => v.ammAddress.toLowerCase()); - } - - async getUnderlyingTokenDefinitions({ - contract, - multicall, - }: GetUnderlyingTokensParams) { - const poolAddress = await contract.read.tempusPool(); - const pool = multicall.wrap(this.contractFactory.tempusPool({ address: poolAddress, network: this.network })); - - return [ - { address: await pool.read.principalShare(), network: this.network }, - { address: await pool.read.yieldShare(), network: this.network }, - ]; - } - - async getPricePerShare({ contract, appToken }: GetPricePerShareParams) { - const totalSupply = await contract.read.totalSupply(); - const reservesRaw = await contract.read.getExpectedTokensOutGivenBPTIn([totalSupply]); - const reserves = reservesRaw.map((r, i) => Number(r) / 10 ** appToken.tokens[i].decimals); - return reserves.map(r => r / appToken.supply); - } - - async getLabel({ appToken }: GetDisplayPropsParams) { - return appToken.tokens.map(v => getLabelFromToken(v)).join(' / '); - } - - async getSecondaryLabel({ appToken }: GetDisplayPropsParams) { - const reservesUSD = appToken.tokens.map((t, i) => appToken.dataProps.reserves[i] * t.price); - const liquidity = reservesUSD.reduce((total, r) => total + r, 0); - const reservePercentages = reservesUSD.map(reserveUSD => reserveUSD / liquidity); - const ratio = reservePercentages.map(p => `${Math.floor(p * 100)}%`).join(' / '); - - return ratio; - } -} diff --git a/src/apps/tempus/common/tempus.datasource.ts b/src/apps/tempus/common/tempus.datasource.ts deleted file mode 100644 index 3369fa815..000000000 --- a/src/apps/tempus/common/tempus.datasource.ts +++ /dev/null @@ -1,25 +0,0 @@ -import Axios from 'axios'; - -import { Network } from '~types'; - -const datasourceUrl = 'https://raw.githubusercontent.com/tempus-finance/tempus-pools-config/master/config.json'; - -export type TempusPool = { - address: string; - ammAddress: string; - yieldsAddress: string; - principalsAddress: string; - // Should probably use yieldBearingTokenAddress instead, but that may have dependency issues in the future - backingTokenAddress: string; -}; - -type TempusData = { - tempusPools: TempusPool[]; -}; - -type TempusDataResponse = Record; - -export const getTempusData = async (network: Network) => { - const { data } = await Axios.get(datasourceUrl); - return data[network]; -}; diff --git a/src/apps/tempus/common/tempus.pool.token-fetcher.ts b/src/apps/tempus/common/tempus.pool.token-fetcher.ts deleted file mode 100644 index b20b23c15..000000000 --- a/src/apps/tempus/common/tempus.pool.token-fetcher.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Inject, Injectable } from '@nestjs/common'; -import { unix } from 'moment'; - -import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - GetDisplayPropsParams, - GetPricePerShareParams, - GetUnderlyingTokensParams, -} from '~position/template/app-token.template.types'; - -import { TempusViemContractFactory } from '../contracts'; -import { TempusPyToken } from '../contracts/viem'; - -import { getTempusData } from './tempus.datasource'; - -@Injectable() -export abstract class TempusPoolTokenFetcher extends AppTokenTemplatePositionFetcher { - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(TempusViemContractFactory) protected readonly contractFactory: TempusViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.tempusPyToken({ address, network: this.network }); - } - - async getAddresses() { - const data = await getTempusData(this.network); - return data.tempusPools.flatMap(v => [v.principalsAddress, v.yieldsAddress]); - } - - async getUnderlyingTokenDefinitions({ contract, multicall }: GetUnderlyingTokensParams) { - const poolAddress = await contract.read.pool(); - const pool = multicall.wrap(this.contractFactory.tempusPool({ address: poolAddress, network: this.network })); - return [{ address: await pool.read.backingToken(), network: this.network }]; - } - - async getPricePerShare({ contract, appToken }: GetPricePerShareParams) { - const pricePerShareRaw = await contract.read.getPricePerFullShareStored(); - const decimals = appToken.decimals; - const pricePerShare = Number(pricePerShareRaw) / 10 ** decimals; - return [pricePerShare]; - } - - async getLabel({ appToken, contract, multicall }: GetDisplayPropsParams) { - const kindLabel = (await contract.read.kind()) === 1 ? 'Yield' : 'Principal'; - const poolAddress = await contract.read.pool(); - const pool = this.contractFactory.tempusPool({ address: poolAddress, network: this.network }); - const maturity = await multicall.wrap(pool).read.maturityTime(); - return `${getLabelFromToken(appToken.tokens[0])} ${kindLabel} Share - ${unix(Number(maturity)).format('L')}`; - } -} diff --git a/src/apps/tempus/contracts/abis/tempus-amm.json b/src/apps/tempus/contracts/abis/tempus-amm.json deleted file mode 100644 index 991002ccd..000000000 --- a/src/apps/tempus/contracts/abis/tempus-amm.json +++ /dev/null @@ -1,1146 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "contract IVault", - "name": "vault", - "type": "address" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "contract ITempusPool", - "name": "pool", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amplificationStart", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amplificationEnd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "swapFeePercentage", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pauseWindowDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "bufferPeriodDuration", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "startValue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "endValue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "startTime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "endTime", - "type": "uint256" - } - ], - "name": "AmpUpdateStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "currentValue", - "type": "uint256" - } - ], - "name": "AmpUpdateStopped", - "type": "event" - }, - { - "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": false, - "internalType": "bool", - "name": "paused", - "type": "bool" - } - ], - "name": "PausedStateChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "swapFeePercentage", - "type": "uint256" - } - ], - "name": "SwapFeePercentageChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "selector", - "type": "bytes4" - } - ], - "name": "getActionId", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAmplificationParameter", - "outputs": [ - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isUpdating", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "precision", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAuthorizer", - "outputs": [ - { - "internalType": "contract IAuthorizer", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "principalsStaked", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "yieldsStaked", - "type": "uint256" - } - ], - "name": "getExpectedBPTInGivenTokensOut", - "outputs": [ - { - "internalType": "uint256", - "name": "lpTokens", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "amountsIn", - "type": "uint256[]" - } - ], - "name": "getExpectedLPTokensForTokensIn", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "yieldShareIn", - "type": "bool" - } - ], - "name": "getExpectedReturnGivenIn", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "bptAmountIn", - "type": "uint256" - } - ], - "name": "getExpectedTokensOutGivenBPTIn", - "outputs": [ - { - "internalType": "uint256", - "name": "principals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "yields", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getLastInvariant", - "outputs": [ - { - "internalType": "uint256", - "name": "lastInvariant", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastInvariantAmp", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPausedState", - "outputs": [ - { - "internalType": "bool", - "name": "paused", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "pauseWindowEndTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "bufferPeriodEndTime", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getPoolId", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getScalingFactors", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "principals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "yields", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - } - ], - "name": "getSwapAmountToEndWithEqualShares", - "outputs": [ - { - "internalType": "uint256", - "name": "amountIn", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "yieldsIn", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSwapFeePercentage", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVault", - "outputs": [ - { - "internalType": "contract IVault", - "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": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "poolId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "balances", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "lastChangeBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "protocolSwapFeePercentage", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } - ], - "name": "onExitPool", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "poolId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "balances", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "lastChangeBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "protocolSwapFeePercentage", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } - ], - "name": "onJoinPool", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "enum IVault.SwapKind", - "name": "kind", - "type": "uint8" - }, - { - "internalType": "contract IERC20", - "name": "tokenIn", - "type": "address" - }, - { - "internalType": "contract IERC20", - "name": "tokenOut", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "poolId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "lastChangeBlock", - "type": "uint256" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } - ], - "internalType": "struct IPoolSwapStructs.SwapRequest", - "name": "request", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "balanceTokenIn", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balanceTokenOut", - "type": "uint256" - } - ], - "name": "onSwap", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "poolId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "balances", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "lastChangeBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "protocolSwapFeePercentage", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } - ], - "name": "queryExit", - "outputs": [ - { - "internalType": "uint256", - "name": "bptIn", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "amountsOut", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "poolId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "balances", - "type": "uint256[]" - }, - { - "internalType": "uint256", - "name": "lastChangeBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "protocolSwapFeePercentage", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "userData", - "type": "bytes" - } - ], - "name": "queryJoin", - "outputs": [ - { - "internalType": "uint256", - "name": "bptOut", - "type": "uint256" - }, - { - "internalType": "uint256[]", - "name": "amountsIn", - "type": "uint256[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - }, - { - "internalType": "bytes", - "name": "poolConfig", - "type": "bytes" - } - ], - "name": "setAssetManagerPoolConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "paused", - "type": "bool" - } - ], - "name": "setPaused", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "swapFeePercentage", - "type": "uint256" - } - ], - "name": "setSwapFeePercentage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "rawEndValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "endTime", - "type": "uint256" - } - ], - "name": "startAmplificationParameterUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stopAmplificationParameterUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "tempusPool", - "outputs": [ - { - "internalType": "contract ITempusPool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/tempus/contracts/abis/tempus-pool.json b/src/apps/tempus/contracts/abis/tempus-pool.json deleted file mode 100644 index 20f70eca8..000000000 --- a/src/apps/tempus/contracts/abis/tempus-pool.json +++ /dev/null @@ -1,867 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "contract ILido", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "controller", - "type": "address" - }, - { - "internalType": "uint256", - "name": "maturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "estYield", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - } - ], - "internalType": "struct TokenData", - "name": "principalsData", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - } - ], - "internalType": "struct TokenData", - "name": "yieldsData", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "depositPercent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "earlyRedeemPercent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "matureRedeemPercent", - "type": "uint256" - } - ], - "internalType": "struct ITempusFees.FeesConfig", - "name": "maxFeeSetup", - "type": "tuple" - }, - { - "internalType": "address", - "name": "referrerAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "currentOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "proposedOwner", - "type": "address" - } - ], - "name": "OwnershipProposed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "backingToken", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "backingTokenONE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "controller", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "currentInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "isBackingToken", - "type": "bool" - } - ], - "name": "estimatedMintedShares", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "principals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "yields", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "toBackingToken", - "type": "bool" - } - ], - "name": "estimatedRedeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "exceptionalHaltTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "exchangeRateONE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "finalize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getFeesConfig", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "depositPercent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "earlyRedeemPercent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "matureRedeemPercent", - "type": "uint256" - } - ], - "internalType": "struct ITempusFees.FeesConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "matured", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maturityInterestRate", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maturityTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxDepositFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxEarlyRedeemFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxMatureRedeemFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maximumNegativeYieldDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "yieldTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "numAssetsPerYieldToken", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "backingTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "numYieldTokensPerAsset", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "backingTokenAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "onDepositBacking", - "outputs": [ - { - "internalType": "uint256", - "name": "mintedShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositedYBT", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "yieldTokenAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "onDepositYieldBearing", - "outputs": [ - { - "internalType": "uint256", - "name": "mintedShares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "depositedBT", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pricePerPrincipalShare", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "pricePerPrincipalShareStored", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pricePerYieldShare", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "pricePerYieldShareStored", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "principalShare", - "outputs": [ - { - "internalType": "contract IPoolShare", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "protocolName", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "uint256", - "name": "principalAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "yieldAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "redeem", - "outputs": [ - { - "internalType": "uint256", - "name": "redeemedYieldTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "uint256", - "name": "principalAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "yieldAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "redeemToBacking", - "outputs": [ - { - "internalType": "uint256", - "name": "redeemedYieldTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "redeemedBackingTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "fee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rate", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "depositPercent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "earlyRedeemPercent", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "matureRedeemPercent", - "type": "uint256" - } - ], - "internalType": "struct ITempusFees.FeesConfig", - "name": "newFeesConfig", - "type": "tuple" - } - ], - "name": "setFeesConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "startTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalFees", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - } - ], - "name": "transferFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "components": [ - { - "internalType": "uint16", - "name": "major", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "minor", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "patch", - "type": "uint16" - } - ], - "internalType": "struct IVersioned.Version", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "yieldBearingONE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "yieldBearingToken", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "yieldShare", - "outputs": [ - { - "internalType": "contract IPoolShare", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/tempus/contracts/abis/tempus-py-token.json b/src/apps/tempus/contracts/abis/tempus-py-token.json deleted file mode 100644 index daa11bed9..000000000 --- a/src/apps/tempus/contracts/abis/tempus-py-token.json +++ /dev/null @@ -1,412 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "contract ITempusPool", - "name": "_pool", - "type": "address" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getPricePerFullShare", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getPricePerFullShareStored", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "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": "kind", - "outputs": [ - { - "internalType": "enum IPoolShare.ShareKind", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pool", - "outputs": [ - { - "internalType": "contract ITempusPool", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/tempus/contracts/index.ts b/src/apps/tempus/contracts/index.ts deleted file mode 100644 index 5dcfebdf6..000000000 --- a/src/apps/tempus/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/tempus/contracts/viem.contract-factory.ts b/src/apps/tempus/contracts/viem.contract-factory.ts deleted file mode 100644 index 19f0b748e..000000000 --- a/src/apps/tempus/contracts/viem.contract-factory.ts +++ /dev/null @@ -1,23 +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 { TempusAmm__factory, TempusPool__factory, TempusPyToken__factory } from './viem'; - -type ContractOpts = { address: string; network: Network }; - -@Injectable() -export class TempusViemContractFactory { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - tempusAmm({ address, network }: ContractOpts) { - return TempusAmm__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - tempusPool({ address, network }: ContractOpts) { - return TempusPool__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - tempusPyToken({ address, network }: ContractOpts) { - return TempusPyToken__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } -} diff --git a/src/apps/tempus/contracts/viem/TempusAmm.ts b/src/apps/tempus/contracts/viem/TempusAmm.ts deleted file mode 100644 index d3c735842..000000000 --- a/src/apps/tempus/contracts/viem/TempusAmm.ts +++ /dev/null @@ -1,1160 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const tempusAmmAbi = [ - { - inputs: [ - { - internalType: 'contract IVault', - name: 'vault', - type: 'address', - }, - { - internalType: 'string', - name: 'name', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol', - type: 'string', - }, - { - internalType: 'contract ITempusPool', - name: 'pool', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amplificationStart', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amplificationEnd', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'swapFeePercentage', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'pauseWindowDuration', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bufferPeriodDuration', - type: 'uint256', - }, - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'startValue', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'endValue', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'startTime', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'endTime', - type: 'uint256', - }, - ], - name: 'AmpUpdateStarted', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'currentValue', - type: 'uint256', - }, - ], - name: 'AmpUpdateStopped', - type: 'event', - }, - { - 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: false, - internalType: 'bool', - name: 'paused', - type: 'bool', - }, - ], - name: 'PausedStateChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'swapFeePercentage', - type: 'uint256', - }, - ], - name: 'SwapFeePercentageChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'selector', - type: 'bytes4', - }, - ], - name: 'getActionId', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getAmplificationParameter', - outputs: [ - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'isUpdating', - type: 'bool', - }, - { - internalType: 'uint256', - name: 'precision', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getAuthorizer', - outputs: [ - { - internalType: 'contract IAuthorizer', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'principalsStaked', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'yieldsStaked', - type: 'uint256', - }, - ], - name: 'getExpectedBPTInGivenTokensOut', - outputs: [ - { - internalType: 'uint256', - name: 'lpTokens', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256[]', - name: 'amountsIn', - type: 'uint256[]', - }, - ], - name: 'getExpectedLPTokensForTokensIn', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'yieldShareIn', - type: 'bool', - }, - ], - name: 'getExpectedReturnGivenIn', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'bptAmountIn', - type: 'uint256', - }, - ], - name: 'getExpectedTokensOutGivenBPTIn', - outputs: [ - { - internalType: 'uint256', - name: 'principals', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'yields', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getLastInvariant', - outputs: [ - { - internalType: 'uint256', - name: 'lastInvariant', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'lastInvariantAmp', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getOwner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPausedState', - outputs: [ - { - internalType: 'bool', - name: 'paused', - type: 'bool', - }, - { - internalType: 'uint256', - name: 'pauseWindowEndTime', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'bufferPeriodEndTime', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getPoolId', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getScalingFactors', - outputs: [ - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'principals', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'yields', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'threshold', - type: 'uint256', - }, - ], - name: 'getSwapAmountToEndWithEqualShares', - outputs: [ - { - internalType: 'uint256', - name: 'amountIn', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'yieldsIn', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getSwapFeePercentage', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'getVault', - outputs: [ - { - internalType: 'contract IVault', - 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: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'nonces', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'poolId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256[]', - name: 'balances', - type: 'uint256[]', - }, - { - internalType: 'uint256', - name: 'lastChangeBlock', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'protocolSwapFeePercentage', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'userData', - type: 'bytes', - }, - ], - name: 'onExitPool', - outputs: [ - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'poolId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256[]', - name: 'balances', - type: 'uint256[]', - }, - { - internalType: 'uint256', - name: 'lastChangeBlock', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'protocolSwapFeePercentage', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'userData', - type: 'bytes', - }, - ], - name: 'onJoinPool', - outputs: [ - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'enum IVault.SwapKind', - name: 'kind', - type: 'uint8', - }, - { - internalType: 'contract IERC20', - name: 'tokenIn', - type: 'address', - }, - { - internalType: 'contract IERC20', - name: 'tokenOut', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bytes32', - name: 'poolId', - type: 'bytes32', - }, - { - internalType: 'uint256', - name: 'lastChangeBlock', - type: 'uint256', - }, - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'address', - name: 'to', - type: 'address', - }, - { - internalType: 'bytes', - name: 'userData', - type: 'bytes', - }, - ], - internalType: 'struct IPoolSwapStructs.SwapRequest', - name: 'request', - type: 'tuple', - }, - { - internalType: 'uint256', - name: 'balanceTokenIn', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'balanceTokenOut', - type: 'uint256', - }, - ], - name: 'onSwap', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, - ], - name: 'permit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'poolId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256[]', - name: 'balances', - type: 'uint256[]', - }, - { - internalType: 'uint256', - name: 'lastChangeBlock', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'protocolSwapFeePercentage', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'userData', - type: 'bytes', - }, - ], - name: 'queryExit', - outputs: [ - { - internalType: 'uint256', - name: 'bptIn', - type: 'uint256', - }, - { - internalType: 'uint256[]', - name: 'amountsOut', - type: 'uint256[]', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'poolId', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256[]', - name: 'balances', - type: 'uint256[]', - }, - { - internalType: 'uint256', - name: 'lastChangeBlock', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'protocolSwapFeePercentage', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'userData', - type: 'bytes', - }, - ], - name: 'queryJoin', - outputs: [ - { - internalType: 'uint256', - name: 'bptOut', - type: 'uint256', - }, - { - internalType: 'uint256[]', - name: 'amountsIn', - type: 'uint256[]', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'contract IERC20', - name: 'token', - type: 'address', - }, - { - internalType: 'bytes', - name: 'poolConfig', - type: 'bytes', - }, - ], - name: 'setAssetManagerPoolConfig', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: 'paused', - type: 'bool', - }, - ], - name: 'setPaused', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'swapFeePercentage', - type: 'uint256', - }, - ], - name: 'setSwapFeePercentage', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'rawEndValue', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'endTime', - type: 'uint256', - }, - ], - name: 'startAmplificationParameterUpdate', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'stopAmplificationParameterUpdate', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'tempusPool', - outputs: [ - { - internalType: 'contract ITempusPool', - name: '', - type: 'address', - }, - ], - 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', - }, -] as const; - -export type TempusAmm = typeof tempusAmmAbi; -export type TempusAmmContract = GetContractReturnType; - -export class TempusAmm__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: tempusAmmAbi, publicClient: client }); - } -} diff --git a/src/apps/tempus/contracts/viem/TempusPool.ts b/src/apps/tempus/contracts/viem/TempusPool.ts deleted file mode 100644 index 67b3f76b7..000000000 --- a/src/apps/tempus/contracts/viem/TempusPool.ts +++ /dev/null @@ -1,881 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const tempusPoolAbi = [ - { - inputs: [ - { - internalType: 'contract ILido', - name: 'token', - type: 'address', - }, - { - internalType: 'address', - name: 'controller', - type: 'address', - }, - { - internalType: 'uint256', - name: 'maturity', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'estYield', - type: 'uint256', - }, - { - components: [ - { - internalType: 'string', - name: 'name', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol', - type: 'string', - }, - ], - internalType: 'struct TokenData', - name: 'principalsData', - type: 'tuple', - }, - { - components: [ - { - internalType: 'string', - name: 'name', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol', - type: 'string', - }, - ], - internalType: 'struct TokenData', - name: 'yieldsData', - type: 'tuple', - }, - { - components: [ - { - internalType: 'uint256', - name: 'depositPercent', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'earlyRedeemPercent', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'matureRedeemPercent', - type: 'uint256', - }, - ], - internalType: 'struct ITempusFees.FeesConfig', - name: 'maxFeeSetup', - type: 'tuple', - }, - { - internalType: 'address', - name: 'referrerAddress', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'currentOwner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'proposedOwner', - type: 'address', - }, - ], - name: 'OwnershipProposed', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousOwner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - inputs: [], - name: 'acceptOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'backingToken', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'backingTokenONE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'controller', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'currentInterestRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'isBackingToken', - type: 'bool', - }, - ], - name: 'estimatedMintedShares', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'principals', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'yields', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'toBackingToken', - type: 'bool', - }, - ], - name: 'estimatedRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'exceptionalHaltTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'exchangeRateONE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'finalize', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getFeesConfig', - outputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'depositPercent', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'earlyRedeemPercent', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'matureRedeemPercent', - type: 'uint256', - }, - ], - internalType: 'struct ITempusFees.FeesConfig', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'initialInterestRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'matured', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maturityInterestRate', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maturityTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maxDepositFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maxEarlyRedeemFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maxMatureRedeemFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'maximumNegativeYieldDuration', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'yieldTokens', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'numAssetsPerYieldToken', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'backingTokens', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'numYieldTokensPerAsset', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'pure', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'backingTokenAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'onDepositBacking', - outputs: [ - { - internalType: 'uint256', - name: 'mintedShares', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositedYBT', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'yieldTokenAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'onDepositYieldBearing', - outputs: [ - { - internalType: 'uint256', - name: 'mintedShares', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'depositedBT', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'pricePerPrincipalShare', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'pricePerPrincipalShareStored', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'pricePerYieldShare', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'pricePerYieldShareStored', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'principalShare', - outputs: [ - { - internalType: 'contract IPoolShare', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'protocolName', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'uint256', - name: 'principalAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'yieldAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'redeem', - outputs: [ - { - internalType: 'uint256', - name: 'redeemedYieldTokens', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address', - }, - { - internalType: 'uint256', - name: 'principalAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'yieldAmount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'redeemToBacking', - outputs: [ - { - internalType: 'uint256', - name: 'redeemedYieldTokens', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'redeemedBackingTokens', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'rate', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - components: [ - { - internalType: 'uint256', - name: 'depositPercent', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'earlyRedeemPercent', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'matureRedeemPercent', - type: 'uint256', - }, - ], - internalType: 'struct ITempusFees.FeesConfig', - name: 'newFeesConfig', - type: 'tuple', - }, - ], - name: 'setFeesConfig', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'startTime', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalFees', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'transferFees', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'version', - outputs: [ - { - components: [ - { - internalType: 'uint16', - name: 'major', - type: 'uint16', - }, - { - internalType: 'uint16', - name: 'minor', - type: 'uint16', - }, - { - internalType: 'uint16', - name: 'patch', - type: 'uint16', - }, - ], - internalType: 'struct IVersioned.Version', - name: '', - type: 'tuple', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'yieldBearingONE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'yieldBearingToken', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'yieldShare', - outputs: [ - { - internalType: 'contract IPoolShare', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type TempusPool = typeof tempusPoolAbi; -export type TempusPoolContract = GetContractReturnType; - -export class TempusPool__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: tempusPoolAbi, publicClient: client }); - } -} diff --git a/src/apps/tempus/contracts/viem/TempusPyToken.ts b/src/apps/tempus/contracts/viem/TempusPyToken.ts deleted file mode 100644 index 191b913eb..000000000 --- a/src/apps/tempus/contracts/viem/TempusPyToken.ts +++ /dev/null @@ -1,426 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const tempusPyTokenAbi = [ - { - inputs: [ - { - internalType: 'contract ITempusPool', - name: '_pool', - type: 'address', - }, - { - internalType: 'string', - name: 'name', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol', - type: 'string', - }, - { - internalType: 'uint8', - name: 'decimals', - type: 'uint8', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'burn', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'burnFrom', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'subtractedValue', - type: 'uint256', - }, - ], - name: 'decreaseAllowance', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getPricePerFullShare', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getPricePerFullShareStored', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - 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: 'kind', - outputs: [ - { - internalType: 'enum IPoolShare.ShareKind', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'manager', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'mint', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'pool', - outputs: [ - { - internalType: 'contract ITempusPool', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transfer', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'sender', - type: 'address', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'transferFrom', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type TempusPyToken = typeof tempusPyTokenAbi; -export type TempusPyTokenContract = GetContractReturnType; - -export class TempusPyToken__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: tempusPyTokenAbi, publicClient: client }); - } -} diff --git a/src/apps/tempus/contracts/viem/index.ts b/src/apps/tempus/contracts/viem/index.ts deleted file mode 100644 index 90342d6d8..000000000 --- a/src/apps/tempus/contracts/viem/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -export type { TempusAmm } from './TempusAmm'; -export type { TempusPool } from './TempusPool'; -export type { TempusPyToken } from './TempusPyToken'; - -export { TempusAmm__factory } from './TempusAmm'; -export { TempusPool__factory } from './TempusPool'; -export { TempusPyToken__factory } from './TempusPyToken'; diff --git a/src/apps/tempus/ethereum/tempus.amm.token-fetcher.ts b/src/apps/tempus/ethereum/tempus.amm.token-fetcher.ts deleted file mode 100644 index d83f016a2..000000000 --- a/src/apps/tempus/ethereum/tempus.amm.token-fetcher.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { TempusAmmTokenFetcher } from '../common/tempus.amm.token-fetcher'; - -@PositionTemplate() -export class EthereumTempusAmmTokenFetcher extends TempusAmmTokenFetcher { - groupLabel = 'AMM Liquidity'; -} diff --git a/src/apps/tempus/ethereum/tempus.pool.token-fetcher.ts b/src/apps/tempus/ethereum/tempus.pool.token-fetcher.ts deleted file mode 100644 index ab0888a68..000000000 --- a/src/apps/tempus/ethereum/tempus.pool.token-fetcher.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { TempusPoolTokenFetcher } from '../common/tempus.pool.token-fetcher'; - -@PositionTemplate() -export class EthereumTempusPoolTokenFetcher extends TempusPoolTokenFetcher { - groupLabel = 'P-Y Tokens'; -} diff --git a/src/apps/tempus/fantom/tempus.amm.token-fetcher.ts b/src/apps/tempus/fantom/tempus.amm.token-fetcher.ts deleted file mode 100644 index 09af98b6f..000000000 --- a/src/apps/tempus/fantom/tempus.amm.token-fetcher.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { TempusAmmTokenFetcher } from '../common/tempus.amm.token-fetcher'; - -@PositionTemplate() -export class FantomTempusAmmTokenFetcher extends TempusAmmTokenFetcher { - groupLabel = 'AMM Liquidity'; -} diff --git a/src/apps/tempus/fantom/tempus.pool.token-fetcher.ts b/src/apps/tempus/fantom/tempus.pool.token-fetcher.ts deleted file mode 100644 index a56e294e2..000000000 --- a/src/apps/tempus/fantom/tempus.pool.token-fetcher.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { TempusPoolTokenFetcher } from '../common/tempus.pool.token-fetcher'; - -@PositionTemplate() -export class FantomTempusPoolTokenFetcher extends TempusPoolTokenFetcher { - groupLabel = 'P-Y Tokens'; -} diff --git a/src/apps/tempus/tempus.module.ts b/src/apps/tempus/tempus.module.ts deleted file mode 100644 index 42c934c6d..000000000 --- a/src/apps/tempus/tempus.module.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Module } from '@nestjs/common'; - -import { AbstractApp } from '~app/app.dynamic-module'; - -import { TempusViemContractFactory } from './contracts'; -import { EthereumTempusAmmTokenFetcher } from './ethereum/tempus.amm.token-fetcher'; -import { EthereumTempusPoolTokenFetcher } from './ethereum/tempus.pool.token-fetcher'; -import { FantomTempusAmmTokenFetcher } from './fantom/tempus.amm.token-fetcher'; -import { FantomTempusPoolTokenFetcher } from './fantom/tempus.pool.token-fetcher'; - -@Module({ - providers: [ - TempusViemContractFactory, - // Ethereum - EthereumTempusAmmTokenFetcher, - EthereumTempusPoolTokenFetcher, - // Fantom - FantomTempusAmmTokenFetcher, - FantomTempusPoolTokenFetcher, - ], -}) -export class TempusAppModule extends AbstractApp() {} diff --git a/src/apps/unipilot/assets/logo.png b/src/apps/unipilot/assets/logo.png deleted file mode 100644 index fbbc85ebc..000000000 Binary files a/src/apps/unipilot/assets/logo.png and /dev/null differ diff --git a/src/apps/unipilot/common/unipilot.vault-definition-resolver.ts b/src/apps/unipilot/common/unipilot.vault-definition-resolver.ts deleted file mode 100644 index 934ccd1e3..000000000 --- a/src/apps/unipilot/common/unipilot.vault-definition-resolver.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { Inject, Injectable } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { gqlFetch } from '~app-toolkit/helpers/the-graph.helper'; -import { Cache } from '~cache/cache.decorator'; -import { Network } from '~types/network.interface'; - -import { UNIPILOT_VAULTS, UNIPILOT_VAULTS_POLYGON } from '../graphql/queries'; -import { SUBGRAPH_ENDPOINTS } from '../utils/constants'; -import { UnipilotVaultDefinition, UnipilotVaultFetcherResponse } from '../utils/generalTypes'; - -@Injectable() -export class UnipilotVaultDefinitionsResolver { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - @Cache({ - key: network => `studio:unipilot:${network}:pool-data-definitions`, - ttl: 5 * 60, // 5 minutes - }) - private async getVaultDefinitionsData(network: Network) { - const Query = network === Network.ETHEREUM_MAINNET ? UNIPILOT_VAULTS : UNIPILOT_VAULTS_POLYGON; - - const data = await gqlFetch({ - endpoint: SUBGRAPH_ENDPOINTS[network].stats, - query: Query, - variables: { - first: 1000, - }, - }); - - return data.vaults; - } - - async getVaultDefinitions(network: Network): Promise { - const vaultsDefinitionsData = await this.getVaultDefinitionsData(network); - - const vaultsDefinitions = vaultsDefinitionsData.map(vault => { - return { - address: vault.id, - token0Address: vault.token0.id, - token1Address: vault.token1.id, - feeTier: vault.feeTier, - token0Symbol: vault.token0.symbol, - token1Symbol: vault.token1.symbol, - strategyId: vault.strategyId, - totalLockedToken0: vault.totalLockedToken0, - totalLockedToken1: vault.totalLockedToken1, - }; - }); - - return vaultsDefinitions; - } -} diff --git a/src/apps/unipilot/common/unipilot.vault.token-fetcher.ts b/src/apps/unipilot/common/unipilot.vault.token-fetcher.ts deleted file mode 100644 index b289c4364..000000000 --- a/src/apps/unipilot/common/unipilot.vault.token-fetcher.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { MetaType } from '~position/position.interface'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { - DefaultAppTokenDataProps, - GetAddressesParams, - GetDisplayPropsParams, - GetPricePerShareParams, - GetUnderlyingTokensParams, -} from '~position/template/app-token.template.types'; -import { GetTokenDefinitionsParams } from '~position/template/contract-position.template.types'; - -import { UnipilotViemContractFactory } from '../contracts'; -import { UnipilotVault } from '../contracts/viem'; -import { UnipilotVaultDefinition } from '../utils/generalTypes'; - -import { UnipilotVaultDefinitionsResolver } from './unipilot.vault-definition-resolver'; - -export type UnipilotVaultTokenDataProps = DefaultAppTokenDataProps & { - fee: number; -}; - -export abstract class UnipilotVaultTokenFetcher extends AppTokenTemplatePositionFetcher< - UnipilotVault, - UnipilotVaultTokenDataProps, - UnipilotVaultDefinition -> { - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(UnipilotVaultDefinitionsResolver) - private readonly vaultDefinitionsResolver: UnipilotVaultDefinitionsResolver, - @Inject(UnipilotViemContractFactory) - private readonly contractFactory: UnipilotViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.unipilotVault({ address, network: this.network }); - } - - async getDefinitions(): Promise { - return this.vaultDefinitionsResolver.getVaultDefinitions(this.network); - } - - async getAddresses({ definitions }: GetAddressesParams): Promise { - return definitions.map(v => v.address); - } - - async getUnderlyingTokenDefinitions({ - definition, - }: GetUnderlyingTokensParams) { - return [ - { address: definition.token0Address, network: this.network }, - { address: definition.token1Address, network: this.network }, - ]; - } - - async getTokenDefinitions({ definition }: GetTokenDefinitionsParams) { - return [ - { - metaType: MetaType.SUPPLIED, - address: definition.token0Address, - network: this.network, - }, - { - metaType: MetaType.SUPPLIED, - address: definition.token1Address, - network: this.network, - }, - ]; - } - - async getPricePerShare({ - appToken, - definition, - }: GetPricePerShareParams) { - const { totalLockedToken0, totalLockedToken1 } = definition; - const reservesRaw = [totalLockedToken0, totalLockedToken1]; - const reserves = reservesRaw.map((r, i) => Number(r) / 10 ** appToken.tokens[i].decimals); - const pricePerShare = reserves.map(r => { - return r == 0 ? 0 : r / appToken.supply; - }); - return pricePerShare; - } - - async getLabel({ - appToken, - definition, - }: GetDisplayPropsParams): Promise { - const strategyLabels = { - '0': '', - '1': 'Wide', - '2': 'Balanced', - '3': 'Narrow', - }; - const { feeTier, strategyId } = definition; - const { tokens } = appToken; - - const feeTierLabel = parseFloat(feeTier) / 10000 + '%'; - - const strategyLabel: string = strategyId ? strategyLabels[strategyId] : ''; - const label = `${tokens[0].symbol}/${tokens[1].symbol} ${feeTierLabel} ${strategyLabel}`; - - return label; - } - - async getSecondaryLabel({ - appToken, - }: GetDisplayPropsParams) { - const { liquidity, reserves } = appToken.dataProps; - const reservePercentages = appToken.tokens.map((t, i) => reserves[i] * (t.price / liquidity)); - return reservePercentages.map(p => `${Math.round(p * 100)}%`).join(' / '); - } -} diff --git a/src/apps/unipilot/contracts/abis/unipilot-ethereum-factory.json b/src/apps/unipilot/contracts/abis/unipilot-ethereum-factory.json deleted file mode 100644 index 263801da3..000000000 --- a/src/apps/unipilot/contracts/abis/unipilot-ethereum-factory.json +++ /dev/null @@ -1,104 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_uniswapFactory", "type": "address" }, - { "internalType": "address", "name": "_governance", "type": "address" }, - { "internalType": "address", "name": "_uniStrategy", "type": "address" }, - { "internalType": "address", "name": "_indexFund", "type": "address" }, - { "internalType": "address", "name": "_WETH", "type": "address" }, - { "internalType": "uint8", "name": "percentage", "type": "uint8" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "_oldGovernance", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "_newGovernance", "type": "address" } - ], - "name": "GovernanceChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "_tokenA", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "_tokenB", "type": "address" }, - { "indexed": false, "internalType": "uint24", "name": "_fee", "type": "uint24" }, - { "indexed": true, "internalType": "address", "name": "_vault", "type": "address" } - ], - "name": "VaultCreated", - "type": "event" - }, - { - "inputs": [ - { "internalType": "address", "name": "_tokenA", "type": "address" }, - { "internalType": "address", "name": "_tokenB", "type": "address" }, - { "internalType": "uint24", "name": "_fee", "type": "uint24" }, - { "internalType": "uint160", "name": "_sqrtPriceX96", "type": "uint160" }, - { "internalType": "string", "name": "_name", "type": "string" }, - { "internalType": "string", "name": "_symbol", "type": "string" } - ], - "name": "createVault", - "outputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getUnipilotDetails", - "outputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint8", "name": "", "type": "uint8" }, - { "internalType": "uint8", "name": "", "type": "uint8" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "isWhitelist", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_newGovernance", "type": "address" }], - "name": "setGovernance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "_strategy", "type": "address" }, - { "internalType": "address", "name": "_indexFund", "type": "address" }, - { "internalType": "uint8", "name": "_indexFundPercentage", "type": "uint8" } - ], - "name": "setUnipilotDetails", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_address", "type": "address" }], - "name": "toggleWhitelistAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint24", "name": "", "type": "uint24" } - ], - "name": "vaults", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/unipilot/contracts/abis/unipilot-polygon-factory.json b/src/apps/unipilot/contracts/abis/unipilot-polygon-factory.json deleted file mode 100644 index f3879f39b..000000000 --- a/src/apps/unipilot/contracts/abis/unipilot-polygon-factory.json +++ /dev/null @@ -1,107 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_uniswapFactory", "type": "address" }, - { "internalType": "address", "name": "_governance", "type": "address" }, - { "internalType": "address", "name": "_uniStrategy", "type": "address" }, - { "internalType": "address", "name": "_indexFund", "type": "address" }, - { "internalType": "address", "name": "_WETH", "type": "address" }, - { "internalType": "uint8", "name": "percentage", "type": "uint8" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "_oldGovernance", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "_newGovernance", "type": "address" } - ], - "name": "GovernanceChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "_tokenA", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "_tokenB", "type": "address" }, - { "indexed": false, "internalType": "uint16", "name": "_strategyType", "type": "uint16" }, - { "indexed": false, "internalType": "uint24", "name": "_fee", "type": "uint24" }, - { "indexed": true, "internalType": "address", "name": "_vault", "type": "address" } - ], - "name": "VaultCreated", - "type": "event" - }, - { - "inputs": [ - { "internalType": "address", "name": "_tokenA", "type": "address" }, - { "internalType": "address", "name": "_tokenB", "type": "address" }, - { "internalType": "uint24", "name": "_fee", "type": "uint24" }, - { "internalType": "uint16", "name": "_vaultStrategy", "type": "uint16" }, - { "internalType": "uint160", "name": "_sqrtPriceX96", "type": "uint160" }, - { "internalType": "string", "name": "_name", "type": "string" }, - { "internalType": "string", "name": "_symbol", "type": "string" } - ], - "name": "createVault", - "outputs": [{ "internalType": "address", "name": "_vault", "type": "address" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getUnipilotDetails", - "outputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint8", "name": "", "type": "uint8" }, - { "internalType": "uint8", "name": "", "type": "uint8" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "isWhitelist", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_newGovernance", "type": "address" }], - "name": "setGovernance", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "_strategy", "type": "address" }, - { "internalType": "address", "name": "_indexFund", "type": "address" }, - { "internalType": "uint8", "name": "_indexFundPercentage", "type": "uint8" } - ], - "name": "setUnipilotDetails", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_address", "type": "address" }], - "name": "toggleWhitelistAccount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint24", "name": "", "type": "uint24" }, - { "internalType": "uint16", "name": "", "type": "uint16" } - ], - "name": "vaults", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/unipilot/contracts/abis/unipilot-vault.json b/src/apps/unipilot/contracts/abis/unipilot-vault.json deleted file mode 100644 index 5b2f71066..000000000 --- a/src/apps/unipilot/contracts/abis/unipilot-vault.json +++ /dev/null @@ -1,303 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_pool", "type": "address" }, - { "internalType": "address", "name": "_unipilotFactory", "type": "address" }, - { "internalType": "address", "name": "_WETH", "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": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } - ], - "name": "CompoundFees", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "depositor", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "recipient", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "lpShares", "type": "uint256" } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "bool", "name": "isReadjustLiquidity", "type": "bool" }, - { "indexed": false, "internalType": "uint256", "name": "fees0", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "fees1", "type": "uint256" } - ], - "name": "FeesSnapshot", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "uint256", "name": "reserves0", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "reserves1", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "fees0", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "fees1", "type": "uint256" } - ], - "name": "PullLiquidity", - "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": "recipient", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "amount1", "type": "uint256" } - ], - "name": "Withdraw", - "type": "event" - }, - { "stateMutability": "payable", "type": "fallback" }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" } - ], - "name": "allowance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "approve", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "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": "amount0Desired", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1Desired", "type": "uint256" }, - { "internalType": "address", "name": "recipient", "type": "address" } - ], - "name": "deposit", - "outputs": [ - { "internalType": "uint256", "name": "lpShares", "type": "uint256" }, - { "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1", "type": "uint256" } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getPositionDetails", - "outputs": [ - { "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1", "type": "uint256" }, - { "internalType": "uint256", "name": "fees0", "type": "uint256" }, - { "internalType": "uint256", "name": "fees1", "type": "uint256" }, - { "internalType": "uint128", "name": "baseLiquidity", "type": "uint128" }, - { "internalType": "uint128", "name": "rangeLiquidity", "type": "uint128" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getVaultInfo", - "outputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint24", "name": "", "type": "uint24" }, - { "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": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], - "name": "nonces", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "owner", "type": "address" }, - { "internalType": "address", "name": "spender", "type": "address" }, - { "internalType": "uint256", "name": "value", "type": "uint256" }, - { "internalType": "uint256", "name": "deadline", "type": "uint256" }, - { "internalType": "uint8", "name": "v", "type": "uint8" }, - { "internalType": "bytes32", "name": "r", "type": "bytes32" }, - { "internalType": "bytes32", "name": "s", "type": "bytes32" } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "readjustLiquidity", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "ticksData", - "outputs": [ - { "internalType": "int24", "name": "baseTickLower", "type": "int24" }, - { "internalType": "int24", "name": "baseTickUpper", "type": "int24" }, - { "internalType": "int24", "name": "rangeTickLower", "type": "int24" }, - { "internalType": "int24", "name": "rangeTickUpper", "type": "int24" } - ], - "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": "uint256", "name": "amount0Owed", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1Owed", "type": "uint256" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "uniswapV3MintCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "int256", "name": "amount0", "type": "int256" }, - { "internalType": "int256", "name": "amount1", "type": "int256" }, - { "internalType": "bytes", "name": "data", "type": "bytes" } - ], - "name": "uniswapV3SwapCallback", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, - { "internalType": "address", "name": "recipient", "type": "address" }, - { "internalType": "bool", "name": "refundAsETH", "type": "bool" } - ], - "name": "withdraw", - "outputs": [ - { "internalType": "uint256", "name": "amount0", "type": "uint256" }, - { "internalType": "uint256", "name": "amount1", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { "stateMutability": "payable", "type": "receive" } -] diff --git a/src/apps/unipilot/contracts/index.ts b/src/apps/unipilot/contracts/index.ts deleted file mode 100644 index 5dcfebdf6..000000000 --- a/src/apps/unipilot/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/unipilot/contracts/viem.contract-factory.ts b/src/apps/unipilot/contracts/viem.contract-factory.ts deleted file mode 100644 index dce452ec3..000000000 --- a/src/apps/unipilot/contracts/viem.contract-factory.ts +++ /dev/null @@ -1,23 +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 { UnipilotEthereumFactory__factory, UnipilotPolygonFactory__factory, UnipilotVault__factory } from './viem'; - -type ContractOpts = { address: string; network: Network }; - -@Injectable() -export class UnipilotViemContractFactory { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - unipilotEthereumFactory({ address, network }: ContractOpts) { - return UnipilotEthereumFactory__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - unipilotPolygonFactory({ address, network }: ContractOpts) { - return UnipilotPolygonFactory__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - unipilotVault({ address, network }: ContractOpts) { - return UnipilotVault__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } -} diff --git a/src/apps/unipilot/contracts/viem/UnipilotEthereumFactory.ts b/src/apps/unipilot/contracts/viem/UnipilotEthereumFactory.ts deleted file mode 100644 index 5e081f3c8..000000000 --- a/src/apps/unipilot/contracts/viem/UnipilotEthereumFactory.ts +++ /dev/null @@ -1,276 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const unipilotEthereumFactoryAbi = [ - { - inputs: [ - { - internalType: 'address', - name: '_uniswapFactory', - type: 'address', - }, - { - internalType: 'address', - name: '_governance', - type: 'address', - }, - { - internalType: 'address', - name: '_uniStrategy', - type: 'address', - }, - { - internalType: 'address', - name: '_indexFund', - type: 'address', - }, - { - internalType: 'address', - name: '_WETH', - type: 'address', - }, - { - internalType: 'uint8', - name: 'percentage', - type: 'uint8', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: '_oldGovernance', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: '_newGovernance', - type: 'address', - }, - ], - name: 'GovernanceChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: '_tokenA', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: '_tokenB', - type: 'address', - }, - { - indexed: false, - internalType: 'uint24', - name: '_fee', - type: 'uint24', - }, - { - indexed: true, - internalType: 'address', - name: '_vault', - type: 'address', - }, - ], - name: 'VaultCreated', - type: 'event', - }, - { - inputs: [ - { - internalType: 'address', - name: '_tokenA', - type: 'address', - }, - { - internalType: 'address', - name: '_tokenB', - type: 'address', - }, - { - internalType: 'uint24', - name: '_fee', - type: 'uint24', - }, - { - internalType: 'uint160', - name: '_sqrtPriceX96', - type: 'uint160', - }, - { - internalType: 'string', - name: '_name', - type: 'string', - }, - { - internalType: 'string', - name: '_symbol', - type: 'string', - }, - ], - name: 'createVault', - outputs: [ - { - internalType: 'address', - name: '_vault', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getUnipilotDetails', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'isWhitelist', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newGovernance', - type: 'address', - }, - ], - name: 'setGovernance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_strategy', - type: 'address', - }, - { - internalType: 'address', - name: '_indexFund', - type: 'address', - }, - { - internalType: 'uint8', - name: '_indexFundPercentage', - type: 'uint8', - }, - ], - name: 'setUnipilotDetails', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_address', - type: 'address', - }, - ], - name: 'toggleWhitelistAccount', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint24', - name: '', - type: 'uint24', - }, - ], - name: 'vaults', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type UnipilotEthereumFactory = typeof unipilotEthereumFactoryAbi; -export type UnipilotEthereumFactoryContract = GetContractReturnType; - -export class UnipilotEthereumFactory__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: unipilotEthereumFactoryAbi, publicClient: client }); - } -} diff --git a/src/apps/unipilot/contracts/viem/UnipilotPolygonFactory.ts b/src/apps/unipilot/contracts/viem/UnipilotPolygonFactory.ts deleted file mode 100644 index ed72c5eaa..000000000 --- a/src/apps/unipilot/contracts/viem/UnipilotPolygonFactory.ts +++ /dev/null @@ -1,292 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const unipilotPolygonFactoryAbi = [ - { - inputs: [ - { - internalType: 'address', - name: '_uniswapFactory', - type: 'address', - }, - { - internalType: 'address', - name: '_governance', - type: 'address', - }, - { - internalType: 'address', - name: '_uniStrategy', - type: 'address', - }, - { - internalType: 'address', - name: '_indexFund', - type: 'address', - }, - { - internalType: 'address', - name: '_WETH', - type: 'address', - }, - { - internalType: 'uint8', - name: 'percentage', - type: 'uint8', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: '_oldGovernance', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: '_newGovernance', - type: 'address', - }, - ], - name: 'GovernanceChanged', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: '_tokenA', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: '_tokenB', - type: 'address', - }, - { - indexed: false, - internalType: 'uint16', - name: '_strategyType', - type: 'uint16', - }, - { - indexed: false, - internalType: 'uint24', - name: '_fee', - type: 'uint24', - }, - { - indexed: true, - internalType: 'address', - name: '_vault', - type: 'address', - }, - ], - name: 'VaultCreated', - type: 'event', - }, - { - inputs: [ - { - internalType: 'address', - name: '_tokenA', - type: 'address', - }, - { - internalType: 'address', - name: '_tokenB', - type: 'address', - }, - { - internalType: 'uint24', - name: '_fee', - type: 'uint24', - }, - { - internalType: 'uint16', - name: '_vaultStrategy', - type: 'uint16', - }, - { - internalType: 'uint160', - name: '_sqrtPriceX96', - type: 'uint160', - }, - { - internalType: 'string', - name: '_name', - type: 'string', - }, - { - internalType: 'string', - name: '_symbol', - type: 'string', - }, - ], - name: 'createVault', - outputs: [ - { - internalType: 'address', - name: '_vault', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getUnipilotDetails', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'isWhitelist', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_newGovernance', - type: 'address', - }, - ], - name: 'setGovernance', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_strategy', - type: 'address', - }, - { - internalType: 'address', - name: '_indexFund', - type: 'address', - }, - { - internalType: 'uint8', - name: '_indexFundPercentage', - type: 'uint8', - }, - ], - name: 'setUnipilotDetails', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_address', - type: 'address', - }, - ], - name: 'toggleWhitelistAccount', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint24', - name: '', - type: 'uint24', - }, - { - internalType: 'uint16', - name: '', - type: 'uint16', - }, - ], - name: 'vaults', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type UnipilotPolygonFactory = typeof unipilotPolygonFactoryAbi; -export type UnipilotPolygonFactoryContract = GetContractReturnType; - -export class UnipilotPolygonFactory__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: unipilotPolygonFactoryAbi, publicClient: client }); - } -} diff --git a/src/apps/unipilot/contracts/viem/UnipilotVault.ts b/src/apps/unipilot/contracts/viem/UnipilotVault.ts deleted file mode 100644 index acff81ffb..000000000 --- a/src/apps/unipilot/contracts/viem/UnipilotVault.ts +++ /dev/null @@ -1,763 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const unipilotVaultAbi = [ - { - inputs: [ - { - internalType: 'address', - name: '_pool', - type: 'address', - }, - { - internalType: 'address', - name: '_unipilotFactory', - type: 'address', - }, - { - internalType: 'address', - name: '_WETH', - 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: false, - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - ], - name: 'CompoundFees', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'depositor', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'lpShares', - type: 'uint256', - }, - ], - name: 'Deposit', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'isReadjustLiquidity', - type: 'bool', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fees0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fees1', - type: 'uint256', - }, - ], - name: 'FeesSnapshot', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'reserves0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'reserves1', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fees0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'fees1', - type: 'uint256', - }, - ], - name: 'PullLiquidity', - 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: 'recipient', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - ], - name: 'Withdraw', - type: 'event', - }, - { - stateMutability: 'payable', - type: 'fallback', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - ], - name: 'allowance', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'approve', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - 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: 'amount0Desired', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1Desired', - type: 'uint256', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - ], - name: 'deposit', - outputs: [ - { - internalType: 'uint256', - name: 'lpShares', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [], - name: 'getPositionDetails', - outputs: [ - { - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fees0', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'fees1', - type: 'uint256', - }, - { - internalType: 'uint128', - name: 'baseLiquidity', - type: 'uint128', - }, - { - internalType: 'uint128', - name: 'rangeLiquidity', - type: 'uint128', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'getVaultInfo', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint24', - name: '', - type: 'uint24', - }, - { - 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: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'nonces', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - internalType: 'address', - name: 'spender', - type: 'address', - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'deadline', - type: 'uint256', - }, - { - internalType: 'uint8', - name: 'v', - type: 'uint8', - }, - { - internalType: 'bytes32', - name: 'r', - type: 'bytes32', - }, - { - internalType: 'bytes32', - name: 's', - type: 'bytes32', - }, - ], - name: 'permit', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'readjustLiquidity', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'ticksData', - outputs: [ - { - internalType: 'int24', - name: 'baseTickLower', - type: 'int24', - }, - { - internalType: 'int24', - name: 'baseTickUpper', - type: 'int24', - }, - { - internalType: 'int24', - name: 'rangeTickLower', - type: 'int24', - }, - { - internalType: 'int24', - name: 'rangeTickUpper', - type: 'int24', - }, - ], - 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: 'uint256', - name: 'amount0Owed', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1Owed', - type: 'uint256', - }, - { - internalType: 'bytes', - name: 'data', - type: 'bytes', - }, - ], - name: 'uniswapV3MintCallback', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'int256', - name: 'amount0', - type: 'int256', - }, - { - internalType: 'int256', - name: 'amount1', - type: 'int256', - }, - { - internalType: 'bytes', - name: 'data', - type: 'bytes', - }, - ], - name: 'uniswapV3SwapCallback', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'liquidity', - type: 'uint256', - }, - { - internalType: 'address', - name: 'recipient', - type: 'address', - }, - { - internalType: 'bool', - name: 'refundAsETH', - type: 'bool', - }, - ], - name: 'withdraw', - outputs: [ - { - internalType: 'uint256', - name: 'amount0', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'amount1', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - stateMutability: 'payable', - type: 'receive', - }, -] as const; - -export type UnipilotVault = typeof unipilotVaultAbi; -export type UnipilotVaultContract = GetContractReturnType; - -export class UnipilotVault__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: unipilotVaultAbi, publicClient: client }); - } -} diff --git a/src/apps/unipilot/contracts/viem/index.ts b/src/apps/unipilot/contracts/viem/index.ts deleted file mode 100644 index 729a04602..000000000 --- a/src/apps/unipilot/contracts/viem/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -export type { UnipilotEthereumFactory } from './UnipilotEthereumFactory'; -export type { UnipilotPolygonFactory } from './UnipilotPolygonFactory'; -export type { UnipilotVault } from './UnipilotVault'; - -export { UnipilotEthereumFactory__factory } from './UnipilotEthereumFactory'; -export { UnipilotPolygonFactory__factory } from './UnipilotPolygonFactory'; -export { UnipilotVault__factory } from './UnipilotVault'; diff --git a/src/apps/unipilot/ethereum/unipilot.pool.token-fetcher.ts b/src/apps/unipilot/ethereum/unipilot.pool.token-fetcher.ts deleted file mode 100644 index 572ddc80b..000000000 --- a/src/apps/unipilot/ethereum/unipilot.pool.token-fetcher.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { UnipilotVaultTokenFetcher } from '../common/unipilot.vault.token-fetcher'; - -@PositionTemplate() -export class EthereumUnipilotPoolTokenFetcher extends UnipilotVaultTokenFetcher { - groupLabel = 'Vaults'; -} diff --git a/src/apps/unipilot/graphql/queries.ts b/src/apps/unipilot/graphql/queries.ts deleted file mode 100644 index ef799bbbb..000000000 --- a/src/apps/unipilot/graphql/queries.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { gql } from 'graphql-request'; - -//unipilot vaults -export const UNIPILOT_VAULTS = gql` - query getVaults($first: Int!) { - vaults { - id - feeTier - token0 { - id - symbol - } - token1 { - id - symbol - } - totalLockedToken0 - totalLockedToken1 - fee0Uninvested - fee1Uninvested - fee0invested - fee1invested - } - } -`; - -//unipilot vaults for polygon -export const UNIPILOT_VAULTS_POLYGON = gql` - query getVaults($first: Int!) { - vaults { - id - feeTier - strategyId - token0 { - id - symbol - } - token1 { - id - symbol - } - totalLockedToken0 - totalLockedToken1 - fee0Uninvested - fee1Uninvested - fee0invested - fee1invested - } - } -`; - -//unipilot vault addresses for apy -export const VAULT_ADDRESSES = gql` - query getAddresses { - vaults(first: 1000) { - id - } - } -`; diff --git a/src/apps/unipilot/polygon/unipilot.pool.token-fetcher.ts b/src/apps/unipilot/polygon/unipilot.pool.token-fetcher.ts deleted file mode 100644 index d2de517aa..000000000 --- a/src/apps/unipilot/polygon/unipilot.pool.token-fetcher.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; - -import { UnipilotVaultTokenFetcher } from '../common/unipilot.vault.token-fetcher'; - -@PositionTemplate() -export class PolygonUnipilotPoolTokenFetcher extends UnipilotVaultTokenFetcher { - groupLabel = 'Vaults'; -} diff --git a/src/apps/unipilot/unipilot.module.ts b/src/apps/unipilot/unipilot.module.ts deleted file mode 100644 index fdc0c0311..000000000 --- a/src/apps/unipilot/unipilot.module.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Module } from '@nestjs/common'; - -import { AbstractApp } from '~app/app.dynamic-module'; - -import { UnipilotVaultDefinitionsResolver } from './common/unipilot.vault-definition-resolver'; -import { UnipilotViemContractFactory } from './contracts'; -import { EthereumUnipilotPoolTokenFetcher } from './ethereum/unipilot.pool.token-fetcher'; -import { PolygonUnipilotPoolTokenFetcher } from './polygon/unipilot.pool.token-fetcher'; - -@Module({ - providers: [ - UnipilotViemContractFactory, - UnipilotVaultDefinitionsResolver, - // Ethereum - EthereumUnipilotPoolTokenFetcher, - // Polygon - PolygonUnipilotPoolTokenFetcher, - ], -}) -export class UnipilotAppModule extends AbstractApp() {} diff --git a/src/apps/unipilot/utils/constants.ts b/src/apps/unipilot/utils/constants.ts deleted file mode 100644 index d84107265..000000000 --- a/src/apps/unipilot/utils/constants.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const SUBGRAPH_ENDPOINTS = { - ethereum: { - stats: 'https://api.thegraph.com/subgraphs/name/unipilotvoirstudio/unipilot-v2-stats?source=zapper', - }, - polygon: { - stats: 'https://api.thegraph.com/subgraphs/name/unipilotvoirstudio/stats-v2-polygon?source=zapper', - }, -}; - -export const SERVER_ENDPOINTS = 'https://apis.unipilot.io/api/unipilot'; diff --git a/src/apps/unipilot/utils/generalTypes.ts b/src/apps/unipilot/utils/generalTypes.ts deleted file mode 100644 index 19c676145..000000000 --- a/src/apps/unipilot/utils/generalTypes.ts +++ /dev/null @@ -1,39 +0,0 @@ -export type UnipilotVaultFetcherResponse = { - vaults: { - id: string; - feeTier: string; - token0: { - id: string; - symbol: string; - }; - token1: { - id: string; - symbol: string; - }; - strategyId?: string; - totalLockedToken0: string; - totalLockedToken1: string; - fee0Uninvested: string; - fee1Uninvested: string; - fee0invested: string; - fee1invested: string; - }[]; -}; - -export type VaultAddressesResponse = { - vaults: { - id: string; - }[]; -}; - -export type UnipilotVaultDefinition = { - address: string; - token0Address: string; - token1Address: string; - feeTier: string; - token0Symbol: string; - token1Symbol: string; - strategyId?: string; - totalLockedToken0: string; - totalLockedToken1: string; -};