Created
May 23, 2022 13:39
-
-
Save shredding/b6ec90b6300ea8057ec6444a59e2b4be to your computer and use it in GitHub Desktop.
Revisions
-
shredding created this gist
May 23, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ // 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_; } }