Skip to content

Commit

Permalink
Merge pull request #38 from Ion-Protocol/jun/M-03-L-03
Browse files Browse the repository at this point in the history
[Plume M-03] add hook to dispatch and L-03 make quote and dispatch consi…
  • Loading branch information
junkim012 authored Jan 12, 2025
2 parents a013aa3 + fee3baf commit fa96689
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,14 @@ contract MultiChainHyperlaneTellerWithMultiAssetSupport is MultiChainTellerBase
* @param data Bridge data
*/
function _quote(uint256 shareAmount, BridgeData calldata data) internal view override returns (uint256) {
bytes memory _payload = abi.encode(shareAmount, data.destinationChainReceiver);
bytes32 messageId = keccak256(abi.encodePacked(++nonce, address(this), block.chainid));

bytes memory _payload = abi.encode(shareAmount, data.destinationChainReceiver, messageId);

bytes32 msgRecipient = _addressToBytes32(selectorToChains[data.chainSelector].targetTeller);

return mailbox.quoteDispatch(
data.chainSelector, msgRecipient, _payload, StandardHookMetadata.overrideGasLimit(data.messageGas)
data.chainSelector, msgRecipient, _payload, StandardHookMetadata.overrideGasLimit(data.messageGas), hook
);
}

Expand Down Expand Up @@ -172,9 +175,9 @@ contract MultiChainHyperlaneTellerWithMultiAssetSupport is MultiChainTellerBase
data.chainSelector, // must be `destinationDomain` on hyperlane
msgRecipient, // must be the teller address left-padded to bytes32
_payload,
StandardHookMetadata.overrideGasLimit(data.messageGas) // Sets the refund address to msg.sender, sets
// `_msgValue`
// to zero
StandardHookMetadata.overrideGasLimit(data.messageGas), // Sets the refund address to msg.sender, sets
// `_msgValue` to zero
hook
);
}

Expand Down

0 comments on commit fa96689

Please sign in to comment.