Skip to content

Commit

Permalink
Fix: check origin domain in ExecutionHub
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Oct 18, 2023
1 parent 4527220 commit e55f5f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/contracts-core/contracts/hubs/ExecutionHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
DuplicatedSnapshotRoot,
IncorrectDestinationDomain,
IncorrectMagicValue,
IncorrectOriginDomain,
IncorrectSnapshotRoot,
GasLimitTooLow,
GasSuppliedTooLow,
Expand Down Expand Up @@ -121,6 +122,8 @@ abstract contract ExecutionHub is AgentSecured, ReentrancyGuardUpgradeable, Exec
bytes32 msgLeaf = message.leaf();
// Ensure message was meant for this domain
if (header.destination() != localDomain) revert IncorrectDestinationDomain();
// Ensure message was not sent from this domain
if (header.origin() == localDomain) revert IncorrectOriginDomain();
// Check that message has not been executed before
ReceiptData memory rcptData = _receiptData[msgLeaf];
if (rcptData.executor != address(0)) revert AlreadyExecuted();
Expand Down

0 comments on commit e55f5f0

Please sign in to comment.