We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 256c420 + 85eabe7 commit 43467e5Copy full SHA for 43467e5
contracts/conduit/ConduitController.sol
@@ -157,8 +157,11 @@ contract ConduitController is ConduitControllerInterface {
157
} else if (!isOpen && channelPreviouslyOpen) {
158
// Set a previously open channel as closed via "swap & pop" method.
159
// Decrement located index to get the index of the closed channel.
160
- uint256 removedChannelIndex = channelIndexPlusOne - 1;
161
-
+ uint256 removedChannelIndex;
+ // channelPreviouslyOpen already ensures channelIndexPlusOne > 0
162
+ unchecked {
163
+ removedChannelIndex = channelIndexPlusOne - 1;
164
+ }
165
// Use length of channels array to determine index of last channel.
166
uint256 finalChannelIndex = conduitProperties.channels.length - 1;
167
0 commit comments