Claim

The claim function allows a user to claim their accumulated MOR rewards from a reward pool. This function is typically called after a lock period has expired or when the user wants to realize pending rewards. The caller claims their rewards, and the minted MOR tokens are sent to the specified receiver address on L2.

Before transferring any rewards, the contract enforces next conditions:

  • The minimum claim lock period since the last stake must have passed.

  • The minimum interval since the last claim must have passed.

  • The custom claim lock (set via claimLockEnd) must have expired.

If all conditions are met, the contract calculates the latest reward amount based on the user’s virtual deposit and the difference in the reward coefficient. The claim updates the user’s multiplier.

Finally, the sendMintMessage function is called on the Distributor to initiate MOR minting to the receiver.

No deposit tokens are moved during the claim. Only MOR tokens are minted cross-chain (via LayerZero) to the user’s address on the destination chain.

ClaimFor

The claimFor function allows another address to claim rewards on behalf of a user. This supports use cases like automated agents, wallets, or third-party services claiming on users’ behalf.

The contract verifies one of the following:

  • The staker has explicitly whitelisted the msg.sender via setClaimSender.

  • Or, the staker has assigned a fixed claimReceiver address via setClaimReceiver— in that case, receiver is overridden with the preconfigured address.

The rest of the logic mirrors the claim function.

Last updated

Was this helpful?