This library helps pack multiple boolean flags and lockup durations into a compact uint256 bitmask. It enables efficient storage and quick access to share manager configuration in vault systems.
Designed for the ShareManager component to control:
All data is packed into a single uint256 using bit-level encoding for optimal storage and gas efficiency.
| Bit Range | Purpose |
|---|---|
[0] |
hasMintPause (bool) |
[1] |
hasBurnPause (bool) |
[2] |
hasTransferPause (bool) |
[3] |
hasWhitelist (bool) |
[4] |
hasTransferWhitelist (bool) |
[5..36] |
globalLockup (uint32) |
[37..68] |
targetedLockup (uint32) |
hasMintPause(uint256 mask) → boolReturns true if minting is paused (bit 0 is set).
hasBurnPause(uint256 mask) → boolReturns true if burning is paused (bit 1 is set).
hasTransferPause(uint256 mask) → boolReturns true if transfers are paused (bit 2 is set).
hasWhitelist(uint256 mask) → boolReturns true if a deposit whitelist is enabled (bit 3 is set).
hasTransferWhitelist(uint256 mask) → boolReturns true if a transfer whitelist is enabled (bit 4 is set).
getGlobalLockup(uint256 mask) → uint32