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

op sdk - Unable to get withdrawal status #557

Open
TheArhaam opened this issue Oct 30, 2024 · 0 comments · May be fixed by #571
Open

op sdk - Unable to get withdrawal status #557

TheArhaam opened this issue Oct 30, 2024 · 0 comments · May be fixed by #571

Comments

@TheArhaam
Copy link

Bug Description

Using @eth-optimism/sdk to bridge ETH between Sepolia & Base Sepolia, deposit & withdrawal initiation has gone through successfully and I've been able to fetch the transaction history (deposits and withrawals) so I'm pretty sure the messenger config has been done correctly.

Here's a snippet of messenger

    const messenger = useMemo(() => {
        if (!signer || !address) return;

        const l1 = import.meta.env.VITE_APP_MODE == "production" ? mainnet : sepolia;
        const l2 = import.meta.env.VITE_APP_MODE == "production" ? base : baseSepolia;
        const l1Provider = new ethers.providers.JsonRpcProvider(
             l1.rpcUrls.default.http[0], // Using custom RPC instead of default for testing
        ).getSigner(address);
        const l2Provider = new ethers.providers.JsonRpcProvider(
            l2.rpcUrls.default.http[0], // Using custom RPC instead of default for testing
        ).getSigner(address);

        return new OP.CrossChainMessenger({
            l1ChainId: l1.id,
            l2ChainId: l2.id,
            l1SignerOrProvider: chainId == l1.id ? signer : l1Provider,
            l2SignerOrProvider: chainId == l2.id ? signer : l2Provider,
        });
    }, [address, signer, chainId]);

Here's a snippet of the status query (which works for deposits):

    const statusQuery = useQuery({
        queryKey: ['status', transactionHash],
        queryFn: async () => await messenger?.getMessageStatus(transactionHash),
        placeholderData: keepPreviousData,
        refetchOnWindowFocus: false,
        enabled: !!address && !!messenger,
        retry: false,
        select: (data) => {
            return formatMessageStatus[data as MessageStatus]
        },
    });

Here's the error:

 Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="respectedGameType()", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)

Here's the network log:

{"method":"eth_call","params":[{"from":"0xd0c4083b5fefc6f4e2ee4a1b37e9f75e6477b6b6","to":"0x0000000000000000000000000000000000000000","data":"0x3c9f397c"},"latest"],"id":87,"jsonrpc":"2.0"}
{"jsonrpc":"2.0","id":87,"result":"0x"}

Steps to Reproduce

Code snippets have been provided above, running it in a React Vite App

Expected behavior

Expect to receive the status of the withdrawal of type MessageStatus

Environment Information:

Relevant dependencies:

    "@eth-optimism/sdk": "^3.3.2",
    "@reown/appkit": "^1.0.4",
    "@reown/appkit-adapter-wagmi": "^1.0.4",
    "@tanstack/react-query": "^5.56.2",
    "ethers": "5.7.2",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "viem": "^2.21.35",
    "wagmi": "^2.12.25"
@TheArhaam TheArhaam linked a pull request Nov 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant