hyperlane-xyz / hyperlane-monorepo

The home for Hyperlane core contracts, sdk packages, and other infrastructure
https://hyperlane.xyz
Other
311 stars 341 forks source link

Document what a Minimal Receiver Contract entails #3154

Open avious00 opened 8 months ago

avious00 commented 8 months ago

From community member:

The docs are pretty unclear regarding how to create a minimal receiver contract. I notice that there are snippets, but a full example of what a minimal receiver should look like would be much clearer, something like:

import "@hyperlane/interfaces/IMessageRecipient";
import "@hyperlane/client/MailboxClient";

contract MyHyperlaneReceiver is IMessageRecipient, MailboxClient {
  constructor (address _hyperlaneMailbox) MailboxClient(_hyperlaneMailbox) {}

  function handle (
    uint32 _origin,
    bytes32 _sender,
    bytes calldata _data
  ) onlyMailbox {
    // do stuff
  }
}
Ash-code183 commented 8 months ago

Hey @paulbalaji @avious00 i can help with this task if you could give me more context upon the document which needs to be updated