Forta Staking Utils
FortaStakingUtils
subjectToActive
function subjectToActive(uint8 subjectType, uint256 subject) internal pure returns (uint256)
Encode "active" and subjectType in subject by hashing them together, shifting left 9 bits,
setting bit 9 (to mark as active) and masking subjectType in
subjectToInactive
function subjectToInactive(uint8 subjectType, uint256 subject) internal pure returns (uint256)
Encode "inactive" and subjectType in subject by hashing them together, shifting left 9 bits,
letting bit 9 unset (to mark as inactive) and masking subjectType in.
activeToInactive
function activeToInactive(uint256 activeSharesId) internal pure returns (uint256)
Unsets bit 9 of an activeSharesId to mark as inactive
inactiveToActive
function inactiveToActive(uint256 inactiveSharesId) internal pure returns (uint256)
Sets bit 9 of an inactiveSharesId to mark as inactive
isActive
function isActive(uint256 sharesId) internal pure returns (bool)
Checks if shares id is active
subjectTypeOfShares
function subjectTypeOfShares(uint256 sharesId) internal pure returns (uint8)
Extracts subject type encoded in shares id