Skip to content

Commit

Permalink
feat: add manta pacific EBV token Tia
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielZhangReal committed Nov 16, 2023
1 parent 1702006 commit c093f06
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/backend/src/config/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ const chainConfig = [
// https://basescan.org/block/0
minTimestamp: UnixTime.fromDate(new Date('2023-06-15T12:35:47Z')),
},
{
chainId: ChainId.MANTA_PACIFIC,
// ~ Timestamp of block number 0 on MantaPacific
// https://pacific-explorer.manta.network/block/0
minTimestamp: UnixTime.fromDate(new Date('2023-09-09T01:45:59Z')),
},
]

export function getChainMinTimestamp(chainId: ChainId): UnixTime {
Expand Down
31 changes: 30 additions & 1 deletion packages/config/src/layer2s/mantapacific.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { EthereumAddress, ProjectId, UnixTime } from '@l2beat/shared-pure'
import {
AssetId,
ChainId,
CoingeckoId,
EthereumAddress,
ProjectId,
Token,
UnixTime,
} from '@l2beat/shared-pure'

import { ProjectDiscovery } from '../discovery/ProjectDiscovery'
import { HARDCODED } from '../discovery/values/hardcoded'
Expand All @@ -23,6 +31,26 @@ const upgradesProxy = {
upgradeDelay: 'No delay',
}

const TOKENS: Omit<Token, 'chainId'>[] = [
{
id: AssetId('mantapacific:tia-celestia'),
name: 'Celestia',
symbol: 'TIA',
decimals: 6,
iconUrl:
'https://assets.coingecko.com/coins/images/31967/large/tia.jpg?1696530772',
address: EthereumAddress('0x6Fae4D9935E2fcb11fC79a64e917fb2BF14DaFaa'),
coingeckoId: CoingeckoId('celestia'),
sinceTimestamp: new UnixTime(1698782429),
category: 'other',
type: 'EBV',
formula: 'totalSupply',
bridgedUsing: {
bridge: 'Hyperlane Nexus',
},
},
]

export const mantapacific: Layer2 = {
type: 'layer2',
id: ProjectId('mantapacific'),
Expand Down Expand Up @@ -51,6 +79,7 @@ export const mantapacific: Layer2 = {
activityDataSource: 'Blockchain RPC',
},
config: {
tokenList: TOKENS.map((t) => ({ ...t, chainId: ChainId.MANTA_PACIFIC })),
escrows: [
discovery.getEscrowDetails({
address: EthereumAddress('0x9168765EE952de7C6f8fC6FaD5Ec209B960b7622'),
Expand Down
5 changes: 5 additions & 0 deletions packages/shared-pure/src/types/ChainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ const CHAIN_IDS: Record<number, { name: string; explorer: string }> = {
name: 'gnosis',
explorer: 'https://gnosisscan.io',
},
169: {
name: 'manta-pacific',
explorer: 'https://pacific-explorer.manta.network',
},
} as const

ChainId.ETHEREUM = chainIdFromName('ethereum')
Expand All @@ -124,3 +128,4 @@ ChainId.LINEA = chainIdFromName('linea')
ChainId.BASE = chainIdFromName('base')
ChainId.POLYGON_ZKEVM = chainIdFromName('polygon-zkevm')
ChainId.GNOSIS = chainIdFromName('gnosis')
ChainId.MANTA_PACIFIC = chainIdFromName('manta-pacific')

0 comments on commit c093f06

Please sign in to comment.