From 2e222f9f2268c0f69a8f21df89fa7e63cb44ac37 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 16 Feb 2024 19:16:28 +0100 Subject: [PATCH] fix: correctly check deadline and standardize ABI --- src/IncentivizedMessageEscrow.sol | 8 ++++---- src/interfaces/IIncentivizedMessageEscrow.sol | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/IncentivizedMessageEscrow.sol b/src/IncentivizedMessageEscrow.sol index 307ecec..bfcd95a 100644 --- a/src/IncentivizedMessageEscrow.sol +++ b/src/IncentivizedMessageEscrow.sol @@ -923,7 +923,7 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes * waste a lot of gas. * There is no reliable way to block this function such that it can't be called twice after a message has been timed out * since the content could we wrong or the proof may still exist. - * @param destinationIncentives The address of the source generalisedIncentives that emitted the original message + * @param implementationIdentifier The address of the source generalisedIncentives that emitted the original message * @param sourceIdentifier The identifier for the source chain (where to send the message) * @param originBlockNumber The block number when the message was originally emitted. * Note that for some L2 this could be the block number of the underlying chain. @@ -931,8 +931,8 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes * @param message Original Generalised Incentives messag */ function timeoutMessage( - bytes calldata destinationIncentives, bytes32 sourceIdentifier, + bytes calldata implementationIdentifier, uint256 originBlockNumber, bytes calldata message ) external payable virtual { @@ -958,7 +958,7 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes // Check that the deadline has passed AND that there is no opt out. // This isn't a strong check but if a relayer is honest, then it can be used as a sanity check. - if (deadline != 0 && deadline <= block.timestamp) revert DeadlineNotPassed(deadline, uint64(block.timestamp)); + if (deadline != 0 && deadline > block.timestamp) revert DeadlineNotPassed(deadline, uint64(block.timestamp)); // Reconstruct message bytes memory receiveAckWithContext = bytes.concat( @@ -976,7 +976,7 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes // Send the message uint128 cost = _sendPacket( sourceIdentifier, - destinationIncentives, + implementationIdentifier, receiveAckWithContext ); diff --git a/src/interfaces/IIncentivizedMessageEscrow.sol b/src/interfaces/IIncentivizedMessageEscrow.sol index aa06451..035c162 100644 --- a/src/interfaces/IIncentivizedMessageEscrow.sol +++ b/src/interfaces/IIncentivizedMessageEscrow.sol @@ -38,8 +38,8 @@ interface IIncentivizedMessageEscrow is IMessageEscrowStructs, IMessageEscrowErr function estimateAdditionalCost() external view returns(address asset, uint256 amount); function timeoutMessage( - bytes calldata destinationIncentives, bytes32 sourceIdentifier, + bytes calldata implementationIdentifier, uint256 originBlockNumber, bytes calldata message ) external payable;