Skip to content

Commit

Permalink
docs: state the fact that setRoute enforces route length limit
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Jun 14, 2024
1 parent cae20e7 commit 72f8a3a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ReservoirPriceOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -594,13 +594,14 @@ contract ReservoirPriceOracle is IPriceOracle, IReservoirPriceOracle, Owned(msg.

bytes32 lSlot = aToken0.calculateSlot(aToken1);

// clear all storage slots that the route has written to previously
// clear the storage slot that the route has written to previously
assembly {
sstore(lSlot, 0)
}
// TODO: What about routs with length >4.
// routes with length 4 use two words of storage
if (lRoute.length == 4) {

// routes with length MAX_ROUTE_LENGTH use one more word of storage
// `setRoute` enforces the MAX_ROUTE_LENGTH limit.
if (lRoute.length == Constants.MAX_ROUTE_LENGTH) {
assembly {
sstore(add(lSlot, 1), 0)
}
Expand Down

0 comments on commit 72f8a3a

Please sign in to comment.