// SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.0; interface IStakedTokenV2 { struct CooldownSnapshot { uint40 timestamp; uint216 amount; } event RewardsAccrued(address user, uint256 amount); event RewardsClaimed( address indexed from, address indexed to, uint256 amount ); event Cooldown(address indexed user, uint256 amount); /** * @dev Allows staking a specified amount of STAKED_TOKEN * @param to The address to receiving the shares * @param amount The amount of assets to be staked */ function stake(address to, uint256 amount) external; /** * @dev Redeems shares, and stop earning rewards * @param to Address to redeem to * @param amount Amount of shares to redeem */ function redeem(address to, uint256 amount) external; /** * @dev Activates the cooldown period to unstake * - It can't be called if the user is not staking */ function cooldown() external; /** * @dev Claims an `amount` of `REWARD_TOKEN` to the address `to` * @param to Address to send the claimed rewards * @param amount Amount to stake */ function claimRewards(address to, uint256 amount) external; /** * @dev Return the total rewards pending to claim by an staker * @param staker The staker address * @return The rewards */ function getTotalRewardsBalance(address staker) external view returns (uint256); /** * @dev implements the permit function as for https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md * @param owner the owner of the funds * @param spender the spender * @param value the amount * @param deadline the deadline timestamp, type(uint256).max for no deadline * @param v signature param * @param s signature param * @param r signature param */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; }