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

feat: ZetaChain.omniChainSwap() function #135

Closed
wants to merge 2 commits into from
Closed

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented May 15, 2024

Makes it possible to fit an omnichain swap contract in a tweet:

// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

import "@zetachain/toolkit/contracts/ZetaChain.sol";

contract Swap is ZetaChain {
    constructor() ZetaChain() {}

    function onCrossChainCall(
        zContext calldata context,
        address zrc20,
        uint256 amount,
        bytes calldata message
    ) external override onlySystem {
        ZetaChain.omniChainSwap(context, zrc20, amount, message);
    }
}

Depends on #134

@fadeev fadeev changed the title feat: ZetaChain.omniChainSwap function feat: ZetaChain.omniChainSwap() function May 15, 2024
@fadeev fadeev closed this Aug 8, 2024
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 this pull request may close these issues.

1 participant