Skip to content

TusimaNetwork/zkBridge-messaging-interfaces

Repository files navigation

zkBridge Messaging - Interfaces

Tusima zkBridge

Tests Twitter Follow Discord

This repo is the interface repo of the zkBridge Messaging component and mainly contains three files: IMessaging.sol, Receiver.sol and ReceiverUpgradeable.sol. Developers can easily implement cross-chain communication by introducing interface files.

More detailed information about Tusima zkBridge please refer to here.

More detailed information about Tusima zkBridge Messaging component please refer to here.

IMessaging

IMessaging.sol is an Solidity interface file, you can find it here.

This file includes two interfaces, ISender and IReceiver, corresponding to Sending and Receiving functionalities, respectively.

You can implement the message receiving function yourself using the IReceiver interface. However, you must ensure the following:

  • Verify that msg.sender originates from Tusima's Messaging contract.
  • Return the function selector at the end of the function, i.e., return IReceiver.handleMsg.selector.

Receiver

We also provide a simpler usage method, that is Receiver.sol, an abstract contract. By implementing the interfaces defined in this abstract contract, you won't need to verify the source of msg.sender or return the function selector. You can solely concentrate on the message processing logic. You can find its code here.

ReceiverUpgradeable

If you wish to make your contract upgradeable, we also offer ReceiverUpgradeable.sol, and its code is here.

About

An Solidity interfaces repo for zkBridge-messaging.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published