Home

Awesome

etheal-sale

Solidity contract for etheal token and sale rounds

Contract Structure

Unique contracts

  1. EthealController: controlling the Etheal MiniMeToken
  2. Hodler: managing the hodler reward fund
  3. EthealPreSale: managing presale
  4. EthealNormalSale: managing normal sale
  5. EthealDeposit: handling deposit before being whitelisted, and saving date for sending data
  6. EthealWhitelist: handling KYC
  7. EthealPromoToken: promo token, which gives additional bonus during sale

Please see detailed description at the bottom.

Basic contracts

MiniMe contracts

Crowdsale basic contracts

EthealController

Controlls the EthealToken contract, the initial HEAL token distribution, handles Grants (vesting tokens for team and advisors), hodler reward and crowdsale.

It is a pausable contract, which is paused at initialization. While paused only this contract and crowdsale contracts can move funds of HEAL token.

It implements HasNoTokens to recover mistakenly sent tokens to this contract.

All the tokens it holds can be used to create and revoke grants, transfer tokens to existing but not started grants.

Tokens for future crowdsales are held at the address of 0x1, which can only be moved to a crowdsale contract. Crowdsale contracts send excess HEAL tokens back to address 0x1. If there is no active crowdsale (which has started but not ended), then it can set a new crowdsale contract and transfer tokens to it.

We have decided to handle crowdsales in a separate contract to the EthealController, because there will be several rounds of sales, and the exact timing of round 2 and 3 is unknown yet.

Token Distribution

Token distribution:

Only the multisig wallet can burn tokens of the EthealController (which belongs to the team and advisors), or burn not yet assigned crowdsale tokens. In the future the controller may be used to burn some of its own profit.

Also the multisig wallet can replace the EthealController with a new one, which can be used for future updates. This transfers the controller rights of EthealToken and hodler reward contract to the new controller, and transfers all eth and HEAL tokens to the new controller. Previously issued and revoced grants will transfer excess HEAL tokens to the old controller, which can be retrieved after a newController is set.

It also implements proxy functions to hodler reward, which enables crowdsale contracts to set hodler stakes.

It implements proxy functions to EthealToken (MiniMe), which stops transfering HEAL tokens when EthealController is stopped, refuses ETH transfers to the EthealToken contract, invalidates hodler stakes whenever any amount of heal token is moved from an address, and helps to recover accidentally sent tokens (other than the EthealToken) to the EthealToken contract.

Hodler

Only crowdsale contracts can interract with it, and it accepts modifications until its start time.

Implements hodler reward logic: Keep tokens intact (can’t move any portion of it) in your wallet for 3/6/9 months after two weeks of ending the normal sale, and 20M HEAL token HODLER reward will be distributed among presale and sale HODLERs in the ratio of their intact stakes to the total amount.

Moving any portion of HEAL tokens from an address invalidates its stakes within the hodler reward.

Remaining HEAL tokens from Referral reward will be moved to hodler lot 9 months.

EthealPreSale

It is pausable, when paused no contribution is accepted.

It is capped, reaching the cap stops the sale immediately.

It is refundable, when not reaching the goal everyone gets back their full contribution in ETH and all the HEAL tokens is transferred back to the EthealController.

It implements a softcap logic, which means after reaching the soft cap the crowdsale is closed in 120 hours.

Sending funds below the minimum contribution amount (0.1ETH) is rejected.

Sending funds above the maximum gas price (100gwei), calculates stakes on 80%. If you send 5eth with 101gwei gas price , this results in calculating your funds as 4eth. In case of not reaching minimum goal, 5eth is refunded. In case of reaching the goal you get 4eth * 1250 = 5000 HEAL tokens.

It implements partial refunding for the last contributor, so the users don't have to be smart, the contract is smart instead. If there is only 1 eth remaining, and the last contributor sends 5 eth, then 4 eth is refunded.

Before token sale start parameters can be changed: max gas price and penalty, minimum contribution, minimum goal and soft and hard caps, starting and end times, and rate.

It implements whitelist logic as follows:

EthealNormalSale

$10M hard cap sale, with 700 HEAL / ETH base price, $4.8M soft cap. Can deposit earlier than start, but above a certain limit whitelisting is needed, either writing address to the EthealWhitelist contract, or offchain signing the address of the contributor.

Time-based bonus structure: Normal Sale bonus

Volume-based bonus:

Sending some promo token to one of the following addresses, results in +5% token bonus:

Deployment

Initial deployment

  1. deploy multisig wallet
  2. deploy MiniMeTokenFactory
  3. deploy EthealController
  4. deploy EthealToken with EthealController address and MiniMeTokenFactory address
  5. EthealController -> setEthealToken(EthealToken.address, 0)
  1. deploy EthealPromoTokenController
  2. deploy EthealPromoToken with EthealPromoTokenController and MiniMeTokenFactory addresses
  3. deploy EthealWhitelist with signer address
  4. deploy EthealNormalSale
  5. EthealController -> setCrowdsaleTransfer PreSale.address
  6. EthealNormalSale
  1. EthealPromoTokenController
  1. deploy EthealDeposit
  2. EthealNormalSale setDeposit -> EthealDeposit address

Deploying a new crowdsale

only when no active crowdsale is present

  1. deploy Crowdsale with the address of EthealController
  2. send funds and set address with EthealController.setCrowdsaleTransfer

Deploying a new EthealToken fork

  1. EthealToken -> createCloneToken
  2. EthealController -> setEthealToken(new EthealToken.address, 0)

Deploying a new EthealController

multisig wallet is needed

  1. deploy new EthealController
  2. new EthealController -> setEthealToken(EthealToken.address, Hodler.address)
  3. old EthealController -> setNewController(new EthealController.address)