From 82101d54f016073c2640d50842e56bd89125f2c1 Mon Sep 17 00:00:00 2001 From: -f Date: Thu, 12 Dec 2024 16:42:44 +0530 Subject: [PATCH 1/4] make releaseValueToRecipient internal --- .../contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol | 4 ++-- solidity/contracts/isms/hook/ArbL2ToL1Ism.sol | 2 +- solidity/contracts/isms/hook/OPL2ToL1Ism.sol | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol b/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol index 51a896129b..b466f69311 100644 --- a/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol +++ b/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol @@ -78,7 +78,7 @@ abstract contract AbstractMessageIdAuthorizedIsm is ) external virtual returns (bool) { bool verified = isVerified(message); if (verified) { - releaseValueToRecipient(message); + _releaseValueToRecipient(message); } return verified; } @@ -89,7 +89,7 @@ abstract contract AbstractMessageIdAuthorizedIsm is * @notice Release the value to the recipient if the message is verified. * @param message Message to release value for. */ - function releaseValueToRecipient(bytes calldata message) public { + function _releaseValueToRecipient(bytes calldata message) internal { bytes32 messageId = message.id(); uint256 _msgValue = verifiedMessages[messageId].clearBit( VERIFIED_MASK_INDEX diff --git a/solidity/contracts/isms/hook/ArbL2ToL1Ism.sol b/solidity/contracts/isms/hook/ArbL2ToL1Ism.sol index 42593f85c6..af7ab6ecd7 100644 --- a/solidity/contracts/isms/hook/ArbL2ToL1Ism.sol +++ b/solidity/contracts/isms/hook/ArbL2ToL1Ism.sol @@ -69,7 +69,7 @@ contract ArbL2ToL1Ism is _verifyWithOutboxCall(metadata, message); require(isVerified(message), "ArbL2ToL1Ism: message not verified"); } - releaseValueToRecipient(message); + _releaseValueToRecipient(message); return true; } diff --git a/solidity/contracts/isms/hook/OPL2ToL1Ism.sol b/solidity/contracts/isms/hook/OPL2ToL1Ism.sol index ef39868611..22b432fab2 100644 --- a/solidity/contracts/isms/hook/OPL2ToL1Ism.sol +++ b/solidity/contracts/isms/hook/OPL2ToL1Ism.sol @@ -70,7 +70,7 @@ contract OPL2ToL1Ism is _verifyWithPortalCall(metadata, message); require(isVerified(message), "OPL2ToL1Ism: message not verified"); } - releaseValueToRecipient(message); + _releaseValueToRecipient(message); return true; } From c771cd95a2a6d40281a8c18a8c5ebc44fb644491 Mon Sep 17 00:00:00 2001 From: -f Date: Thu, 12 Dec 2024 16:43:31 +0530 Subject: [PATCH 2/4] docs(changeset): Made releaseValueToRecipient internal --- .changeset/nine-eyes-smile.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/nine-eyes-smile.md diff --git a/.changeset/nine-eyes-smile.md b/.changeset/nine-eyes-smile.md new file mode 100644 index 0000000000..50ce0cb1ed --- /dev/null +++ b/.changeset/nine-eyes-smile.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/core': patch +--- + +Made releaseValueToRecipient internal From a5c72340b67902092a39dd2955a83d0c874768c6 Mon Sep 17 00:00:00 2001 From: -f Date: Thu, 12 Dec 2024 16:46:57 +0530 Subject: [PATCH 3/4] move --- .../hook/AbstractMessageIdAuthorizedIsm.sol | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol b/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol index b466f69311..a133de5d8d 100644 --- a/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol +++ b/solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol @@ -85,21 +85,6 @@ abstract contract AbstractMessageIdAuthorizedIsm is // ============ Public Functions ============ - /** - * @notice Release the value to the recipient if the message is verified. - * @param message Message to release value for. - */ - function _releaseValueToRecipient(bytes calldata message) internal { - bytes32 messageId = message.id(); - uint256 _msgValue = verifiedMessages[messageId].clearBit( - VERIFIED_MASK_INDEX - ); - if (_msgValue > 0) { - verifiedMessages[messageId] -= _msgValue; - payable(message.recipientAddress()).sendValue(_msgValue); - } - } - /** * @notice Check if a message is verified through preVerifyMessage first. * @param message Message to check. @@ -138,6 +123,21 @@ abstract contract AbstractMessageIdAuthorizedIsm is // ============ Internal Functions ============ + /** + * @notice Release the value to the recipient if the message is verified. + * @param message Message to release value for. + */ + function _releaseValueToRecipient(bytes calldata message) internal { + bytes32 messageId = message.id(); + uint256 _msgValue = verifiedMessages[messageId].clearBit( + VERIFIED_MASK_INDEX + ); + if (_msgValue > 0) { + verifiedMessages[messageId] -= _msgValue; + payable(message.recipientAddress()).sendValue(_msgValue); + } + } + /** * @notice Check if sender is authorized to message `preVerifyMessage`. */ From 9e0277edf47991eb3de5b8a4bf382320b1211691 Mon Sep 17 00:00:00 2001 From: -f Date: Fri, 13 Dec 2024 13:30:44 +0530 Subject: [PATCH 4/4] patch -> minor --- .changeset/nine-eyes-smile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/nine-eyes-smile.md b/.changeset/nine-eyes-smile.md index 50ce0cb1ed..e0ae7027b5 100644 --- a/.changeset/nine-eyes-smile.md +++ b/.changeset/nine-eyes-smile.md @@ -1,5 +1,5 @@ --- -'@hyperlane-xyz/core': patch +'@hyperlane-xyz/core': minor --- Made releaseValueToRecipient internal