Skip to content

Commit

Permalink
fix: be more strict regarding which bytes are triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
reednaa committed Apr 30, 2024
1 parent 84797f3 commit a59d87b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/IncentivizedMessageEscrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes
* @dev This can only be set once. When set, is cannot be changed.
* This is to protect relayers as this could be used to fail acks.
* You are not allowed to set a 0 length implementation address.
* If you want to disable a specific route, set it 1 length like
* hex"00" or hex"3e" or hex"ee" or hex"ff" or hex"01", etc.
* If you want to disable a specific route, set implementation to hex"00".
*/
function setRemoteImplementation(bytes32 destinationIdentifier, bytes calldata implementation) external {
if (implementationAddressHash[msg.sender][destinationIdentifier] != bytes32(0)) revert ImplementationAddressAlreadySet(
Expand Down Expand Up @@ -259,7 +258,7 @@ abstract contract IncentivizedMessageEscrow is IIncentivizedMessageEscrow, Bytes
// Check that the application has set a destination implementation by checking if the length of the destinationImplementation entry is not 0.
bytes memory destinationImplementation = implementationAddress[msg.sender][destinationIdentifier];
if (destinationImplementation.length == 0) revert NoImplementationAddressSet();
if (destinationImplementation.length == 1) revert RouteDisabled();
if (destinationImplementation.length == 1 && destinationImplementation[0] == 0x00) revert RouteDisabled();

// Check that the deadline is lower than the AMB specification.
unchecked {
Expand Down

0 comments on commit a59d87b

Please sign in to comment.