Skip to content

Smart Contracts

TRTH’s protocol logic lives in Solidity contracts compiled with 0.8.24. The system centers on a capped ERC-20 that pre-mints the full supply once at deployment, a weekly epoch rewards engine with VRF hooks, a USDC-style genesis phase, single-shot Uniswap V4 liquidity creation, fee recycling, and optional timelocked governance.

Purpose: ERC-20 TRTH with CAP = 21_000_000e18, enforced by OpenZeppelin ERC20Capped.

Supply model: The token has no minter roles and no AccessControl. The entire 21,000,000 TRTH supply is minted once in the constructor to a treasury/deployer address, so there is no ongoing minting and no hidden inflation lever. Distribution to the protocol’s buckets happens by transfer of that pre-minted supply, not by minting on demand:

  • 19,950,000 TRTH is transferred to EpochRewardsV1_1 to fund weekly emissions.
  • 525,000 TRTH is transferred to Genesis for pro-rata participant distribution.
  • 525,000 TRTH is transferred to LiquidityBootstrap to seed initial liquidity.

Interactions: The token exposes a public burn(uint256) (holders can burn their own balance; used by the FeeSink buyback-and-burn path) and an immutable balanceSyncHook set once in the constructor. The hook implements IBalanceSyncHook and receives syncBalance callbacks on transfer, mint, and burn so EpochRewardsV1_1 can track balances for reward eligibility without wrapping the token.

Purpose: 7-day epochs, base / bonus / king reward accounting, VRF request and fulfillment lifecycle, claims, and carry between epochs. Emission halves every 31-day era.

Interactions: Pays claims by transferring from the pre-funded emission pool held by the contract, preserving the invariant distributedTotal <= EMISSION_POOL. Calls into Chainlink through ChainlinkVrfWordAdapter. Consumers rely on the hook or indexed events for holder snapshots.

Purpose: Bridge Chainlink VRF v2.5 to EpochRewardsV1_1 with a stable request id space for the rewards contract while mapping to upstream Chainlink request ids.

Interactions: Implements the request/fulfill path so EpochRewardsV1_1 receives fulfillRandomness with verifiable words.

Purpose: Genesis phase with deposits in USDC on Base, referrals, influencer tiers, and batch distribution of TRTH allocations.

Interactions: Distributes TRTH from its pre-funded genesis allocation. BOOTSTRAP_ROLE is granted to LiquidityBootstrap so the LP module can pull finalized genesis state when bootstrapping.

Purpose: One-shot Uniswap V4 LP creation using the Uniswap V4 PositionManager (with Permit2), producing a position NFT, plus configured fee tier, tick bounds, and sqrtPriceX96 for pool initialization.

Interactions: Consumes a pre-funded LP allocation held by the bootstrap contract and requires BOOTSTRAP_ROLE on Genesis for coordination.

Purpose: FeeSink collects protocol fees and executes TRTH buyback and burn via swaps when a V4FeeSinkSwapAdapter is configured (Uniswap V4 swap router integration).

Purpose: Governance timelock (TimelockController) for delayed execution of admin actions — role grants, parameter updates, and coordinator changes — reducing rug-pull surface when multisigs or DAOs control the protocol.

ContractPrimary function
TruthTokenCapped ERC-20, full supply pre-minted at deploy, immutable balance hook, public burn
EpochRewardsV1_1Epochs, VRF lifecycle, claims, carry
ChainlinkVrfWordAdapterVRF v2.5 bridge to rewards
GenesisUSDC deposits, referrals, tiers, distribution
LiquidityBootstrapSingle Uniswap V4 position
FeeSinkSwap adapter + burns
V4FeeSinkSwapAdapterUniswap V4 swaps for FeeSink
ProtocolTimelockTimelocked proposals

For deployed addresses, see Contract Addresses.