Skip to content

Commit 48d65d4

Browse files
authored
docs: fix comment duplication (#775)
Signed-off-by: Pablo Maldonado <[email protected]>
1 parent 6e18091 commit 48d65d4

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

contracts/SpokePool.sol

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ abstract contract SpokePool is
6060
WETH9Interface private DEPRECATED_wrappedNativeToken;
6161
uint32 private DEPRECATED_depositQuoteTimeBuffer;
6262

63-
// Count of deposits is used to construct a unique deposit identifier for this spoke pool. This value
64-
// gets emitted and incremented on each depositV3 call. Because its a uint32, it will get implicitly cast to
65-
// uint256 in the emitted V3FundsDeposited event by setting its most significant bits to 0.
66-
// This variable name `numberOfDeposits` should ideally be re-named to
67-
// depositNonceCounter or something similar because its not a true representation of the number of deposits
68-
// because `unsafeDepositV3` can be called directly and bypass this increment.
63+
// `numberOfDeposits` acts as a counter to generate unique deposit identifiers for this spoke pool.
64+
// It is a uint32 that increments with each `depositV3` call. In the `V3FundsDeposited` event, it is
65+
// implicitly cast to uint256 by setting its most significant bits to 0, reducing the risk of ID collisions
66+
// with unsafe deposits. However, this variable's name could be improved (e.g., `depositNonceCounter`)
67+
// since it does not accurately reflect the total number of deposits, as `unsafeDepositV3` can bypass this increment.
6968
uint32 public numberOfDeposits;
7069

7170
// Whether deposits and fills are disabled.
@@ -519,13 +518,7 @@ abstract contract SpokePool is
519518
uint32 exclusivityParameter,
520519
bytes calldata message
521520
) public payable override nonReentrant unpausedDeposits {
522-
// Increment deposit nonce variable `numberOfDeposits` so that deposit ID for this deposit on this
523-
// spoke pool is unique. This variable `numberOfDeposits` should ideally be re-named to
524-
// depositNonceCounter or something similar because its not a true representation of the number of deposits
525-
// because `unsafeDepositV3` can be called directly and bypass this increment.
526-
// The `numberOfDeposits` is a uint32 that will get implicitly cast to uint256 by setting the
527-
// most significant bits to 0, which creates very little chance this an unsafe deposit ID collides
528-
// with a safe deposit ID.
521+
// Increment the `numberOfDeposits` counter to ensure a unique deposit ID for this spoke pool.
529522
DepositV3Params memory params = DepositV3Params({
530523
depositor: depositor,
531524
recipient: recipient,

0 commit comments

Comments
 (0)