{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/gmp-sdk/util/TimeLock.sol",
    "Parent Contracts": [
        "contracts/gmp-sdk/interfaces/ITimeLock.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [
        "keccak256(bytes)"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract TimeLock is ITimeLock {\n    bytes32 internal constant PREFIX_TIME_LOCK = keccak256('time-lock');\n\n    uint256 internal immutable _minimumTimeLockDelay;\n\n    /**\n     * @notice The constructor for the TimeLock.\n     * @param minimumTimeDelay The minimum time delay (in secs) that must pass for the TimeLock to be executed\n     */\n    constructor(uint256 minimumTimeDelay) {\n        _minimumTimeLockDelay = minimumTimeDelay;\n    }\n\n    /**\n     * @notice Returns a minimum time delay at which the TimeLock may be scheduled.\n     * @return uint Minimum scheduling delay time (in secs) from the current block timestamp\n     */\n    function minimumTimeLockDelay() external view override returns (uint256) {\n        return _minimumTimeLockDelay;\n    }\n\n    /**\n     * @notice Returns the timestamp after which the TimeLock may be executed.\n     * @param hash The hash of the timelock\n     * @return uint The timestamp after which the timelock with the given hash can be executed\n     */\n    function getTimeLock(bytes32 hash) external view override returns (uint256) {\n        return _getTimeLockEta(hash);\n    }\n\n    /**\n     * @notice Schedules a new timelock.\n     * @dev The timestamp will be set to the current block timestamp + minimum time delay,\n     * if the provided timestamp is less than that.\n     * @param hash The hash of the new timelock\n     * @param eta The proposed Unix timestamp (in secs) after which the new timelock can be executed\n     * @return uint The Unix timestamp (in secs) after which the new timelock can be executed\n     */\n    function _scheduleTimeLock(bytes32 hash, uint256 eta) internal returns (uint256) {\n        if (hash == 0) revert InvalidTimeLockHash();\n        if (_getTimeLockEta(hash) != 0) revert TimeLockAlreadyScheduled();\n\n        uint256 minimumEta = block.timestamp + _minimumTimeLockDelay;\n\n        if (eta < minimumEta) eta = minimumEta;\n\n        _setTimeLockEta(hash, eta);\n\n        return eta;\n    }\n\n    /**\n     * @notice Cancels an existing timelock by setting its eta to zero.\n     * @param hash The hash of the timelock to cancel\n     */\n    function _cancelTimeLock(bytes32 hash) internal {\n        if (hash == 0) revert InvalidTimeLockHash();\n\n        _setTimeLockEta(hash, 0);\n    }\n\n    /**\n     * @notice Finalizes an existing timelock and sets its eta back to zero.\n     * @dev To finalize, the timelock must currently exist and the required time delay\n     * must have passed.\n     * @param hash The hash of the timelock to finalize\n     */\n    function _finalizeTimeLock(bytes32 hash) internal {\n        uint256 eta = _getTimeLockEta(hash);\n\n        if (hash == 0 || eta == 0) revert InvalidTimeLockHash();\n\n        if (block.timestamp < eta) revert TimeLockNotReady();\n\n        _setTimeLockEta(hash, 0);\n    }\n\n    /**\n     * @dev Returns the timestamp after which the timelock with the given hash can be executed.\n     */\n    function _getTimeLockEta(bytes32 hash) internal view returns (uint256 eta) {\n        bytes32 key = keccak256(abi.encodePacked(PREFIX_TIME_LOCK, hash));\n\n        assembly {\n            eta := sload(key)\n        }\n    }\n\n    /**\n     * @dev Sets a new timestamp for the timelock with the given hash.\n     */\n    function _setTimeLockEta(bytes32 hash, uint256 eta) private {\n        bytes32 key = keccak256(abi.encodePacked(PREFIX_TIME_LOCK, hash));\n\n        assembly {\n            sstore(key, eta)\n        }\n    }\n}"
}