From 4e9115ddf5602076307ddf2bc904371ec70cbb9b Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Mon, 21 Aug 2023 10:01:55 +0400 Subject: [PATCH] fix: messaging template (#35) --- .../messaging/contracts/{{contractName}}.sol.hbs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/templates/messaging/contracts/{{contractName}}.sol.hbs b/templates/messaging/contracts/{{contractName}}.sol.hbs index 14d15c00..45e1553f 100644 --- a/templates/messaging/contracts/{{contractName}}.sol.hbs +++ b/templates/messaging/contracts/{{contractName}}.sol.hbs @@ -37,7 +37,7 @@ contract {{contractName}} is if (!_isValidChainId(destinationChainId)) revert InvalidDestinationChainId(); - uint256 crossChainGas = 18 * (10 ** 18); + uint256 crossChainGas = 2 * (10 ** 18); uint256 zetaValueAndGas = _zetaConsumer.getZetaFromEth{ value: msg.value }(address(this), crossChainGas); @@ -58,27 +58,16 @@ contract {{contractName}} is function onZetaMessage( ZetaInterfaces.ZetaMessage calldata zetaMessage ) external override isValidMessageCall(zetaMessage) { - /** - * @dev Decode should follow the signature of the message provided to zeta.send. - */ (bytes32 messageType{{#if arguments.pairs}}, {{#each arguments.pairs}}{{#if @index}}, {{/if}}{{this.[1]}} {{this.[0]}}{{/each}}{{/if}}) = abi.decode( zetaMessage.message, (bytes32{{#if arguments.pairs}}, {{#each arguments.pairs}}{{#if @index}}, {{/if}}{{this.[1]}}{{/each}}{{/if}}) ); - /** - * @dev Setting a message type is a useful pattern to distinguish between different messages. - */ if (messageType != {{contractNameUnderscore}}_MESSAGE_TYPE) revert InvalidMessageType(); emit {{contractName}}Event({{#each arguments.pairs}}{{#if @index}}, {{/if}}{{this.[0]}}{{/each}}); } - /** - * @dev Called by the Zeta Connector contract when the message fails to be sent. - * Useful to cleanup and leave the application on its initial state. - * Note that the require statements and the functionality are similar to onZetaMessage. - */ function onZetaRevert( ZetaInterfaces.ZetaRevert calldata zetaRevert ) external override isValidRevertCall(zetaRevert) {