Skip to content

Commit c24c723

Browse files
committed
Fix
1 parent 09b298e commit c24c723

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

contracts/SpokePool.sol

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ abstract contract SpokePool is
839839
// Exclusivity deadline is inclusive and is the latest timestamp that the exclusive relayer has sole right
840840
// to fill the relay.
841841
if (
842-
_fillIsExclusive(relayData.exclusiveRelayer, relayData.exclusivityDeadline) &&
842+
_fillIsExclusive(relayData.exclusiveRelayer, relayData.exclusivityDeadline, uint32(getCurrentTime())) &&
843843
relayData.exclusiveRelayer != msg.sender
844844
) {
845845
revert NotExclusiveRelayer();
@@ -885,7 +885,7 @@ abstract contract SpokePool is
885885
// Exclusivity deadline is inclusive and is the latest timestamp that the exclusive relayer has sole right
886886
// to fill the relay.
887887
if (
888-
_fillIsExclusive(relayData.exclusiveRelayer, relayData.exclusivityDeadline) &&
888+
_fillIsExclusive(relayData.exclusiveRelayer, relayData.exclusivityDeadline, uint32(getCurrentTime())) &&
889889
relayData.exclusiveRelayer != msg.sender
890890
) {
891891
revert NotExclusiveRelayer();
@@ -929,14 +929,15 @@ abstract contract SpokePool is
929929
* then Across will not include a slow fill for the intended deposit.
930930
*/
931931
function requestV3SlowFill(V3RelayData calldata relayData) public override nonReentrant unpausedFills {
932+
uint32 currentTime = uint32(getCurrentTime());
932933
// If a depositor has set an exclusivity deadline, then only the exclusive relayer should be able to
933934
// fast fill within this deadline. Moreover, the depositor should expect to get *fast* filled within
934935
// this deadline, not slow filled. As a simplifying assumption, we will not allow slow fills to be requested
935936
// during this exclusivity period.
936-
if (_fillIsExclusive(relayData.exclusiveRelayer, relayData.exclusivityDeadline)) {
937-
revert NotExclusiveRelayer();
937+
if (_fillIsExclusive(relayData.exclusiveRelayer, relayData.exclusivityDeadline, currentTime)) {
938+
revert NoSlowFillsInExclusivityWindow();
938939
}
939-
if (relayData.fillDeadline < getCurrentTime()) revert ExpiredFillDeadline();
940+
if (relayData.fillDeadline < currentTime) revert ExpiredFillDeadline();
940941

941942
bytes32 relayHash = _getV3RelayHash(relayData);
942943
if (fillStatuses[relayHash] != uint256(FillStatus.Unfilled)) revert InvalidSlowFillRequest();
@@ -1413,8 +1414,12 @@ abstract contract SpokePool is
14131414
}
14141415

14151416
// Determine whether the combination of exlcusiveRelayer and exclusivityDeadline implies active exclusivity.
1416-
function _fillIsExclusive(address exclusiveRelayer, uint32 exclusivityDeadline) internal pure returns (bool) {
1417-
return exclusivityDeadline >= getCurrentTime() && exclusiveRelayer != address(0);
1417+
function _fillIsExclusive(
1418+
address exclusiveRelayer,
1419+
uint32 exclusivityDeadline,
1420+
uint32 currentTime
1421+
) internal pure returns (bool) {
1422+
return exclusivityDeadline >= currentTime && exclusiveRelayer != address(0);
14181423
}
14191424

14201425
// Implementing contract needs to override this to ensure that only the appropriate cross chain admin can execute

0 commit comments

Comments
 (0)