Skip to content

Commit

Permalink
Merge headers (#803)
Browse files Browse the repository at this point in the history
* style: merge storage and constants to state headers

* style: declare first the immutable variables
  • Loading branch information
andreivladbrg authored Jan 29, 2024
1 parent ea6f097 commit b5b884d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/SablierV2Comptroller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contract SablierV2Comptroller is
Adminable // 1 inherited component
{
/*//////////////////////////////////////////////////////////////////////////
PUBLIC STORAGE
STATE VARIABLES
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2Comptroller
Expand Down
6 changes: 1 addition & 5 deletions src/SablierV2LockupDynamic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,12 @@ contract SablierV2LockupDynamic is
using SafeERC20 for IERC20;

/*//////////////////////////////////////////////////////////////////////////
PUBLIC CONSTANTS
STATE VARIABLES
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2LockupDynamic
uint256 public immutable override MAX_SEGMENT_COUNT;

/*//////////////////////////////////////////////////////////////////////////
PRIVATE STORAGE
//////////////////////////////////////////////////////////////////////////*/

/// @dev Sablier V2 Lockup Dynamic streams mapped by unsigned integer ids.
mapping(uint256 id => LockupDynamic.Stream stream) private _streams;

Expand Down
2 changes: 1 addition & 1 deletion src/SablierV2LockupLinear.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract SablierV2LockupLinear is
using SafeERC20 for IERC20;

/*//////////////////////////////////////////////////////////////////////////
PRIVATE STORAGE
STATE VARIABLES
//////////////////////////////////////////////////////////////////////////*/

/// @dev Sablier V2 Lockup Linear streams mapped by unsigned integers.
Expand Down
2 changes: 1 addition & 1 deletion src/abstracts/Adminable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Errors } from "../libraries/Errors.sol";
/// @notice See the documentation in {IAdminable}.
abstract contract Adminable is IAdminable {
/*//////////////////////////////////////////////////////////////////////////
STORAGE
STATE VARIABLES
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc IAdminable
Expand Down
6 changes: 1 addition & 5 deletions src/abstracts/SablierV2Base.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ abstract contract SablierV2Base is
using SafeERC20 for IERC20;

/*//////////////////////////////////////////////////////////////////////////
PUBLIC CONSTANTS
STATE VARIABLES
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2Base
UD60x18 public constant override MAX_FEE = UD60x18.wrap(0.1e18);

/*//////////////////////////////////////////////////////////////////////////
PUBLIC STORAGE
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2Base
ISablierV2Comptroller public override comptroller;

Expand Down
2 changes: 1 addition & 1 deletion src/abstracts/SablierV2Lockup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract contract SablierV2Lockup is
ERC721 // 6 inherited components
{
/*//////////////////////////////////////////////////////////////////////////
USER-FACING STORAGE
STATE VARIABLES
//////////////////////////////////////////////////////////////////////////*/

/// @inheritdoc ISablierV2Lockup
Expand Down
7 changes: 1 addition & 6 deletions test/fork/Fork.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ import { Base_Test } from "../Base.t.sol";
/// @notice Common logic needed by all fork tests.
abstract contract Fork_Test is Base_Test {
/*//////////////////////////////////////////////////////////////////////////
CONSTANTS
STATE VARIABLES
//////////////////////////////////////////////////////////////////////////*/

IERC20 internal immutable ASSET;
address internal immutable HOLDER;

/*//////////////////////////////////////////////////////////////////////////
VARIABLES
//////////////////////////////////////////////////////////////////////////*/

uint256 internal initialHolderBalance;

/*//////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 1 addition & 5 deletions test/invariant/handlers/BaseHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { TimestampStore } from "../stores/TimestampStore.sol";
/// @notice Base contract with common logic needed by all handler contracts.
abstract contract BaseHandler is Constants, Fuzzers, StdCheats {
/*//////////////////////////////////////////////////////////////////////////
CONSTANTS
STATE-VARIABLES
//////////////////////////////////////////////////////////////////////////*/

/// @dev Maximum number of streams that can be created during an invariant campaign.
Expand All @@ -21,10 +21,6 @@ abstract contract BaseHandler is Constants, Fuzzers, StdCheats {
/// @dev The virtual address of the Foundry VM.
address internal constant VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code"))));

/*//////////////////////////////////////////////////////////////////////////
VARIABLES
//////////////////////////////////////////////////////////////////////////*/

/// @dev Maps function names to the number of times they have been called.
mapping(string func => uint256 calls) public calls;

Expand Down
6 changes: 1 addition & 5 deletions test/utils/Defaults.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Users } from "./Types.sol";
/// @notice Contract with default values used throughout the tests.
contract Defaults is Constants {
/*//////////////////////////////////////////////////////////////////////////
CONSTANTS
STATE VARIABLES
//////////////////////////////////////////////////////////////////////////*/

UD60x18 public constant BROKER_FEE = UD60x18.wrap(0.003e18); // 0.3%
Expand All @@ -35,10 +35,6 @@ contract Defaults is Constants {
uint128 public constant WITHDRAW_AMOUNT = 2600e18;
uint40 public immutable WARP_26_PERCENT; // 26% of the way through the stream

/*//////////////////////////////////////////////////////////////////////////
VARIABLES
//////////////////////////////////////////////////////////////////////////*/

IERC20 private asset;
Users private users;

Expand Down

0 comments on commit b5b884d

Please sign in to comment.