Skip to content

Commit

Permalink
Merge pull request #60 from BVM-priv/add-favicon-and-rename-l2
Browse files Browse the repository at this point in the history
Add favicon and rename bvm to hemi
  • Loading branch information
gndelia authored Feb 14, 2024
2 parents 1f89918 + 58b7b07 commit 6dc759b
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 43 deletions.
Binary file added marketing/app/favicon.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions marketing/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { locales } from 'app/i18n'
import type { Metadata } from 'next'
import { ReactNode } from 'react'

type Props = {
children: ReactNode
}

export const metadata: Metadata = {
title: 'Hemi',
}

export const generateStaticParams = async () =>
locales.map(locale => ({ locale }))

Expand Down
2 changes: 1 addition & 1 deletion marketing/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"home": {
"get-started": "Get Started",
"page-title": "Bitcoin's security.<br />Ethereum's agility.",
"subtitle": "All possibilities In Between and Beyond.<br />A better approach to Ethereum's Layer-2 with BVM Network.",
"subtitle": "All possibilities In Between and Beyond.<br />A better approach to Ethereum's Layer-2 with Hemi Network.",
"tunnel-and-swap": "Tunnel & Swap"
},
"network": {
Expand Down
2 changes: 1 addition & 1 deletion marketing/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"home": {
"get-started": "Comenzar",
"page-title": "La seguridad de Bitcoin.<br />La agilidad de Ethereum.",
"subtitle": "Todas las posibilidades dentro y más allá. Un mejor enfoque para la capa 2 de Ethereum con la red BVM.",
"subtitle": "Todas las posibilidades dentro y más allá. Un mejor enfoque para la capa 2 de Ethereum con la red Hemi.",
"tunnel-and-swap": "Túnel e Intercambio"
},
"network": {
Expand Down
6 changes: 3 additions & 3 deletions webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Integer representing the ID of the blockchain. E.g.: 11155222

#### NEXT_PUBLIC_CHAIN_NAME

The name of the blockchain. E.g.: BVM
The name of the blockchain. E.g.: Hemi

#### NEXT_PUBLIC_CHAIN_NETWORK

Expand All @@ -34,7 +34,7 @@ If the address is no a secure address (https), the application will not work.

#### NEXT_PUBLIC_CHAIN_EXPLORER_NAME

The name of the blockchain explorer. E.g.: BVM Explorer
The name of the blockchain explorer. E.g.: Hemi Explorer

#### NEXT_PUBLIC_CHAIN_EXPLORER_URL

Expand All @@ -43,7 +43,7 @@ If the address is no a secure address (https), the application will not work.

#### NEXT_PUBLIC_CHAIN_CURRENCY_NAME

The name of the currency of the blockchain. E.g.: BVM
The name of the currency of the blockchain. E.g.: HEMI

#### NEXT_PUBLIC_CHAIN_CURRENCY_SYMBOL

Expand Down
8 changes: 4 additions & 4 deletions webapp/app/[locale]/bridge/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { TokenSelector } from 'app/components/TokenSelector'
import { bvm, networks } from 'app/networks'
import { hemi, networks } from 'app/networks'
import dynamic from 'next/dynamic'
import { useTranslations } from 'next-intl'
import Skeleton from 'react-loading-skeleton'
Expand Down Expand Up @@ -100,7 +100,7 @@ const FormContent = function ({ bridgeState, isRunningOperation }: Props) {
networkId={fromNetworkId}
networks={networks.filter(chain => chain.id !== toNetworkId)}
onSelectNetwork={updateFromNetwork}
readonly={fromNetworkId === bvm.id}
readonly={fromNetworkId === hemi.id}
/>
</div>
<div className="flex justify-between rounded-xl bg-zinc-50 p-4 text-zinc-400">
Expand Down Expand Up @@ -169,7 +169,7 @@ const FormContent = function ({ bridgeState, isRunningOperation }: Props) {
networkId={toNetworkId}
networks={networks.filter(chain => chain.id !== fromNetworkId)}
onSelectNetwork={updateToNetwork}
readonly={toNetworkId === bvm.id}
readonly={toNetworkId === hemi.id}
/>
</div>
<div className="flex justify-between rounded-xl bg-zinc-50 p-4 text-zinc-400">
Expand Down Expand Up @@ -229,7 +229,7 @@ const FormContent = function ({ bridgeState, isRunningOperation }: Props) {
export default function Bridge() {
const bridgeState = useBridgeState()

const isDepositOperation = bridgeState.toNetworkId === bvm.id
const isDepositOperation = bridgeState.toNetworkId === hemi.id

const OperationComponent = isDepositOperation ? Deposit : Withdraw

Expand Down
6 changes: 3 additions & 3 deletions webapp/app/[locale]/bridge/useBridgeState.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bvm, bridgeableNetworks } from 'app/networks'
import { hemi, bridgeableNetworks } from 'app/networks'
import { useReducer } from 'react'
import { tokenList } from 'tokenList'
import { Token } from 'types/token'
Expand Down Expand Up @@ -154,8 +154,8 @@ export const useBridgeState = function (): BridgeState & {
fromInput: '0',
fromNetworkId: bridgeableNetworks[0].id,
fromToken: getNativeToken(bridgeableNetworks[0].id),
toNetworkId: bvm.id,
toToken: getNativeToken(bvm.id),
toNetworkId: hemi.id,
toToken: getNativeToken(hemi.id),
})

const updateFromInput = function (payload: UpdateFromInput['payload']) {
Expand Down
Binary file added webapp/app/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion webapp/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Props = {
}

export const metadata: Metadata = {
title: 'BVM',
title: 'Hemi',
}

export const generateStaticParams = async () =>
Expand Down
4 changes: 2 additions & 2 deletions webapp/app/networks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Chain } from 'wagmi'
import { mainnet, sepolia } from 'wagmi/chains'

export const bvm: Chain = {
export const hemi: Chain = {
blockExplorers: {
default: {
name: process.env.NEXT_PUBLIC_CHAIN_EXPLORER_NAME,
Expand Down Expand Up @@ -31,4 +31,4 @@ const testnetMode = process.env.NEXT_PUBLIC_TESTNET_MODE === 'true'

export const bridgeableNetworks = testnetMode ? [sepolia] : [mainnet]

export const networks = [bvm, ...bridgeableNetworks]
export const networks = [hemi, ...bridgeableNetworks]
10 changes: 6 additions & 4 deletions webapp/components/addNetworkToWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
'use client'

import { bvm } from 'app/networks'
import { hemi } from 'app/networks'
import { useTranslations } from 'next-intl'
import { useAccount, useSwitchNetwork, useNetwork } from 'wagmi'

export function AddNetworkToWallet() {
const { isConnected } = useAccount()
const { chain } = useNetwork()
const { switchNetwork } = useSwitchNetwork()
const t = useTranslations()

if (!isConnected || chain.id === bvm.id) {
if (!isConnected || chain.id === hemi.id) {
return null
}

Expand All @@ -18,9 +20,9 @@ export function AddNetworkToWallet() {
onClick={() => switchNetwork(parseInt(process.env.NEXT_PUBLIC_CHAIN_ID))}
type="button"
>
<div className="bg-bvm-gradient mr-2 h-8 w-8 rounded-full"></div>
<div className="bg-hemi-gradient mr-2 h-8 w-8 rounded-full"></div>
<p className="mr-auto text-base text-black">
Add BVM Network to your wallet
{t('common.add-hemi-to-wallet')}
</p>
<svg
fill="none"
Expand Down
2 changes: 1 addition & 1 deletion webapp/components/networkSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const NetworkSelector = function ({
}

// TODO update with image from network
const Logo = () => <div className="bg-bvm-gradient h-6 w-6 rounded-full" />
const Logo = () => <div className="bg-hemi-gradient h-6 w-6 rounded-full" />

const commonCss = 'flex items-center rounded-xl bg-zinc-50 p-2 gap-x-2'

Expand Down
2 changes: 1 addition & 1 deletion webapp/components/reviewBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const ReviewWithdraw = function ({
/>
<SubSection
symbol={gasSymbol}
text={tCommon('network-gas-fee', { network: 'BVM' })}
text={tCommon('network-gas-fee', { network: 'Hemi' })}
value={canWithdraw ? gas : '0'}
/>
<div className="absolute left-0 right-0 h-px border-t border-zinc-400"></div>
Expand Down
22 changes: 11 additions & 11 deletions webapp/hooks/useL2Bridge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type CrossChainMessenger as CrossChainMessengerType } from '@eth-optimism/sdk'
import { bvm } from 'app/networks'
import { hemi } from 'app/networks'
import {
type Provider,
useJsonRpcProvider,
Expand Down Expand Up @@ -79,7 +79,7 @@ const useCrossChainMessenger = function ({
},
l1ChainId,
l1SignerOrProvider: l1Signer,
l2ChainId: bvm.id,
l2ChainId: hemi.id,
l2SignerOrProvider: l2Signer,
})
},
Expand Down Expand Up @@ -154,7 +154,7 @@ const useDepositCrossChainMessenger = function (
operation: GasEstimationOperations,
) {
const l1Signer = useWeb3Provider(l1ChainId)
const l2Signer = useJsonRpcProvider(bvm.id)
const l2Signer = useJsonRpcProvider(hemi.id)

return useCrossChainMessenger({
l1ChainId,
Expand All @@ -170,14 +170,14 @@ const useWithdrawCrossChainMessenger = function (
operation: GasEstimationOperations,
) {
const l1Signer = useJsonRpcProvider(l1ChainId)
const l2Signer = useWeb3Provider(bvm.id)
const l2Signer = useWeb3Provider(hemi.id)

return useCrossChainMessenger({
l1ChainId,
l1Signer,
l2Signer,
operation,
walletConnectedToChain: bvm.id,
walletConnectedToChain: hemi.id,
})
}

Expand All @@ -197,7 +197,7 @@ export const useDepositErc20Token = function ({
useDepositCrossChainMessenger(l1ChainId, 'depositERC20')

const l1BridgeAddress = token.address
const l2BridgeAddress = token.extensions?.bridgeInfo[bvm.id].tokenAddress
const l2BridgeAddress = token.extensions?.bridgeInfo[hemi.id].tokenAddress

const depositErc20TokenGasFees = useEstimateGasFees({
amount: toDeposit,
Expand All @@ -224,7 +224,7 @@ export const useDepositErc20Token = function ({
},
mutationKey: [
l1ChainId,
bvm.id,
hemi.id,
crossChainMessengerStatus,
l1BridgeAddress,
l2BridgeAddress,
Expand Down Expand Up @@ -273,7 +273,7 @@ export const useDepositNativeToken = function ({
const response = await crossChainMessenger.depositETH(amount)
return response.hash
},
mutationKey: [l1ChainId, bvm.id, crossChainMessengerStatus, toDeposit],
mutationKey: [l1ChainId, hemi.id, crossChainMessengerStatus, toDeposit],
})

return {
Expand Down Expand Up @@ -304,7 +304,7 @@ export const useWithdrawNativeToken = function ({
crossChainMessengerStatus,
enabled,
operation: 'withdrawETH',
walletConnectedToChain: bvm.id,
walletConnectedToChain: hemi.id,
})

const {
Expand All @@ -316,7 +316,7 @@ export const useWithdrawNativeToken = function ({
const response = await crossChainMessenger.withdrawETH(toWithdraw)
return response.hash
},
mutationKey: [l1ChainId, bvm.id, crossChainMessengerStatus, amount],
mutationKey: [l1ChainId, hemi.id, crossChainMessengerStatus, amount],
})

return {
Expand Down Expand Up @@ -352,7 +352,7 @@ export const useWithdrawToken = function ({
crossChainMessengerStatus,
enabled,
operation: 'withdrawERC20',
walletConnectedToChain: bvm.id,
walletConnectedToChain: hemi.id,
})

const {
Expand Down
1 change: 1 addition & 0 deletions webapp/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
}
},
"common": {
"add-hemi-to-wallet": "Add Hemi Network to your wallet",
"connect-wallet": "Connect Wallet",
"erc20-extra-approval": "Approve 10x deposits",
"network-gas-fee": "{network} gas fee",
Expand Down
1 change: 1 addition & 0 deletions webapp/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
}
},
"common": {
"add-hemi-to-wallet": "Añadir la red Hemi a su billetera",
"connect-wallet": "Conectar Billetera",
"erc20-extra-approval": "Aprobar 10x este depósito",
"network-gas-fee": "Tarifa de gas de {network}",
Expand Down
2 changes: 1 addition & 1 deletion webapp/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config: Config = {
theme: {
extend: {
backgroundImage: {
'bvm-gradient':
'hemi-gradient':
'linear-gradient(143deg, #F16063 -3.27%, rgba(116, 96, 241, 0.00) 130.65%)',
},
fontFamily: {
Expand Down
20 changes: 10 additions & 10 deletions webapp/tokenList.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable sort-keys */
// example list for Token list - will probably need to be loaded from somewhere

import { bvm } from 'app/networks'
import { hemi } from 'app/networks'
import { Token } from 'types/token'
import { sepolia } from 'wagmi/chains'

Expand All @@ -13,7 +13,7 @@ const tokens: Token[] = [
decimals: 18,
extensions: {
bridgeInfo: {
[bvm.id]: {
[hemi.id]: {
tokenAddress: '0x97942656B0EfC2555155cEA70Cb3C716C33EcF70',
},
},
Expand All @@ -29,7 +29,7 @@ const tokens: Token[] = [
decimals: 6,
extensions: {
bridgeInfo: {
[bvm.id]: {
[hemi.id]: {
tokenAddress: '0x221f3Ea46017307daCaf669F38529223B08f3178',
},
},
Expand All @@ -41,7 +41,7 @@ const tokens: Token[] = [
},
{
address: '0x97942656B0EfC2555155cEA70Cb3C716C33EcF70',
chainId: bvm.id,
chainId: hemi.id,
decimals: 18,
extensions: {
bridgeInfo: {
Expand All @@ -57,7 +57,7 @@ const tokens: Token[] = [
},
{
address: '0x221f3Ea46017307daCaf669F38529223B08f3178',
chainId: bvm.id,
chainId: hemi.id,
decimals: 6,
extensions: {
bridgeInfo: {
Expand Down Expand Up @@ -93,14 +93,14 @@ const nativeTokens: Token[] = [
symbol: sepolia.nativeCurrency.symbol,
},
{
address: 'BVM',
chainId: bvm.id,
decimals: bvm.nativeCurrency.decimals,
address: 'HEMI',
chainId: hemi.id,
decimals: hemi.nativeCurrency.decimals,
// using random logo for now
logoURI:
'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png',
name: bvm.nativeCurrency.name,
symbol: bvm.nativeCurrency.symbol,
name: hemi.nativeCurrency.name,
symbol: hemi.nativeCurrency.symbol,
},
]

Expand Down

0 comments on commit 6dc759b

Please sign in to comment.