Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
/ Poolz-Back Public archive

smart contracts using solidity for erc20 tokens to eth and erc20 to erc20

License

Notifications You must be signed in to change notification settings

The-Poolz/Poolz-Back

Repository files navigation

Replaced by : https://github.com/The-Poolz/LockDealNFT.InvestProvider

Poolz-Back

Build Status codecov CodeFactor

The-Poolz core decentralized application for creating Initial DEX Offerings.

Navigation

Installation

npm install

Testing

truffle run coverage

Deployment

truffle dashboard
truffle migrate --f 1 --to 1 --network dashboard

UML

classDiagram

Create new Pool

function CreatePool(
address _Token, //token to sell address
uint256 _FinishTime, //Until what time the pool will work
uint256 _Rate, //the rate of the trade
uint256 _POZRate, //the rate for POZ Holders, how much each token = main coin
uint256 _StartAmount, //Total amount of the tokens to sell in the pool
uint64 _LockedUntil, //False = DSP or True = TLP
address _MainCoin, // address(0x0) = ETH, address of main token
bool _Is21Decimal, //focus the for smaller tokens.
uint256 _Now, //Start Time - can be 0 to not change current flow
uint256 _WhiteListId // the Id of the Whitelist contract, 0 For turn-off
) public payable whenNotPaused {

_Token - ERC20 token address for sale.

_FinishTime - after the time finished the pool expired. PO can withdraw remaining tokens.

_Rate - during the investment period, the rate will be multiplied by the investment amount.

_POZRate - rate for whitelisted users. _POZRate must be greater than the regular rate.

_StartAmount - total amount of the tokens to sell in the IDO. The contract will lock the tokens until the investment time.

_LockedUntil - set to zero to use Direct Sales Pools, or enter a time in the future to use Time-Locked Pools.

_MainCoin - trading token address. Investors will use this token/coin to purchase IDO tokens.

_Is21Decimal - If true, the rate will be rate*10^-21.

_Now - start pool time. Tokens can only be purchased after the start time.

_WhiteListId - the whitelist ID we will be working with. The white list contains a list of users with primary access to sales.

Pool types

The main types are Direct Selling Pools (DSP) and Time Locked Pools (TLP).

  • Direct Sale Pools (DSP): These are pools without any lock-in period, where investors get the token immediately after the swap.
  • Time-Locked Pools (TLP): These pools have a predefined lock-in period and investors receive their swapped tokens only after the completion of this duration.

Pool statuses

enum PoolStatus {Created, Open, PreMade, OutOfstock, Finished, Close} //the status of the pools

  • Created: the pool is exclusively available for $POOLZ token holders.

  • Open: the pool is available for all Poolz users.

  • Out of Stock: the predefined supply of auctioning tokens has been sold-out, but the pool’s duration has not ended. In the case of TLP, tokens will be locked for the remaining duration.

  • Finished: the pool has reached the end of its stipulated duration. Both for DSP and TLP, the leftover tokens are returned to the PO’s wallet at this point. Investors, on the other hand, get their tokens purchased (swapped) through TLP.

  • Closed: the pool is complete and tokens have been duly disbursed.

License

The-Poolz Contracts is released under the MIT License.