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

feat: Migrate to the Paseo testnet #128

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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 app/src/__tests__/Transfer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Transfer', () => {
// Polkadot-native chains should result in a basic chain id
expect(getDestChainId(Mainnet.AssetHub)).toBe(Mainnet.AssetHub.chainId.toString())
expect(getDestChainId(Mainnet.Mythos)).toBe(Mainnet.Mythos.chainId.toString())
expect(getDestChainId(Testnet.RococoAssetHub)).toBe(Testnet.RococoAssetHub.chainId.toString())
expect(getDestChainId(Testnet.PaseoAssetHub)).toBe(Testnet.PaseoAssetHub.chainId.toString())
})

it('convert amount to string', () => {
Expand Down
53 changes: 21 additions & 32 deletions app/src/config/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export namespace Mainnet {
}
}

/* Testnet :: Rococo - Sepolia */
/* Testnet :: Paseo - Sepolia */
export namespace Testnet {
// Chains
export const Sepolia: Chain = {
Expand All @@ -230,15 +230,15 @@ export namespace Testnet {
supportedAddressTypes: ['evm'],
}

export const RococoAssetHub: Chain = {
uid: 'rococo-assethub',
name: 'Rococo Asset Hub',
logoURI: 'https://cnews24.ru/uploads/d41/d419a4c7028eaf6864f972e554d761e7b10e5d06.png',
export const PaseoAssetHub: Chain = {
uid: 'paseo-assethub',
name: 'Paseo Asset Hub',
logoURI: 'https://s2.coinmarketcap.com/static/img/coins/64x64/6636.png',
chainId: 1000,
network: Network.Polkadot,
supportedAddressTypes: ['ss58'],
rpcConnection: 'wss://rococo-asset-hub-rpc.polkadot.io',
specName: 'asset-hub-rococo',
rpcConnection: 'wss://asset-hub-paseo-rpc.dwellir.com',
specName: 'asset-hub-paseo',
}

// Tokens
Expand All @@ -253,17 +253,6 @@ export namespace Testnet {
'{"parents":"2","interior":{"X2":[{"GlobalConsensus":{"Ethereum":{"chainId":"11155111"}}},{"AccountKey20":{"network":null,"key":"0xfff9976782d46cc05630d1f6ebab18b2324d6b14"}}]}}',
}

export const VETH: Token = {
id: 'veth',
name: 'Venus ETH',
symbol: 'vETH',
logoURI: 'https://s2.coinmarketcap.com/static/img/coins/64x64/7963.png',
decimals: 18,
address: '0xc3d088842dcf02c13699f936bb83dfbbc6f721ab',
multilocation:
'{"parents":"2","interior":{"X2":[{"GlobalConsensus":{"Ethereum":{"chainId":"11155111"}}},{"AccountKey20":{"network":null,"key":"0xc3d088842dcf02c13699f936bb83dfbbc6f721ab"}}]}}',
}

export const ETH: Token = {
id: 'seth',
name: 'Sepolia Ether',
Expand All @@ -275,12 +264,12 @@ export namespace Testnet {
multilocation: '',
}

export const ROC: Token = {
id: 'roc',
name: 'Rococo',
logoURI: 'https://s2.coinmarketcap.com/static/img/coins/64x64/6636.png',
symbol: 'ROC',
decimals: 12,
export const PAS: Token = {
id: 'pas',
name: 'Paseo',
logoURI: 'https://imgur.com/MhQMspt',
symbol: 'PAS',
decimals: 10,
address: '',
multilocation: '{"V2":{"parents":"1","interior":"Here"}}',
}
Expand Down Expand Up @@ -362,19 +351,19 @@ export const mainnetRegistry: Registry = {
}

export const testnetRegistry: Registry = {
chains: [Testnet.Sepolia, Testnet.RococoAssetHub],
tokens: [Testnet.WETH, Testnet.VETH],
chains: [Testnet.Sepolia, Testnet.PaseoAssetHub],
tokens: [Testnet.WETH],
routes: [
{
from: Testnet.Sepolia.uid,
to: Testnet.RococoAssetHub.uid,
tokens: [Testnet.WETH.id, Testnet.VETH.id],
to: Testnet.PaseoAssetHub.uid,
tokens: [Testnet.WETH.id],
sdk: 'SnowbridgeApi',
},
{
from: Testnet.RococoAssetHub.uid,
from: Testnet.PaseoAssetHub.uid,
to: Testnet.Sepolia.uid,
tokens: [Testnet.WETH.id, Testnet.VETH.id],
tokens: [Testnet.WETH.id],
sdk: 'AssetTransferApi',
},
],
Expand All @@ -387,8 +376,8 @@ export const REGISTRY = {

export function getNativeToken(chain: Chain): Token {
switch (chain.uid) {
case 'rococo-assethub':
return Testnet.ROC
case 'paseo-assethub':
return Testnet.PAS
case 'sepolia':
return Testnet.ETH
case 'polkadot-assethub':
Expand Down
2 changes: 1 addition & 1 deletion app/src/context/snowbridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function toSnowbridgeNetwork(env: Environment): string {
case Environment.Mainnet:
return 'polkadot_mainnet'
case Environment.Testnet:
return 'rococo_sepolia'
return 'paseo_sepolia'
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/store/environmentStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { create } from 'zustand'
export enum Environment {
/* Polkadot - Ethereum */
Mainnet = 'mainnet',
/* Rococo - Sepolia */
/* Paseo - Sepolia */
Testnet = 'testnet',
}
interface State {
Expand Down
4 changes: 2 additions & 2 deletions app/src/utils/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export const removeURLSlash = (url: string) => {
const EXPLORERS: { [environment in Environment]: { [explorerName: string]: string } } = {
[Environment.Testnet]: {
etherscan: 'https://sepolia.etherscan.io/',
subscan_assethub: 'https://assethub-rococo.subscan.io/',
subscan_brigehub: 'https://bridgehub-rococo.subscan.io/',
subscan_assethub: 'https://assethub-paseo.subscan.io/',
subscan_brigehub: 'https://bridgehub-paseo.subscan.io/',
},
[Environment.Mainnet]: {
etherscan: 'https://etherscan.io/',
Expand Down
Loading