From deffb4d00b7853f4af4b9ee7f79a883d4fa87542 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 12 Nov 2024 17:35:58 +0300 Subject: [PATCH] returns bytes 4 --- examples/call/contracts/Connected.sol | 3 ++- examples/nft/contracts/Connected.sol | 3 ++- examples/token/contracts/Connected.sol | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/call/contracts/Connected.sol b/examples/call/contracts/Connected.sol index 329a0352..d7b174dc 100644 --- a/examples/call/contracts/Connected.sol +++ b/examples/call/contracts/Connected.sol @@ -76,8 +76,9 @@ contract Connected { function onCall( MessageContext calldata context, bytes calldata message - ) external payable onlyGateway { + ) external payable onlyGateway returns (bytes4) { emit HelloEvent("Hello on EVM from onCall()", "hey"); + return ""; } function onRevert( diff --git a/examples/nft/contracts/Connected.sol b/examples/nft/contracts/Connected.sol index 9cee3f5a..b756a745 100644 --- a/examples/nft/contracts/Connected.sol +++ b/examples/nft/contracts/Connected.sol @@ -91,7 +91,7 @@ contract Connected is function onCall( MessageContext calldata context, bytes calldata message - ) external payable onlyGateway { + ) external payable onlyGateway returns (bytes4) { if (context.sender != counterparty) revert Unauthorized(); (address receiver, uint256 tokenId, string memory uri) = abi.decode( @@ -102,6 +102,7 @@ contract Connected is _safeMint(receiver, tokenId); _setTokenURI(tokenId, uri); emit TokenTransferReceived(receiver, tokenId, uri); + return ""; } function onRevert(RevertContext calldata context) external onlyGateway { diff --git a/examples/token/contracts/Connected.sol b/examples/token/contracts/Connected.sol index 12095acf..9f066163 100644 --- a/examples/token/contracts/Connected.sol +++ b/examples/token/contracts/Connected.sol @@ -70,7 +70,7 @@ contract Connected is ERC20, Ownable2Step, Events { function onCall( MessageContext calldata context, bytes calldata message - ) external payable onlyGateway { + ) external payable onlyGateway returns (bytes4) { if (context.sender != counterparty) revert Unauthorized(); (address receiver, uint256 amount) = abi.decode( message, @@ -78,6 +78,7 @@ contract Connected is ERC20, Ownable2Step, Events { ); _mint(receiver, amount); emit TokenTransferReceived(receiver, amount); + return ""; } function onRevert(RevertContext calldata context) external onlyGateway {}