diff --git a/test/invariant/Invariant.t.sol b/test/invariant/Invariant.t.sol index c3b7a7646..45b0fb464 100644 --- a/test/invariant/Invariant.t.sol +++ b/test/invariant/Invariant.t.sol @@ -35,12 +35,12 @@ abstract contract Invariant_Test is Base_Test, ForgeInvariantTest { // Target only the comptroller handler for invariant testing (to avoid getting reverts). targetContract(address(comptrollerHandler)); - // Exclude the comptroller, linear and pro for being the `msg.sender`. + // Exclude the comptroller, linear and pro from being the `msg.sender`. excludeSender(address(comptroller)); excludeSender(address(linear)); excludeSender(address(pro)); - // Exclude the comptroller handler for being the `msg.sender`. + // Exclude the comptroller handler from being the `msg.sender`. excludeSender(address(comptrollerHandler)); // Label the comptroller handler. diff --git a/test/invariant/handlers/LockupHandler.t.sol b/test/invariant/handlers/LockupHandler.t.sol index 98e69b5b5..5b2b2ca74 100644 --- a/test/invariant/handlers/LockupHandler.t.sol +++ b/test/invariant/handlers/LockupHandler.t.sol @@ -18,7 +18,7 @@ abstract contract LockupHandler is BaseHandler { IERC20 public asset; ISablierV2Lockup public lockup; - LockupHandlerStorage public _storage; + LockupHandlerStorage public store; /*////////////////////////////////////////////////////////////////////////// PRIVATE TEST VARIABLES @@ -32,10 +32,10 @@ abstract contract LockupHandler is BaseHandler { CONSTRUCTOR //////////////////////////////////////////////////////////////////////////*/ - constructor(IERC20 asset_, ISablierV2Lockup lockup_, LockupHandlerStorage _storage_) { + constructor(IERC20 asset_, ISablierV2Lockup lockup_, LockupHandlerStorage store_) { asset = asset_; lockup = lockup_; - _storage = _storage_; + store = store_; } /*////////////////////////////////////////////////////////////////////////// @@ -50,24 +50,24 @@ abstract contract LockupHandler is BaseHandler { } modifier useFuzzedStreamRecipient(uint256 streamIndexSeed) { - uint256 lastStreamId = _storage.lastStreamId(); + uint256 lastStreamId = store.lastStreamId(); if (lastStreamId == 0) { return; } - currentStreamId = _storage.streamIds(bound(streamIndexSeed, 0, lastStreamId - 1)); - currentRecipient = _storage.streamIdsToRecipients(currentStreamId); + currentStreamId = store.streamIds(bound(streamIndexSeed, 0, lastStreamId - 1)); + currentRecipient = store.streamIdsToRecipients(currentStreamId); vm.startPrank(currentRecipient); _; vm.stopPrank(); } modifier useFuzzedStreamSender(uint256 streamIndexSeed) { - uint256 lastStreamId = _storage.lastStreamId(); + uint256 lastStreamId = store.lastStreamId(); if (lastStreamId == 0) { return; } - currentStreamId = _storage.streamIds(bound(streamIndexSeed, 0, lastStreamId - 1)); - currentSender = _storage.streamIdsToSenders(currentStreamId); + currentStreamId = store.streamIds(bound(streamIndexSeed, 0, lastStreamId - 1)); + currentSender = store.streamIdsToSenders(currentStreamId); vm.startPrank(currentSender); _; vm.stopPrank(); @@ -93,7 +93,7 @@ abstract contract LockupHandler is BaseHandler { lockup.burn(currentStreamId); // Set the recipient associated with this stream to the zero address. - _storage.updateRecipient(currentStreamId, address(0)); + store.updateRecipient(currentStreamId, address(0)); } function cancel(uint256 streamIndexSeed) external instrument("cancel") useFuzzedStreamSender(streamIndexSeed) { @@ -106,7 +106,7 @@ abstract contract LockupHandler is BaseHandler { // Record the returned amount by adding it to the ghost variable `returnedAmountsSum`. This is needed to // check invariants against the contract's balance. uint128 returnedAmount = lockup.returnableAmountOf(currentStreamId); - _storage.addReturnedAmount(returnedAmount); + store.addReturnedAmount(returnedAmount); // Cancel the stream. lockup.cancel(currentStreamId); @@ -210,6 +210,6 @@ abstract contract LockupHandler is BaseHandler { lockup.transferFrom({ from: currentRecipient, to: newRecipient, tokenId: currentStreamId }); // Update the recipient associated with this stream id. - _storage.updateRecipient(currentStreamId, newRecipient); + store.updateRecipient(currentStreamId, newRecipient); } } diff --git a/test/invariant/handlers/LockupLinearCreateHandler.t.sol b/test/invariant/handlers/LockupLinearCreateHandler.t.sol index cf4027748..865d23ddc 100644 --- a/test/invariant/handlers/LockupLinearCreateHandler.t.sol +++ b/test/invariant/handlers/LockupLinearCreateHandler.t.sol @@ -24,16 +24,16 @@ contract LockupLinearCreateHandler is BaseHandler { //////////////////////////////////////////////////////////////////////////*/ IERC20 public asset; - LockupHandlerStorage public _storage; + LockupHandlerStorage public store; /*////////////////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////////*/ - constructor(IERC20 asset_, ISablierV2LockupLinear linear_, LockupHandlerStorage _storage_) { + constructor(IERC20 asset_, ISablierV2LockupLinear linear_, LockupHandlerStorage store_) { asset = asset_; linear = linear_; - _storage = _storage_; + store = store_; } /*////////////////////////////////////////////////////////////////////////// @@ -68,7 +68,7 @@ contract LockupLinearCreateHandler is BaseHandler { params.totalAmount = boundUint128(params.totalAmount, 1, 1_000_000_000e18); // We don't want to fuzz more than a certain number of streams. - if (_storage.lastStreamId() >= MAX_STREAM_COUNT) { + if (store.lastStreamId() >= MAX_STREAM_COUNT) { return; } @@ -95,7 +95,7 @@ contract LockupLinearCreateHandler is BaseHandler { }); // Store the stream id. - _storage.pushStreamId(streamId, params.sender, params.recipient); + store.pushStreamId(streamId, params.sender, params.recipient); } struct CreateWithRangeParams { @@ -117,7 +117,7 @@ contract LockupLinearCreateHandler is BaseHandler { params.totalAmount = boundUint128(params.totalAmount, 1, 1_000_000_000e18); // We don't want to fuzz more than a certain number of streams. - if (_storage.lastStreamId() >= MAX_STREAM_COUNT) { + if (store.lastStreamId() >= MAX_STREAM_COUNT) { return; } @@ -144,6 +144,6 @@ contract LockupLinearCreateHandler is BaseHandler { }); // Store the stream id. - _storage.pushStreamId(streamId, params.sender, params.recipient); + store.pushStreamId(streamId, params.sender, params.recipient); } } diff --git a/test/invariant/handlers/LockupLinearHandler.t.sol b/test/invariant/handlers/LockupLinearHandler.t.sol index 5d1319131..a6cc29017 100644 --- a/test/invariant/handlers/LockupLinearHandler.t.sol +++ b/test/invariant/handlers/LockupLinearHandler.t.sol @@ -15,6 +15,6 @@ contract LockupLinearHandler is LockupHandler { constructor( IERC20 asset_, ISablierV2LockupLinear linear_, - LockupHandlerStorage _storage_ - ) LockupHandler(asset_, linear_, _storage_) {} + LockupHandlerStorage store_ + ) LockupHandler(asset_, linear_, store_) {} } diff --git a/test/invariant/handlers/LockupProCreateHandler.t.sol b/test/invariant/handlers/LockupProCreateHandler.t.sol index c43a6c9f8..bedbf02fb 100644 --- a/test/invariant/handlers/LockupProCreateHandler.t.sol +++ b/test/invariant/handlers/LockupProCreateHandler.t.sol @@ -27,7 +27,7 @@ contract LockupProCreateHandler is BaseHandler { //////////////////////////////////////////////////////////////////////////*/ IERC20 public asset; - LockupHandlerStorage public _storage; + LockupHandlerStorage public store; /*////////////////////////////////////////////////////////////////////////// CONSTRUCTOR @@ -37,12 +37,12 @@ contract LockupProCreateHandler is BaseHandler { IERC20 asset_, ISablierV2Comptroller comptroller_, ISablierV2LockupPro pro_, - LockupHandlerStorage _storage_ + LockupHandlerStorage store_ ) { asset = asset_; comptroller = comptroller_; pro = pro_; - _storage = _storage_; + store = store_; } /*////////////////////////////////////////////////////////////////////////// @@ -86,7 +86,7 @@ contract LockupProCreateHandler is BaseHandler { params.totalAmount = boundUint128(params.totalAmount, 1, 1_000_000_000e18); // We don't want to fuzz more than a certain number of streams. - if (_storage.lastStreamId() > MAX_STREAM_COUNT) { + if (store.lastStreamId() > MAX_STREAM_COUNT) { return; } @@ -129,7 +129,7 @@ contract LockupProCreateHandler is BaseHandler { }); // Store the stream id. - _storage.pushStreamId(vars.streamId, params.sender, params.recipient); + store.pushStreamId(vars.streamId, params.sender, params.recipient); } struct CreateWithMilestonesParams { @@ -156,7 +156,7 @@ contract LockupProCreateHandler is BaseHandler { params.totalAmount = boundUint128(params.totalAmount, 1, 1_000_000_000e18); // We don't want to fuzz more than a certain number of streams. - if (_storage.lastStreamId() >= MAX_STREAM_COUNT) { + if (store.lastStreamId() >= MAX_STREAM_COUNT) { return; } @@ -195,6 +195,6 @@ contract LockupProCreateHandler is BaseHandler { }); // Store the stream id. - _storage.pushStreamId(vars.streamId, params.sender, params.recipient); + store.pushStreamId(vars.streamId, params.sender, params.recipient); } } diff --git a/test/invariant/handlers/LockupProHandler.t.sol b/test/invariant/handlers/LockupProHandler.t.sol index af87ae353..797ce006c 100644 --- a/test/invariant/handlers/LockupProHandler.t.sol +++ b/test/invariant/handlers/LockupProHandler.t.sol @@ -15,6 +15,6 @@ contract LockupProHandler is LockupHandler { constructor( IERC20 asset_, ISablierV2LockupPro pro_, - LockupHandlerStorage _storage_ - ) LockupHandler(asset_, pro_, _storage_) {} + LockupHandlerStorage store_ + ) LockupHandler(asset_, pro_, store_) {} } diff --git a/test/invariant/lockup/Lockup.t.sol b/test/invariant/lockup/Lockup.t.sol index 952155264..509bae273 100644 --- a/test/invariant/lockup/Lockup.t.sol +++ b/test/invariant/lockup/Lockup.t.sol @@ -30,7 +30,7 @@ abstract contract Lockup_Invariant_Test is Invariant_Test { // Deploy the lockupHandlerStorage. lockupHandlerStorage = new LockupHandlerStorage(); - // Exclude the lockup handler store for being the `msg.sender`. + // Exclude the lockup handler store from being the `msg.sender`. excludeSender(address(lockupHandlerStorage)); } diff --git a/test/invariant/lockup/linear/Linear.t.sol b/test/invariant/lockup/linear/Linear.t.sol index 58d1bbc36..ae2b09dca 100644 --- a/test/invariant/lockup/linear/Linear.t.sol +++ b/test/invariant/lockup/linear/Linear.t.sol @@ -33,12 +33,12 @@ contract Linear_Invariant_Test is Lockup_Invariant_Test { linearHandler = new LockupLinearHandler({ asset_: DEFAULT_ASSET, linear_: linear, - _storage_: lockupHandlerStorage + store_: lockupHandlerStorage }); linearCreateHandler = new LockupLinearCreateHandler({ asset_: DEFAULT_ASSET, linear_: linear, - _storage_: lockupHandlerStorage + store_: lockupHandlerStorage }); // Cast the linear contract as {SablierV2Lockup} and the linear handler as {LockupHandler}. @@ -58,7 +58,7 @@ contract Linear_Invariant_Test is Lockup_Invariant_Test { targetContract(address(linearHandler)); targetContract(address(linearCreateHandler)); - // Exclude the linear handlers for being the `msg.sender`. + // Exclude the linear handlers from being the `msg.sender`. excludeSender(address(flashLoanHandler)); excludeSender(address(linearHandler)); excludeSender(address(linearCreateHandler)); diff --git a/test/invariant/lockup/pro/Pro.t.sol b/test/invariant/lockup/pro/Pro.t.sol index c347e08b6..243e232ad 100644 --- a/test/invariant/lockup/pro/Pro.t.sol +++ b/test/invariant/lockup/pro/Pro.t.sol @@ -30,12 +30,12 @@ contract Pro_Invariant_Test is Lockup_Invariant_Test { Lockup_Invariant_Test.setUp(); // Deploy the pro contract handlers. - proHandler = new LockupProHandler({ asset_: DEFAULT_ASSET, pro_: pro, _storage_: lockupHandlerStorage }); + proHandler = new LockupProHandler({ asset_: DEFAULT_ASSET, pro_: pro, store_: lockupHandlerStorage }); proCreateHandler = new LockupProCreateHandler({ asset_: DEFAULT_ASSET, comptroller_: comptroller, pro_: pro, - _storage_: lockupHandlerStorage + store_: lockupHandlerStorage }); // Cast the pro contract as {SablierV2Lockup} and the pro handler as {LockupHandler}. @@ -55,7 +55,7 @@ contract Pro_Invariant_Test is Lockup_Invariant_Test { targetContract(address(proHandler)); targetContract(address(proCreateHandler)); - // Exclude the pro handlers for being the `msg.sender`. + // Exclude the pro handlers from being the `msg.sender`. excludeSender(address(flashLoanHandler)); excludeSender(address(proHandler)); excludeSender(address(proCreateHandler));