USUAL* Vested Allocation Staking
Last updated
Last updated
The UsualSP contract is a smart contract designed for managing the vesting and staking of USUALS token allocations. It allows insiders to vest and claim their USUALS allocations over a pre-defined vesting period and provides users (both insiders and outsiders) the ability to stake USUALS tokens to receive yield in the form of liquid allocations and rewards in USUAL tokens. Insiders can claim their vested USUALS allocations after a user-specific cliff period (multiple of the ONE_MONTH constant), and these tokens are distributed in monthly increments.
RewardAccrualBase: Base contract that handles the reward accrual mechanism for staked tokens.
PausableUpgradeable: Allows contract functionality to be paused by authorized accounts (OZ implementation).
ReentrancyGuardUpgradeable: Prevents reentrant attacks on sensitive functions (OZ implementation).
IUsualSP: Interface defining the required methods for the UsualSP contract.
Vesting: Insiders receive an initial USUALS allocation that is vested over a defined period. This allocation is released gradually, with insiders able to claim it from their start time and after their cliff period has passed.
Claiming USUALS Allocations: Insiders can claim their vested USUALS after the cliff period is over. The claimable amount is calculated based on the duration passed since the vesting started.
Staking: Users (including insiders) can stake their USUALS tokens to receive liquid allocations and rewards in USUAL tokens. These rewards accrue over time and can be claimed.
Reward Accrual: Users who stake USUALS tokens are eligible for rewards in USUAL tokens based on the staking duration and amount.
Pause and Unpause: Admins with specific role have the ability to pause and unpause the contract to safeguard against attacks or during upgrades.
initialize: Initializes the contract by setting the registry contract, vesting start date, and duration.
claimOriginalAllocation: Allows insiders to claim their vested USUALS allocations.
stake: Users can stake their USUALS tokens to receive liquid allocations.
unstake: Users can withdraw a portion of their staked USUALS tokens.
claimReward: Users can claim their accrued rewards in USUAL tokens based on their allocation.
pause: Pauses all token transfer operations; callable only by the PAUSING_CONTRACTS_ROLE.
unpause: Resumes all token transfer operations; also callable only by the DEFAULT_ADMIN_ROLE.
allocate: Function to allocate original USUALS allocations and set the vesting start times and cliff durations for insiders. Only callable by the USUALSP_OPERATOR_ROLE.
stakeUsualS: Sends the total supply of USUALS to the staking contract. Only callable by the USUALS contract.
removeOriginalAllocation: Function to remove the original allocation and claimed amounts for a list of recipients. Only callable by the USUALSP_OPERATOR_ROLE.
startRewardDistribution: Initiates the reward distribution process. Only callable by the Distribution Module contract.
CONTRACT_REGISTRY_ACCESS: Registry access contract address.
DEFAULT_ADMIN_ROLE: Default admin role. Can unpause the contract.
PAUSING_CONTRACTS_ROLE: Role required to pause the contract.
USUALSP_OPERATOR_ROLE: Role required for allocation management and staking operations.
CONTRACT_USUALS: The address of the USUALS token contract.
CONTRACT_USUAL: The address of the USUAL token contract.
CONTRACT_DISTRIBUTION_MODULE: The address of the Distribution Module contract.
ONE_MONTH: Represents the duration of one month in seconds, used to calculate the vesting schedule.
NUMBER_OF_MONTHS_IN_THREE_YEARS: Used to calculate the total vesting duration over three years.
STARTDATE_USUAL_CLAIMING_USUALSP: The start date of the Usual claiming.
Pausability: Ensures that token transfers can be halted in case of emergency.
Role-Based Access Control: Restricts sensitive actions to addresses with appropriate roles.
ReentrancyGuard: All external-facing functions that handle transfers or state changes are protected from reentrancy attacks.