Public Repository for the proof token sale smart contracts
The ProofToken and TokenSale contracts are inspired by open-zeppelin standard and audited contracts.
The Proof Tokens are based on the StandardToken
and MintableToken
ERC20 contracts. Additional functionality is heavily inspired by the MinimeToken
(https://github.com/Giveth/minime/blob/master/contracts/MiniMeToken.sol)
The TokenSale contract is inspired by the open-zeppelin Crowdsale
contract with additional functionality mixed in.
295,297 tokens have already been issued during the presale. These tokens will be imported before the first presale
The following contracts are hosted on this repository.
- The tokensale contract
- The Proof token contract
- The token factory contract
- Several other interface contracts
There are several prerequisites for using the smart contract.
This can be done with the truffle migrate --network ethereum
command. The contract addresses will successively appear
on the console.
You can use the 'scripts/importBalances.js' along with the provided csv file describing the presale balances. This import mechanism differs from the traditional way of importing presale balances via a claim function and makes the process automatic for presale buyers. The counterpart is that this requires more trust in the ICO team. Only the controller of the Proof token contract can call this function
Calling the lockPresaleBalances
function ensures that no other presale balances can be imported.
Only the controller of the Proof token contract can call this function
Proof tokens can only be created by the controller contract. The control of the proof Token can be given
from the contract creator to the tokensale by calling the changeControl
function.
It is better not to use the wallet that created the contract and transfer ownership to a wallet shared by several members of the team
The multisig refers to the wallet to which funds from the tokensale are transferred when a investor sends ether
The proof wallet receives the proof tokens when upon completion of the tokensale
Token purchase can be made only between the start block and the end block
The token cap is the maximum number of tokens that can be issued in ERC20 units (= number of tokens times 10^18) The cap is the maximum number of tokens that can be issued
-
The token sale will start on the date indicated by the
startTime
variable. Alternatively, it is possible to force the starting of the token sale by calling theforceStart
method. Only the tokensale controller can call this method. -
By default the Proof tokens are not transferable at the start of the tokensale. The controller of the tokensale can call the
enableTransfers
andlockTransfers
methods to make token transferables. After the endTime, anybody can make the tokens definitely transferables by calling theenableTransfers
method. ThelockTransfers
method will fail after the end of the token sale. -
The token master wallet can be used to send tokens to certain addresses (ex: exchanges) without making transfers available to anyone before the end of the presale. The token sale controller can call the
enableMasterTransfers
andlockMasterTransfers
to activate/deactivate this option.
- The tokensale can be paused with the
pause
function. In this case, token minting is paused and tokens can not be bought anymore. This does not affect whether tokens are transferable or not.
The token sale can be finalized in different ways.
-
First if the end block is reached, no more tokens can be issued by the token sale. The rest of the functionality of the tokensale contract however remains available. It is necessary to manually enable transfers through the
enableTransfers
function (can only be called by the owner of the tokensale). -
The last and standard way to finalize the token sale is to call the
finalize
function. This function can only be called by the owner of the token sale contract and can only be called when the token sale is paused. This automatically finishes the minting of the proof tokens and enables token transfers
Step-by-step instructions to finalize the token sale:
- Pause the token sale with the
pause
function - Allocate Proof Tokens with the
allocateProofTokens
function - step 1 needs to be completed - Finalize the token sale with the
finalize
function - step 1 and 2 need to be completed - Optionally, transfer the control of the Proof token to another smart-contract
- OSX or Linux (Windows setup is likely possible but not covered in this guide)
- Node (version 8.7.0 required for the testing environment)
- testrpc / geth
- Clone the repository and install dependencies
git clone https://github.com/ProofSuite/ProofPresaleContract.git
cd ProofPresaleContract
npm install
- Install the latest version of truffle
npm install -g truffle
- Compile contracts
truffle compile
- Initialize testrpc (or geth)
testrpc
- Migrate contracts to chosen network
truffle migrate --network development
- Make sure you are using the latest version of node
nvm install 8.7.0
nvm use 8.7.0
-
Fill in
truffle.js
anddeploy_contracts.js
with appropriate wallet addresses. Unlock the corresponding accounts. -
Verify all tests are passing
truffle test
- You can interact with the contracts via the console
truffle console