Skip to content

Commit

Permalink
fix(l2): add token in the wrap/unwrap success modal
Browse files Browse the repository at this point in the history
  • Loading branch information
solidovic authored Dec 10, 2024
1 parent 08b5733 commit 531074f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions modules/web3/web3-provider/dapp-chain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import React, {
useEffect,
} from 'react';
import invariant from 'tiny-invariant';
import { LidoSDKProvider } from './lido-sdk';
import { LidoSDKL2Provider } from './lido-sdk-l2';

import { CHAINS, isSDKSupportedL2Chain } from 'consts/chains';
import { useAccount } from 'wagmi';
import { config } from 'config';
import { ModalProvider } from 'providers/modal-provider';

import { wagmiChainMap } from './web3-provider';
import { LidoSDKProvider } from './lido-sdk';
import { LidoSDKL2Provider } from './lido-sdk-l2';

export enum DAPP_CHAIN_TYPE {
Ethereum = 'Ethereum',
Expand Down Expand Up @@ -168,7 +170,10 @@ export const SupportL2Chains: React.FC<React.PropsWithChildren> = ({
[chainType, walletChainId],
)}
>
<LidoSDKL2Provider>{children}</LidoSDKL2Provider>
<LidoSDKL2Provider>
{/* Some modals depend on the LidoSDKL2Provider */}
<ModalProvider>{children}</ModalProvider>
</LidoSDKL2Provider>
</DappChainContext.Provider>
);
};
Expand Down
6 changes: 3 additions & 3 deletions shared/hooks/use-token-address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const fetchTokenAddress = async (
): Promise<Address> => {
if (isL2) {
const address =
LIDO_L2_CONTRACT_ADDRESSES[core.chainId as CHAINS]?.[
token as LIDO_L2_CONTRACT_NAMES
LIDO_L2_CONTRACT_ADDRESSES[chainId]?.[
token.toLowerCase() as LIDO_L2_CONTRACT_NAMES
];
invariant(address, `Do not have address for ${token} on ${core.chainId}`);
invariant(address, `Do not have address for ${token} on ${chainId}`);
return address;
} else {
const address = await core.getContractAddress(
Expand Down

0 comments on commit 531074f

Please sign in to comment.