Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hyperlane configs #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
21 changes: 21 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "simple-import-sort", "prettier"],
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"prettier/prettier": "error"
}
}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"trailingComma": "none"
}
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@tangle-network/evm-contract-metadata",
"version": "0.0.1",
"type": "module",
"main": "./dist/evm-contract-metadata.umd.cjs",
"module": "./dist/evm-contract-metadata.js",
"files": [
"dist"
],
"exports": {
".": {
"import": "./dist/evm-contract-metadata.js",
"require": "./dist/evm-contract-metadata.umd.cjs",
"types": "./dist/evm-contract-metadata.d.ts"
}
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"devDependencies": {
"typescript": "~5.6.2",
"vite": "^5.4.10"
},
"dependencies": {
"@hyperlane-xyz/sdk": "^5.6.2",
"@hyperlane-xyz/utils": "^5.6.2",
"viem": "^2.21.40",
"vite-plugin-dts": "^4.3.0"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
34 changes: 34 additions & 0 deletions src/EVM/chains.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { EvmChain, EvmChainInfo, EVMChainId } from './types';
import { holesky } from 'viem/chains';
import { defineChain } from 'viem';

export const EvmChains: Record<EvmChain, EvmChainInfo> = {
[EvmChain.HOLESKY]: {
...holesky,
isTestnet: true
},
[EvmChain.TANGLE_TESTNET]: {
...defineChain({
id: EVMChainId.TANGLE_TESTNET,
name: 'Tangle Testnet EVM',
nativeCurrency: {
name: 'Test Tangle Network Token',
symbol: 'tTNT',
decimals: 18
},
blockExplorers: {
default: {
name: 'Tangle Testnet EVM Explorer',
url: 'https://testnet-explorer.tangle.tools'
}
},
rpcUrls: {
default: {
http: ['https://testnet-rpc.tangle.tools']
}
},
isTestnet: true
}),
isTestnet: true
}
} as const;
3 changes: 3 additions & 0 deletions src/EVM/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './chains';
export * from './tokens';
export * from './types';
23 changes: 23 additions & 0 deletions src/EVM/tokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { EvmToken, EvmTokenInfo, EvmChain } from './types';

/**
* EVM Chain to token map
*
* @constant
* @type {Record<EvmChain, Record<EvmToken, EvmTokenInfo>>}
*/
export const EvmTokens: Record<EvmChain, Record<EvmToken, EvmTokenInfo>> = {
[EvmChain.HOLESKY]: {
[EvmToken.WETH]: {
address: '0x94373a4919B3240D86eA41593D5eBa789FEF3848',
symbol: 'WETH'
}
},
[EvmChain.TANGLE_TESTNET]: {
[EvmToken.WETH]: {
address: '0x200DE548e393c38ee80482e9c5c186CBA7096ad4',
symbol: 'WETH'
}
}
} as const;

24 changes: 24 additions & 0 deletions src/EVM/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type { Chain } from 'viem/chains';

export enum EvmToken {
WETH = 'WETH'
}

export type EvmTokenInfo = {
address: string;
symbol: string;
};

export enum EvmChain {
HOLESKY = 'holesky',
TANGLE_TESTNET = 'tangletestnet'
}

export type EvmChainInfo = Chain & {
isTestnet: boolean;
};

export enum EVMChainId {
HOLESKY = 17000,
TANGLE_TESTNET = 3799,
}
56 changes: 56 additions & 0 deletions src/Hyperlane/addresses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { HyperlaneChain, HyperlaneChainAddresses } from './types';

const HOLESKY_ADDRESSES: HyperlaneChainAddresses = {
staticMerkleRootMultisigIsmFactory:
'0xf56991Fb4829cE3Da2Dd4050292823D3056A2a84',
staticMessageIdMultisigIsmFactory:
'0x23160191baf37EB3d92CeC1A4F11cffe74CC2814',
staticAggregationIsmFactory: '0xeC6E0302B1d191a4958859234D31dE97E9692Eb4',
staticAggregationHookFactory: '0xCA6719E2f4a3b8405536bD7d8d719379e7721B7f',
domainRoutingIsmFactory: '0xb545E1BD3a7E8d7463CD30Ce64D470BC901dAbf8',
staticMerkleRootWeightedMultisigIsmFactory:
'0xC5F161354EBB6E6F89536A2d9e49FECD654c7ef0',
staticMessageIdWeightedMultisigIsmFactory:
'0xdf28b577913B3cA63cc954cc8D2d593c1a975d87',
proxyAdmin: '0x7FF8c50bdFC41eedba12f81FF6f49ae4F84c96C2',
mailbox: '0x57529d3663bb44e8ab3335743dd42d2e1E3b46BA',
interchainAccountRouter: '0x9d80DfCA188C5a3327f927b4c8f5B5D3bb006Bca',
interchainAccountIsm: '0x665D8B4818e5674639852585D9Fd4889Ca009eFC',
validatorAnnounce: '0xb07Af962F2046185DF848DAD5061D32eF04EbC38',
testRecipient: '0x54484aC0eB76C22F038e1EF92c585fF3A377231c',
protocolFee: '0x5a3Fe91ea1b337baF23aca05606A6c1D05D270E8',
merkleTreeHook: '0x87b863A6A0d841F2949f03016c306f4b9d346feD',
interchainGasPaymaster: '0x5CBf4e70448Ed46c2616b04e9ebc72D29FF0cfA9'
} as const;

const TANGLE_TESTNET_ADDRESSES: HyperlaneChainAddresses = {
domainRoutingIsmFactory: '0x8822Df6071d8db08e62cf2BfEbb4ec698a6118A0',
interchainAccountIsm: '0x46BdA7969f78c23802b80Fb10DaF50B1949B76fD',
interchainAccountRouter: '0x996AF1d2888f24B2c6b9304E71a02A75efc25E9C',
mailbox: '0x0FDc2400B5a50637880dbEfB25d631c957620De8',
proxyAdmin: '0x526c2fC4cCC194570ED160bC6B1e1211c577A76c',
staticAggregationHookFactory: '0x56E0d8D26144b5E97Fbfd0462B8DCb0F1E3a0628',
staticAggregationIsmFactory: '0x4eb63FfcA8467e8779e3075D61E8261C982F7943',
staticMerkleRootMultisigIsmFactory:
'0x541A17B1a99b5CC5C5f8A988B31339Ff2F228690',
staticMerkleRootWeightedMultisigIsmFactory:
'0xDbCad8F8648AE9A2977E97d8821E0e813Bf2Df6B',
staticMessageIdMultisigIsmFactory:
'0x62c7b864f1751052004a69Cd8dff6a246DbFA627',
staticMessageIdWeightedMultisigIsmFactory:
'0x1b2FA712be75D74E0D2758506221Ba8750e6AbDC',
testRecipient: '0x18f8DD0825e002a3e2224de41c558d3A819Cdc76',
validatorAnnounce: '0x9FBC5ED24d7a3dea193cE9Ddd44e56236c8e5D86',
protocolFee: '0xff38FeF8b08e11E778C8dB1400Ecf33E80d2FDAc',
merkleTreeHook: '0x7aF2ABc39d93150c91bb414da72443e2Fe7A9127',
interchainGasPaymaster: '0x0000000000000000000000000000000000000000'
} as const;

/**
* Hyperlane contract addresses of Tangle supported chains.
* Contains core Hyperlane addresses like mailboxes, IGP, routers etc.
*/
export const HyperlaneAddresses = {
[HyperlaneChain.HOLESKY]: HOLESKY_ADDRESSES,
[HyperlaneChain.TANGLE_TESTNET]: TANGLE_TESTNET_ADDRESSES
} as const satisfies Record<HyperlaneChain, HyperlaneChainAddresses>;
74 changes: 74 additions & 0 deletions src/Hyperlane/chains.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { ChainMap, ChainMetadata, ExplorerFamily } from '@hyperlane-xyz/sdk';
import { ProtocolType } from '@hyperlane-xyz/utils';

/**
* Hyperlane chains deployed by the Tangle Network.
*
* @see {@link ChainMap}
* @see {@link ChainMetadata}
* @type {ChainMap<ChainMetadata>}
*/
export const HyperlaneChains: ChainMap<ChainMetadata> = {
holesky: {
blockExplorers: [
{
apiUrl: 'https://api-holesky.etherscan.io/api',
family: ExplorerFamily.Etherscan,
name: 'Etherscan',
url: 'https://holesky.etherscan.io'
}
],
blocks: {
confirmations: 1,
estimateBlockTime: 13,
reorgPeriod: 2
},
chainId: 17000,
displayName: 'Holesky',
domainId: 17000,
isTestnet: true,
name: 'holesky',
nativeToken: {
decimals: 18,
name: 'Ether',
symbol: 'ETH'
},
protocol: ProtocolType.Ethereum,
rpcUrls: [
{
http: 'https://ethereum-holesky-rpc.publicnode.com'
}
]
},
tangletestnet: {
blockExplorers: [
{
apiUrl: 'https://testnet-explorer.tangle.tools/api',
family: ExplorerFamily.Blockscout,
name: 'Tangle Testnet Explorer',
url: 'https://testnet-explorer.tangle.tools'
}
],
blocks: {
confirmations: 4,
estimateBlockTime: 6,
reorgPeriod: 4
},
chainId: 3799,
displayName: 'Tangle Testnet',
domainId: 3799,
isTestnet: true,
name: 'tangletestnet',
nativeToken: {
decimals: 18,
name: 'Tangle Testnet Token',
symbol: 'tTNT'
},
protocol: ProtocolType.Ethereum,
rpcUrls: [
{
http: 'https://testnet-rpc.tangle.tools'
}
]
}
};
16 changes: 16 additions & 0 deletions src/Hyperlane/chains/holesky/addresses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
staticMerkleRootMultisigIsmFactory: '0xf56991Fb4829cE3Da2Dd4050292823D3056A2a84'
staticMessageIdMultisigIsmFactory: '0x23160191baf37EB3d92CeC1A4F11cffe74CC2814'
staticAggregationIsmFactory: '0xeC6E0302B1d191a4958859234D31dE97E9692Eb4'
staticAggregationHookFactory: '0xCA6719E2f4a3b8405536bD7d8d719379e7721B7f'
domainRoutingIsmFactory: '0xb545E1BD3a7E8d7463CD30Ce64D470BC901dAbf8'
staticMerkleRootWeightedMultisigIsmFactory: '0xC5F161354EBB6E6F89536A2d9e49FECD654c7ef0'
staticMessageIdWeightedMultisigIsmFactory: '0xdf28b577913B3cA63cc954cc8D2d593c1a975d87'
proxyAdmin: '0x7FF8c50bdFC41eedba12f81FF6f49ae4F84c96C2'
mailbox: '0x57529d3663bb44e8ab3335743dd42d2e1E3b46BA'
interchainAccountRouter: '0x9d80DfCA188C5a3327f927b4c8f5B5D3bb006Bca'
interchainAccountIsm: '0x665D8B4818e5674639852585D9Fd4889Ca009eFC'
validatorAnnounce: '0xb07Af962F2046185DF848DAD5061D32eF04EbC38'
testRecipient: '0x54484aC0eB76C22F038e1EF92c585fF3A377231c'
protocolFee: '0x5a3Fe91ea1b337baF23aca05606A6c1D05D270E8'
merkleTreeHook: '0x87b863A6A0d841F2949f03016c306f4b9d346feD'
interchainGasPaymaster: '0x5CBf4e70448Ed46c2616b04e9ebc72D29FF0cfA9'
22 changes: 22 additions & 0 deletions src/Hyperlane/chains/holesky/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# yaml-language-server: $schema=../schema.json
blockExplorers:
- apiUrl: https://api-holesky.etherscan.io/api
family: etherscan
name: Etherscan
url: https://holesky.etherscan.io
blocks:
confirmations: 1
estimateBlockTime: 13
reorgPeriod: 2
chainId: 17000
displayName: Holesky
domainId: 17000
isTestnet: true
name: holesky
nativeToken:
decimals: 18
name: Ether
symbol: ETH
protocol: ethereum
rpcUrls:
- http: https://ethereum-holesky-rpc.publicnode.com
Loading