// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title SOMA Token Rewards Contract. * @author SOMA.finance * @notice Interface for the {TokenRewards} contract. */ interface ITokenRewards { /** * @notice Emitted when an account claims tokens. * @param amount The amount of tokens claimed. * @param caller The address of the message sender that triggered the event. */ event Claimed(uint256 amount, address caller); /** * @notice Emitted when the vesting period timestamps are updated. * @param startTime The timestamp marking the start of the vesting period. * @param endTime The timestamp marking the end of the vesting period. * @param caller The address of the message sender that triggered the event. */ event UpdatedTimestamps(uint256 startTime, uint256 endTime, address caller); /** * @notice Emitted when rewards are deposited. * @param amount The amount of reward tokens deposited. * @param caller The address of the message sender that triggered the event. */ event RewardsDeposited(uint256 amount, address caller); /** * @notice Emitted when tokens are seized. * @param amount The amount of reward tokens deposited. * @param seizeTo The address that receives seized tokens. * @param caller The address of the message sender that triggered the event. */ event Seized(uint256 amount, address seizeTo, address caller); /** * @notice Returns the Token Rewards GLOBAL_ADMIN_ROLE. * @dev Equivalent to `keccak256("TokenRewards.ADMIN_ROLE")`. */ function GLOBAL_ADMIN_ROLE() external view returns (bytes32); /** * @notice Returns the Token Rewards GLOBAL_SEIZE_ROLE. * @dev Equivalent to `keccak256("TokenRewards.SEIZE_ROLE")`. */ function GLOBAL_SEIZE_ROLE() external view returns (bytes32); /** * @notice Returns the Token Rewards LOCAL_ADMIN_ROLE. */ function LOCAL_ADMIN_ROLE() external returns (bytes32); /** * @notice Returns the Token Rewards LOCAL_SEIZE_ROLE. */ function LOCAL_SEIZE_ROLE() external returns (bytes32); /** * @notice Updates the timestamps of the vesting period. * @param _startTime The new timestamp marking the start of the vesting period. * @param _endTime The new timestamp marking the end of the vesting period. * @custom:emits UpdatedTimestamps * @custom:requirement The `_startTime` must be less than the `_endTime`. */ function updateTime(uint256 _startTime, uint256 _endTime) external; /** * @notice Returns the timestamp marking the start of the vesting period. */ function startTime() external view returns (uint256); /** * @notice Returns the timestamp marking the end of the vesting period. */ function endTime() external view returns (uint256); /** * @notice Returns the address of the reward token. */ function rewardToken() external view returns (IERC20); /** * @notice Returns an account's claimed amount, denominated in the reward token. * @param user The account to return the claimed balance of. * @return The claimed amount of the account. */ function claimedAmount(address user) external view returns (uint256); /** * @notice Returns the reward token balance of the contract. */ function rewardTokenBalance() external view returns (uint256); /** * @notice Returns the duration of the vesting period in seconds. * @dev Returns `endTime` - `startTime`. */ function duration() external view returns (uint256); /** * @notice Seizes the reward tokens. * @custom:emits Seized * @custom:requirement The function caller must have the GLOBAL_SEIZE_ROLE or LOCAL_SEIZE_ROLE. */ function seize() external; /** * @notice Claims the reward tokens. * @param _proof The merkle proof used to verify the claimable rewards of the account. * @param _amount The amount of tokens to claim. * @custom:emits Claimed * @custom:requirement The SOMA contracts must not be paused. * @custom:requirement `_amount` must be greater than zero. * @custom:requirement The proof must be valid within the merkle tree. * @custom:requirement The claimable rewards balance for the account must be greater than zero. * @return Boolean indicating if the transaction was successful. */ function claim(bytes32[] calldata _proof, uint256 _amount) external returns (bool); /** * @notice Returns the claimable balance of an account. * @param amount The total allocation of reward tokens for the account. * @param user The account to return the claimable rewards balance of. * @return The claimable balance of the account. */ function claimableRewards(uint256 amount, address user) external view returns (uint256); }