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

fix publicent error #187

Merged
merged 2 commits into from
Apr 24, 2024
Merged
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
2 changes: 1 addition & 1 deletion composables/transaction/useMergeToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type SourceTokenInfo = {
};
const NOVA_CHAIN_ID = nodeType === "nexus" ? 810180 : 810181;
const MERGE_TOKEN_PORTAL_ADDRESSES =
nodeType === "nexus" ? "0x83FD59FD58C6A5E6eA449e5400D02803875e1104" : "0x83FD59FD58C6A5E6eA449e5400D02803875e1104";
nodeType === "nexus" ? "0x83FD59FD58C6A5E6eA449e5400D02803875e1104" : "0x400993142059ddF34636c58Bb066aAD2d21ec273";
export default (tokenL2Address: Ref<string | undefined>) => {
const onboardStore = useOnboardStore();
const {
Expand Down
3 changes: 2 additions & 1 deletion composables/zksync/useTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useOnboardStore } from "@/store/onboard";
import { useZkSyncWalletStore } from "@/store/zksync/wallet";
import { formatError } from "@/utils/formatters";
import { sleep } from "@/utils/helpers";
import { NOVA_CHAIN_ID } from "@/utils/constants";

type TransactionParams = {
type: "transfer" | "withdrawal";
Expand All @@ -33,7 +34,7 @@ export default (getSigner: () => Promise<Signer | undefined>, getProvider: () =>
const transactionHash = ref<string | undefined>();
const eraWalletStore = useZkSyncWalletStore();
const onboardStore = useOnboardStore();
const publicClient = onboardStore.getPublicClient(onboardStore.network.chainId);
const publicClient = onboardStore.getPublicClient(NOVA_CHAIN_ID);

const retrieveBridgeAddresses = useMemoize(() => getProvider().getDefaultBridgeAddresses());
const { validateAddress } = useScreening();
Expand Down
66 changes: 39 additions & 27 deletions utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WITHDRAWAL_DELAY } from './../store/zksync/transactionStatus';
import { WITHDRAWAL_DELAY } from "./../store/zksync/transactionStatus";
import type { Token } from "@/types";

export const ETH_TOKEN: Token = {
Expand All @@ -10,34 +10,46 @@ export const ETH_TOKEN: Token = {
iconUrl: "/img/eth.svg",
};

export const NOVA_CHAIN_ID = process.env.NODE_TYPE === "nexus" ? 810180 : 810181;

export const WITHDRAWAL_DELAY_DAYS = 14;

export const MERGE_TOKENS = [
{
symbol: "USDT",
address: "0x2F8A25ac62179B31D62D7F80884AE57464699059",
targetNetworkKeys: ["ethereum", "arbitrum", "zksync", "primary", "manta", "mantle", "optimism"],
decimals: 6,
},
{
symbol: "WBTC",
address: "0xDa4AaEd3A53962c83B35697Cd138cc6df43aF71f",
targetNetworkKeys: ["ethereum", "arbitrum", "zksync", "primary", "manta", "mantle", "optimism"],
decimals: 18,
},
{
symbol: "USDC",
address: "0x1a1A3b2ff016332e866787B311fcB63928464509",
targetNetworkKeys: ["ethereum", "arbitrum", "zksync", "primary", "manta", "mantle", "optimism", "base"],
decimals: 6,
},
{
symbol: "DAI",
address: "0xF573fA04A73d5AC442F3DEa8741317fEaA3cDeab",
targetNetworkKeys: ["ethereum", "arbitrum", "zksync", "primary", "optimism", "base"],
decimals: 18,
},
];
export const MERGE_TOKENS =
process.env.NODE_TYPE === "nexus"
? [
{
symbol: "USDT",
address: "0x2F8A25ac62179B31D62D7F80884AE57464699059",
targetNetworkKeys: ["ethereum", "arbitrum", "zksync", "primary", "manta", "mantle", "optimism"],
decimals: 6,
},
{
symbol: "WBTC",
address: "0xDa4AaEd3A53962c83B35697Cd138cc6df43aF71f",
targetNetworkKeys: ["ethereum", "arbitrum", "zksync", "primary", "manta", "mantle", "optimism"],
decimals: 18,
},
{
symbol: "USDC",
address: "0x1a1A3b2ff016332e866787B311fcB63928464509",
targetNetworkKeys: ["ethereum", "arbitrum", "zksync", "primary", "manta", "mantle", "optimism", "base"],
decimals: 6,
},
{
symbol: "DAI",
address: "0xF573fA04A73d5AC442F3DEa8741317fEaA3cDeab",
targetNetworkKeys: ["ethereum", "arbitrum", "zksync", "primary", "optimism", "base"],
decimals: 18,
},
]
: [
{
symbol: "USDT",
address: "0x9b80873119412f965428B18B362A583f3e96A5B3",
targetNetworkKeys: ["arbitrum", "base"],
decimals: 6,
},
];

export const isMergeToken = (address: string) => {
return address ? MERGE_TOKENS.some((token) => token.address.toLowerCase() === address.toLowerCase()) : false;
Expand Down
Loading