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

Last updated