creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "pluri_faucet (1).sol": {
        "content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.25;\r\n\r\n/// @title Interface for the PluriStaking contract.\r\ninterface IPluriStaking {\r\n    /// @notice Called to trigger the auto minting of rewards in the PluriStaking contract.\r\n    /// @param minter Address which will receive the minted tokens.\r\n    /// @return True if auto minting is successful.\r\n    function autoMint(address minter) external returns (bool);\r\n}\r\n\r\n/// @title PluriFaucet\r\n/// @notice Manages the cooldown period for reward distribution in the Pluri token ecosystem.\r\ncontract PluriFaucet {\r\n    // Interface to interact with the PluriStaking contract.\r\n    IPluriStaking private pluriStaking;\r\n\r\n    // Address of the PluriStaking contract.\r\n    address public pluriStakingAddress;\r\n\r\n    // Mapping to track the last time an address called the autoMint function.\r\n    mapping(address => uint256) public lastAccessTime;\r\n\r\n    // Cooldown period for calling autoMint. Set to 1 day.\r\n    uint256 public constant COOLDOWN_PERIOD = 1 days;\r\n\r\n    /// @notice Constructs the PluriFaucet contract.\r\n    /// @param _pluriStakingAddress Address of the PluriStaking contract.\r\n    constructor(address _pluriStakingAddress) {\r\n        pluriStakingAddress = _pluriStakingAddress;\r\n        pluriStaking = IPluriStaking(_pluriStakingAddress);\r\n    }\r\n\r\n    /// @notice Allows an address to call the autoMint function, subject to a cooldown period.\r\n    /// @dev Ensures that each address can only trigger autoMint once every cooldown period.\r\n    /// @param addressToMint Address which will receive the minted tokens.\r\n    function callAutoMint(address addressToMint) external returns (bool) {\r\n        require(addressToMint != address(0), \"Pluri Error: Address cannot be 0\");\r\n        require(block.timestamp >= lastAccessTime[msg.sender] + COOLDOWN_PERIOD, \"Pluri Error: 24 Hour cooldown period not yet elapsed\");\r\n        require(pluriStaking.autoMint(addressToMint), \"Pluri Error: Auto minting failed\");\r\n        lastAccessTime[msg.sender] = block.timestamp;\r\n        return true;\r\n    }\r\n}\r\n"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": false,
        "runs": 200
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}