WENBlocks
  • Getting Started
    • Overview
      • Technical Architecture
    • Key Features
  • Staking
    • Overview
    • Creating a Stake
    • Withdrawing the Stake
    • Claiming Rewards
  • Liquidity Program
    • How It Works
  • WNT
    • WNT — The Engine of the WEN Ecosystem
  • Airdrops
    • Airdrop Schedule
    • Server Management
    • Penalty Structure
    • How It Works
    • Example
  • Smart Contracts
  • Security
    • Overview
    • Internal Audits
    • External Audits
    • AI Audits
      • Grok
  • CODE
    • WENBlocksManager.sol
    • wnmContract.sol
    • wblkToken.sol
    • wuniContract.sol
    • wntToken.sol
    • syncnode.py
    • airdropGenerator.js
    • dayTrigger.js
  • Conclusion
    • Conclusion
  • Socials
    • Links
Powered by GitBook
On this page
  • Contract Interactions
  • Access Control
  • Security Features
  • Protocol Timing Mechanism
  1. Getting Started
  2. Overview

Technical Architecture

Contract Interactions

The WENBlocks ecosystem consists of five main smart contracts that work together:

  1. WNMToken: Core staking and governance token

    • Inherits from Stakeable base contract

    • Implements IBurnRedeemable interface

    • Manages staking logic and reward distribution

  2. WENBlocksManager: Protocol management contract

    • Handles airdrops with Merkle proofs

    • Manages penalty collection and redistribution

    • Controls liquidity program

    • Implements LP token vesting

  3. WBLKToken, WUNIToken, WNTToken: Reward tokens

    • Controlled minting by WNMToken and WENBlocksManager

    • ERC20 compliant with burn functionality

Access Control

  • onlyOwner: For initial configuration functions

  • onlyManager: For WENBlocksManager authorized functions

  • onlyServer: For airdrop creation (WENBlocksManager)

  • onlyWNMandManager: For token minting functions

Security Features

  • ReentrancyGuard on all functions handling transfers

  • Merkle proof verification for airdrops

  • Access control modifiers on sensitive functions

  • SafeMath operations via Solidity 0.8.x

  • ERC-165 support for interface discovery

  • Dual XEN burning mechanisms (direct and callback)

  • Day increment mechanism for penalty and reward timing

Protocol Timing Mechanism

  • The protocol operates on "WEN days" starting from contract deployment

  • Each day advances when incrementDay() is called (after 24 hours have elapsed)

  • An automated script (dayTrigger.js) calls this function daily

  • updateDailyPenalty() can be called by any address; it simply fails if already run for the current WEN day

  • This timing mechanism controls:

    • Airdrop schedules

    • Penalty applications

    • Staking durations

    • LP vesting periods

PreviousOverviewNextKey Features

Last updated 1 month ago