From a501438e5f3e9fd578919dd747d4f4823f1f446b Mon Sep 17 00:00:00 2001 From: William Poulin Date: Tue, 2 Jan 2024 16:53:55 -0500 Subject: [PATCH] more --- .../avalanche/penguin.vault.token-fetcher.ts | 56 - .../penguin/contracts/abis/penguin-vault.json | 742 -------- .../contracts/viem.contract-factory.ts | 4 - .../penguin/contracts/viem/PenguinVault.ts | 1581 ----------------- src/apps/penguin/contracts/viem/index.ts | 2 - src/apps/penguin/penguin.module.ts | 2 - .../contracts/abis/pika-protocol-es-pika.json | 278 --- .../contracts/viem.contract-factory.ts | 10 +- .../contracts/viem/PikaProtocolEsPika.ts | 630 ------- .../pika-protocol/contracts/viem/index.ts | 2 - .../pika-protocol.es-pika.token-fetcher.ts | 37 - .../pika-protocol/pika-protocol.module.ts | 2 - .../arbitrum/pirex.apxglp.token-fetcher.ts | 48 - .../arbitrum/pirex.apxgmx.token-fetcher.ts | 48 - src/apps/pirex/contracts/abis/apx-btrfly.json | 988 ---------- src/apps/pirex/contracts/abis/apx-glp.json | 592 ------ src/apps/pirex/contracts/abis/apx-gmx.json | 533 ------ .../pirex/contracts/viem.contract-factory.ts | 11 +- src/apps/pirex/contracts/viem/ApxBtrfly.ts | 1002 ----------- src/apps/pirex/contracts/viem/ApxGlp.ts | 1449 --------------- src/apps/pirex/contracts/viem/ApxGmx.ts | 1288 -------------- src/apps/pirex/contracts/viem/index.ts | 6 - .../ethereum/pirex.apxbtrfly.token-fetcher.ts | 48 - src/apps/pirex/pirex.module.ts | 6 - 24 files changed, 2 insertions(+), 9363 deletions(-) delete mode 100644 src/apps/penguin/avalanche/penguin.vault.token-fetcher.ts delete mode 100644 src/apps/penguin/contracts/abis/penguin-vault.json delete mode 100644 src/apps/penguin/contracts/viem/PenguinVault.ts delete mode 100644 src/apps/pika-protocol/contracts/abis/pika-protocol-es-pika.json delete mode 100644 src/apps/pika-protocol/contracts/viem/PikaProtocolEsPika.ts delete mode 100644 src/apps/pika-protocol/optimism/pika-protocol.es-pika.token-fetcher.ts delete mode 100644 src/apps/pirex/arbitrum/pirex.apxglp.token-fetcher.ts delete mode 100644 src/apps/pirex/arbitrum/pirex.apxgmx.token-fetcher.ts delete mode 100644 src/apps/pirex/contracts/abis/apx-btrfly.json delete mode 100644 src/apps/pirex/contracts/abis/apx-glp.json delete mode 100644 src/apps/pirex/contracts/abis/apx-gmx.json delete mode 100644 src/apps/pirex/contracts/viem/ApxBtrfly.ts delete mode 100644 src/apps/pirex/contracts/viem/ApxGlp.ts delete mode 100644 src/apps/pirex/contracts/viem/ApxGmx.ts delete mode 100644 src/apps/pirex/ethereum/pirex.apxbtrfly.token-fetcher.ts diff --git a/src/apps/penguin/avalanche/penguin.vault.token-fetcher.ts b/src/apps/penguin/avalanche/penguin.vault.token-fetcher.ts deleted file mode 100644 index 96de590ae..000000000 --- a/src/apps/penguin/avalanche/penguin.vault.token-fetcher.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { GetPricePerShareParams, GetUnderlyingTokensParams } from '~position/template/app-token.template.types'; - -import { PenguinViemContractFactory } from '../contracts'; -import { PenguinVault } from '../contracts/viem'; - -@PositionTemplate() -export class AvalanchePenguinVaultTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'Compounder Vaults'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(PenguinViemContractFactory) protected readonly contractFactory: PenguinViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.penguinVault({ network: this.network, address }); - } - - async getAddresses() { - return [ - '0xab6eed788beed09d1279b21b6c91f9750242e0f5', - '0xbbd9dd1f15c729745edffd8e46253463d40a7d84', - '0x323c5cc630c0ce1f2823d1a3d48260f770b5669b', - '0xb6cd0569563549033c129769dbc58d1843ed98cb', - '0x9acbca2315a517a3dab8e857f5921a8b3435891a', - '0xdf5fb3fa0161a8508599a6dfc9d6c004cb58652b', - '0x1ad8ff956247f87de904f31b0322843f32f19a5c', - '0xbe42a57f4a08636c26457475e94409516fa39b3b', - '0xfc8deac2f93e5b4739ece2802e5c5e05106fd872', - '0xc90b9a965c800a0318ec4282a86e387beeef0ffe', - '0xb4558486cd8fd2dd5e3b078e7822c1bb66c782d0', - '0x85fc4ec9dee0df5060f321b743838f7068499177', - '0xd6da9d000ffa1ea6d3939fcd80f4d473f2027567', - '0x4ec41d1e25925c57876885c34fe0b323d7cc3846', - '0x7dd48db5372539d01ed4b6cc525403d98bc61bdd', - '0x21d2aaed1d2f5e36ff02b008b091054d065c9824', - ]; - } - - async getUnderlyingTokenDefinitions({ contract }: GetUnderlyingTokensParams) { - return [{ address: await contract.read.depositToken(), network: this.network }]; - } - - async getPricePerShare({ contract, appToken }: GetPricePerShareParams) { - const reserveRaw = await contract.read.totalDeposits(); - const reserve = Number(reserveRaw) / 10 ** appToken.tokens[0].decimals; - return [reserve / appToken.supply]; - } -} diff --git a/src/apps/penguin/contracts/abis/penguin-vault.json b/src/apps/penguin/contracts/abis/penguin-vault.json deleted file mode 100644 index 437879b69..000000000 --- a/src/apps/penguin/contracts/abis/penguin-vault.json +++ /dev/null @@ -1,742 +0,0 @@ -[ - { - "type": "constructor", - "stateMutability": "nonpayable", - "inputs": [ - { "type": "string", "name": "_name", "internalType": "string" }, - { "type": "address[8]", "name": "_initAddressArray", "internalType": "address[8]" }, - { "type": "uint256", "name": "_pid", "internalType": "uint256" }, - { "type": "uint256", "name": "_minTokensToReinvest", "internalType": "uint256" }, - { "type": "uint256[4]", "name": "_initFeeStructure", "internalType": "uint256[4]" }, - { "type": "address[]", "name": "_pathRewardToToken0", "internalType": "address[]" }, - { "type": "address[]", "name": "_pathRewardToToken1", "internalType": "address[]" }, - { "type": "address", "name": "_pefiGlobalVariables", "internalType": "address" }, - { "type": "bool", "name": "_USE_GLOBAL_PEFI_VARIABLES", "internalType": "bool" } - ] - }, - { - "type": "event", - "name": "Approval", - "inputs": [ - { "type": "address", "name": "owner", "internalType": "address", "indexed": true }, - { "type": "address", "name": "spender", "internalType": "address", "indexed": true }, - { "type": "uint256", "name": "value", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ClaimedxPEFI", - "inputs": [ - { "type": "address", "name": "account", "internalType": "address", "indexed": true }, - { "type": "uint256", "name": "amount", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Deposit", - "inputs": [ - { "type": "address", "name": "account", "internalType": "address", "indexed": true }, - { "type": "uint256", "name": "amount", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "DepositsEnabled", - "inputs": [{ "type": "bool", "name": "newValue", "internalType": "bool", "indexed": false }], - "anonymous": false - }, - { - "type": "event", - "name": "FeeStructureUpdated", - "inputs": [ - { "type": "uint256", "name": "newPOOL_CREATOR_FEE_BIPS", "internalType": "uint256", "indexed": false }, - { "type": "uint256", "name": "newNEST_FEE_BIPS", "internalType": "uint256", "indexed": false }, - { "type": "uint256", "name": "newDEV_FEE_BIPS", "internalType": "uint256", "indexed": false }, - { "type": "uint256", "name": "newALTERNATE_FEE_BIPS", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "NestStakingBipsChanged", - "inputs": [ - { "type": "uint256", "name": "oldNEST_STAKING_BIPS", "internalType": "uint256", "indexed": false }, - { "type": "uint256", "name": "newNEST_STAKING_BIPS", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [ - { "type": "address", "name": "previousOwner", "internalType": "address", "indexed": true }, - { "type": "address", "name": "newOwner", "internalType": "address", "indexed": true } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Recovered", - "inputs": [ - { "type": "address", "name": "token", "internalType": "address", "indexed": false }, - { "type": "uint256", "name": "amount", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Reinvest", - "inputs": [ - { "type": "uint256", "name": "newTotalDeposits", "internalType": "uint256", "indexed": false }, - { "type": "uint256", "name": "newTotalSupply", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "StakedPEFI", - "inputs": [{ "type": "uint256", "name": "amountPefiSentToNest", "internalType": "uint256", "indexed": false }], - "anonymous": false - }, - { - "type": "event", - "name": "Transfer", - "inputs": [ - { "type": "address", "name": "from", "internalType": "address", "indexed": true }, - { "type": "address", "name": "to", "internalType": "address", "indexed": true }, - { "type": "uint256", "name": "value", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "UpdateAlternateAddress", - "inputs": [ - { "type": "address", "name": "oldValue", "internalType": "address", "indexed": false }, - { "type": "address", "name": "newValue", "internalType": "address", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "UpdateDevAddress", - "inputs": [ - { "type": "address", "name": "oldValue", "internalType": "address", "indexed": false }, - { "type": "address", "name": "newValue", "internalType": "address", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "UpdateMaxTokensToDepositWithoutReinvest", - "inputs": [ - { "type": "uint256", "name": "oldValue", "internalType": "uint256", "indexed": false }, - { "type": "uint256", "name": "newValue", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "UpdateMinTokensToReinvest", - "inputs": [ - { "type": "uint256", "name": "oldValue", "internalType": "uint256", "indexed": false }, - { "type": "uint256", "name": "newValue", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "UpdateNestAddress", - "inputs": [ - { "type": "address", "name": "oldValue", "internalType": "address", "indexed": false }, - { "type": "address", "name": "newValue", "internalType": "address", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "UpdatePoolCreatorAddress", - "inputs": [ - { "type": "address", "name": "oldValue", "internalType": "address", "indexed": false }, - { "type": "address", "name": "newValue", "internalType": "address", "indexed": false } - ], - "anonymous": false - }, - { - "type": "event", - "name": "UseGlobalVariablesUpdated", - "inputs": [{ "type": "bool", "name": "newValue", "internalType": "bool", "indexed": false }], - "anonymous": false - }, - { - "type": "event", - "name": "Withdraw", - "inputs": [ - { "type": "address", "name": "account", "internalType": "address", "indexed": true }, - { "type": "uint256", "name": "amount", "internalType": "uint256", "indexed": false } - ], - "anonymous": false - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "ALTERNATE_FEE_BIPS", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "ALTERNATE_FEE_BIPS_LOCAL", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "bool", "name": "", "internalType": "bool" }], - "name": "DEPOSITS_ENABLED", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "DEV_FEE_BIPS", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "DEV_FEE_BIPS_LOCAL", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "bytes32", "name": "", "internalType": "bytes32" }], - "name": "DOMAIN_TYPEHASH", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "MAX_TOTAL_FEE", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "MIN_TOKENS_TO_REINVEST", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "NEST_FEE_BIPS", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "NEST_FEE_BIPS_LOCAL", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "NEST_STAKING_BIPS", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "bytes32", "name": "", "internalType": "bytes32" }], - "name": "PERMIT_TYPEHASH", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "PID", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "POOL_CREATOR_FEE_BIPS", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "POOL_CREATOR_FEE_BIPS_LOCAL", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "bool", "name": "", "internalType": "bool" }], - "name": "USE_GLOBAL_PEFI_VARIABLES", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "bytes32", "name": "", "internalType": "bytes32" }], - "name": "VERSION_HASH", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "allowance", - "inputs": [ - { "type": "address", "name": "account", "internalType": "address" }, - { "type": "address", "name": "spender", "internalType": "address" } - ] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "alternateAddress", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "alternateAddressLocal", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [{ "type": "bool", "name": "", "internalType": "bool" }], - "name": "approve", - "inputs": [ - { "type": "address", "name": "spender", "internalType": "address" }, - { "type": "uint256", "name": "amount", "internalType": "uint256" } - ] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "balanceOf", - "inputs": [{ "type": "address", "name": "account", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "checkReward", - "inputs": [] - }, - { "type": "function", "stateMutability": "nonpayable", "outputs": [], "name": "claimXPEFI", "inputs": [] }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint8", "name": "", "internalType": "uint8" }], - "name": "decimals", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "deposit", - "inputs": [{ "type": "uint256", "name": "amount", "internalType": "uint256" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "depositFor", - "inputs": [ - { "type": "address", "name": "account", "internalType": "address" }, - { "type": "uint256", "name": "amount", "internalType": "uint256" } - ] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "contract IERC20" }], - "name": "depositToken", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "depositWithPermit", - "inputs": [ - { "type": "uint256", "name": "amount", "internalType": "uint256" }, - { "type": "uint256", "name": "deadline", "internalType": "uint256" }, - { "type": "uint8", "name": "v", "internalType": "uint8" }, - { "type": "bytes32", "name": "r", "internalType": "bytes32" }, - { "type": "bytes32", "name": "s", "internalType": "bytes32" } - ] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "devAddress", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "devAddressLocal", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "estimateDeployedBalance", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "estimateReinvestReward", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "getDepositTokensForShares", - "inputs": [{ "type": "uint256", "name": "amount", "internalType": "uint256" }] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "bytes32", "name": "", "internalType": "bytes32" }], - "name": "getDomainSeparator", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "getSharesForDepositTokens", - "inputs": [{ "type": "uint256", "name": "amount", "internalType": "uint256" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "impromptuTokenAggregation", - "inputs": [ - { "type": "uint256", "name": "minReturnAmountAccepted", "internalType": "uint256" }, - { "type": "bool", "name": "disableDeposits", "internalType": "bool" } - ] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "string", "name": "", "internalType": "string" }], - "name": "name", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "nestAddress", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "nestAddressLocal", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "nonces", - "inputs": [{ "type": "address", "name": "", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "owner", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "contract PenguinStrategyGlobalVariables" }], - "name": "pefiGlobalVariableContract", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "pendingXPefi", - "inputs": [{ "type": "address", "name": "user", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "permit", - "inputs": [ - { "type": "address", "name": "owner", "internalType": "address" }, - { "type": "address", "name": "spender", "internalType": "address" }, - { "type": "uint256", "name": "value", "internalType": "uint256" }, - { "type": "uint256", "name": "deadline", "internalType": "uint256" }, - { "type": "uint8", "name": "v", "internalType": "uint8" }, - { "type": "bytes32", "name": "r", "internalType": "bytes32" }, - { "type": "bytes32", "name": "s", "internalType": "bytes32" } - ] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "poolCreatorAddress", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "recoverAVAX", - "inputs": [{ "type": "uint256", "name": "amount", "internalType": "uint256" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "recoverERC20", - "inputs": [ - { "type": "address", "name": "tokenAddress", "internalType": "address" }, - { "type": "uint256", "name": "tokenAmount", "internalType": "uint256" } - ] - }, - { "type": "function", "stateMutability": "nonpayable", "outputs": [], "name": "reinvest", "inputs": [] }, - { "type": "function", "stateMutability": "nonpayable", "outputs": [], "name": "renounceOwnership", "inputs": [] }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "revokeAllowance", - "inputs": [ - { "type": "address", "name": "token", "internalType": "address" }, - { "type": "address", "name": "spender", "internalType": "address" } - ] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "contract IERC20" }], - "name": "rewardToken", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "contract IRouter" }], - "name": "router", - "inputs": [] - }, - { "type": "function", "stateMutability": "nonpayable", "outputs": [], "name": "setAllowances", "inputs": [] }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "stakingContract", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "string", "name": "", "internalType": "string" }], - "name": "symbol", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "token0", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "address", "name": "", "internalType": "address" }], - "name": "token1", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "totalDeposits", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "totalSupply", - "inputs": [] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [{ "type": "bool", "name": "", "internalType": "bool" }], - "name": "transfer", - "inputs": [ - { "type": "address", "name": "dst", "internalType": "address" }, - { "type": "uint256", "name": "amount", "internalType": "uint256" } - ] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [{ "type": "bool", "name": "", "internalType": "bool" }], - "name": "transferFrom", - "inputs": [ - { "type": "address", "name": "src", "internalType": "address" }, - { "type": "address", "name": "dst", "internalType": "address" }, - { "type": "uint256", "name": "amount", "internalType": "uint256" } - ] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "transferOwnership", - "inputs": [{ "type": "address", "name": "newOwner", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateAlternateAddress", - "inputs": [{ "type": "address", "name": "newValue", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateDepositsEnabled", - "inputs": [{ "type": "bool", "name": "newValue", "internalType": "bool" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateDevAddress", - "inputs": [{ "type": "address", "name": "newValue", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateFeeStructure", - "inputs": [ - { "type": "uint256", "name": "newPOOL_CREATOR_FEE_BIPS", "internalType": "uint256" }, - { "type": "uint256", "name": "newNEST_FEE_BIPS", "internalType": "uint256" }, - { "type": "uint256", "name": "newDEV_FEE_BIPS", "internalType": "uint256" }, - { "type": "uint256", "name": "newALTERNATE_FEE_BIPS", "internalType": "uint256" } - ] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateMaxTokensToDepositWithoutReinvest", - "inputs": [{ "type": "uint256", "name": "newValue", "internalType": "uint256" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateMinTokensToReinvest", - "inputs": [{ "type": "uint256", "name": "newValue", "internalType": "uint256" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateNestAddress", - "inputs": [{ "type": "address", "name": "newValue", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateNestStakingBips", - "inputs": [{ "type": "uint256", "name": "newNEST_STAKING_BIPS", "internalType": "uint256" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updatePoolCreatorAddress", - "inputs": [{ "type": "address", "name": "newValue", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "updateUseGlobalVariables", - "inputs": [{ "type": "bool", "name": "newValue", "internalType": "bool" }] - }, - { - "type": "function", - "stateMutability": "nonpayable", - "outputs": [], - "name": "withdraw", - "inputs": [{ "type": "uint256", "name": "amount", "internalType": "uint256" }] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "xPefiDebt", - "inputs": [{ "type": "address", "name": "", "internalType": "address" }] - }, - { - "type": "function", - "stateMutability": "view", - "outputs": [{ "type": "uint256", "name": "", "internalType": "uint256" }], - "name": "xPefiPerShare", - "inputs": [] - } -] diff --git a/src/apps/penguin/contracts/viem.contract-factory.ts b/src/apps/penguin/contracts/viem.contract-factory.ts index 1a93bafef..467bca902 100644 --- a/src/apps/penguin/contracts/viem.contract-factory.ts +++ b/src/apps/penguin/contracts/viem.contract-factory.ts @@ -9,7 +9,6 @@ import { PenguinExtraRewarder__factory, PenguinIPefi__factory, PenguinRewarderRate__factory, - PenguinVault__factory, PenguinXPefi__factory, } from './viem'; @@ -34,9 +33,6 @@ export class PenguinViemContractFactory { penguinRewarderRate({ address, network }: ContractOpts) { return PenguinRewarderRate__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } - penguinVault({ address, network }: ContractOpts) { - return PenguinVault__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } penguinXPefi({ address, network }: ContractOpts) { return PenguinXPefi__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } diff --git a/src/apps/penguin/contracts/viem/PenguinVault.ts b/src/apps/penguin/contracts/viem/PenguinVault.ts deleted file mode 100644 index f2df4b78a..000000000 --- a/src/apps/penguin/contracts/viem/PenguinVault.ts +++ /dev/null @@ -1,1581 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const penguinVaultAbi = [ - { - type: 'constructor', - stateMutability: 'nonpayable', - inputs: [ - { - type: 'string', - name: '_name', - internalType: 'string', - }, - { - type: 'address[8]', - name: '_initAddressArray', - internalType: 'address[8]', - }, - { - type: 'uint256', - name: '_pid', - internalType: 'uint256', - }, - { - type: 'uint256', - name: '_minTokensToReinvest', - internalType: 'uint256', - }, - { - type: 'uint256[4]', - name: '_initFeeStructure', - internalType: 'uint256[4]', - }, - { - type: 'address[]', - name: '_pathRewardToToken0', - internalType: 'address[]', - }, - { - type: 'address[]', - name: '_pathRewardToToken1', - internalType: 'address[]', - }, - { - type: 'address', - name: '_pefiGlobalVariables', - internalType: 'address', - }, - { - type: 'bool', - name: '_USE_GLOBAL_PEFI_VARIABLES', - internalType: 'bool', - }, - ], - }, - { - type: 'event', - name: 'Approval', - inputs: [ - { - type: 'address', - name: 'owner', - internalType: 'address', - indexed: true, - }, - { - type: 'address', - name: 'spender', - internalType: 'address', - indexed: true, - }, - { - type: 'uint256', - name: 'value', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'ClaimedxPEFI', - inputs: [ - { - type: 'address', - name: 'account', - internalType: 'address', - indexed: true, - }, - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'Deposit', - inputs: [ - { - type: 'address', - name: 'account', - internalType: 'address', - indexed: true, - }, - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'DepositsEnabled', - inputs: [ - { - type: 'bool', - name: 'newValue', - internalType: 'bool', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'FeeStructureUpdated', - inputs: [ - { - type: 'uint256', - name: 'newPOOL_CREATOR_FEE_BIPS', - internalType: 'uint256', - indexed: false, - }, - { - type: 'uint256', - name: 'newNEST_FEE_BIPS', - internalType: 'uint256', - indexed: false, - }, - { - type: 'uint256', - name: 'newDEV_FEE_BIPS', - internalType: 'uint256', - indexed: false, - }, - { - type: 'uint256', - name: 'newALTERNATE_FEE_BIPS', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'NestStakingBipsChanged', - inputs: [ - { - type: 'uint256', - name: 'oldNEST_STAKING_BIPS', - internalType: 'uint256', - indexed: false, - }, - { - type: 'uint256', - name: 'newNEST_STAKING_BIPS', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'OwnershipTransferred', - inputs: [ - { - type: 'address', - name: 'previousOwner', - internalType: 'address', - indexed: true, - }, - { - type: 'address', - name: 'newOwner', - internalType: 'address', - indexed: true, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'Recovered', - inputs: [ - { - type: 'address', - name: 'token', - internalType: 'address', - indexed: false, - }, - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'Reinvest', - inputs: [ - { - type: 'uint256', - name: 'newTotalDeposits', - internalType: 'uint256', - indexed: false, - }, - { - type: 'uint256', - name: 'newTotalSupply', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'StakedPEFI', - inputs: [ - { - type: 'uint256', - name: 'amountPefiSentToNest', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'Transfer', - inputs: [ - { - type: 'address', - name: 'from', - internalType: 'address', - indexed: true, - }, - { - type: 'address', - name: 'to', - internalType: 'address', - indexed: true, - }, - { - type: 'uint256', - name: 'value', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'UpdateAlternateAddress', - inputs: [ - { - type: 'address', - name: 'oldValue', - internalType: 'address', - indexed: false, - }, - { - type: 'address', - name: 'newValue', - internalType: 'address', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'UpdateDevAddress', - inputs: [ - { - type: 'address', - name: 'oldValue', - internalType: 'address', - indexed: false, - }, - { - type: 'address', - name: 'newValue', - internalType: 'address', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'UpdateMaxTokensToDepositWithoutReinvest', - inputs: [ - { - type: 'uint256', - name: 'oldValue', - internalType: 'uint256', - indexed: false, - }, - { - type: 'uint256', - name: 'newValue', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'UpdateMinTokensToReinvest', - inputs: [ - { - type: 'uint256', - name: 'oldValue', - internalType: 'uint256', - indexed: false, - }, - { - type: 'uint256', - name: 'newValue', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'UpdateNestAddress', - inputs: [ - { - type: 'address', - name: 'oldValue', - internalType: 'address', - indexed: false, - }, - { - type: 'address', - name: 'newValue', - internalType: 'address', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'UpdatePoolCreatorAddress', - inputs: [ - { - type: 'address', - name: 'oldValue', - internalType: 'address', - indexed: false, - }, - { - type: 'address', - name: 'newValue', - internalType: 'address', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'UseGlobalVariablesUpdated', - inputs: [ - { - type: 'bool', - name: 'newValue', - internalType: 'bool', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'event', - name: 'Withdraw', - inputs: [ - { - type: 'address', - name: 'account', - internalType: 'address', - indexed: true, - }, - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - indexed: false, - }, - ], - anonymous: false, - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'ALTERNATE_FEE_BIPS', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'ALTERNATE_FEE_BIPS_LOCAL', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'bool', - name: '', - internalType: 'bool', - }, - ], - name: 'DEPOSITS_ENABLED', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'DEV_FEE_BIPS', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'DEV_FEE_BIPS_LOCAL', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'bytes32', - name: '', - internalType: 'bytes32', - }, - ], - name: 'DOMAIN_TYPEHASH', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'MAX_TOKENS_TO_DEPOSIT_WITHOUT_REINVEST', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'MAX_TOTAL_FEE', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'MIN_TOKENS_TO_REINVEST', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'NEST_FEE_BIPS', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'NEST_FEE_BIPS_LOCAL', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'NEST_STAKING_BIPS', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'bytes32', - name: '', - internalType: 'bytes32', - }, - ], - name: 'PERMIT_TYPEHASH', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'PID', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'POOL_CREATOR_FEE_BIPS', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'POOL_CREATOR_FEE_BIPS_LOCAL', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'bool', - name: '', - internalType: 'bool', - }, - ], - name: 'USE_GLOBAL_PEFI_VARIABLES', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'bytes32', - name: '', - internalType: 'bytes32', - }, - ], - name: 'VERSION_HASH', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'allowance', - inputs: [ - { - type: 'address', - name: 'account', - internalType: 'address', - }, - { - type: 'address', - name: 'spender', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'alternateAddress', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'alternateAddressLocal', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [ - { - type: 'bool', - name: '', - internalType: 'bool', - }, - ], - name: 'approve', - inputs: [ - { - type: 'address', - name: 'spender', - internalType: 'address', - }, - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'balanceOf', - inputs: [ - { - type: 'address', - name: 'account', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'checkReward', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'claimXPEFI', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint8', - name: '', - internalType: 'uint8', - }, - ], - name: 'decimals', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'deposit', - inputs: [ - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'depositFor', - inputs: [ - { - type: 'address', - name: 'account', - internalType: 'address', - }, - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'contract IERC20', - }, - ], - name: 'depositToken', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'depositWithPermit', - inputs: [ - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - { - type: 'uint256', - name: 'deadline', - internalType: 'uint256', - }, - { - type: 'uint8', - name: 'v', - internalType: 'uint8', - }, - { - type: 'bytes32', - name: 'r', - internalType: 'bytes32', - }, - { - type: 'bytes32', - name: 's', - internalType: 'bytes32', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'devAddress', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'devAddressLocal', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'estimateDeployedBalance', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'estimateReinvestReward', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'getDepositTokensForShares', - inputs: [ - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'bytes32', - name: '', - internalType: 'bytes32', - }, - ], - name: 'getDomainSeparator', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'getSharesForDepositTokens', - inputs: [ - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'impromptuTokenAggregation', - inputs: [ - { - type: 'uint256', - name: 'minReturnAmountAccepted', - internalType: 'uint256', - }, - { - type: 'bool', - name: 'disableDeposits', - internalType: 'bool', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'string', - name: '', - internalType: 'string', - }, - ], - name: 'name', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'nestAddress', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'nestAddressLocal', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'nonces', - inputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'owner', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'contract PenguinStrategyGlobalVariables', - }, - ], - name: 'pefiGlobalVariableContract', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'pendingXPefi', - inputs: [ - { - type: 'address', - name: 'user', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'permit', - inputs: [ - { - type: 'address', - name: 'owner', - internalType: 'address', - }, - { - type: 'address', - name: 'spender', - internalType: 'address', - }, - { - type: 'uint256', - name: 'value', - internalType: 'uint256', - }, - { - type: 'uint256', - name: 'deadline', - internalType: 'uint256', - }, - { - type: 'uint8', - name: 'v', - internalType: 'uint8', - }, - { - type: 'bytes32', - name: 'r', - internalType: 'bytes32', - }, - { - type: 'bytes32', - name: 's', - internalType: 'bytes32', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'poolCreatorAddress', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'recoverAVAX', - inputs: [ - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'recoverERC20', - inputs: [ - { - type: 'address', - name: 'tokenAddress', - internalType: 'address', - }, - { - type: 'uint256', - name: 'tokenAmount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'reinvest', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'renounceOwnership', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'revokeAllowance', - inputs: [ - { - type: 'address', - name: 'token', - internalType: 'address', - }, - { - type: 'address', - name: 'spender', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'contract IERC20', - }, - ], - name: 'rewardToken', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'contract IRouter', - }, - ], - name: 'router', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'setAllowances', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'stakingContract', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'string', - name: '', - internalType: 'string', - }, - ], - name: 'symbol', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'token0', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - name: 'token1', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'totalDeposits', - inputs: [], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'totalSupply', - inputs: [], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [ - { - type: 'bool', - name: '', - internalType: 'bool', - }, - ], - name: 'transfer', - inputs: [ - { - type: 'address', - name: 'dst', - internalType: 'address', - }, - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [ - { - type: 'bool', - name: '', - internalType: 'bool', - }, - ], - name: 'transferFrom', - inputs: [ - { - type: 'address', - name: 'src', - internalType: 'address', - }, - { - type: 'address', - name: 'dst', - internalType: 'address', - }, - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'transferOwnership', - inputs: [ - { - type: 'address', - name: 'newOwner', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateAlternateAddress', - inputs: [ - { - type: 'address', - name: 'newValue', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateDepositsEnabled', - inputs: [ - { - type: 'bool', - name: 'newValue', - internalType: 'bool', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateDevAddress', - inputs: [ - { - type: 'address', - name: 'newValue', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateFeeStructure', - inputs: [ - { - type: 'uint256', - name: 'newPOOL_CREATOR_FEE_BIPS', - internalType: 'uint256', - }, - { - type: 'uint256', - name: 'newNEST_FEE_BIPS', - internalType: 'uint256', - }, - { - type: 'uint256', - name: 'newDEV_FEE_BIPS', - internalType: 'uint256', - }, - { - type: 'uint256', - name: 'newALTERNATE_FEE_BIPS', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateMaxTokensToDepositWithoutReinvest', - inputs: [ - { - type: 'uint256', - name: 'newValue', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateMinTokensToReinvest', - inputs: [ - { - type: 'uint256', - name: 'newValue', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateNestAddress', - inputs: [ - { - type: 'address', - name: 'newValue', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateNestStakingBips', - inputs: [ - { - type: 'uint256', - name: 'newNEST_STAKING_BIPS', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updatePoolCreatorAddress', - inputs: [ - { - type: 'address', - name: 'newValue', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'updateUseGlobalVariables', - inputs: [ - { - type: 'bool', - name: 'newValue', - internalType: 'bool', - }, - ], - }, - { - type: 'function', - stateMutability: 'nonpayable', - outputs: [], - name: 'withdraw', - inputs: [ - { - type: 'uint256', - name: 'amount', - internalType: 'uint256', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'xPefiDebt', - inputs: [ - { - type: 'address', - name: '', - internalType: 'address', - }, - ], - }, - { - type: 'function', - stateMutability: 'view', - outputs: [ - { - type: 'uint256', - name: '', - internalType: 'uint256', - }, - ], - name: 'xPefiPerShare', - inputs: [], - }, -] as const; - -export type PenguinVault = typeof penguinVaultAbi; -export type PenguinVaultContract = GetContractReturnType; - -export class PenguinVault__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: penguinVaultAbi, publicClient: client }); - } -} diff --git a/src/apps/penguin/contracts/viem/index.ts b/src/apps/penguin/contracts/viem/index.ts index 1af9114cb..762892eab 100644 --- a/src/apps/penguin/contracts/viem/index.ts +++ b/src/apps/penguin/contracts/viem/index.ts @@ -7,7 +7,6 @@ export type { PenguinChef } from './PenguinChef'; export type { PenguinExtraRewarder } from './PenguinExtraRewarder'; export type { PenguinIPefi } from './PenguinIPefi'; export type { PenguinRewarderRate } from './PenguinRewarderRate'; -export type { PenguinVault } from './PenguinVault'; export type { PenguinXPefi } from './PenguinXPefi'; export { PenguinChefV2__factory } from './PenguinChefV2'; @@ -15,5 +14,4 @@ export { PenguinChef__factory } from './PenguinChef'; export { PenguinExtraRewarder__factory } from './PenguinExtraRewarder'; export { PenguinIPefi__factory } from './PenguinIPefi'; export { PenguinRewarderRate__factory } from './PenguinRewarderRate'; -export { PenguinVault__factory } from './PenguinVault'; export { PenguinXPefi__factory } from './PenguinXPefi'; diff --git a/src/apps/penguin/penguin.module.ts b/src/apps/penguin/penguin.module.ts index 45da17e46..13dcab096 100644 --- a/src/apps/penguin/penguin.module.ts +++ b/src/apps/penguin/penguin.module.ts @@ -6,7 +6,6 @@ import { AvalanchePenguinChefV1FarmContractPositionFetcher } from './avalanche/p import { AvalanchePenguinChefV2FarmContractPositionFetcher } from './avalanche/penguin.chef-v2-farm.contract-position-fetcher'; import { AvalanchePenguinIPefiTokenFetcher } from './avalanche/penguin.i-pefi.token-fetcher'; import { AvalanchePenguinVaultClaimableContractPositionFetcher } from './avalanche/penguin.vault-claimable.contract-position-fetcher'; -import { AvalanchePenguinVaultTokenFetcher } from './avalanche/penguin.vault.token-fetcher'; import { AvalanchePenguinXPefiTokenFetcher } from './avalanche/penguin.x-pefi.token-fetcher'; import { PenguinViemContractFactory } from './contracts'; @@ -17,7 +16,6 @@ import { PenguinViemContractFactory } from './contracts'; AvalanchePenguinChefV2FarmContractPositionFetcher, AvalanchePenguinIPefiTokenFetcher, AvalanchePenguinXPefiTokenFetcher, - AvalanchePenguinVaultTokenFetcher, AvalanchePenguinVaultClaimableContractPositionFetcher, ], }) diff --git a/src/apps/pika-protocol/contracts/abis/pika-protocol-es-pika.json b/src/apps/pika-protocol/contracts/abis/pika-protocol-es-pika.json deleted file mode 100644 index 498d6b5c4..000000000 --- a/src/apps/pika-protocol/contracts/abis/pika-protocol-es-pika.json +++ /dev/null @@ -1,278 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "string", "name": "name", "type": "string" }, - { "internalType": "string", "name": "symbol", "type": "string" }, - { "internalType": "uint256", "name": "totalSupply", "type": "uint256" }, - { "internalType": "address", "name": "beneficiary", "type": "address" }, - { "internalType": "address", "name": "gov", "type": "address" } - ], - "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" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "bool", "name": "transfersAllowed", "type": "bool" }], - "name": "TransfersAllowed", - "type": "event" - }, - { - "inputs": [], - "name": "ADMIN_ROLE", - "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": "MINTER_ROLE", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "TRANSFER_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": [], - "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": "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": "_recipient", "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": "bytes32", "name": "role", "type": "bytes32" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "bool", "name": "_transfersAllowed", "type": "bool" }], - "name": "setTransfersAllowed", - "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": "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": "transfersAllowed", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/pika-protocol/contracts/viem.contract-factory.ts b/src/apps/pika-protocol/contracts/viem.contract-factory.ts index 27396b31f..f7ee6cd87 100644 --- a/src/apps/pika-protocol/contracts/viem.contract-factory.ts +++ b/src/apps/pika-protocol/contracts/viem.contract-factory.ts @@ -3,12 +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 { - PikaProtocolEsPika__factory, - PikaProtocolVault__factory, - PikaProtocolVaultReward__factory, - PikaProtocolVester__factory, -} from './viem'; +import { PikaProtocolVault__factory, PikaProtocolVaultReward__factory, PikaProtocolVester__factory } from './viem'; type ContractOpts = { address: string; network: Network }; @@ -16,9 +11,6 @@ type ContractOpts = { address: string; network: Network }; export class PikaProtocolViemContractFactory { constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - pikaProtocolEsPika({ address, network }: ContractOpts) { - return PikaProtocolEsPika__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } pikaProtocolVault({ address, network }: ContractOpts) { return PikaProtocolVault__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } diff --git a/src/apps/pika-protocol/contracts/viem/PikaProtocolEsPika.ts b/src/apps/pika-protocol/contracts/viem/PikaProtocolEsPika.ts deleted file mode 100644 index 77ffb7c1f..000000000 --- a/src/apps/pika-protocol/contracts/viem/PikaProtocolEsPika.ts +++ /dev/null @@ -1,630 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const pikaProtocolEsPikaAbi = [ - { - inputs: [ - { - internalType: 'string', - name: 'name', - type: 'string', - }, - { - internalType: 'string', - name: 'symbol', - type: 'string', - }, - { - internalType: 'uint256', - name: 'totalSupply', - type: 'uint256', - }, - { - internalType: 'address', - name: 'beneficiary', - type: 'address', - }, - { - internalType: 'address', - name: 'gov', - type: 'address', - }, - ], - 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', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'bool', - name: 'transfersAllowed', - type: 'bool', - }, - ], - name: 'TransfersAllowed', - type: 'event', - }, - { - inputs: [], - name: 'ADMIN_ROLE', - 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: 'MINTER_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'TRANSFER_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: [], - 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: '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: '_recipient', - 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: 'bytes32', - name: 'role', - type: 'bytes32', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'revokeRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'bool', - name: '_transfersAllowed', - type: 'bool', - }, - ], - name: 'setTransfersAllowed', - 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: '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: 'transfersAllowed', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type PikaProtocolEsPika = typeof pikaProtocolEsPikaAbi; -export type PikaProtocolEsPikaContract = GetContractReturnType; - -export class PikaProtocolEsPika__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: pikaProtocolEsPikaAbi, publicClient: client }); - } -} diff --git a/src/apps/pika-protocol/contracts/viem/index.ts b/src/apps/pika-protocol/contracts/viem/index.ts index cda32e591..632a1caa1 100644 --- a/src/apps/pika-protocol/contracts/viem/index.ts +++ b/src/apps/pika-protocol/contracts/viem/index.ts @@ -2,12 +2,10 @@ /* tslint:disable */ /* eslint-disable */ -export type { PikaProtocolEsPika } from './PikaProtocolEsPika'; export type { PikaProtocolVaultReward } from './PikaProtocolVaultReward'; export type { PikaProtocolVault } from './PikaProtocolVault'; export type { PikaProtocolVester } from './PikaProtocolVester'; -export { PikaProtocolEsPika__factory } from './PikaProtocolEsPika'; export { PikaProtocolVaultReward__factory } from './PikaProtocolVaultReward'; export { PikaProtocolVault__factory } from './PikaProtocolVault'; export { PikaProtocolVester__factory } from './PikaProtocolVester'; diff --git a/src/apps/pika-protocol/optimism/pika-protocol.es-pika.token-fetcher.ts b/src/apps/pika-protocol/optimism/pika-protocol.es-pika.token-fetcher.ts deleted file mode 100644 index 8f1316075..000000000 --- a/src/apps/pika-protocol/optimism/pika-protocol.es-pika.token-fetcher.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { Inject } from '@nestjs/common'; - -import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { PositionTemplate } from '~app-toolkit/decorators/position-template.decorator'; -import { AppTokenTemplatePositionFetcher } from '~position/template/app-token.template.position-fetcher'; -import { GetUnderlyingTokensParams } from '~position/template/app-token.template.types'; - -import { PikaProtocolViemContractFactory } from '../contracts'; -import { PikaProtocolEsPika } from '../contracts/viem'; - -@PositionTemplate() -export class OptimismPikaProtocolEsPikaTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'EsPika'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(PikaProtocolViemContractFactory) protected readonly contractFactory: PikaProtocolViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.contractFactory.pikaProtocolEsPika({ address, network: this.network }); - } - - async getAddresses() { - return ['0x1508fbb7928aedc86bee68c91bc4afcf493b0e78']; - } - - async getUnderlyingTokenDefinitions(_params: GetUnderlyingTokensParams) { - return [{ address: '0x9a601c5bb360811d96a23689066af316a30c3027', network: this.network }]; - } - - async getPricePerShare() { - return [1]; - } -} diff --git a/src/apps/pika-protocol/pika-protocol.module.ts b/src/apps/pika-protocol/pika-protocol.module.ts index fd912e5dc..474c95b53 100644 --- a/src/apps/pika-protocol/pika-protocol.module.ts +++ b/src/apps/pika-protocol/pika-protocol.module.ts @@ -3,7 +3,6 @@ import { Module } from '@nestjs/common'; import { AbstractApp } from '~app/app.dynamic-module'; import { PikaProtocolViemContractFactory } from './contracts'; -import { OptimismPikaProtocolEsPikaTokenFetcher } from './optimism/pika-protocol.es-pika.token-fetcher'; import { OptimismPikaProtocolEscrowContractPositionFetcher } from './optimism/pika-protocol.escrowed.contract-position-fetcher'; import { OptimismPikaProtocolVaultContractPositionFetcher } from './optimism/pika-protocol.vault.contract-position-fetcher'; @@ -11,7 +10,6 @@ import { OptimismPikaProtocolVaultContractPositionFetcher } from './optimism/pik providers: [ PikaProtocolViemContractFactory, OptimismPikaProtocolVaultContractPositionFetcher, - OptimismPikaProtocolEsPikaTokenFetcher, OptimismPikaProtocolEscrowContractPositionFetcher, ], }) diff --git a/src/apps/pirex/arbitrum/pirex.apxglp.token-fetcher.ts b/src/apps/pirex/arbitrum/pirex.apxglp.token-fetcher.ts deleted file mode 100644 index e33c974ce..000000000 --- a/src/apps/pirex/arbitrum/pirex.apxglp.token-fetcher.ts +++ /dev/null @@ -1,48 +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, - DefaultAppTokenDefinition, - GetUnderlyingTokensParams, - UnderlyingTokenDefinition, - GetPricePerShareParams, -} from '~position/template/app-token.template.types'; - -import { PirexViemContractFactory } from '../contracts'; -import { ApxGlp } from '../contracts/viem'; - -@PositionTemplate() -export class ArbitrumPirexApxglpTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'Pirex GMX'; - - constructor( - @Inject(APP_TOOLKIT) readonly appToolkit: IAppToolkit, - @Inject(PirexViemContractFactory) private readonly pirexContractFactory: PirexViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.pirexContractFactory.apxGlp({ address, network: this.network }); - } - - async getAddresses(_params: GetAddressesParams): Promise { - return ['0x6cec1903eae091bdc532cfde68fff0723fd3ee14']; - } - - async getUnderlyingTokenDefinitions( - _params: GetUnderlyingTokensParams, - ): Promise { - return [{ address: '0x4277f8f2c384827b5273592ff7cebd9f2c1ac258', network: this.network }]; - } - - async getPricePerShare({ contract, appToken }: GetPricePerShareParams) { - const reserveRaw = await contract.read.totalAssets(); - const reserve = Number(reserveRaw) / 10 ** appToken.tokens[0].decimals; - const pricePerShare = reserve / appToken.supply; - return [pricePerShare]; - } -} diff --git a/src/apps/pirex/arbitrum/pirex.apxgmx.token-fetcher.ts b/src/apps/pirex/arbitrum/pirex.apxgmx.token-fetcher.ts deleted file mode 100644 index e70516837..000000000 --- a/src/apps/pirex/arbitrum/pirex.apxgmx.token-fetcher.ts +++ /dev/null @@ -1,48 +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, - DefaultAppTokenDefinition, - GetUnderlyingTokensParams, - UnderlyingTokenDefinition, - GetPricePerShareParams, -} from '~position/template/app-token.template.types'; - -import { PirexViemContractFactory } from '../contracts'; -import { ApxGmx } from '../contracts/viem'; - -@PositionTemplate() -export class ArbitrumPirexApxgmxTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'Pirex GMX'; - - constructor( - @Inject(APP_TOOLKIT) readonly appToolkit: IAppToolkit, - @Inject(PirexViemContractFactory) private readonly pirexContractFactory: PirexViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.pirexContractFactory.apxGmx({ address, network: this.network }); - } - - async getAddresses(_params: GetAddressesParams): Promise { - return ['0x61dbc0d6d7a6bde37f93d2014044a7c6b6de34d2']; - } - - async getUnderlyingTokenDefinitions( - _params: GetUnderlyingTokensParams, - ): Promise { - return [{ address: '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a', network: this.network }]; - } - - async getPricePerShare({ contract, appToken }: GetPricePerShareParams) { - const reserveRaw = await contract.read.totalAssets(); - const reserve = Number(reserveRaw) / 10 ** appToken.tokens[0].decimals; - const pricePerShare = reserve / appToken.supply; - return [pricePerShare]; - } -} diff --git a/src/apps/pirex/contracts/abis/apx-btrfly.json b/src/apps/pirex/contracts/abis/apx-btrfly.json deleted file mode 100644 index 1aa6fbeea..000000000 --- a/src/apps/pirex/contracts/abis/apx-btrfly.json +++ /dev/null @@ -1,988 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "pxBtrfly", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AlreadySet", - "type": "error" - }, - { - "inputs": [], - "name": "ExceedsMax", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "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": "amount", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Harvest", - "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": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "PlatformFeeUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_platform", - "type": "address" - } - ], - "name": "PlatformUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "_strategy", - "type": "address" - } - ], - "name": "StrategySet", - "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": "amount", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "penalty", - "type": "uint256" - } - ], - "name": "WithdrawalPenaltyUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FEE_DENOMINATOR", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_PLATFORM_FEE", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_WITHDRAWAL_PENALTY", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "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 ERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "convertToAssets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "convertToShares", - "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": "uint256", - "name": "assets", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "deposit", - "outputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "harvest", - "outputs": [], - "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": "assets", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "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": "platform", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "platformFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "previewDeposit", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "previewMint", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "previewRedeem", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "name": "previewWithdraw", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "redeem", - "outputs": [ - { - "internalType": "uint256", - "name": "assets", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_platform", - "type": "address" - } - ], - "name": "setPlatform", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "setPlatformFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_strategy", - "type": "address" - } - ], - "name": "setStrategy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "penalty", - "type": "uint256" - } - ], - "name": "setWithdrawalPenalty", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "strategy", - "outputs": [ - { - "internalType": "contract UnionPirexStaking", - "name": "", - "type": "address" - } - ], - "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": "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" - }, - { - "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": "shares", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalPenalty", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/pirex/contracts/abis/apx-glp.json b/src/apps/pirex/contracts/abis/apx-glp.json deleted file mode 100644 index 9f0eb182f..000000000 --- a/src/apps/pirex/contracts/abis/apx-glp.json +++ /dev/null @@ -1,592 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_gmxBaseReward", "type": "address" }, - { "internalType": "address", "name": "_asset", "type": "address" }, - { "internalType": "address", "name": "_pxGmx", "type": "address" }, - { "internalType": "string", "name": "_name", "type": "string" }, - { "internalType": "string", "name": "_symbol", "type": "string" }, - { "internalType": "address", "name": "_platform", "type": "address" }, - { "internalType": "address", "name": "_rewardsModule", "type": "address" }, - { "internalType": "address", "name": "_pirexFees", "type": "address" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { "inputs": [], "name": "ExceedsMax", "type": "error" }, - { "inputs": [], "name": "InvalidAssetParam", "type": "error" }, - { "inputs": [], "name": "InvalidParam", "type": "error" }, - { "inputs": [], "name": "ZeroAddress", "type": "error" }, - { "inputs": [], "name": "ZeroAmount", "type": "error" }, - { "inputs": [], "name": "ZeroShares", "type": "error" }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "rewardsDelta", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "rewardsIndex", "type": "uint256" } - ], - "name": "AccrueRewards", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "accruedRewards", "type": "uint256" }], - "name": "AccrueStrategy", - "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": "amount", "type": "uint256" } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "incentive", "type": "uint256" }], - "name": "CompoundIncentiveUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "minGlp", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "gmxBaseRewardAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "pxGmxAmountOut", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "pxGlpAmountOut", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "totalPxGlpFee", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "totalPxGmxFee", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "pxGlpIncentive", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "pxGmxIncentive", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "strategyIndex", "type": "uint256" } - ], - "name": "Compounded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }], - "name": "PlatformFeeUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_platform", "type": "address" }], - "name": "PlatformUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "PxGmxClaimed", - "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": "amount", "type": "uint256" } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "Withdraw", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "penalty", "type": "uint256" }], - "name": "WithdrawalPenaltyUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FEE_DENOMINATOR", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_COMPOUND_INCENTIVE", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_PLATFORM_FEE", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_WITHDRAWAL_PENALTY", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "ONE", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "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 ERC20", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "minUsdg", "type": "uint256" }, - { "internalType": "uint256", "name": "minGlp", "type": "uint256" }, - { "internalType": "bool", "name": "optOutIncentive", "type": "bool" } - ], - "name": "compound", - "outputs": [ - { "internalType": "uint256", "name": "gmxBaseRewardAmountIn", "type": "uint256" }, - { "internalType": "uint256", "name": "pxGmxAmountOut", "type": "uint256" }, - { "internalType": "uint256", "name": "pxGlpAmountOut", "type": "uint256" }, - { "internalType": "uint256", "name": "totalPxGlpFee", "type": "uint256" }, - { "internalType": "uint256", "name": "totalPxGmxFee", "type": "uint256" }, - { "internalType": "uint256", "name": "pxGlpIncentive", "type": "uint256" }, - { "internalType": "uint256", "name": "pxGmxIncentive", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "compoundIncentive", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "name": "convertToAssets", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "name": "convertToShares", - "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": "uint256", "name": "assets", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" } - ], - "name": "deposit", - "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" } - ], - "name": "depositFsGlp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "token", "type": "address" }, - { "internalType": "uint256", "name": "tokenAmount", "type": "uint256" }, - { "internalType": "uint256", "name": "minUsdg", "type": "uint256" }, - { "internalType": "uint256", "name": "minGlp", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" } - ], - "name": "depositGlp", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "minUsdg", "type": "uint256" }, - { "internalType": "uint256", "name": "minGlp", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" } - ], - "name": "depositGlpETH", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], - "name": "getUserIndex", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "user", "type": "address" }], - "name": "getUserRewardsAccrued", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmxBaseReward", - "outputs": [{ "internalType": "contract ERC20", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "maxDeposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "maxMint", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], - "name": "maxRedeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "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": "assets", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "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": "pirexFees", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "platform", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "platformFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "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": "pxGmx", - "outputs": [{ "internalType": "contract ERC20", "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": "assets", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "rewardsModule", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "incentive", "type": "uint256" }], - "name": "setCompoundIncentive", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_platform", "type": "address" }], - "name": "setPlatform", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "fee", "type": "uint256" }], - "name": "setPlatformFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "penalty", "type": "uint256" }], - "name": "setWithdrawalPenalty", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "strategyIndex", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "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": "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" - }, - { - "inputs": [], - "name": "vaultTotalAssets", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "vaultTotalExtraRewards", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "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": "shares", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalPenalty", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/pirex/contracts/abis/apx-gmx.json b/src/apps/pirex/contracts/abis/apx-gmx.json deleted file mode 100644 index 400ddc846..000000000 --- a/src/apps/pirex/contracts/abis/apx-gmx.json +++ /dev/null @@ -1,533 +0,0 @@ -[ - { - "inputs": [ - { "internalType": "address", "name": "_gmxBaseReward", "type": "address" }, - { "internalType": "address", "name": "_gmx", "type": "address" }, - { "internalType": "address", "name": "_asset", "type": "address" }, - { "internalType": "string", "name": "_name", "type": "string" }, - { "internalType": "string", "name": "_symbol", "type": "string" }, - { "internalType": "address", "name": "_platform", "type": "address" }, - { "internalType": "address", "name": "_rewardsModule", "type": "address" }, - { "internalType": "address", "name": "_pirexFees", "type": "address" } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { "inputs": [], "name": "AlreadySet", "type": "error" }, - { "inputs": [], "name": "ExceedsMax", "type": "error" }, - { "inputs": [], "name": "InvalidAssetParam", "type": "error" }, - { "inputs": [], "name": "InvalidParam", "type": "error" }, - { "inputs": [], "name": "ZeroAddress", "type": "error" }, - { "inputs": [], "name": "ZeroAmount", "type": "error" }, - { "inputs": [], "name": "ZeroShares", "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": "amount", "type": "uint256" } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "incentive", "type": "uint256" }], - "name": "CompoundIncentiveUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, - { "indexed": false, "internalType": "uint24", "name": "fee", "type": "uint24" }, - { "indexed": false, "internalType": "uint256", "name": "amountOutMinimum", "type": "uint256" }, - { "indexed": false, "internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160" }, - { "indexed": false, "internalType": "uint256", "name": "gmxBaseRewardAmountIn", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "gmxAmountOut", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "pxGmxMintAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "totalFee", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "incentive", "type": "uint256" } - ], - "name": "Compounded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }], - "name": "PlatformFeeUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "address", "name": "_platform", "type": "address" }], - "name": "PlatformUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint24", "name": "_poolFee", "type": "uint24" }], - "name": "PoolFeeUpdated", - "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": "amount", "type": "uint256" } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, - { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } - ], - "name": "Withdraw", - "type": "event" - }, - { - "anonymous": false, - "inputs": [{ "indexed": false, "internalType": "uint256", "name": "penalty", "type": "uint256" }], - "name": "WithdrawalPenaltyUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "FEE_DENOMINATOR", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_COMPOUND_INCENTIVE", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_PLATFORM_FEE", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MAX_WITHDRAWAL_PENALTY", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SWAP_ROUTER", - "outputs": [{ "internalType": "contract IV3SwapRouter", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "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 ERC20", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "balanceOf", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "amountOutMinimum", "type": "uint256" }, - { "internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160" }, - { "internalType": "bool", "name": "optOutIncentive", "type": "bool" } - ], - "name": "compound", - "outputs": [ - { "internalType": "uint256", "name": "gmxBaseRewardAmountIn", "type": "uint256" }, - { "internalType": "uint256", "name": "gmxAmountOut", "type": "uint256" }, - { "internalType": "uint256", "name": "pxGmxMintAmount", "type": "uint256" }, - { "internalType": "uint256", "name": "totalFee", "type": "uint256" }, - { "internalType": "uint256", "name": "incentive", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "compoundIncentive", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "name": "convertToAssets", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "name": "convertToShares", - "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": "uint256", "name": "assets", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" } - ], - "name": "deposit", - "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "amount", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" } - ], - "name": "depositGmx", - "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "gmx", - "outputs": [{ "internalType": "contract ERC20", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "gmxBaseReward", - "outputs": [{ "internalType": "contract ERC20", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "maxDeposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "maxMint", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], - "name": "maxRedeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "account", "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": "assets", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "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": "pirexFees", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "platform", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "platformFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "poolFee", - "outputs": [{ "internalType": "uint24", "name": "", "type": "uint24" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "name": "previewDeposit", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "name": "previewMint", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "name": "previewRedeem", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "name": "previewWithdraw", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "shares", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "redeem", - "outputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "rewardsModule", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "incentive", "type": "uint256" }], - "name": "setCompoundIncentive", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_platform", "type": "address" }], - "name": "setPlatform", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "fee", "type": "uint256" }], - "name": "setPlatformFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint24", "name": "_poolFee", "type": "uint24" }], - "name": "setPoolFee", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "penalty", "type": "uint256" }], - "name": "setWithdrawalPenalty", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [{ "internalType": "string", "name": "", "type": "string" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalAssets", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "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" - }, - { - "inputs": [], - "name": "vaultTotalAssets", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "assets", "type": "uint256" }, - { "internalType": "address", "name": "receiver", "type": "address" }, - { "internalType": "address", "name": "account", "type": "address" } - ], - "name": "withdraw", - "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdrawalPenalty", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - } -] diff --git a/src/apps/pirex/contracts/viem.contract-factory.ts b/src/apps/pirex/contracts/viem.contract-factory.ts index da694747f..a042e1c08 100644 --- a/src/apps/pirex/contracts/viem.contract-factory.ts +++ b/src/apps/pirex/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 { ApxBtrfly__factory, ApxGlp__factory, ApxGmx__factory, PirexPxCvx__factory } from './viem'; +import { PirexPxCvx__factory } from './viem'; type ContractOpts = { address: string; network: Network }; @@ -11,15 +11,6 @@ type ContractOpts = { address: string; network: Network }; export class PirexViemContractFactory { constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - apxBtrfly({ address, network }: ContractOpts) { - return ApxBtrfly__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - apxGlp({ address, network }: ContractOpts) { - return ApxGlp__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } - apxGmx({ address, network }: ContractOpts) { - return ApxGmx__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } pirexPxCvx({ address, network }: ContractOpts) { return PirexPxCvx__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); } diff --git a/src/apps/pirex/contracts/viem/ApxBtrfly.ts b/src/apps/pirex/contracts/viem/ApxBtrfly.ts deleted file mode 100644 index b239e978d..000000000 --- a/src/apps/pirex/contracts/viem/ApxBtrfly.ts +++ /dev/null @@ -1,1002 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const apxBtrflyAbi = [ - { - inputs: [ - { - internalType: 'address', - name: 'pxBtrfly', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'AlreadySet', - type: 'error', - }, - { - inputs: [], - name: 'ExceedsMax', - type: 'error', - }, - { - inputs: [], - name: 'ZeroAddress', - 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: 'amount', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'Deposit', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - ], - name: 'Harvest', - 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: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'PlatformFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_platform', - type: 'address', - }, - ], - name: 'PlatformUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_strategy', - type: 'address', - }, - ], - name: 'StrategySet', - 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: 'amount', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'Withdraw', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'WithdrawalPenaltyUpdated', - type: 'event', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'FEE_DENOMINATOR', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_PLATFORM_FEE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_WITHDRAWAL_PENALTY', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - 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 ERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'convertToAssets', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'convertToShares', - 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: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'deposit', - outputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'harvest', - outputs: [], - 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: 'assets', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - 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: 'platform', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'platformFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'previewDeposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'previewMint', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'previewRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'previewWithdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'redeem', - outputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_platform', - type: 'address', - }, - ], - name: 'setPlatform', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'setPlatformFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_strategy', - type: 'address', - }, - ], - name: 'setStrategy', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'setWithdrawalPenalty', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'strategy', - outputs: [ - { - internalType: 'contract UnionPirexStaking', - name: '', - type: 'address', - }, - ], - 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: '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', - }, - { - 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: 'shares', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'withdrawalPenalty', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type ApxBtrfly = typeof apxBtrflyAbi; -export type ApxBtrflyContract = GetContractReturnType; - -export class ApxBtrfly__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: apxBtrflyAbi, publicClient: client }); - } -} diff --git a/src/apps/pirex/contracts/viem/ApxGlp.ts b/src/apps/pirex/contracts/viem/ApxGlp.ts deleted file mode 100644 index 27c9e14bc..000000000 --- a/src/apps/pirex/contracts/viem/ApxGlp.ts +++ /dev/null @@ -1,1449 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const apxGlpAbi = [ - { - inputs: [ - { - internalType: 'address', - name: '_gmxBaseReward', - type: 'address', - }, - { - internalType: 'address', - name: '_asset', - type: 'address', - }, - { - internalType: 'address', - name: '_pxGmx', - type: 'address', - }, - { - internalType: 'string', - name: '_name', - type: 'string', - }, - { - internalType: 'string', - name: '_symbol', - type: 'string', - }, - { - internalType: 'address', - name: '_platform', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardsModule', - type: 'address', - }, - { - internalType: 'address', - name: '_pirexFees', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'ExceedsMax', - type: 'error', - }, - { - inputs: [], - name: 'InvalidAssetParam', - type: 'error', - }, - { - inputs: [], - name: 'InvalidParam', - type: 'error', - }, - { - inputs: [], - name: 'ZeroAddress', - type: 'error', - }, - { - inputs: [], - name: 'ZeroAmount', - type: 'error', - }, - { - inputs: [], - name: 'ZeroShares', - type: 'error', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'rewardsDelta', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'rewardsIndex', - type: 'uint256', - }, - ], - name: 'AccrueRewards', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'accruedRewards', - type: 'uint256', - }, - ], - name: 'AccrueStrategy', - 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: 'amount', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'incentive', - type: 'uint256', - }, - ], - name: 'CompoundIncentiveUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'minGlp', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'gmxBaseRewardAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'pxGmxAmountOut', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'pxGlpAmountOut', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'totalPxGlpFee', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'totalPxGmxFee', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'pxGlpIncentive', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'pxGmxIncentive', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'strategyIndex', - type: 'uint256', - }, - ], - name: 'Compounded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'Deposit', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'PlatformFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_platform', - type: 'address', - }, - ], - name: 'PlatformUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - ], - name: 'PxGmxClaimed', - 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: 'amount', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'Withdraw', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'WithdrawalPenaltyUpdated', - type: 'event', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'FEE_DENOMINATOR', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_COMPOUND_INCENTIVE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_PLATFORM_FEE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_WITHDRAWAL_PENALTY', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'ONE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - 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 ERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'minUsdg', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minGlp', - type: 'uint256', - }, - { - internalType: 'bool', - name: 'optOutIncentive', - type: 'bool', - }, - ], - name: 'compound', - outputs: [ - { - internalType: 'uint256', - name: 'gmxBaseRewardAmountIn', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'pxGmxAmountOut', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'pxGlpAmountOut', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'totalPxGlpFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'totalPxGmxFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'pxGlpIncentive', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'pxGmxIncentive', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'compoundIncentive', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'convertToAssets', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'convertToShares', - 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: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'deposit', - outputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'depositFsGlp', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'token', - type: 'address', - }, - { - internalType: 'uint256', - name: 'tokenAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minUsdg', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minGlp', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'depositGlp', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'minUsdg', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'minGlp', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'depositGlpETH', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'payable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - ], - name: 'getUserIndex', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address', - }, - ], - name: 'getUserRewardsAccrued', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'gmxBaseReward', - outputs: [ - { - internalType: 'contract ERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'maxDeposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'maxMint', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'maxRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - 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: 'assets', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - 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: 'pirexFees', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'platform', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'platformFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '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: 'pxGmx', - outputs: [ - { - internalType: 'contract ERC20', - 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: 'assets', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'rewardsModule', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'incentive', - type: 'uint256', - }, - ], - name: 'setCompoundIncentive', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_platform', - type: 'address', - }, - ], - name: 'setPlatform', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'setPlatformFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'setWithdrawalPenalty', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'strategyIndex', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - 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: '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', - }, - { - inputs: [], - name: 'vaultTotalAssets', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'vaultTotalExtraRewards', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - 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: 'shares', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'withdrawalPenalty', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type ApxGlp = typeof apxGlpAbi; -export type ApxGlpContract = GetContractReturnType; - -export class ApxGlp__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: apxGlpAbi, publicClient: client }); - } -} diff --git a/src/apps/pirex/contracts/viem/ApxGmx.ts b/src/apps/pirex/contracts/viem/ApxGmx.ts deleted file mode 100644 index 1aba1d56c..000000000 --- a/src/apps/pirex/contracts/viem/ApxGmx.ts +++ /dev/null @@ -1,1288 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const apxGmxAbi = [ - { - inputs: [ - { - internalType: 'address', - name: '_gmxBaseReward', - type: 'address', - }, - { - internalType: 'address', - name: '_gmx', - type: 'address', - }, - { - internalType: 'address', - name: '_asset', - type: 'address', - }, - { - internalType: 'string', - name: '_name', - type: 'string', - }, - { - internalType: 'string', - name: '_symbol', - type: 'string', - }, - { - internalType: 'address', - name: '_platform', - type: 'address', - }, - { - internalType: 'address', - name: '_rewardsModule', - type: 'address', - }, - { - internalType: 'address', - name: '_pirexFees', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - inputs: [], - name: 'AlreadySet', - type: 'error', - }, - { - inputs: [], - name: 'ExceedsMax', - type: 'error', - }, - { - inputs: [], - name: 'InvalidAssetParam', - type: 'error', - }, - { - inputs: [], - name: 'InvalidParam', - type: 'error', - }, - { - inputs: [], - name: 'ZeroAddress', - type: 'error', - }, - { - inputs: [], - name: 'ZeroAmount', - type: 'error', - }, - { - inputs: [], - name: 'ZeroShares', - 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: 'amount', - type: 'uint256', - }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'incentive', - type: 'uint256', - }, - ], - name: 'CompoundIncentiveUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: false, - internalType: 'uint24', - name: 'fee', - type: 'uint24', - }, - { - indexed: false, - internalType: 'uint256', - name: 'amountOutMinimum', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint160', - name: 'sqrtPriceLimitX96', - type: 'uint160', - }, - { - indexed: false, - internalType: 'uint256', - name: 'gmxBaseRewardAmountIn', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'gmxAmountOut', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'pxGmxMintAmount', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'totalFee', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'incentive', - type: 'uint256', - }, - ], - name: 'Compounded', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'Deposit', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'user', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address', - }, - ], - name: 'OwnershipTransferred', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'PlatformFeeUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: '_platform', - type: 'address', - }, - ], - name: 'PlatformUpdated', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint24', - name: '_poolFee', - type: 'uint24', - }, - ], - name: 'PoolFeeUpdated', - 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: 'amount', - type: 'uint256', - }, - ], - name: 'Transfer', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'caller', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'Withdraw', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'WithdrawalPenaltyUpdated', - type: 'event', - }, - { - inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'FEE_DENOMINATOR', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_COMPOUND_INCENTIVE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_PLATFORM_FEE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MAX_WITHDRAWAL_PENALTY', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'SWAP_ROUTER', - outputs: [ - { - internalType: 'contract IV3SwapRouter', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'address', - name: '', - 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 ERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amountOutMinimum', - type: 'uint256', - }, - { - internalType: 'uint160', - name: 'sqrtPriceLimitX96', - type: 'uint160', - }, - { - internalType: 'bool', - name: 'optOutIncentive', - type: 'bool', - }, - ], - name: 'compound', - outputs: [ - { - internalType: 'uint256', - name: 'gmxBaseRewardAmountIn', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'gmxAmountOut', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'pxGmxMintAmount', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'totalFee', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'incentive', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'compoundIncentive', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'convertToAssets', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'convertToShares', - 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: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'deposit', - outputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'amount', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - ], - name: 'depositGmx', - outputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'gmx', - outputs: [ - { - internalType: 'contract ERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'gmxBaseReward', - outputs: [ - { - internalType: 'contract ERC20', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'maxDeposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'maxMint', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'owner', - type: 'address', - }, - ], - name: 'maxRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - 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: 'assets', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - 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: 'pirexFees', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'platform', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'platformFee', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'poolFee', - outputs: [ - { - internalType: 'uint24', - name: '', - type: 'uint24', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'previewDeposit', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'previewMint', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - name: 'previewRedeem', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - name: 'previewWithdraw', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'redeem', - outputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'rewardsModule', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'incentive', - type: 'uint256', - }, - ], - name: 'setCompoundIncentive', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_platform', - type: 'address', - }, - ], - name: 'setPlatform', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'fee', - type: 'uint256', - }, - ], - name: 'setPlatformFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint24', - name: '_poolFee', - type: 'uint24', - }, - ], - name: 'setPoolFee', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'penalty', - type: 'uint256', - }, - ], - name: 'setWithdrawalPenalty', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalAssets', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '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', - }, - { - inputs: [], - name: 'vaultTotalAssets', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'assets', - type: 'uint256', - }, - { - internalType: 'address', - name: 'receiver', - type: 'address', - }, - { - internalType: 'address', - name: 'account', - type: 'address', - }, - ], - name: 'withdraw', - outputs: [ - { - internalType: 'uint256', - name: 'shares', - type: 'uint256', - }, - ], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'withdrawalPenalty', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, -] as const; - -export type ApxGmx = typeof apxGmxAbi; -export type ApxGmxContract = GetContractReturnType; - -export class ApxGmx__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: apxGmxAbi, publicClient: client }); - } -} diff --git a/src/apps/pirex/contracts/viem/index.ts b/src/apps/pirex/contracts/viem/index.ts index df94f40dd..32368f855 100644 --- a/src/apps/pirex/contracts/viem/index.ts +++ b/src/apps/pirex/contracts/viem/index.ts @@ -2,12 +2,6 @@ /* tslint:disable */ /* eslint-disable */ -export type { ApxBtrfly } from './ApxBtrfly'; -export type { ApxGlp } from './ApxGlp'; -export type { ApxGmx } from './ApxGmx'; export type { PirexPxCvx } from './PirexPxCvx'; -export { ApxBtrfly__factory } from './ApxBtrfly'; -export { ApxGlp__factory } from './ApxGlp'; -export { ApxGmx__factory } from './ApxGmx'; export { PirexPxCvx__factory } from './PirexPxCvx'; diff --git a/src/apps/pirex/ethereum/pirex.apxbtrfly.token-fetcher.ts b/src/apps/pirex/ethereum/pirex.apxbtrfly.token-fetcher.ts deleted file mode 100644 index 4efee3648..000000000 --- a/src/apps/pirex/ethereum/pirex.apxbtrfly.token-fetcher.ts +++ /dev/null @@ -1,48 +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, - DefaultAppTokenDefinition, - GetUnderlyingTokensParams, - UnderlyingTokenDefinition, - GetPricePerShareParams, -} from '~position/template/app-token.template.types'; - -import { PirexViemContractFactory } from '../contracts'; -import { ApxBtrfly } from '../contracts/viem'; - -@PositionTemplate() -export class EthereumPirexApxBtrflyTokenFetcher extends AppTokenTemplatePositionFetcher { - groupLabel = 'Pirex BTRFLY'; - - constructor( - @Inject(APP_TOOLKIT) readonly appToolkit: IAppToolkit, - @Inject(PirexViemContractFactory) private readonly pirexContractFactory: PirexViemContractFactory, - ) { - super(appToolkit); - } - - getContract(address: string) { - return this.pirexContractFactory.apxBtrfly({ address, network: this.network }); - } - - async getAddresses(_params: GetAddressesParams): Promise { - return ['0xfa35d1f603384e8fcfcbff3e610935d02922544e']; - } - - async getUnderlyingTokenDefinitions( - _params: GetUnderlyingTokensParams, - ): Promise { - return [{ address: '0xc55126051b22ebb829d00368f4b12bde432de5da', network: this.network }]; - } - - async getPricePerShare({ contract, appToken }: GetPricePerShareParams) { - const reserveRaw = await contract.read.totalAssets(); - const reserve = Number(reserveRaw) / 10 ** appToken.tokens[0].decimals; - const pricePerShare = reserve / appToken.supply; - return [pricePerShare]; - } -} diff --git a/src/apps/pirex/pirex.module.ts b/src/apps/pirex/pirex.module.ts index 56e188921..fd9cbf63e 100644 --- a/src/apps/pirex/pirex.module.ts +++ b/src/apps/pirex/pirex.module.ts @@ -2,22 +2,16 @@ import { Module } from '@nestjs/common'; import { AbstractApp } from '~app/app.dynamic-module'; -import { ArbitrumPirexApxglpTokenFetcher } from './arbitrum/pirex.apxglp.token-fetcher'; -import { ArbitrumPirexApxgmxTokenFetcher } from './arbitrum/pirex.apxgmx.token-fetcher'; import { ArbitrumPirexPxGlpTokenFetcher } from './arbitrum/pirex.pxglp.token-fetcher'; import { ArbitrumPirexPxGmxTokenFetcher } from './arbitrum/pirex.pxgmx.token-fetcher'; import { PirexViemContractFactory } from './contracts'; -import { EthereumPirexApxBtrflyTokenFetcher } from './ethereum/pirex.apxbtrfly.token-fetcher'; import { EthereumPirexPxBtrflyTokenFetcher } from './ethereum/pirex.pxbtrfly.token-fetcher'; import { EthereumPirexPxCvxTokenFetcher } from './ethereum/pirex.pxcvx.token-fetcher'; @Module({ providers: [ - ArbitrumPirexApxgmxTokenFetcher, - ArbitrumPirexApxglpTokenFetcher, ArbitrumPirexPxGlpTokenFetcher, ArbitrumPirexPxGmxTokenFetcher, - EthereumPirexApxBtrflyTokenFetcher, EthereumPirexPxCvxTokenFetcher, EthereumPirexPxBtrflyTokenFetcher, PirexViemContractFactory,