diff --git a/packages/evm/contracts/Yaho.sol b/packages/evm/contracts/Yaho.sol index 2df8d65b..f94488e6 100644 --- a/packages/evm/contracts/Yaho.sol +++ b/packages/evm/contracts/Yaho.sol @@ -38,14 +38,15 @@ contract Yaho is IMessageDispatcher, MessageHashCalculator { function relayMessagesToAdapters( uint256[] memory messageIds, address[] memory adapters, - address[] memory destinationAdapters + address[] memory destinationAdapters, + uint256 gas ) external payable returns (bytes32[] memory) { if (messageIds.length == 0) revert NoMessageIdsGiven(address(this)); if (adapters.length == 0) revert NoAdaptersGiven(address(this)); if (adapters.length != destinationAdapters.length) revert UnequalArrayLengths(address(this)); bytes32[] memory adapterReciepts = new bytes32[](adapters.length); for (uint256 i = 0; i < adapters.length; i++) { - adapterReciepts[i] = IMessageRelay(adapters[i]).relayMessages(messageIds, destinationAdapters[i]); + adapterReciepts[i] = IMessageRelay(adapters[i]).relayMessages(messageIds, destinationAdapters[i], gas); } return adapterReciepts; } @@ -59,7 +60,8 @@ contract Yaho is IMessageDispatcher, MessageHashCalculator { function dispatchMessagesToAdapters( Message[] memory messages, address[] memory adapters, - address[] memory destinationAdapters + address[] memory destinationAdapters, + uint256 gas ) external payable returns (bytes32[] memory messageIds, bytes32[] memory) { if (adapters.length == 0) revert NoAdaptersGiven(address(this)); messageIds = dispatchMessages(messages); @@ -69,7 +71,7 @@ contract Yaho is IMessageDispatcher, MessageHashCalculator { } bytes32[] memory adapterReciepts = new bytes32[](adapters.length); for (uint256 i = 0; i < adapters.length; i++) { - adapterReciepts[i] = IMessageRelay(adapters[i]).relayMessages(uintIds, destinationAdapters[i]); + adapterReciepts[i] = IMessageRelay(adapters[i]).relayMessages(uintIds, destinationAdapters[i], gas); } return (messageIds, adapterReciepts); } diff --git a/packages/evm/contracts/adapters/AMB/AMBMessageRelayer.sol b/packages/evm/contracts/adapters/AMB/AMBMessageRelayer.sol index a2a4ed79..499461b4 100644 --- a/packages/evm/contracts/adapters/AMB/AMBMessageRelayer.sol +++ b/packages/evm/contracts/adapters/AMB/AMBMessageRelayer.sol @@ -17,7 +17,11 @@ contract AMBMessageRelay is IMessageRelay { yaho = _yaho; } - function relayMessages(uint256[] memory messageIds, address ambAdapter) public payable returns (bytes32 receipt) { + function relayMessages( + uint256[] memory messageIds, + address ambAdapter, + uint256 gas + ) public payable returns (bytes32 receipt) { bytes32[] memory hashes = new bytes32[](messageIds.length); for (uint256 i = 0; i < messageIds.length; i++) { uint256 id = messageIds[i]; @@ -25,6 +29,6 @@ contract AMBMessageRelay is IMessageRelay { emit MessageRelayed(address(this), messageIds[i]); } bytes memory data = abi.encodeCall(AMBAdapter.storeHashes, (messageIds, hashes)); - receipt = amb.requireToPassMessage(ambAdapter, data, 0); + receipt = amb.requireToPassMessage(ambAdapter, data, gas); } } diff --git a/packages/evm/contracts/interfaces/IMessageRelay.sol b/packages/evm/contracts/interfaces/IMessageRelay.sol index 8b63e8d7..82340aea 100644 --- a/packages/evm/contracts/interfaces/IMessageRelay.sol +++ b/packages/evm/contracts/interfaces/IMessageRelay.sol @@ -2,5 +2,9 @@ pragma solidity ^0.8.17; interface IMessageRelay { - function relayMessages(uint256[] memory messageIds, address adapter) external payable returns (bytes32 receipts); + function relayMessages( + uint256[] memory messageIds, + address adapter, + uint256 gas + ) external payable returns (bytes32 receipts); } diff --git a/packages/evm/contracts/test/MockMessageRealy.sol b/packages/evm/contracts/test/MockMessageRealy.sol index e344a993..62725909 100644 --- a/packages/evm/contracts/test/MockMessageRealy.sol +++ b/packages/evm/contracts/test/MockMessageRealy.sol @@ -6,7 +6,7 @@ import { IMessageRelay } from "../interfaces/IMessageRelay.sol"; contract MockMessageRelay is IMessageRelay { uint256 public count; - function relayMessages(uint256[] memory, address) external payable returns (bytes32 receipts) { + function relayMessages(uint256[] memory, address, uint256) external payable returns (bytes32 receipts) { receipts = bytes32(count); count++; } diff --git a/packages/evm/tasks/deploy/replay.ts b/packages/evm/tasks/deploy/replay.ts index 494a5824..40086a6b 100644 --- a/packages/evm/tasks/deploy/replay.ts +++ b/packages/evm/tasks/deploy/replay.ts @@ -100,7 +100,7 @@ export const deploy = async ({ networks }: { networks: string[] }, hre: HardhatR // deploy hashi module try { - console.log(`\x1B[4mHeader Storage\x1B[0m`) + console.log(`\x1B[4mHashi Module\x1B[0m`) const hashiModuleFactory: HashiModule__factory = ( await hre.ethers.getContractFactory("HashiModule") )