Skip to content

Instantly share code, notes, and snippets.

@shredding
Created May 23, 2022 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shredding/b6ec90b6300ea8057ec6444a59e2b4be to your computer and use it in GitHub Desktop.
Save shredding/b6ec90b6300ea8057ec6444a59e2b4be to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.13;
import {Router} from "@abacus-network/app/contracts/Router.sol";
contract Playground is Router {
constructor(address abacusConnectionManager_) {
__AbacusConnectionClient_initialize(abacusConnectionManager_);
}
string public message;
function foo(uint32 destination_, string memory message_) external {
_dispatch(
destination_,
abi.encodeWithSelector(
this.handleBar.selector,
message_
)
);
}
function _handle(uint32 origin_, bytes32 sender_, bytes memory message_) internal virtual override {
// is origin_ / sender_ validated / guaranteed to be correct?
address(this).call(message_);
}
function handleBar(string memory message_) external onlyInbox {
message = message_;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment