Distribution V4
DistributionV4.sol
is the core contract of the Techno Capital Machine. It allows Capital Providers to stake stETH (Lido Staked ETH) on Ethereum and claim MOR rewards to Arbitrum.
DistributionV4
utilizes L1Sender
to bridge stETH yield and relay MOR claims to Arbitrum. LinearDistributionIntervalDecrease
is used to calculate pool rewards.
This contract is also used to track other MOR emissions through private pools. For instance, pool 1
is a private pool used to track Code emissions, where deposit "amounts" correspond to weights.
Version history
The V3 version of the contract introduces the ability to lock MOR emissions for a chosen period of time. During this period, emissions cannot be claimed; however a multiplier of up to 10.7x is applied.
The V4 version of the contract introduces two new lock periods claimLockPeriodAfterClaim
and claimLockPeriodAfterStake
for each pool. Initially, these are set to 90 days for the capital pool (pool 0
) and 0 for all other pools. During this period after claiming or staking, emissions are locked and cannot be claimed.
Public Variables
Functions
stake
Allows users to stake the deposit token (stETH) in a public pool.
Parameters
lockClaim
Locks the user's claim for a specified period, during which a multiplier is applied. This incentivizes users to delay claiming emissions for higher returns.
Parameters
claim
Enables users to claim their MOR rewards from a specific pool. After verifying claims internally, minting instructions are sent to L2MessageReceiver
on Arbitrum via L1Sender
.
Rewards can only be claimed after the claimLockPeriod
.
Parameters
withdraw
Allows users to withdraw their staked tokens from a public pool.
Withdrawals can only be made after the withdrawLockPeriod
and withdrawLockPeriodAfterStake
.
Parameters
getCurrentUserReward
Calculates and returns the current unclaimed reward amount for a user in a specified pool.
Parameters
Return Values
Distribution_init
Initializes the contract with the deposit token (stETH) address, L1Sender
address, and initial pools.
Parameters
createPool
Creates a new pool based on the provided pool configuration. This function can only be called by the owner of the contract.
Parameters
editPool
Edits an existing pool's configuration. This function can only be called by the owner of the contract.
Parameters
getPeriodReward
Calculates the reward for a specified pool and period. Uses the LinearDistributionIntervalDecrease
library.
Parameters
Return Values
getClaimLockPeriodMultiplier
Calculates the multiplier based on the duration between the start and end of the claim lock period. This multiplier is applied to the user’s stake (or weights) for emissions calculations.
Parameters
Return Values
getCurrentUserMultiplier
Returns the current reward multiplier for a user based on their claim lock period.
Parameters
Return Values
manageUsersInPrivatePool
Manages user stakes in a private pool used for non-Capital emissions by adjusting their deposited "amounts" based on a specified array. This function can only be called by the owner of the contract.
In the case of Code emissions (e.g. pool 1
), amounts correspond to weights.
Parameters
overplus
Calculates the amount of surplus deposit tokens (stETH yield) in the contract that are not deposited in any pools. These tokens can be bridged to Arbitrum to provision Protocol-Owned Liquidity.
Return Values
bridgeOverplus
Bridges surplus deposit tokens (stETH yield) to Arbitrum via L1Sender
. This function can only be called by the owner of the contract.
Parameters
Return Values
Events
PoolCreated
Emitted when a new pool is created.
Parameters
PoolEdited
Emitted when an existing pool's configuration is edited.
Parameters
UserStaked
Emitted when a user stakes tokens in a pool.
Parameters
UserClaimed
Emitted when a user claims rewards from a pool.
Parameters
UserWithdrawn
Emitted when a user withdraws from a pool.
OverplusBridged
Emitted when surplus deposit tokens are bridged to Arbitrum.
Parameters
Structs
Pool
Configuration data for a pool, including reward distribution schedules and lock periods.
Also see LinearDistributionIntervalDecrease
.
Fields
PoolData
Fields
UserData
Fields
Last updated
Was this helpful?