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

Eclipse devnet, opening to give eclipse team a test UI #83

Open
wants to merge 3 commits into
base: eclipse-mainnet
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
Binary file modified public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file modified public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function AppLayout({ children }: PropsWithChildren) {
<Head>
{/* https://nextjs.org/docs/messages/no-document-viewport-meta */}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nautilus Bridge</title>
<title>Eclipse Bridge</title>
</Head>
<div id="app-content" className="h-full min-h-screen w-full min-w-screen">
<div className="max-w-screen-xl mx-auto flex flex-col justify-between min-h-screen px-4">
Expand Down
2 changes: 1 addition & 1 deletion src/components/nav/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function Footer() {
</div>
<div className="hidden sm:flex flex-col ml-3">
<p className="leading-6">
Bridge ZBC with the Nautilus Chain Bridge
Bridge with the Eclipse Devnet Bridge
<br />
Build with <Link href="https://www.hyperlane.xyz">Hyperlane</Link>
</p>
Expand Down
28 changes: 28 additions & 0 deletions src/consts/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,34 @@ export const chains: ChainMap<ChainMetadata & { mailbox?: Address }> = {
...chainMetadata.solanadevnet,
mailbox: '4v25Dz9RccqUrTzmfHzJMsjd1iVoNrWzeJ4o6GYuJrVn',
},
eclipsedevnet: {
protocol: ProtocolType.Sealevel,
chainId: 3131313,
domainId: 3131313,
name: 'eclipsedevnet',
displayName: 'Eclipse Devnet',
nativeToken: {
"name": "Eclipse",
"symbol": "ECLIPSE",
"decimals": 9
},
rpcUrls: [{ http: 'https://staging-rpc.dev2.eclipsenetwork.xyz' }],
blockExplorers: [
// {
// name: 'Solana Explorer',
// url: 'https://explorer.solana.com',
// apiUrl: 'https://explorer.solana.com',
// family: ExplorerFamily.Other,
// },
],
blocks: {
confirmations: 1,
reorgPeriod: 0,
estimateBlockTime: 0.4,
},
isTestnet: true,
mailbox: 'AATtwuHptB6ruozdwc3XUFwGCuPfZL6jwPid955RoL6N',
},
proteustestnet: {
chainId: 88002,
domainId: 88002,
Expand Down
170 changes: 85 additions & 85 deletions src/consts/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,95 +1,95 @@
import { WarpTokenConfig } from '../features/tokens/types';

export const tokenList: WarpTokenConfig = [
// bsc
{
type: 'collateral',
chainId: 56,
address: '0x37a56cdcD83Dce2868f721De58cB3830C44C6303',
hypCollateralAddress: '0xC27980812E2E66491FD457D488509b7E04144b98',
name: 'Zebec',
symbol: 'ZBC',
decimals: 9,
logoURI: '/logos/zebec.png',
},
// // bsc
// {
// type: 'collateral',
// chainId: 56,
// address: '0x37a56cdcD83Dce2868f721De58cB3830C44C6303',
// hypCollateralAddress: '0xC27980812E2E66491FD457D488509b7E04144b98',
// name: 'Zebec',
// symbol: 'ZBC',
// decimals: 9,
// logoURI: '/logos/zebec.png',
// },

// nautilus
{
type: 'native',
chainId: 22222,
hypNativeAddress: '0x4501bBE6e731A4bC5c60C03A77435b2f6d5e9Fe7',
name: 'Zebec',
symbol: 'ZBC',
decimals: 18,
logoURI: '/logos/zebec.png',
},
// // nautilus
// {
// type: 'native',
// chainId: 22222,
// hypNativeAddress: '0x4501bBE6e731A4bC5c60C03A77435b2f6d5e9Fe7',
// name: 'Zebec',
// symbol: 'ZBC',
// decimals: 18,
// logoURI: '/logos/zebec.png',
// },

// solana
// solanadevnet to eclipse
{
type: 'collateral',
chainId: 1399811149,
address: 'wzbcJyhGhQDLTV1S99apZiiBdE4jmYfbw99saMMdP59',
hypCollateralAddress: 'EJqwFjvVJSAxH8Ur2PYuMfdvoJeutjmH6GkoEFQ4MdSa',
name: 'Zebec',
symbol: 'wZBC',
type: 'native',
chainId: 1399811151,
// address: 'wzbcJyhGhQDLTV1S99apZiiBdE4jmYfbw99saMMdP59',
hypNativeAddress: '62V5Sv2HeLZ4RqwxwYjaBQ7K9cqHbfert9pVtjfrxgYG',
name: 'Devnet SOL',
symbol: 'devSOL',
decimals: 9,
isSpl2022: false,
logoURI: '/logos/zebec.png',
// isSpl2022: false,
logoURI: '/logos/solana.svg',
},

{
chainId: 56,
name: 'Ethereum Token',
symbol: 'ETH',
decimals: 18,
type: 'collateral',
address: '0x2170ed0880ac9a755fd29b2688956bd959f933f8',
hypCollateralAddress: '0x2a6822dc5639b3fe70de6b65b9ff872e554162fa',
isNft: false,
logoURI: '/logos/weth.png',
},
{
chainId: 56,
name: 'USD Coin',
symbol: 'USDC',
decimals: 18,
type: 'collateral',
address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
hypCollateralAddress: '0x6937a62f93a56D2AE9392Fa1649b830ca37F3ea4',
isNft: false,
logoURI: '/logos/USDC.svg',
},
{
chainId: 56,
name: 'Tether USD',
symbol: 'USDT',
decimals: 18,
type: 'collateral',
address: '0x55d398326f99059ff775485246999027b3197955',
hypCollateralAddress: '0xb7d36720a16A1F9Cfc1f7910Ac49f03965401a36',
isNft: false,
logoURI: '/logos/tether.svg',
},
{
chainId: 56,
name: 'BTCB Token',
symbol: 'BTCB',
decimals: 18,
type: 'collateral',
address: '0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c',
hypCollateralAddress: '0xB3545006A532E8C23ebC4e33d5ab2232Cafc35Ad',
isNft: false,
logoURI: '/logos/bitcoin.svg',
},
{
chainId: 22222,
name: 'PoseiSwap Token',
symbol: 'POSE',
decimals: 18,
type: 'collateral',
address: '0xB883935B47B0508b479CEE642DB4b9E2de387920',
hypCollateralAddress: '0x79B1257BDBCaeF98Da685A7c225b6e61a119Cb7a',
isNft: false,
logoURI: '/logos/POSE.jpg',
},
// {
// chainId: 56,
// name: 'Ethereum Token',
// symbol: 'ETH',
// decimals: 18,
// type: 'collateral',
// address: '0x2170ed0880ac9a755fd29b2688956bd959f933f8',
// hypCollateralAddress: '0x2a6822dc5639b3fe70de6b65b9ff872e554162fa',
// isNft: false,
// logoURI: '/logos/weth.png',
// },
// {
// chainId: 56,
// name: 'USD Coin',
// symbol: 'USDC',
// decimals: 18,
// type: 'collateral',
// address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
// hypCollateralAddress: '0x6937a62f93a56D2AE9392Fa1649b830ca37F3ea4',
// isNft: false,
// logoURI: '/logos/USDC.svg',
// },
// {
// chainId: 56,
// name: 'Tether USD',
// symbol: 'USDT',
// decimals: 18,
// type: 'collateral',
// address: '0x55d398326f99059ff775485246999027b3197955',
// hypCollateralAddress: '0xb7d36720a16A1F9Cfc1f7910Ac49f03965401a36',
// isNft: false,
// logoURI: '/logos/tether.svg',
// },
// {
// chainId: 56,
// name: 'BTCB Token',
// symbol: 'BTCB',
// decimals: 18,
// type: 'collateral',
// address: '0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c',
// hypCollateralAddress: '0xB3545006A532E8C23ebC4e33d5ab2232Cafc35Ad',
// isNft: false,
// logoURI: '/logos/bitcoin.svg',
// },
// {
// chainId: 22222,
// name: 'PoseiSwap Token',
// symbol: 'POSE',
// decimals: 18,
// type: 'collateral',
// address: '0xB883935B47B0508b479CEE642DB4b9E2de387920',
// hypCollateralAddress: '0x79B1257BDBCaeF98Da685A7c225b6e61a119Cb7a',
// isNft: false,
// logoURI: '/logos/POSE.jpg',
// },
];
2 changes: 1 addition & 1 deletion src/features/caip/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function parseCaip2Id(id: ChainCaip2Id) {
const [_protocol, reference] = id.split(':');
const protocol = _protocol as ProtocolType;
if (!Object.values(ProtocolType).includes(protocol)) {
throw new Error(`Invalid chain protocol type: ${id}`);
// throw new Error(`Invalid chain protocol type: ${id}`);
}
if (!reference) {
throw new Error(`No reference found in caip2 id: ${id}`);
Expand Down
3 changes: 2 additions & 1 deletion src/features/transfer/TransferTokenForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ function validateFormValues(

if (!tokenCaip19Id) return { tokenCaip19Id: 'Token required' };
const { address: tokenAddress } = parseCaip19Id(tokenCaip19Id);
if (!isValidAddress(tokenAddress)) return { tokenCaip19Id: 'Invalid token' };
console.log('tokenAddress', tokenAddress, 'tokenCaip19Id', tokenCaip19Id);
// if (!isValidAddress(tokenAddress)) return { tokenCaip19Id: 'Invalid token' };

const destProtocol = getProtocolType(destinationCaip2Id);
if (!isValidAddress(recipientAddress, destProtocol))
Expand Down
3 changes: 3 additions & 0 deletions src/features/transfer/useTokenTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ async function executeTransfer({
// it's possible that the collateral contract balance is insufficient to
// cover the remote transfer. This ensures the balance is sufficient or throws.
async function ensureSufficientCollateral(route: Route, weiAmount: string, isNft?: boolean) {
// Ignore for now, having some issues w/ native
return;

if (!isRouteToCollateral(route) || isNft) return;
logger.debug('Ensuring collateral balance for route', route);
const adapter = AdapterFactory.HypTokenAdapterFromRouteDest(route);
Expand Down
5 changes: 2 additions & 3 deletions src/features/wallet/EvmWalletContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import '@rainbow-me/rainbowkit/styles.css';
import {
argentWallet,
coinbaseWallet,
injectedWallet,
ledgerWallet,
injectedWallet, // ledgerWallet,
metaMaskWallet,
omniWallet,
rainbowWallet,
Expand Down Expand Up @@ -35,7 +34,7 @@ const connectors = connectorsForWallets([
metaMaskWallet(connectorConfig),
injectedWallet(connectorConfig),
walletConnectWallet(connectorConfig),
ledgerWallet(connectorConfig),
// ledgerWallet(connectorConfig),
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/features/wallet/SolanaWalletContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { logger } from '../../utils/logger';

export function SolanaWalletContext({ children }: PropsWithChildren<unknown>) {
// TODO support multiple networks
const network = WalletAdapterNetwork.Mainnet;
const network = WalletAdapterNetwork.Devnet;
const endpoint = useMemo(() => clusterApiUrl(network), [network]);
const wallets = useMemo(
() => [
Expand Down
32 changes: 1 addition & 31 deletions src/images/logos/app-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 1 addition & 26 deletions src/images/logos/app-title.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ export default function Document() {
<meta name="msapplication-TileColor" content="#025aa1" />
<meta name="theme-color" content="#ffffff" />

<meta name="application-name" content="Nautilus Bridge" />
<meta name="keywords" content="Hyperlane Warp Route Nautilus Bridge" />
<meta name="description" content="Nautilus Bridge - Built with Hyperlane" />
<meta name="application-name" content="Eclipse Bridge" />
<meta name="keywords" content="Hyperlane Warp Route Eclipse Bridge" />
<meta name="description" content="Eclipse Bridge - Built with Hyperlane" />

<meta name="HandheldFriendly" content="true" />
<meta name="apple-mobile-web-app-title" content="Nautilus Bridge" />
<meta name="apple-mobile-web-app-title" content="Eclipse Bridge" />
<meta name="apple-mobile-web-app-capable" content="yes" />

<meta property="og:url" content="https://warp.hyperlane.xyz" />
<meta property="og:title" content="Nautilus Bridge" />
<meta property="og:title" content="Eclipse Bridge" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://warp.hyperlane.xyz/icon.png" />
<meta property="og:description" content="Nautilus Bridge - Built with Hyperlane" />
<meta property="og:description" content="Eclipse Bridge - Built with Hyperlane" />
</Head>
<body className="text-black">
<Main />
Expand Down