Contracts
Accessingcrowdpool

Working with CrowdPool

The CrowdPool contract manages the crowd pool process for a project. It keeps track of various fees, the status of the crowdpool, buyer information, and token details.

Structs

CrowdPoolFeeInfo

struct CrowdPoolFeeInfo {
    uint256 pooled_fee;
    uint256 sold_fee;
    uint256 referral_fee;
    address payable pooled_fee_address;
    address payable sole_fee_address;
    address payable referral_fee_address;
}

Represents the fee information for the crowdpool.

  • pooled_fee: The fee percentage for the pooled amount.
  • sold_fee: The fee percentage for the sold amount.
  • referral_fee: The fee percentage for referrals.
  • pooled_fee_address: The address where the pooled fees will be sent.
  • sole_fee_address: The address where the sold fees will be sent.
  • referral_fee_address: The address for referral fees. If it is not address(0), there is a valid referral.

CrowdPoolStatus

struct CrowdPoolStatus {
    bool lp_generation_complete;
    bool force_failed;
    uint256 pooled_amount;
    uint256 sold_amount;
    uint256 token_withdraw;
    uint256 base_withdraw;
    uint256 num_buyers;
}

Represents the status of the crowdpool.

  • lp_generation_complete: Indicates whether the LP generation is complete.
  • force_failed: Flag to force fail the crowdpool.
  • pooled_amount: The total amount of base currency pooled (usually ETH).
  • sold_amount: The total number of crowdpool tokens sold.
  • token_withdraw: The total number of tokens withdrawn after a successful crowdpool.
  • base_withdraw: The total number of base tokens withdrawn on crowdpool failure.
  • num_buyers: The number of unique participants.

BuyerInfo

struct BuyerInfo {
    uint256 base;
    uint256 sale;
}

Represents the information of a buyer.

  • base: The total amount of base tokens (usually ETH) deposited by the user, which can be withdrawn on crowdpool failure.
  • sale: The number of crowdpool tokens a user is owed, which can be withdrawn on crowdpool success.

TokenInfo

struct TokenInfo {
    string name;
    string symbol;
    uint256 totalsupply;
    uint256 decimal;
}

Represents the details of a token.

  • name: The name of the token.
  • symbol: The symbol of the token.
  • totalsupply: The total supply of the token.
  • decimal: The number of decimal places used by the token.

Please note that the data types address payable refer to Ethereum addresses that can receive payments.