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 new testnet to SkaleNetworks #244

Merged
merged 1 commit into from
Feb 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
[submodule "skale-network"]
path = skale-network
url = https://github.com/skalenetwork/skale-network.git
branch = add-additional-metadata
branch = master
2 changes: 1 addition & 1 deletion helper-scripts
2 changes: 1 addition & 1 deletion skale-network
Submodule skale-network updated 26 files
+1 −0 dependencies/README.md
+ dependencies/libiconv-1.15.tar.gz
+1 −1 metadata/legacy/chains.json
+2 −2 metadata/mainnet/chains.json
+2 −2 metadata/staging/chains.json
+77 −0 metadata/testnet/chains.json
+58 −0 metadata/testnet/icons/giant-half-dual-testnet-madnft.svg
+6 −0 metadata/testnet/icons/giant-half-dual-testnet-nftrade.svg
+11 −0 metadata/testnet/icons/giant-half-dual-testnet-untitled-platformer.svg
+2 −0 metadata/testnet/icons/giant-half-dual-testnet.svg
+2 −0 metadata/testnet/icons/juicy-low-small-testnet-ruby.svg
+13 −0 metadata/testnet/icons/juicy-low-small-testnet.svg
+26 −0 metadata/testnet/icons/lanky-ill-funny-testnet.svg
+9 −0 metadata/testnet/icons/mainnet.svg
+ metadata/testnet/logos/aware-fake-trim-testnet.png
+1 −0 metadata/testnet/logos/giant-half-dual-testnet-nftrade.svg
+ metadata/testnet/logos/giant-half-dual-testnet-untitled-platformer.png
+ metadata/testnet/logos/giant-half-dual-testnet.png
+ metadata/testnet/logos/juicy-low-small-testnet-ruby.png
+ metadata/testnet/logos/juicy-low-small-testnet.png
+ metadata/testnet/logos/lanky-ill-funny-testnet.png
+ metadata/testnet/logos/mainnet.png
+17,317 −0 releases/mainnet/skale-manager/1.9.4/skale-manager-1.9.4-mainnet-abi.json
+27 −0 releases/mainnet/skale-manager/1.9.4/skale-manager-1.9.4-mainnet-contracts.json
+7,410 −0 releases/staging/ima-contracts/1.5.0/mainnet/ima.json
+15,413 −0 releases/staging/skale-manager/1.9.4/manager.json
11 changes: 7 additions & 4 deletions src/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,24 @@ export const MAINNET_EXPLORER_URLS: { [skaleNetwork: string]: string } = {
mainnet: 'https://etherscan.io',
staging: 'https://goerli.etherscan.io/',
legacy: 'https://goerli.etherscan.io/',
regression: 'https://goerli.etherscan.io/'
regression: 'https://goerli.etherscan.io/',
testnet: 'https://holesky.etherscan.io/'
}

export const BASE_EXPLORER_URLS: { [skaleNetwork: string]: string } = {
mainnet: 'explorer.mainnet.skalenodes.com',
staging: 'explorer.staging-v3.skalenodes.com',
legacy: 'legacy-explorer.skalenodes.com',
regression: 'regression-explorer.skalenodes.com'
regression: 'regression-explorer.skalenodes.com',
testnet: 'testnet-explorer.skalenodes.com'
}

export const MAINNET_WS_ENDPOINTS: { [skaleNetwork: string]: string } = {
mainnet: 'wss://ethereum.publicnode.com',
staging: 'wss://ethereum-goerli.publicnode.com',
legacy: 'wss://ethereum-goerli.publicnode.com ',
regression: 'wss://ethereum-goerli.publicnode.com '
legacy: 'wss://ethereum-goerli.publicnode.com',
regression: 'wss://ethereum-goerli.publicnode.com',
testnet: 'wss://ethereum-holesky.publicnode.com'
}

// ETA constants
Expand Down
4 changes: 3 additions & 1 deletion src/core/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import mainnetAddresses from '../metadata/addresses/mainnet.json'
import stagingAddresses from '../metadata/addresses/staging.json'
import legacyAddresses from '../metadata/addresses/legacy.json'
import regressionAddresses from '../metadata/addresses/regression.json'
import testnetAddresses from '../metadata/addresses/testnet.json'

import sChainAbi from '../metadata/schainAbi.json'
import mainnetAbi from '../metadata/mainnetAbi.json'
Expand All @@ -52,7 +53,8 @@ export const IMA_ADDRESSES = {
mainnet: mainnetAddresses,
staging: stagingAddresses,
legacy: legacyAddresses,
regression: regressionAddresses
regression: regressionAddresses,
testnet: testnetAddresses
}

