Summary
Gateway.createOrder() derives deterministic order IDs from keccak256(abi.encode(msg.sender, _nonce[msg.sender], block.chainid)) and reverts with 'OrderAlreadyExists' if order[orderId].sender != address(0).
Because Gateway.settleIn() was permissionless (external whenNotPaused), accepted an arbitrary caller-supplied bytes32 _orderId, and wrote directly into the same order mapping (order[_orderId].sender = _recipient), any caller could pre-occupy a target address’s next deterministic orderId at zero net token cost (_amount = 1 base unit returned to the caller) and permanently block that address from calling createOrder() on that chain until the proxy was upgraded.
Root Cause
createOrder()incremented_nonce[msg.sender], computedkeccak256(abi.encode(msg.sender, _nonce[msg.sender], block.chainid)), and enforcedrequire(order[orderId].sender == address(0), 'OrderAlreadyExists').settleIn()accepted an arbitrary_orderIdand_amount >= 1, writingorder[_orderId].sender = _recipient(_recipient != address(0)).- On
'OrderAlreadyExists',createOrder()reverted with_nonce[sender]and the existingorderrecord unchanged, leaving the target address’s next order ID permanently blocked.
Remediation
Domain-separate settleIn() storage keys inside the existing order mapping (keccak256(abi.encode('SETTLE_IN', _orderId))) to preserve the TransparentUpgradeableProxy storage layout while preventing settleIn() from colliding with createOrder() order IDs, fixed in e75a8e6.
