creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/ClairLocking.sol": {
        "content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.24;\r\n\r\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\r\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\r\n\r\ncontract TokenLock is Ownable {\r\n    struct LockInfo {\r\n        uint256 amount;\r\n        uint256 releaseTime;\r\n    }\r\n\r\n    mapping(address => LockInfo) private clairTeamLocks;\r\n    mapping(address => LockInfo) private investorLocks;\r\n\r\n    IERC20 public token;\r\n    address public investorAddress;\r\n    address public clairTeamAddress;\r\n\r\n    event TokensLocked(address indexed recipient, uint256 amount, uint256 releaseTime);\r\n    event ClairTeamTokensReleased(address indexed recipient, uint256 amount);\r\n    event InvestorTokensReleased(address indexed recipient, uint256 amount);\r\n\r\n    modifier onlyClairTeam() {\r\n        require(msg.sender == clairTeamAddress, \"Only Clair team address allowed\");\r\n        _;\r\n    }\r\n\r\n    modifier onlyInvestor() {\r\n        require(msg.sender == investorAddress, \"Only investor address allowed\");\r\n        _;\r\n    }\r\n\r\n    constructor(address _tokenAddress, address _clairTeamAddress, address _investorAddress) Ownable(msg.sender) {\r\n        token = IERC20(_tokenAddress);\r\n        clairTeamAddress = _clairTeamAddress;\r\n        investorAddress = _investorAddress;\r\n    }\r\n\r\n    function lockForClairTeam(address _recipient, uint256 _amount) external onlyClairTeam() {\r\n        require(clairTeamLocks[_recipient].amount == 0, \"Tokens already locked for this address\");\r\n        require(_amount > 0, \"Amount must be greater than zero\");\r\n\r\n        uint256 _releaseTime = block.timestamp + 24 * 30 days;\r\n        clairTeamLocks[_recipient] = LockInfo(_amount, _releaseTime);\r\n        token.transferFrom(msg.sender, address(this), _amount);\r\n\r\n        emit TokensLocked(_recipient, _amount, _releaseTime);\r\n    }\r\n\r\n    function lockForInvestors(address _recipient, uint256 _amount) external onlyInvestor() {\r\n        require(investorLocks[_recipient].amount == 0, \"Tokens already locked for this address\");\r\n        require(_amount > 0, \"Amount must be greater than zero\");\r\n        uint256 _releaseTime = block.timestamp + 24 * 30 days;\r\n        investorLocks[_recipient] = LockInfo(_amount, _releaseTime);\r\n        token.transferFrom(msg.sender, address(this), _amount);\r\n\r\n        emit TokensLocked(_recipient, _amount, _releaseTime);\r\n    }\r\n\r\n    function releaseClairTeamTokens() external onlyClairTeam {\r\n        address recipient = msg.sender;\r\n        require(clairTeamLocks[recipient].amount > 0, \"No tokens locked for this address\");\r\n        require(block.timestamp >= clairTeamLocks[recipient].releaseTime, \"Release time not reached yet\");\r\n    \r\n        uint256 amount = clairTeamLocks[recipient].amount;\r\n        delete clairTeamLocks[recipient];\r\n        token.transfer(recipient, amount);\r\n        emit ClairTeamTokensReleased(recipient, amount);\r\n    }\r\n\r\n    function releaseInvestorTokens() external onlyInvestor {\r\n        address recipient = msg.sender;\r\n        require(investorLocks[recipient].amount > 0, \"No tokens locked for this address\");\r\n        require(block.timestamp >= investorLocks[recipient].releaseTime, \"Release time not reached yet\");\r\n\r\n        uint256 amount = investorLocks[recipient].amount;\r\n        delete investorLocks[recipient];\r\n        token.transfer(recipient, amount);\r\n        emit InvestorTokensReleased(recipient, amount);\r\n    }\r\n\r\n    function getClairTeamLock(address _recipient) external view returns (uint256 amount, uint256 releaseTime) {\r\n        return (clairTeamLocks[_recipient].amount, clairTeamLocks[_recipient].releaseTime);\r\n    }\r\n\r\n    function getInvestorLock(address _recipient) external view returns (uint256 amount, uint256 releaseTime) {\r\n        return (investorLocks[_recipient].amount, investorLocks[_recipient].releaseTime);\r\n    }\r\n}\r\n"
      },
      "@openzeppelin/contracts/access/Ownable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    constructor(address initialOwner) {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        _checkOwner();\n        _;\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"
      },
      "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /**\n     * @dev Returns the value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 value) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n     * caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n"
      },
      "@openzeppelin/contracts/utils/Context.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "abi"
          ]
        }
      },
      "remappings": [],
      "evmVersion": "istanbul"
    }
  }}