Skip to content

Commit

Permalink
onCall: remove return
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Nov 12, 2024
1 parent 68217a5 commit c5e2348
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions examples/call/contracts/Connected.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ contract Connected {
function onCall(
MessageContext calldata context,
bytes calldata message
) external payable onlyGateway returns (bytes4) {
) external payable onlyGateway {
emit HelloEvent("Hello on EVM from onCall()", "hey");

return "";
}

function onRevert(
Expand Down
3 changes: 1 addition & 2 deletions examples/nft/contracts/Connected.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ contract Connected is
function onCall(
MessageContext calldata context,
bytes calldata message
) external payable onlyGateway returns (bytes4) {
) external payable onlyGateway {
if (context.sender != counterparty) revert Unauthorized();

(address receiver, uint256 tokenId, string memory uri) = abi.decode(
Expand All @@ -102,7 +102,6 @@ contract Connected is
_safeMint(receiver, tokenId);
_setTokenURI(tokenId, uri);
emit TokenTransferReceived(receiver, tokenId, uri);
return "";
}

function onRevert(RevertContext calldata context) external onlyGateway {
Expand Down
3 changes: 1 addition & 2 deletions examples/token/contracts/Connected.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ contract Connected is ERC20, Ownable2Step, Events {
function onCall(
MessageContext calldata context,
bytes calldata message
) external payable onlyGateway returns (bytes4) {
) external payable onlyGateway {
if (context.sender != counterparty) revert Unauthorized();
(address receiver, uint256 amount) = abi.decode(
message,
(address, uint256)
);
_mint(receiver, amount);
emit TokenTransferReceived(receiver, amount);
return "";
}

function onRevert(RevertContext calldata context) external onlyGateway {}
Expand Down

0 comments on commit c5e2348

Please sign in to comment.