export const IMA_ABIS = {
Expand Down
2 changes: 1 addition & 1 deletion src/core/interfaces/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import { TokenConnectionsMap, TokenMetadataMap, MetaportTheme } from '.'

export type SkaleNetwork = 'mainnet' | 'staging' | 'legacy' | 'regression'
export type SkaleNetwork = 'mainnet' | 'staging' | 'legacy' | 'regression' | 'testnet'

export interface MetaportConfig {
openOnLoad?: boolean
Expand Down
8 changes: 6 additions & 2 deletions src/core/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,30 @@ import mainnetMeta from '../meta/mainnet/chains.json'
import stagingMeta from '../meta/staging/chains.json'
import legacyMeta from '../meta/legacy/chains.json'
import regressionMeta from '../meta/regression/chains.json'
import testnetMeta from '../meta/testnet/chains.json'

import * as MAINNET_CHAIN_ICONS from '../meta/mainnet/icons'
import * as STAGING_CHAIN_ICONS from '../meta/staging/icons'
import * as LEGACY_CHAIN_ICONS from '../meta/legacy/icons'
import * as REGRESSION_CHAIN_ICONS from '../meta/regression/icons'
import * as TESTNET_CHAIN_ICONS from '../meta/testnet/icons'

import * as icons from '../icons'

const CHAIN_ICONS: { [network in SkaleNetwork]: any } = {
mainnet: MAINNET_CHAIN_ICONS,
staging: STAGING_CHAIN_ICONS,
legacy: LEGACY_CHAIN_ICONS,
regression: REGRESSION_CHAIN_ICONS
regression: REGRESSION_CHAIN_ICONS,
testnet: TESTNET_CHAIN_ICONS
}

export const CHAINS_META: NetworksMetadataMap = {
mainnet: mainnetMeta,
staging: stagingMeta,
legacy: legacyMeta,
regression: regressionMeta
regression: regressionMeta,
testnet: testnetMeta
}

function transformChainName(chainName: string): string {
Expand Down
6 changes: 5 additions & 1 deletion src/core/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const CHAIN_IDS: { [network in SkaleNetwork]: number } = {
staging: 5,
legacy: 5,
regression: 5,
mainnet: 1
mainnet: 1,
testnet: 17000
}

export function isMainnetChainId(chainId: number | BigInt, skaleNetwork: SkaleNetwork): boolean {
Expand Down Expand Up @@ -93,6 +94,9 @@ export function getMainnetAbi(network: string) {
if (network === 'regression') {
return { ...IMA_ABIS.mainnet, ...IMA_ADDRESSES.regression }
}
if (network === 'testnet') {
return { ...IMA_ABIS.mainnet, ...IMA_ADDRESSES.testnet }
}
return { ...IMA_ABIS.mainnet, ...IMA_ADDRESSES.mainnet }
}

Expand Down
10 changes: 10 additions & 0 deletions src/metadata/addresses/testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"message_proxy_mainnet_address": "0x682ef859e1cE314ceD13A6FA32cE77AaeCE98e28",
"linker_address": "0x840A1BCa22c6D67Ed1076A1018b404EbcaA8a10c",
"community_pool_address": "0xF263049E4D7b331154077e30dD4de72F779E9554",
"deposit_box_eth_address": "0xe1A65b7677866A80B6e4263469FAC22ddc26F4b8",
"deposit_box_erc20_address": "0x4121c9218a65e12f027714AE956Aea7B9C220dAE",
"deposit_box_erc721_address": "0x024cdFF8Cd5cF334243B2fC2fd3eA1Fc1C9ebec5",
"deposit_box_erc1155_address": "0xb990E0D1F115398D7E6A8E4269e68b9034366280",
"deposit_box_erc721_with_metadata_address": "0x81caAfd5DF89d9DA44054c0a0a305E35DD7e958E"
}
3 changes: 2 additions & 1 deletion src/metadata/faucet.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@
"func": "0x0c11dedd"
}
},
"regression": null
"regression": null,
"testnet": null
}
3 changes: 2 additions & 1 deletion src/metadata/proxy.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"staging": "staging-v3.skalenodes.com",
"legacy": "legacy-proxy.skalenodes.com",
"regression": "regression-proxy.skalenodes.com",
"qatestnet": "new-testnet-proxy.skalenodes.com"
"qatestnet": "new-testnet-proxy.skalenodes.com",
"testnet": "testnet.skalenodes.com"
}
Loading