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

Possibly missed outgoing transaction #3389

Open
fadeev opened this issue Jan 22, 2025 · 5 comments
Open

Possibly missed outgoing transaction #3389

fadeev opened this issue Jan 22, 2025 · 5 comments
Labels
bug Something isn't working priority:1

Comments

@fadeev
Copy link
Member

fadeev commented Jan 22, 2025

In this transaction, I'm trying to call withdrawAndCall to send USDC.POL to a contract on Polygon and trigger the onReceive function. The transaction on ZetaChain was successful and the WithdrawnAndCalled event was triggered, but the contract on Polygon was not called.

https://zetachain.blockscout.com/tx/0xbc083fa261b987866369defcf2763723f29a46e491eddf4fdb9dff7cae2a7168?tab=logs

Image

This Gateway call was not made inside onRevert.

@lumtis lumtis added the bug Something isn't working label Jan 22, 2025
@lumtis
Copy link
Member

lumtis commented Jan 22, 2025

Do they have the CCTX index of the original cctx or the tx hash that initiated the first deposit?

withdrawAndCall calls onCall on the connected chain, not onReceive

@zeta-chain zeta-chain deleted a comment Jan 22, 2025
@kyexHead
Copy link

kyexHead commented Jan 23, 2025

  1. This is my first transaction on BSC.https://bscscan.com/tx/0x90412c83344eea64ee93432fc7e9082ca7e91ed8292818a34815d8be20329842

  2. For what you mentioned about withdrawAndCall calls onCall on the connected chain, i have tested withdrawAndCall calls onReceive on zetaTest and bscTest, and the tests passed. Below are the transaction details:
    https://zetachaintestnet.blockscout.com/tx/0x47a39a1d30cbeb38b5d2bb863e4430cded50904c6cc648abcf725bb771a8cd8d

https://testnet.bscscan.com/tx/0xb5a6c46a47dc05b3e6e6de1f1cccbf1bac2944c68c107ab2a0f5319b8874d3e4

The partial source code of the universal Contract on zetachain is as follows:

if (swapDetail.targetChainPoolNum > 0) {
            IGatewayZEVM(gateWay).withdrawAndCall(
                swapDetail.omnichainSwapContract,
                amountOut,
                tokenOutOfZetaChain,
                abi.encodeWithSignature(
                    "onReceive(bytes,bytes,uint256,uint256)",
                    swapDetail.targetChainSwapPath,
                    swapDetail.recipient,
                    amountOut,
                    swapDetail.minAmountOut
                ),
                CallOptions(
                    150000 + swapDetail.targetChainPoolNum * 110000,
                    false
                ),
                RevertOptions(
                    address(this),
                    true,
                    address(this),
                    abi.encode(swapDetail.sender, tokenInOfZetaChain),
                    0
                )
            );
        } 

The partial source code of the contract on BSC is as follows:

    function onReceive(
        bytes calldata targetChainSwapPath,
        bytes calldata recipient,
        uint256 amountIn,
        uint256 minAmountOut
    ) external payable whenNotPaused nonReentrant {
        (, address tokenIn, address tokenOut) = decodeSwapPath(
            targetChainSwapPath
        );
}

@zeta-chain zeta-chain deleted a comment Jan 23, 2025
@lumtis
Copy link
Member

lumtis commented Jan 23, 2025

Thanks for sharing. We'll look at it.

@lumtis
Copy link
Member

lumtis commented Jan 24, 2025

The CCTX exists: https://zetachain.blockpi.network/lcd/v1/public/zeta-chain/crosschain/cctx/0x088ab33e1b7cf41cc34a7de92bc875b7fb26f8ead6cefff730927ccbe939bda1

This is the tx on Polygon: https://polygonscan.com/tx/0xa49cb2a969b5a65e5ed0c7044eb460dc483a4d2cde986bc257c275cb889e7f87

The crosschain call reverted, then the revert transaction reverted as well. We're currently working on improving the info in the CCTX, but yeah it looks the call on Polygon fails.

@kyexHead
Copy link

Thanks for your support, I will investigate the reason for the failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:1
Projects
None yet
Development

No branches or pull requests

4 participants
@fadeev @lumtis @kyexHead and others