PepeX
  • ⚙️ PepeX
    • DEX: PepeX 🚀
    • PepeX Listing Process
  • WOJAK - PEPE - CHAD
    • Introduction
      • Token Overview
    • Wojak.farm (WOJAK)
    • Pepe (PEPE)
      • Understanding the Pepe Smart Contract
      • How are Pepe minted? Staking and Rewards System Staking:
      • Tax Mechanism and Oracle Integration
      • Contract Governance
      • Inflation: Long-Term Sustainability
      • The PEPE getReward Function: A Key Mechanism
    • Chad (CHAD)
      • Tokenomics
      • burnChadforEth
      • Fixed Supply + Ownership Renounced
  • Official links and information
    • Links
    • Contract Addresses (ETH)
  • Guides
    • Developer Contribution Guide
    • How to bridge Pepe: ETHEREUM -> BASE
Powered by GitBook
On this page

Was this helpful?

  1. WOJAK - PEPE - CHAD
  2. Pepe (PEPE)

The PEPE getReward Function: A Key Mechanism

PreviousInflation: Long-Term SustainabilityNextChad (CHAD)

Last updated 1 year ago

Was this helpful?

Central to this ecosystem is the getReward function, a critical mechanism for rewarding user participation.

Code for the getReward Function
  • Updating Staking Rewards: Initially, the function updates the staking rewards for the user (msg.sender), ensuring that each participant’s contribution is accurately reflected.

  • RewardValidation: It checks the user’s staked balance to confirm if there are sufficient rewards to claim the requested amount, maintaining the integrity of the reward system.

  • Oracle Consultation: The Oracle is then consulted to ascertain the current value of PEPE tokens in ETH. This step is vital for calculating the rewards in ETH equivalent.

  • TaxCalculation and Verification: The function calculates the ETH tax based on the Oracle’s valuation and verifies that the user has provided enough ETH to cover this tax.

  • Token Minting and Tax Transfer: Following successful verification, PEPE tokens are minted for the user, and the ETH tax is transferred to the Chad contract.

  • Refunding Overpayment: If the user sends more ETH than required, the function refunds the excess amount