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

Warp Precompile Solidity interface + Example Solidity contract to send and receive a message from Subnet A to Subnet B #443

Closed
2 of 3 tasks
aaronbuchwald opened this issue Jan 19, 2023 · 2 comments
Assignees

Comments

@aaronbuchwald
Copy link
Collaborator

aaronbuchwald commented Jan 19, 2023

  • Add the Solidity interface for the precompile including the events created by the precompile
  • Add an Example Solidity contract that uses the interface to send and receive a message
  • Create a mock of the precompile to set up a Foundry or HardHat test of the Example Solidity contract (the example contract should treat the mock as coming from the precompile address)
@minghinmatthewlam
Copy link

Warp precompile interface will be defined out in #447

@michaelkaplan13
Copy link
Contributor

The working precompile interface is:

// (c) 2022-2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.16;

struct CrossChainMessage {
    bytes32 originChainId;
    bytes32 originSenderAddress;
    bytes32 destinationChainId;
    bytes32 destinationAddress;
    bytes payload;
}

interface WarpMessenger {
    event SendCrossSubnetMessage(
        bytes32 indexed destinationChainId,
        bytes32 indexed destinationAddress,
        bytes32 indexed sender,
        bytes message
    );

    function sendCrossSubnetMessage(
        bytes32 destinationChainId,
        bytes32 destinationAddress,
        bytes calldata payload
    ) external;

    function verifySubnetMessage(uint256 messageIndex)
        external
        returns (CrossChainMessage calldata message, bool success);

    function getBlockchainId() external view returns (bytes32);
}

@aaronbuchwald aaronbuchwald added this to EVM May 1, 2023
@aaronbuchwald aaronbuchwald moved this to Backlog 🗄 in EVM May 1, 2023
@aaronbuchwald aaronbuchwald moved this from Backlog 🗄 to Selected for Development ⏳ in EVM May 1, 2023
@aaronbuchwald aaronbuchwald moved this from Selected for Development ⏳ to In Progress 🏗 in EVM Jun 16, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Avalanche Warp Messaging Jun 17, 2023
@github-project-automation github-project-automation bot moved this from In Progress 🏗 to Done ✅ in EVM Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Archived in project
Development

No branches or pull requests

3 participants