LEEQUID
  • 👋 Welcome
  • Navigating LEEQUID
    • 🌱 Staking
      • The staking protocol
      • Matching stake to unstake requests
      • Potential wait times while staking
      • Deposited LYX lifecycle
      • Importing sLYX to your wallet
    • 🍇 Collecting rewards
      • Reward distribution in the LEEQUID protocol
      • Auto-compounding
      • Withdrawing rewards
      • Reward calculation in Proof of Stake
    • 🍂 Exiting the protocol
      • Option 1: swapping sLYX for LYX
      • Option 2: unstaking through the staking pool
      • Matching unstake to stake requests
      • Potential wait times while unstaking
    • 🍷 Claiming
      • Claim queued stake
      • Claim unstaked LYX
      • Claim rewards
    • 🔄 Swapping
      • LYX for sLYX: An instant alternative to staking
      • sLYX for LYX: an instant alternative to exiting
      • Providing liquidty
      • Providing Liquidity: a practical example
  • LEEQUID in depth
    • 🔐 Protocol security and risks
      • Security overview
      • Smart contract code correctness
      • Slashing and unexpected validator behaviour
      • sLYX token: economic balance
      • Validator key management
    • 📃 Smart contracts
      • Oracles
      • Merkle Distributor
      • Rewards
      • Pool
      • StakedLyxToken
      • FeesEscrow
    • 💧 The sLYX token
      • Acquiring sLYX
      • 1:1 ratio with LYX
      • Potential unpeg of sLYX from LYX
    • 💦 The liquidity pool (DEX)
      • Implementation
  • Incident Response
    • Contacts
    • Vulnerability Disclosure Policy
Powered by GitBook
On this page
  1. LEEQUID in depth
  2. 📃 Smart contracts

Merkle Distributor

0x555D2044145280397Ef298205048d3a3eA784abc

The MerkleDistributor smart contract is part of a liquid staking application, designed to distribute rewards based on off-chain calculations to users who have contributed their sLYX tokens to liquidity pools like the LEEQUID swap.

This contract is beneficial in situations where rewards cannot be directly given to liquidity providers, since liquidity pools are addresses with disabled rewards. Instead, the rewards are calculated off-chain and distributed using a Merkle tree.

This contract plays a crucial role in the rewards distribution system, enabling a secure, transparent and efficient mechanism for distributing rewards to liquidity providers.

Key features

Merkle root management

This contract maintains a Merkle Root (merkleRoot) that helps in proving rewards ownership. This can be updated by the oracle through setMerkleRoot function.

Claim mechanism

Users can claim their rewards through the claim function by providing the Merkle proof. The function verifies the proof and distributes the reward if the proof is valid.

Periodic distribution

The contract allows periodic distribution of tokens through the distributePeriodically function. The distribution period is defined in terms of block numbers.

One-time distribution

For one-off distributions, the distributeOneTime function is used. It transfers tokens to the contract and triggers a one-time distribution event.

Claim status

It provides the isClaimed function to check if a particular reward has been claimed or not.

Upgradeability

The contract allows updating the Oracles addresses. This operation can be done only when the contract is paused and only by the admin, as ensured by the upgrade function.

Pausing

The contract inherits from OwnablePausableUpgradeable, which allows the admin to pause the contract in case of anomalies. Certain functions like upgrade, distributePeriodically, distributeOneTime, and claim are affected by the pause status of the contract.

Auditable events

The contract emits specific events like MerkleRootUpdated, PeriodicDistributionAdded, OneTimeDistributionAdded, and Claimed to keep a transparent and verifiable record of significant actions.

Last updated 1 year ago