In TODO Comment states to use tight packing but time is not truncated so truncate time to uint64
to prevent stack too deep as comment states. 3 storage slots will be saved. uint64 is more than enough to hold any realistic time.
Although here there is not gas saving rewards but here comment explicilty states as TODO to prevent stack-too-deep. So this mistake can be considered at least low.
struct SwanMarketParameters {
/// @notice The interval at which the buyerAgent can withdraw the funds.
- uint256 withdrawInterval;
+ uint64 withdrawInterval;
/// @notice The interval at which the creators can mint assets.
- uint256 sellInterval;
+ uint64 sellInterval;
/// @notice The interval at which the buyers can buy the assets.
- uint256 buyInterval;
+ uint64 buyInterval;
+ /// @notice Timestamp of the block that this market parameter was added.
+ /// @dev Even if this is provided by the user, it will get overwritten by the internal `block.timestamp`.
+ uint64 timestamp;
/// @notice A fee percentage taken from each listing's buyer fee.
uint256 platformFee;
/// @notice The maximum number of assets that can be listed per round.
uint256 maxAssetCount;
- /// @notice Timestamp of the block that this market parameter was added.
- /// @dev Even if this is provided by the user, it will get overwritten by the internal `block.timestamp`.
- uint256 timestamp;
}