{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/Timelock.sol",
    "Parent Contracts": [
        "contracts/Permissions.sol",
        "lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol",
        "lib/openzeppelin-contracts/contracts/access/AccessControl.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol",
        "lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol",
        "lib/openzeppelin-contracts/contracts/access/IAccessControl.sol",
        "lib/openzeppelin-contracts/contracts/utils/Context.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract Timelock is Permissions {\n  bytes32 public immutable GOVERNOR_ROLE;\n\n  // The amount of delay after which a delay can a queued can be executed.\n  uint256 public delay = 2 days;\n  // The the period within which an queued proposal can be executed.\n  uint256 public gracePeriod = 7 days;\n\n  mapping(bytes32 => bool) public queuedTransactions;\n\n  event NewDelay(uint256 indexed newDelay_);\n  event NewGracePeriod(uint256 indexed newGracePerios_);\n  event NewGovernor(address newGovernor);\n  event CancelTransaction(\n    bytes32 indexed txHash_,\n    address indexed target_,\n    uint256 value_,\n    string signature_,\n    bytes data_,\n    uint256 eta_\n  );\n  event ExecuteTransaction(\n    bytes32 indexed txHash_,\n    address indexed target_,\n    uint256 value_,\n    string signature_,\n    bytes data_,\n    uint256 eta_\n  );\n  event QueueTransaction(\n    bytes32 indexed txHash_,\n    address indexed target_,\n    uint256 value_,\n    string signature_,\n    bytes data_,\n    uint256 eta_\n  );\n\n  address public governor;\n\n  constructor(address _governor, address _repository) {\n    require(_governor != address(0), \"Timelock: Governor addr(0)\");\n    GOVERNOR_ROLE = 0x7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55;\n    _initialSetup(_repository);\n    _setupRole(TIMELOCK_ROLE, address(this));\n    // setup GOVERNOR_ROLE\n    _setupRole(\n      0x7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55,\n      address(this)\n    );\n    _setupRole(\n      0x7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55,\n      _governor\n    );\n    _setRoleAdmin(\n      0x7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55,\n      TIMELOCK_ROLE\n    );\n\n    governor = _governor;\n  }\n\n  receive() external payable {}\n\n  /**\n   * @notice Sets the amount of time after which a proposal that has been queued can be executed.\n   */\n  function setDelay(uint256 _delay) external onlyTimelock {\n    require(\n      _delay >= 0 && _delay < gracePeriod,\n      \"Timelock::setDelay: Delay must not be greater equal to zero and less than gracePeriod\"\n    );\n    delay = _delay;\n\n    emit NewDelay(delay);\n  }\n\n  /**\n   * @notice Sets the amount of time within which a queued proposal can be executed.\n   */\n  function setGracePeriod(uint256 _gracePeriod)\n    external\n    onlyRoleMalt(GOVERNOR_ROLE, \"Must have timelock role\")\n  {\n    require(\n      _gracePeriod > delay,\n      \"Timelock::gracePeriod: Grace period must be greater than delay\"\n    );\n    gracePeriod = _gracePeriod;\n\n    emit NewGracePeriod(gracePeriod);\n  }\n\n  /**\n   * @notice Sets the governor address that is allowed to make proposals\n   */\n  function setGovernor(address _governor) external onlyTimelock {\n    _transferRole(_governor, governor, GOVERNOR_ROLE);\n    governor = _governor;\n    emit NewGovernor(_governor);\n  }\n\n  function queueTransaction(\n    address target,\n    uint256 value,\n    string memory signature,\n    bytes memory data,\n    uint256 eta\n  )\n    external\n    onlyRoleMalt(\n      GOVERNOR_ROLE,\n      \"Timelock::queueTransaction: Call must come from governor.\"\n    )\n    returns (bytes32)\n  {\n    require(\n      eta >= block.timestamp + delay,\n      \"Timelock::queueTransaction: Estimated execution block must satisfy delay.\"\n    );\n\n    require(_isContract(target), \"target not a contract\");\n\n    bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));\n    queuedTransactions[txHash] = true;\n\n    emit QueueTransaction(txHash, target, value, signature, data, eta);\n    return txHash;\n  }\n\n  function cancelTransaction(\n    address target,\n    uint256 value,\n    string memory signature,\n    bytes memory data,\n    uint256 eta\n  )\n    external\n    onlyRoleMalt(\n      GOVERNOR_ROLE,\n      \"Timelock::cancelTransaction: Call must come from governor.\"\n    )\n  {\n    bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));\n    queuedTransactions[txHash] = false;\n\n    emit CancelTransaction(txHash, target, value, signature, data, eta);\n  }\n\n  function executeTransaction(\n    address target,\n    uint256 value,\n    string memory signature,\n    bytes memory data,\n    uint256 eta\n  )\n    external\n    payable\n    onlyRoleMalt(\n      GOVERNOR_ROLE,\n      \"Timelock::executeTransaction: Call must come from governor.\"\n    )\n    returns (bytes memory)\n  {\n    bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));\n    require(\n      queuedTransactions[txHash],\n      \"Timelock::executeTransaction: Transaction hasn't been queued.\"\n    );\n    require(\n      block.timestamp >= eta,\n      \"Timelock::executeTransaction: Transaction hasn't surpassed time lock.\"\n    );\n    require(\n      block.timestamp <= eta + gracePeriod,\n      \"Timelock::executeTransaction: Transaction is stale.\"\n    );\n\n    require(_isContract(target), \"target not a contract\");\n\n    queuedTransactions[txHash] = false;\n\n    bytes memory callData;\n\n    if (bytes(signature).length == 0) {\n      callData = data;\n    } else {\n      callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data);\n    }\n\n    (bool success, bytes memory returnData) = target.call{value: value}(\n      callData\n    );\n\n    require(\n      success,\n      \"Timelock::executeTransaction: Transaction execution reverted.\"\n    );\n\n    emit ExecuteTransaction(txHash, target, value, signature, data, eta);\n\n    return returnData;\n  }\n\n  /**\n   * @notice Special modifier to allow call only by this contract.\n   */\n  modifier onlyTimelock() {\n    require(msg.sender == address(this), \"Call must come from timelock\");\n    _;\n  }\n\n  function _isContract(address addr) internal view returns (bool) {\n    uint256 size;\n    assembly {\n      size := extcodesize(addr)\n    }\n    return size > 0;\n  }\n}"
}