Architecture

Impact Token Smart Contract Architecture

Overview

The ImpactTokenPot is a smart contract system designed to manage tokenized contribution pools with impact-driven mechanics. It implements a unique pot-based system where users can contribute funds and receive tokenized shares, with built-in features for price oracles, referrals, and liquidity management.


Contract Hierarchy

  • ImpactTokenPot: Main contract inheriting from ERC20

  • ImpactTokenPotFactory: Factory contract for creating and managing pot instances


Impact Token Lifecycle

  1. Token Creation

  • Each ImpactTokenPot instance creates a new ERC20 token with customizable name and symbol

  • Token parameters include distribution metrics (target launch value and entry price) and contribution ratios (creator, contributors, and liquidity)

  1. Token Distribution & Minting

  • Initial Lock: All token transfers are locked by default (transfersLocked = true)

  • Contribution-based Minting:

    • Tokens are minted to contributors during the contribution phase

    • Uses a randomized minting mechanism within defined bounds:

      • Lower bound: distributionLowerboundMultiplier (e.g., 0.05x average)

      • Upper bound: distributionUpperboundMultiplier (e.g., 10x average)

    • Final contributor receives remaining tokens in the contributor pool

  1. Token Unlock Phases

  • Transfers remain locked during the contribution phase

  • Unlock occurs after pot finalization, once finalized:

    • Referral earnings can be withdrawn by users

    • IP fee system that can be toggled by platform or the creator (ipFeeEnabled)

    • Distribution ratios controlled by tokenRatioBps array, where the liquidty can be injected automatically (see below)

  1. Liquidity Management

  • Automated Mode (default):

    • Automatic liquidity injection after pot finalization

    • Pairs impact token with contribution token

    • Creates initial trading pool with defined ratios

  • Manual Mode (liquidityManualModel = true):

    • Allows custom liquidity management strategies

    • Platform owner can control liquidity injection timing and amounts

  1. Fees

  • Platform fees: 5% for successful launches

  1. Cancellation

  • Platform or the creator have the option to cancel the impact token

  • If done so, contributors can get refunds by withdrawing on the impact token page

  • No fees are charged for cancelled impact tokens

Pot Lifecycle States

solidityCopyInsertenum State {
    Ongoing,
    Finalized,
    Cancelled 
}

Randomized Token Distribution

The ImpactTokenPot implements a sophisticated randomized token distribution mechanism that ensures fair and unpredictable token allocations while maintaining mathematical bounds to prevent extreme outcomes. This system is designed to create engagement and excitement while ensuring every participant receives a meaningful allocation.

Distribution Parameters

  • Total Token Pool

    • Calculated as: contributorsLeftover = totalSupply() * tokenRatioBps[1] / 10000

    • This represents the total amount of tokens available for distribution to contributors

  • Average Share

    • Calculated as: averageContributionShare = contributorsLeftover / expectedContributors

    • Serves as the baseline for distribution calculations

    • expectedContributors = fixedPrice / allowedContribution

  • Distribution Bounds

    • Lower Bound: distributionLowerbound = averageContributionShare * distributionLowerboundMultiplier / 10000

    • Upper Bound: distributionUpperbound = averageContributionShare * distributionUpperboundMultiplier / 10000

    • Example: If distributionLowerboundMultiplier = 500 and distributionUpperboundMultiplier = 100000

      • Lower Bound = 0.05x of average share

        • Upper Bound = 10x of average share

  • Oracle Price Feed

    • Uses BTC/USD price from Binance Oracle together with other blockchain entropy sources

    • Accessed through: IFactory(factory).getOraclePrices()

    • contribute() function prevents contract calls to prevent exploits when generating the randomness

Last updated