diff --git a/src/apps/opnx/assets/logo.png b/src/apps/opnx/assets/logo.png deleted file mode 100644 index 113419e15..000000000 Binary files a/src/apps/opnx/assets/logo.png and /dev/null differ diff --git a/src/apps/opnx/contracts/abis/veox.json b/src/apps/opnx/contracts/abis/veox.json deleted file mode 100644 index 44b745acd..000000000 --- a/src/apps/opnx/contracts/abis/veox.json +++ /dev/null @@ -1,612 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "token_addr", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "locktime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "enum VotingEscrow.DepositType", - "name": "deposit_type", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ts", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "prevSupply", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "supply", - "type": "uint256" - } - ], - "name": "Supply", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "provider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "ts", - "type": "uint256" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "inputs": [], - "name": "MAXTIME", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MINTIME", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_block", - "type": "uint256" - } - ], - "name": "balanceOfAt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_t", - "type": "uint256" - } - ], - "name": "balanceOfAtT", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "checkpoint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_unlock_time", - "type": "uint256" - } - ], - "name": "create_lock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_unlock_time", - "type": "uint256" - } - ], - "name": "create_lock_as_minter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "deposit_for", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "epoch", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "addr", - "type": "address" - } - ], - "name": "get_last_user_slope", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_value", - "type": "uint256" - } - ], - "name": "increase_amount", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_unlock_time", - "type": "uint256" - } - ], - "name": "increase_unlock_time", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "locked", - "outputs": [ - { - "internalType": "int128", - "name": "amount", - "type": "int128" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addr", - "type": "address" - } - ], - "name": "locked__end", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "point_history", - "outputs": [ - { - "internalType": "int128", - "name": "bias", - "type": "int128" - }, - { - "internalType": "int128", - "name": "slope", - "type": "int128" - }, - { - "internalType": "uint256", - "name": "ts", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blk", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "slope_changes", - "outputs": [ - { - "internalType": "int128", - "name": "", - "type": "int128" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "supply", - "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": "token", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_block", - "type": "uint256" - } - ], - "name": "totalSupplyAt", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "t", - "type": "uint256" - } - ], - "name": "totalSupplyAtT", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "user_point_epoch", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "user_point_history", - "outputs": [ - { - "internalType": "int128", - "name": "bias", - "type": "int128" - }, - { - "internalType": "int128", - "name": "slope", - "type": "int128" - }, - { - "internalType": "uint256", - "name": "ts", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blk", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_idx", - "type": "uint256" - } - ], - "name": "user_point_history__ts", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/src/apps/opnx/contracts/index.ts b/src/apps/opnx/contracts/index.ts deleted file mode 100644 index 5dcfebdf6..000000000 --- a/src/apps/opnx/contracts/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -export * from './viem.contract-factory'; diff --git a/src/apps/opnx/contracts/viem.contract-factory.ts b/src/apps/opnx/contracts/viem.contract-factory.ts deleted file mode 100644 index a225c101d..000000000 --- a/src/apps/opnx/contracts/viem.contract-factory.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Injectable, Inject } from '@nestjs/common'; - -import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { Network } from '~types/network.interface'; - -import { Veox__factory } from './viem'; - -type ContractOpts = { address: string; network: Network }; - -@Injectable() -export class OpnxViemContractFactory { - constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) {} - - veox({ address, network }: ContractOpts) { - return Veox__factory.connect(address, this.appToolkit.getViemNetworkProvider(network)); - } -} diff --git a/src/apps/opnx/contracts/viem/Veox.ts b/src/apps/opnx/contracts/viem/Veox.ts deleted file mode 100644 index ae3c17f99..000000000 --- a/src/apps/opnx/contracts/viem/Veox.ts +++ /dev/null @@ -1,626 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { getContract, GetContractReturnType, PublicClient } from 'viem'; - -export const veoxAbi = [ - { - inputs: [ - { - internalType: 'address', - name: 'token_addr', - type: 'address', - }, - ], - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'provider', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: true, - internalType: 'uint256', - name: 'locktime', - type: 'uint256', - }, - { - indexed: false, - internalType: 'enum VotingEscrow.DepositType', - name: 'deposit_type', - type: 'uint8', - }, - { - indexed: false, - internalType: 'uint256', - name: 'ts', - type: 'uint256', - }, - ], - name: 'Deposit', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'prevSupply', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'supply', - type: 'uint256', - }, - ], - name: 'Supply', - type: 'event', - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'provider', - type: 'address', - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256', - }, - { - indexed: false, - internalType: 'uint256', - name: 'ts', - type: 'uint256', - }, - ], - name: 'Withdraw', - type: 'event', - }, - { - inputs: [], - name: 'MAXTIME', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'MINTIME', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'addr', - type: 'address', - }, - ], - name: 'balanceOf', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'addr', - type: 'address', - }, - { - internalType: 'uint256', - name: '_block', - type: 'uint256', - }, - ], - name: 'balanceOfAt', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'addr', - type: 'address', - }, - { - internalType: 'uint256', - name: '_t', - type: 'uint256', - }, - ], - name: 'balanceOfAtT', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'checkpoint', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_unlock_time', - type: 'uint256', - }, - ], - name: 'create_lock', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_addr', - type: 'address', - }, - { - internalType: 'uint256', - name: '_value', - type: 'uint256', - }, - { - internalType: 'uint256', - name: '_unlock_time', - type: 'uint256', - }, - ], - name: 'create_lock_as_minter', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'decimals', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_addr', - type: 'address', - }, - { - internalType: 'uint256', - name: '_value', - type: 'uint256', - }, - ], - name: 'deposit_for', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [], - name: 'epoch', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: 'addr', - type: 'address', - }, - ], - name: 'get_last_user_slope', - outputs: [ - { - internalType: 'int128', - name: '', - type: 'int128', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_value', - type: 'uint256', - }, - ], - name: 'increase_amount', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_unlock_time', - type: 'uint256', - }, - ], - name: 'increase_unlock_time', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'locked', - outputs: [ - { - internalType: 'int128', - name: 'amount', - type: 'int128', - }, - { - internalType: 'uint256', - name: 'end', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_addr', - type: 'address', - }, - ], - name: 'locked__end', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'point_history', - outputs: [ - { - internalType: 'int128', - name: 'bias', - type: 'int128', - }, - { - internalType: 'int128', - name: 'slope', - type: 'int128', - }, - { - internalType: 'uint256', - name: 'ts', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'blk', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'slope_changes', - outputs: [ - { - internalType: 'int128', - name: '', - type: 'int128', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'supply', - 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: 'token', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_block', - type: 'uint256', - }, - ], - name: 'totalSupplyAt', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'uint256', - name: 't', - type: 'uint256', - }, - ], - name: 'totalSupplyAtT', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - ], - name: 'user_point_epoch', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '', - type: 'address', - }, - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - name: 'user_point_history', - outputs: [ - { - internalType: 'int128', - name: 'bias', - type: 'int128', - }, - { - internalType: 'int128', - name: 'slope', - type: 'int128', - }, - { - internalType: 'uint256', - name: 'ts', - type: 'uint256', - }, - { - internalType: 'uint256', - name: 'blk', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [ - { - internalType: 'address', - name: '_addr', - type: 'address', - }, - { - internalType: 'uint256', - name: '_idx', - type: 'uint256', - }, - ], - name: 'user_point_history__ts', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - { - inputs: [], - name: 'withdraw', - outputs: [], - stateMutability: 'nonpayable', - type: 'function', - }, -] as const; - -export type Veox = typeof veoxAbi; -export type VeoxContract = GetContractReturnType; - -export class Veox__factory { - static connect(address: string, client: PublicClient) { - return getContract({ address, abi: veoxAbi, publicClient: client }); - } -} diff --git a/src/apps/opnx/contracts/viem/index.ts b/src/apps/opnx/contracts/viem/index.ts deleted file mode 100644 index 2041fb72f..000000000 --- a/src/apps/opnx/contracts/viem/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -export type { Veox } from './Veox'; - -export { Veox__factory } from './Veox'; diff --git a/src/apps/opnx/ethereum/opnx.veox.contract-position-fetcher.ts b/src/apps/opnx/ethereum/opnx.veox.contract-position-fetcher.ts deleted file mode 100644 index 13b29cf89..000000000 --- a/src/apps/opnx/ethereum/opnx.veox.contract-position-fetcher.ts +++ /dev/null @@ -1,44 +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 { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { - GetDisplayPropsParams, - GetTokenBalancesParams, - GetTokenDefinitionsParams, -} from '~position/template/contract-position.template.types'; -import { VotingEscrowTemplateContractPositionFetcher } from '~position/template/voting-escrow.template.contract-position-fetcher'; - -import { OpnxViemContractFactory } from '../contracts'; -import { Veox } from '../contracts/viem'; -import { VeoxContract } from '../contracts/viem/Veox'; - -@PositionTemplate() -export class EthereumOpnxContractPositionFetcher extends VotingEscrowTemplateContractPositionFetcher { - veTokenAddress = '0x28901cf869d94c9d892fbd86c8e57b801e8fdd87'; - groupLabel = 'Staking'; - - constructor( - @Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit, - @Inject(OpnxViemContractFactory) private readonly opnxContractFactory: OpnxViemContractFactory, - ) { - super(appToolkit); - } - - getEscrowContract(address: string): VeoxContract { - return this.opnxContractFactory.veox({ address, network: this.network }); - } - - getEscrowedTokenAddress({ contract }: GetTokenDefinitionsParams) { - return contract.read.token(); - } - - async getEscrowedTokenBalance({ contract, address }: GetTokenBalancesParams) { - return contract.read.locked([address]).then(v => v[0]); - } - - async getLabel({ contractPosition }: GetDisplayPropsParams) { - return getLabelFromToken(contractPosition.tokens[0]); - } -} diff --git a/src/apps/opnx/opnx.module.ts b/src/apps/opnx/opnx.module.ts deleted file mode 100644 index 45c2a4740..000000000 --- a/src/apps/opnx/opnx.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common'; - -import { AbstractApp } from '~app/app.dynamic-module'; - -import { OpnxViemContractFactory } from './contracts'; -import { EthereumOpnxContractPositionFetcher } from './ethereum/opnx.veox.contract-position-fetcher'; - -@Module({ - providers: [EthereumOpnxContractPositionFetcher, OpnxViemContractFactory], -}) -export class OpnxAppModule extends AbstractApp() {}