Skip to content

Commit

Permalink
remove stylus
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc committed Jul 10, 2024
1 parent dca358b commit 8707c00
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,6 @@ export type TransferPanelSummaryProps = {
token: ERC20BridgeToken | null
}

function StylusNetworkWarning() {
const [{ sourceChain, destinationChain }] = useNetworks()
const { isStylusTestnetV2: isSourceChainStylusTestnet } = isNetwork(
sourceChain.id
)
const { isStylusTestnetV2: isDestinationChainStylusTestnet } = isNetwork(
destinationChain.id
)

if (!isSourceChainStylusTestnet && !isDestinationChainStylusTestnet) {
return null
}

return (
<NoteBox variant="warning">
Stylus is now live on Arbitrum Sepolia. The Stylus v1 and v2 testnets will
be deprecated shortly. Please withdraw all testnet assets and resume
testing on Arbitrum Sepolia.
</NoteBox>
)
}

function StyledLoader() {
return (
<span className="flex">
Expand Down Expand Up @@ -272,7 +250,6 @@ export function TransferPanelSummary({ token }: TransferPanelSummaryProps) {
)}
</span>
</div>
<StylusNetworkWarning />
</TransferPanelSummaryContainer>
)
}
2 changes: 0 additions & 2 deletions packages/arb-token-bridge-ui/src/hooks/useNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
holesky,
arbitrumNova,
arbitrumSepolia,
stylusTestnetV2,
localL1Network as local,
localL2Network as arbitrumLocal
} from '../util/wagmi/wagmiAdditionalNetworks'
Expand Down Expand Up @@ -38,7 +37,6 @@ export function isSupportedChainId(
arbitrum.id,
arbitrumNova.id,
arbitrumSepolia.id,
stylusTestnetV2.id,
arbitrumLocal.id,
local.id,
...getOrbitChains().map(chain => chain.chainID),
Expand Down
8 changes: 0 additions & 8 deletions packages/arb-token-bridge-ui/src/types/ChainQueryParam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const chainQueryParams = [
'arbitrum-one',
'arbitrum-nova',
'arbitrum-sepolia',
'stylus-testnet',
'stylus-testnet-v2',
'custom-localhost',
'arbitrum-localhost'
] as const
Expand Down Expand Up @@ -51,9 +49,6 @@ export function getChainQueryParamForChain(chainId: ChainId): ChainQueryParam {
case ChainId.ArbitrumNova:
return 'arbitrum-nova'

case ChainId.StylusTestnetV2:
return 'stylus-testnet-v2'

case ChainId.Sepolia:
return 'sepolia'

Expand Down Expand Up @@ -104,9 +99,6 @@ export function getChainForChainKeyQueryParam(
case 'arbitrum-sepolia':
return customChains.arbitrumSepolia

case 'stylus-testnet-v2':
return customChains.stylusTestnetV2

case 'custom-localhost':
return customChains.localL1Network

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const teleportEnabledTokens: {
{
symbol: 'WETH',
l1Address: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14',
allowedL3ChainIds: [ChainId.StylusTestnetV2]
allowedL3ChainIds: []
},
{
symbol: 'LINK',
l1Address: '0x779877A7B0D9E8603169DdbD7836e478b4624789',
allowedL3ChainIds: [ChainId.StylusTestnetV2]
allowedL3ChainIds: []
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,6 @@ describe('getBaseChainIdByChainId', () => {
chainId: xaiTestnetChainId
})
).toBe(ChainId.Sepolia)

expect(
getBaseChainIdByChainId({
chainId: ChainId.StylusTestnetV2
})
).toBe(ChainId.Sepolia)
})
})

Expand Down
10 changes: 0 additions & 10 deletions packages/arb-token-bridge-ui/src/util/bridgeUiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,6 @@ export function getBridgeUiConfigForChain(chainId: number): BridgeUiConfig {
'AnyTrust protocol. Low fees for high-volume transactions. Secured by a trust-minimized Data Availability Committee (DAC).'
}
}
case ChainId.StylusTestnetV2:
return {
color: '#E3066E',
network: {
name: 'Stylus Testnet v2',
logo: '/images/StylusLogo.svg',
description:
'An experimental playground for Arbitrum Stylus smart contracts.'
}
}
default: {
// added Orbit chains
const orbitChain = orbitChains[chainId]
Expand Down
18 changes: 4 additions & 14 deletions packages/arb-token-bridge-ui/src/util/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ export enum ChainId {
ArbitrumNova = 42170,
// L2 Testnets
ArbitrumSepolia = 421614,
ArbitrumLocal = 412346,
// Orbit
StylusTestnetV2 = 13331371
ArbitrumLocal = 412346
}

export const supportedCustomOrbitParentChains = [
Expand Down Expand Up @@ -174,9 +172,7 @@ export const rpcURLs: { [chainId: number]: string } = {
[ChainId.ArbitrumSepolia]: loadEnvironmentVariableWithFallback({
env: chainIdToInfuraUrl(ChainId.ArbitrumSepolia),
fallback: 'https://sepolia-rollup.arbitrum.io/rpc'
}),
// Orbit Testnets
[ChainId.StylusTestnetV2]: 'https://stylusv2.arbitrum.io/rpc'
})
}

