Skip to content

Latest commit

 

History

History
161 lines (122 loc) · 4 KB

File metadata and controls

161 lines (122 loc) · 4 KB

Function Description

This document lists the sequence of function call for owner and investor.

WRITE FUNCTIONS

Owner

These functions are only called by the owner.

At anytime

  • Transfer ownership
  function transferOwnership(address newOwner_) public virtual onlyOwner {}

Before Presale Starts

  • Transfer tokens before presale starts, but can't transfer once presale starts
 function transferTokensToPresale(uint256 presaleSupplyAmount_) public onlyOwner {}

After Presale Ends

  • Set wallet address (checks if non-zero address) to recieve raised money for withdraw.
  function setWallet(address wallet_) external onlyOwner notZeroAddress(wallet_) {}
  • Set claim time for users claim tokens if softcap reached.
  function setClaimTime(uint256 claimTime_) external onlyOwner {}
  • Withdraw raised money to wallet if softcap reached.
  function withdraw() external onlyOwner nonReentrant {}
  • Refund raised money to investors if softcap not reached.
  function refund() external onlyOwner nonReentrant {}

Investor

These functions are only called by the investor.

Before Presale Starts

On Presale Period

  • Buy tokens with USDT
  function buyWithUSDT(uint256 tokenAmount_) external whenNotPaused {}
  • Buy tokens with USDC
  function buyWithUSDC(uint256 tokenAmount_) external whenNotPaused {}
  • Buy tokens with DAI
  function buyWithDAI(uint256 tokenAmount_) external whenNotPaused {}
  • Buy tokens with ETH
  function buyWithETH() external payable whenNotPaused nonReentrant {}

After Presale Ends and sets claim time

  • Claim tokens if softcap reached.
  function claim(address user_) external nonReentrant {}

HELPER FUNCTIONS

  • Calculate token amount available with coin (like usdt, usdc, and dai) based on coin amount.
  function estimatedTokenAmountAvailableWithCoin(uint256 coinAmount_, IERC20 coin_) public view returns (uint256) {}
  • Calculate coin amount for buying certain amount of tokens.
  function estimatedCoinAmountForTokenAmount(uint256 tokenAmount_, IERC20 coin_) public view returns (uint256) {}
  • Calculate token amount available with ETH based on ETH amount.
  function estimatedTokenAmountAvailableWithETH(uint256 ethAmount_) public view returns (uint256) {}
  • Calculate ETH amount for buying certain amount of tokens.
 function estimatedEthAmountForTokenAmount(uint256 tokenAmount_) public view returns (uint256) {}
  • Get funds raised during presale.
  function getFundsRaised() external view returns (uint256) {}
  • Get token amount for each investor.
  function getTokenAmountForInvestor(address from_) public view returns (uint256) {}
  • Get investments for each investor with what coin.
  function getInvestments(address user_, IERC20 coin_) external view returns (uint256) {}
  • Get investors list
  function getInvestors() external view returns (address[] memory) {}
  • Get early investors list
  function getEarlyInvestors() external view returns (address[] memory) {}
  • Checks if user is early investor or not
  function isEarlyInvestors(address user_) public view returns (bool) {}
  • Get available tokens for buying in presale.
  function tokensAvailable() public view returns (uint256) {}
  • Get Bonus token amount for distributing to early investors after presale ends.
  function getBonusTokenAmount() public view returns (uint256) {}
  • Calculate remaining time for presale.
  function getRemainingTime() public view returns (uint256) {}
  • Get remaining token amount for increasing price in presale.
  function getRemainingTokenAmountForIncreasingPrice() external view returns (uint256) {}
  • Get presale start time
  function getPresaleStartTime() external view returns (uint256) {}
  • Get owner address
  function getOwner() public view returns (address) {}