Skip to content

Commit

Permalink
change arbitrum stylus v2 testnet to arbitrum sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
kairoski03 committed Jun 18, 2024
1 parent 5e82efe commit 730b222
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/components/arbitrum/Compiler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ export const Compiler: React.FunctionComponent<InterfaceProps> = ({
const socket = io(ARBITRUM_COMPILER_CONSUMER_ENDPOINT, {
reconnection: false,
transports: ['websocket'],
timeout: 120_000,
});

try {
Expand Down
4 changes: 2 additions & 2 deletions src/components/arbitrum/Connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Client } from '@remixproject/plugin';
import { Api } from '@remixproject/plugin-utils';
import { IRemixApi } from '@remixproject/plugin-api';
import { Connect as CommonConnect } from '../common/Connect';
import { STYLUS_TESTNET_V2_CHAIN_ID } from './const';
import { ARBITRUM_SEPOLIA_CHAIN } from './const';

interface InterfaceProps {
client: Client<Api, Readonly<IRemixApi>>;
Expand Down Expand Up @@ -39,7 +39,7 @@ export const Connect: React.FunctionComponent<InterfaceProps> = ({ client }) =>
setInjectedProvider={setInjectedProvider}
setProviderNetwork={setProviderNetwork}
/>
{providerNetwork === STYLUS_TESTNET_V2_CHAIN_ID ? (
{providerNetwork === ARBITRUM_SEPOLIA_CHAIN.chainId ? (
<Project
account={account}
injectedProvider={injectedProvider}
Expand Down
17 changes: 10 additions & 7 deletions src/components/arbitrum/MetamaskConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import AlertCloseButton from '../common/AlertCloseButton';
import { log } from '../../utils/logger';
import { NetworkUI } from '../common/Network';
import Web3 from 'web3';
import { STYLUS_TESTNET_V2_CHAIN_ID } from './const';
import { ARBITRUM_SEPOLIA_CHAIN } from './const';

const web3 = new Web3((window as any).ethereum);

Expand Down Expand Up @@ -35,7 +35,10 @@ export const MetamaskConnect: React.FunctionComponent<InterfaceProps> = ({
const [network, setNetwork] = useState<string>('');

const ethereum = (window as any).ethereum;

let networkName = '';
if (network === ARBITRUM_SEPOLIA_CHAIN.chainId) {
networkName = ARBITRUM_SEPOLIA_CHAIN.chainName;
}
// Establish a connection to the Aptos blockchain on component mount
useEffect(() => {
const connect = async () => {
Expand Down Expand Up @@ -94,20 +97,20 @@ export const MetamaskConnect: React.FunctionComponent<InterfaceProps> = ({
<AlertCloseButton onClick={() => setError('')} />
<div>{error}</div>
</Alert>
{network === STYLUS_TESTNET_V2_CHAIN_ID ? (
<NetworkUI networkName={'Stylus testnet (v2)'} />
{network === ARBITRUM_SEPOLIA_CHAIN.chainId ? (
<NetworkUI networkName={networkName} />
) : (
<small style={{ color: 'red', fontWeight: 'bold' }}>
Only Stylus Testnet V2 network is supported currently.
${ARBITRUM_SEPOLIA_CHAIN.chainName} network is supported currently.
<br />
Please switch to the network below and reconnect your wallet.
<br />
Chain ID: 13331371
Chain ID: 421614
<br />
RPC URL: https://stylusv2.arbitrum.io/rpc
</small>
)}
{network === STYLUS_TESTNET_V2_CHAIN_ID ? (
{network === ARBITRUM_SEPOLIA_CHAIN.chainId ? (
<Form>
<Form.Group>
<Form.Text className="text-muted" style={mb4}>
Expand Down
10 changes: 9 additions & 1 deletion src/components/arbitrum/const.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
export const STYLUS_TESTNET_V2_CHAIN_ID = '0xcb6bab';
export const STYLUS_TESTNET_V2_CHAIN = {
chainId: '0xcb6bab',
chainName: 'Stylus testnet (v2)',
};

export const ARBITRUM_SEPOLIA_CHAIN = {
chainId: '0x66eee',
chainName: 'Arbitrum Sepolia (Testnet)',
};

0 comments on commit 730b222

Please sign in to comment.