RewardPool
Introduction
The RewardPool contract encapsulates the emission logic for MOR tokens across multiple reward buckets. It defines how MOR tokens are distributed over time using emission curves, serving as a shared utility that ensures controlled and sustainable token issuance within the protocol.
The contract supports multiple independent reward pools, each corresponding to a specific bucket — a category of protocol participants eligible to earn MOR rewards. These buckets include Capital, Provider, Builder, Compute, Code, and Protection.
It implements a linear interval-based emission decay model using the LinearDistributionIntervalDecrease library. The contract allows the protocol owner to register reward pools with distinct configurations and provides utilities to query reward amounts over time. Each reward pool has its own emission curve, with customizable payout start time, emission amount, and decay interval.
By isolating emission logic from staking and distribution, RewardPool enables independent upgrades and adjustments to token economics without affecting user balances or yield sources. This modular design helps ensure scalability, transparency, and long-term reward sustainability across the ecosystem.
Storage
rewardPools
The MOR reward pools data, where the pool #0 is a capital reward. pool. rewardPools[<rewardPool>]
RewardPool[] public rewardPools;
struct RewardPool {
uint128 payoutStart;
uint128 decreaseInterval;
uint256 initialReward;
uint256 rewardDecrease;
bool isPublic;
}payoutStart
The unix epoch timestamp in seconds when the pool starts to pay out rewards.
decreaseInterval
The interval in seconds between reward decreases.
initialReward
The initial MOR reward for the bucket. Wei.
rewardDecrease
The MOR reward decrease per decreaseInterval. Wei.
isPublic
true - for Capital bucket, false for others.
Write functions for the contract owner
RewardPool_init
Initializes the contract with a list of reward pool configurations.
poolsInfo_
Array of reward pool configs to initialize with.
addRewardPool
Adds a new reward pool to the registry. Only callable by the contract owner.
rewardPool_
Reward pool configuration with emission parameters.
Validation functions uses by protocol
onlyExistedRewardPool
Reverts if the specified reward pool does not exist.
index_
Index of the reward pool to verify.
onlyPublicRewardPool
Reverts if the specified reward pool is not public.
index_
Index of the reward pool to verify.
onlyNotPublicRewardPool
Reverts if the specified reward pool is public.
index_
Index of the reward pool to verify.
Read functions
getPeriodRewards
Calculates the total rewards to be distributed in a given time range using the pool’s emission curve.
index_
Index of the reward pool.
startTime_
Start of the time interval (Unix timestamp in seconds).
endTime_
End of the time interval (Unix timestamp in seconds).
isRewardPoolExist
Checks if a reward pool exists at a specific index.
index_
Index of the reward pool to check.
isRewardPoolPublic
Checks if a reward pool is marked as public.
index_
Index of the reward pool to query.
supportsInterface
Used for interface detection (ERC165). Returns true if the contract supports a specific interfaceId_. Supports IChainLinkDataConsumer, IERC165.
version
Returns the current version of the contract.
Last updated
Was this helpful?