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: simplify the omnichain template #134

Closed
wants to merge 7 commits into from
Closed

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented May 15, 2024

Before:

// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
 
import "@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol";
import "@zetachain/protocol-contracts/contracts/zevm/interfaces/zContract.sol";
import "@zetachain/toolkit/contracts/OnlySystem.sol";
 
contract MyContract is zContract, OnlySystem {
    SystemContract public systemContract;
 
    constructor(address systemContractAddress) {
        systemContract = SystemContract(systemContractAddress);
    }
 
    function onCrossChainCall(
        zContext calldata context,
        address zrc20,
        uint256 amount,
        bytes calldata message
    ) external virtual override onlySystem(systemContract) {
        // TODO: implement the logic
    }
}

After:

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

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

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

    function onCrossChainCall(
        zContext calldata context,
        address zrc20,
        uint256 amount,
        bytes calldata message
    ) external override onlySystem {
        // TODO: implement the logic
    }
}

@fadeev fadeev requested a review from andresaiello May 21, 2024 10:00
@fadeev fadeev marked this pull request as draft July 4, 2024 06:38
@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.

2 participants