@@ -523,9 +523,9 @@ abstract contract SpokePool is
523523 * @param fillDeadline The deadline for the relayer to fill the deposit. After this destination chain timestamp,
524524 * the fill will revert on the destination chain. Must be set between [currentTime, currentTime + fillDeadlineBuffer]
525525 * where currentTime is block.timestamp on this chain or this transaction will revert.
526- * @param exclusivityDeadline The deadline for the exclusive relayer to fill the deposit. After this
527- * destination chain timestamp, anyone can fill this deposit on the destination chain. If exclusiveRelayer is set
528- * to address(0), then this also must be set to 0, (and vice versa), otherwise this must be set >= current time .
526+ * @param exclusivityPeriod Added to the current time to set the exclusive reayer deadline,
527+ * which is the deadline for the exclusiveRelayer to fill the deposit. After this destination chain timestamp,
528+ * anyone can fill the deposit .
529529 * @param message The message to send to the recipient on the destination chain if the recipient is a contract.
530530 * If the message is not empty, the recipient contract must implement handleV3AcrossMessage() or the fill will revert.
531531 */
@@ -540,7 +540,7 @@ abstract contract SpokePool is
540540 address exclusiveRelayer ,
541541 uint32 quoteTimestamp ,
542542 uint32 fillDeadline ,
543- uint32 exclusivityDeadline ,
543+ uint32 exclusivityPeriod ,
544544 bytes calldata message
545545 ) public payable override nonReentrant unpausedDeposits {
546546 // Check that deposit route is enabled for the input token. There are no checks required for the output token
@@ -567,22 +567,6 @@ abstract contract SpokePool is
567567 // situation won't be a problem for honest users.
568568 if (fillDeadline < currentTime || fillDeadline > currentTime + fillDeadlineBuffer) revert InvalidFillDeadline ();
569569
570- // As a safety measure, prevent caller from inadvertently locking funds during exclusivity period
571- // by forcing them to specify an exclusive relayer if the exclusivity period
572- // is in the future. If this deadline is 0, then the exclusive relayer must also be address(0).
573- // @dev Checks if either are > 0 by bitwise or-ing.
574- if (uint256 (uint160 (exclusiveRelayer)) | exclusivityDeadline != 0 ) {
575- // Now that we know one is nonzero, we need to perform checks on each.
576- // Check that exclusive relayer is nonzero.
577- if (exclusiveRelayer == address (0 )) revert InvalidExclusiveRelayer ();
578-
579- // Check that deadline is in the future.
580- if (exclusivityDeadline < currentTime) revert InvalidExclusivityDeadline ();
581- }
582-
583- // No need to sanity check exclusivityDeadline because if its bigger than fillDeadline, then
584- // there the full deadline is exclusive, and if its too small, then there is no exclusivity period.
585-
586570 // If the address of the origin token is a wrappedNativeToken contract and there is a msg.value with the
587571 // transaction then the user is sending the native token. In this case, the native token should be
588572 // wrapped.
@@ -608,7 +592,7 @@ abstract contract SpokePool is
608592 numberOfDeposits++ ,
609593 quoteTimestamp,
610594 fillDeadline,
611- exclusivityDeadline ,
595+ uint32 ( getCurrentTime ()) + exclusivityPeriod ,
612596 depositor,
613597 recipient,
614598 exclusiveRelayer,
@@ -642,9 +626,9 @@ abstract contract SpokePool is
642626 * @param fillDeadlineOffset Added to the current time to set the fill deadline, which is the deadline for the
643627 * relayer to fill the deposit. After this destination chain timestamp, the fill will revert on the
644628 * destination chain.
645- * @param exclusivityDeadline The latest timestamp that only the exclusive relayer can fill the deposit. After this
646- * destination chain timestamp, anyone can fill this deposit on the destination chain. Should be 0 if
647- * exclusive relayer is 0 .
629+ * @param exclusivityPeriod Added to the current time to set the exclusive relayer deadline,
630+ * which is the deadline for the exclusiveRelayer to fill the deposit. After this destination chain timestamp,
631+ * anyone can fill the deposit up to the fillDeadline timestamp .
648632 * @param message The message to send to the recipient on the destination chain if the recipient is a contract.
649633 * If the message is not empty, the recipient contract must implement handleV3AcrossMessage() or the fill will revert.
650634 */
@@ -658,7 +642,7 @@ abstract contract SpokePool is
658642 uint256 destinationChainId ,
659643 address exclusiveRelayer ,
660644 uint32 fillDeadlineOffset ,
661- uint32 exclusivityDeadline ,
645+ uint32 exclusivityPeriod ,
662646 bytes calldata message
663647 ) external payable {
664648 depositV3 (
@@ -672,12 +656,13 @@ abstract contract SpokePool is
672656 exclusiveRelayer,
673657 uint32 (getCurrentTime ()),
674658 uint32 (getCurrentTime ()) + fillDeadlineOffset,
675- exclusivityDeadline ,
659+ exclusivityPeriod ,
676660 message
677661 );
678662 }
679663
680664 /**
665+ * @notice DEPRECATED. Use depositV3() instead.
681666 * @notice Submits deposit and sets exclusivityDeadline to current time plus some offset. This function is
682667 * designed to be called by users who want to set an exclusive relayer for some amount of time after their deposit
683668 * transaction is mined.
@@ -708,7 +693,7 @@ abstract contract SpokePool is
708693 * @param fillDeadline The deadline for the relayer to fill the deposit. After this destination chain timestamp,
709694 * the fill will revert on the destination chain. Must be set between [currentTime, currentTime + fillDeadlineBuffer]
710695 * where currentTime is block.timestamp on this chain or this transaction will revert.
711- * @param exclusivityDeadlineOffset Added to the current time to set the exclusive reayer deadline,
696+ * @param exclusivityPeriod Added to the current time to set the exclusive reayer deadline,
712697 * which is the deadline for the exclusiveRelayer to fill the deposit. After this destination chain timestamp,
713698 * anyone can fill the deposit.
714699 * @param message The message to send to the recipient on the destination chain if the recipient is a contract.
@@ -725,7 +710,7 @@ abstract contract SpokePool is
725710 address exclusiveRelayer ,
726711 uint32 quoteTimestamp ,
727712 uint32 fillDeadline ,
728- uint32 exclusivityDeadlineOffset ,
713+ uint32 exclusivityPeriod ,
729714 bytes calldata message
730715 ) public payable {
731716 depositV3 (
@@ -739,7 +724,7 @@ abstract contract SpokePool is
739724 exclusiveRelayer,
740725 quoteTimestamp,
741726 fillDeadline,
742- uint32 ( getCurrentTime ()) + exclusivityDeadlineOffset ,
727+ exclusivityPeriod ,
743728 message
744729 );
745730 }
@@ -845,7 +830,11 @@ abstract contract SpokePool is
845830 {
846831 // Exclusivity deadline is inclusive and is the latest timestamp that the exclusive relayer has sole right
847832 // to fill the relay.
848- if (relayData.exclusivityDeadline >= getCurrentTime () && relayData.exclusiveRelayer != msg .sender ) {
833+ if (
834+ relayData.exclusiveRelayer != msg .sender &&
835+ relayData.exclusivityDeadline >= getCurrentTime () &&
836+ relayData.exclusiveRelayer != address (0 )
837+ ) {
849838 revert NotExclusiveRelayer ();
850839 }
851840
0 commit comments