FundRequest / contracts

Contracts for FundRequest (platform, token, crowdsale)

Home Page:https://fundrequest.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

As a FR supporter I buy FND tokens during the public token sale

gerbert-vandenberghe opened this issue · comments

Context

During the public token sale whitelisted participants will be able to transfer ETH to the FundRequest token sale contract and receive FND tokens in exchange.

The goal of this story is to implement the functions of the token sale contract that are needed during the token sale.

Flow of events of buying FND tokens

  1. The user sends ETH to the token contract.
  2. The token contract checks is the contract is pauzed (if so, the transaction fails).
  3. The token contract checks if the total hard cap is not reached (if so, the transaction fails).
  4. The token contract checks if the sending ETH address is whitelisted (if not, the transaction fails).
  5. If it is the first/capped round of the public token sale
    • then the token contract checks the amount of ETH against the max. cap per person and against the ETH that was already transferred from this address. (if the max. cap is exceeded the transaction fails).
  6. The token contract sends the ETH to the FundRequest MultiSig wallet.
  7. The token contract mints the tokens: 1.800 FND / ETH
  8. The token contract assigns the FND to the ETH address from which the ETH were send.

Extra Functions

Pause / Unpause

It has to be possible to pause and unpause the token sale contract.

  • Only a FundRequest address can call this function.
  • When the contract is paused, it is not possible to transfer ETH to the token sale contract.

Whitelist an ETH address

The token sale contract contains a list of whitelisted ETH addresses. It has to be possible to add an extra address.

Set max cap per person

In the first round of the public token sale there will be a max cap per person. It is not allowed to transfer more .

End first/capped round

When the first round is ended and a user transfers ETH, there will not be checked on max. cap per person when a user transfers ETH. A person can transfer any amount of ETH to the token contract as long as it does not make the hard cap exceed.

Set hard cap

There is a hard cap. As soon as this hard cap is reached it will no longer be possible to transfer any ETH to the token contract.

Note that the user can make multiple transfers from his contract. The sum of the ETH has to be compared to the personal cap.

Test cases

See attachement.

screen shot 2017-12-21 at 11 32 12

commented

Is it a personal cap per personal, or a general cap per address?
ex.
everyone 5 eth max
or
person a: 5eth, person b: 10 eth

the same cap for every address as in your first example - everybody equal.

Example : everyone 5 eth max

commented
  • Pausable
  • Whitelist an address
  • Max cap per person
  • End first (capped) round
  • set/update hard cap