Treasury

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/**
 * @title ITreasury
 * @dev Interface for the treasury of a decentralized finance (DeFi) system.
 * This treasury interface manages deposits, withdrawals, and can interact with
 * various investment protocols to generate yield.
 */
interface ITreasury {
    /// @notice Emitted when funds are deposited via fallback or receive function.
    /// @param sender The address of the sender who deposited the funds.
    /// @param amount The amount of funds deposited.
    event FundsReceived(address indexed sender, uint256 amount);

    /**
     * @dev Emitted when funds are withdrawn from the treasury.
     * @param recipient The address receiving the withdrawal.
     * @param amount The amount of funds withdrawn.
     * @param timestamp The time at which the withdrawal occurred.
     */
    event FundsWithdrawn(address indexed recipient, uint256 amount, uint256 timestamp);

    /**
     * @notice Withdraws funds from the treasury.
     * @dev Allows an authorized entity to withdraw funds from the treasury. This function
     * should include access controls to prevent unauthorized withdrawals.
     * @param recipient The address to receive the withdrawn funds.
     * @param amount The amount of funds to withdraw.
     */
    function withdraw(address recipient, uint256 amount) external;

    /**
     * @notice Returns the balance of the treasury.
     * @dev Provides the current balance of funds held by the treasury. This balance
     * might be in the form of native cryptocurrency or ERC20 tokens.
     * @return The current balance of the treasury.
     */
    function getBalance() external view returns (uint256);
}

Last updated