Skip to main content

CreatorShareOFT

LayerZero OFT (Omnichain Fungible Token) for cross-chain share transfers with integrated buy fee and lottery.


Source

ContractPath
CreatorShareOFTcontracts/services/messaging/CreatorShareOFT.sol

Purpose

CreatorShareOFT (■TOKEN) is the user-facing tradeable token. It serves three primary functions:

  1. Tradeable asset - Listed on DEXs for price discovery
  2. Cross-chain transfers - Bridges to other chains via LayerZero
  3. Fee collection - Captures 6.9% on DEX purchases for the protocol

This is the token users interact with directly. It wraps vault shares and adds protocol-level functionality.


System role


Key behaviors

Buy fee mechanism

The contract classifies addresses to detect buy transactions:

ClassificationBehavior
SwapOnlyDEX pools/routers - outgoing transfers trigger fee
NoFeesVault, controller - exempt from fees
UnknownNormal addresses - no fees

When a transfer moves tokens from a SwapOnly address to a normal address, it's classified as a buy and the 6.9% fee applies.

Sells (normal → SwapOnly) and transfers (normal → normal) incur no fee.

Lottery integration

Buy transactions automatically enter the buyer into the lottery. The LotteryManager is notified with the buyer's address and transaction amount to calculate their probability weight.

Cross-chain transfers

As a LayerZero OFT, the token can be bridged to any chain where a peer ShareOFT is deployed. The bridging process:

  1. Burns tokens on the source chain
  2. Sends message via LayerZero
  3. Mints equivalent tokens on destination chain

Invariants

InvariantDescription
Buy fee capMaximum 10% (configurable, default 6.9%)
Minting authorityOnly vault and authorized minters
Cross-chain supplyTotal supply consistent across all chains

Access control

RolePermissions
OwnerSet address classifications, fee parameters
MinterMint and burn tokens
LayerZeroReceive cross-chain messages

Integration points

Integrates withPurpose
WrapperMinting on wrap
GaugeControllerFee recipient
LotteryManagerLottery entry
LayerZeroCross-chain messaging
DEX poolsTrading venues

Configuration

DEX addresses must be registered as SwapOnly for fee detection to work:

Address typeUse case
SwapOnlyUniswap pools, routers, aggregators
NoFeesVault, wrapper, controller
UnknownUser wallets (default)

Implementation details

For function signatures and events, see the source code.

Key implementation notes:

  • Inherits from LayerZero's OFT standard
  • Fee calculation happens in _update() override
  • Cross-chain peer addresses must be configured before bridging