Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contracts/SpokePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,8 @@ abstract contract SpokePool is

// slither-disable-next-line timestamp
uint256 currentTime = getCurrentTime();
if (currentTime - quoteTimestamp > depositQuoteTimeBuffer) revert InvalidQuoteTimestamp();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to update comment above as there should be no overflow anymore

if (quoteTimestamp > currentTime || currentTime - quoteTimestamp > depositQuoteTimeBuffer)
revert InvalidQuoteTimestamp();

// fillDeadline is relative to the destination chain.
// Don’t allow fillDeadline to be more than several bundles into the future.
Expand Down
6 changes: 6 additions & 0 deletions test/evm/hardhat/SpokePool.Deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@ describe("SpokePool Depositor Logic", async function () {
...getDepositArgsFromRelayData(relayData, destinationChainId, currentTime.sub(quoteTimeBuffer).sub(1))
)
).to.be.revertedWith("InvalidQuoteTimestamp");
await expect(
spokePool.connect(depositor).depositV3(
// quoteTimestamp in the future should also revert with InvalidQuoteTimestamp
...getDepositArgsFromRelayData(relayData, destinationChainId, currentTime.add(500))
)
).to.be.revertedWith("InvalidQuoteTimestamp");
await expect(
spokePool.connect(depositor).depositV3(
// quoteTimestamp right at the buffer is OK
Expand Down
Loading