export const explorerUrls: { [chainId: number]: string } = {
Expand All @@ -189,9 +185,7 @@ export const explorerUrls: { [chainId: number]: string } = {
[ChainId.ArbitrumNova]: 'https://nova.arbiscan.io',
[ChainId.ArbitrumOne]: 'https://arbiscan.io',
// L2 Testnets
[ChainId.ArbitrumSepolia]: 'https://sepolia.arbiscan.io',
// Orbit Testnets
[ChainId.StylusTestnetV2]: 'https://stylusv2-explorer.arbitrum.io'
[ChainId.ArbitrumSepolia]: 'https://sepolia.arbiscan.io'
}

export const getExplorerUrl = (chainId: ChainId) => {
Expand Down Expand Up @@ -340,8 +334,6 @@ export function isNetwork(chainId: ChainId) {
const isArbitrumSepolia = chainId === ChainId.ArbitrumSepolia
const isArbitrumLocal = chainId === ChainId.ArbitrumLocal

const isStylusTestnetV2 = chainId === ChainId.StylusTestnetV2

const isEthereumMainnetOrTestnet =
isEthereumMainnet || isSepolia || isHolesky || isLocal

Expand All @@ -361,7 +353,6 @@ export function isNetwork(chainId: ChainId) {
isHolesky ||
isArbitrumSepolia ||
isCustomOrbitChain ||
isStylusTestnetV2 ||
isTestnetOrbitChain

const isSupported =
Expand Down Expand Up @@ -390,7 +381,6 @@ export function isNetwork(chainId: ChainId) {
// Orbit chains
isOrbitChain,
isTestnet,
isStylusTestnetV2,
// General
isSupported,
// Core Chain is a chain category for the UI
Expand Down Expand Up @@ -445,7 +435,7 @@ function isArbitrumChain(chain: L1Network | L2Network): chain is L2Network {

export const TELEPORT_ALLOWLIST: { [id: number]: number[] } = {
[ChainId.Ethereum]: [1380012617, 70700], // Rari and PopApex
[ChainId.Sepolia]: [ChainId.StylusTestnetV2]
[ChainId.Sepolia]: []
}

export function getChildChainIds(chain: L2Network | L1Network) {
Expand Down
5 changes: 3 additions & 2 deletions packages/arb-token-bridge-ui/src/util/orbitChainsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,9 @@ export function getOrbitChains(

export function getInboxAddressFromOrbitChainId(chainId: number) {
return (
l2Networks[chainId]?.ethBridge.inbox ?? // for stylus testnet v2
getOrbitChains().find(chain => chain.chainID === chainId)?.ethBridge.inbox // for other custom orbit chains
getOrbitChains()
//
.find(chain => chain.chainID === chainId)?.ethBridge.inbox
)
}

Expand Down
5 changes: 0 additions & 5 deletions packages/arb-token-bridge-ui/src/util/wagmi/getWagmiChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
holesky,
arbitrumNova,
arbitrumSepolia,
stylusTestnetV2,
localL1Network,
localL2Network
} from './wagmiAdditionalNetworks'
Expand All @@ -17,7 +16,6 @@ import { orbitChains } from '../orbitChainsList'

export function getWagmiChain(chainId: number): Chain {
const customChain = getCustomChainFromLocalStorageById(chainId)
// excluding Stylus because its part of the SDK
const orbitChain = orbitChains[chainId]

if (customChain) {
Expand Down Expand Up @@ -48,9 +46,6 @@ export function getWagmiChain(chainId: number): Chain {
case ChainId.ArbitrumSepolia:
return arbitrumSepolia

case ChainId.StylusTestnetV2:
return stylusTestnetV2

// Local networks
case ChainId.Local:
return localL1Network
Expand Down
3 changes: 0 additions & 3 deletions packages/arb-token-bridge-ui/src/util/wagmi/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
sepolia,
arbitrumNova,
arbitrumSepolia,
stylusTestnetV2,
localL1Network as local,
localL2Network as arbitrumLocal,
holesky
Expand Down Expand Up @@ -37,7 +36,6 @@ const chainList = isTestingEnvironment
arbitrumSepolia,
holesky,
// Orbit chains
stylusTestnetV2,
...wagmiOrbitChains,
// add local environments during testing
local,
Expand All @@ -52,7 +50,6 @@ const chainList = isTestingEnvironment
sepolia,
arbitrumSepolia,
holesky,
stylusTestnetV2,
...wagmiOrbitChains,
...customChains
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,6 @@ export const arbitrumNova: Chain = {
}
}

export const stylusTestnetV2: Chain = {
id: ChainId.StylusTestnetV2,
name: 'Stylus Testnet v2',
network: 'stylus-testnet-v2',
nativeCurrency: ether,
rpcUrls: {
default: {
http: [rpcURLs[ChainId.StylusTestnetV2]!]
},
public: {
http: [rpcURLs[ChainId.StylusTestnetV2]!]
}
},
blockExplorers: {
default: {
name: 'Blockscout',
url: 'https://stylusv2-explorer.arbitrum.io'
}
}
}

/**
* For e2e testing
*/
Expand Down

0 comments on commit 8707c00

Please sign in to comment.