Multicurrency TokenSale Engine
The Token Crowdsale procedure serves a similar function with one of the steps of the tokenization process.
Technically, in both cases, tokens are released with their subsequent redemption.
At the pre-ICO stage Token Crowdsale Contract — 1 smart contract was used to distribute tokens. (https://github.com/BankEx/pre-ico-token-contract)
The token sale stage uses an infrastructure with 2 smart contracts and an oracle (external software with respect to the Ether) https://github.com/BankEx/ico-token-contract-draft
Such a configuration allows you to accept not only the Ether, but another crypto currency, such as Bitcoin, Litecoin...etc. And also convert Pre-Sale Tokens, implement KYC and freeze tokens.
Ethereum smart contracts that distribute BANKEX tokens (BKX).
BANKEX Token (BKX)
BKX is an ERC-20 compatible token.
- The token contract is created by the crowdsale contract
- BKX has fixed total supply
- Tokens offered for the crowdsale are transferred to the crowdsale contract at creation time
- 3,000,000 BKX are reserved for pre-tokensale (PBKX) investors
- All remaining tokens are stored on BANKEX balance
BKX transactions are restricted until explicitly allowed. BKX transactions can only be authorized by:
- The crowdsale contract — to distribute tokens purchased through the crowdsale
- PBKX conversion contract — to perform conversion
- Bankex — to distribute tokens to the team and pre-sale investors (non-PBKX)
Pre-Sale Token Conversion
3,000,000 tokens known as PBKX, has been distributed during the pre-sale phase. These tokens can and should be converted to BKX tokens. In order to do so, PBKX holder should run the convert function of the PBKX contract. After the transaction is executed, the PBKX holder balance will be set to 0, and her BKX balance will be increased by the corresponding amount. The conversion rate is set by BANKEX using setRate function. Conversion respects tokens' decimals, i.e. if the conversion rate is set to 1, for 1 PBKX (10 ** 2 token subunits) the investor will get 1 BKX (10 ** 18 token subunits). Partial conversion is not supported.
The number of tokens offered for the crowdsale are transferred to the crowdsale contract at the instantiation time. The crowdsale starts at the specified timestamp and ends when either the specified timestamp is reached or all the tokens are sold. Unsold tokens will be transferred back to BANKEX.
The tokens are sold in tranches, each tranche is comprised of a fixed number of tokens at a fixed price.After all the tokens in a tranche are sold out, the next tranche will become available.
The crowdsale contract interoperates with an External Oracle account which authorizes BANKEX to:
- Distribute tokens on behalf of investor without making direct Ether transfer to the crowdsale contract.
- Register investors.
Only registered investors are allowed to participate in the crowdsale.
Tokens can be purchased in 2 ways:
- By an investor via a direct Ether transfer to the crowdsale contract. The funds are instantly sent to the BANKEX-controlled address, and the corresponding number of tokens are transferred from the crowdsale contract to the sender's address. To prove that the Ether collected is not used to purchase BKX tokens, BANKEX can use a time lock wallet to receive the funds, or just avoid spending from the address. As the cost of a token subunit is intended to be orders of magnitude smaller than the cost of Ether transfer (and also for security reasons), the change isn't returned. The investor who purchases the last available tokens will be refunded manually.
- By the External Oracle account on behalf of an investor, who has purchased the tokens via non-Ether payment. In this case no Ether is collected by the contract, so the External Oracle specifies the address where the tokens should be sent to and the Ether equivalent of the purchase will use will use its exchange rate, without any explicit conversion. It should also provide some kind of a receipt that will be stored on the Ethereum blockchain and can later be used to prove that the funds were actually transferred to BANKEX (e.g. BTC transaction hash). In any case only registered investors can participate in the crowdsale, and the purchase amount should be greater than the specified minimum.
There will be no changes as the tokens are sold in subunits. If investors hit the hard cap, their change will be refunded with manual Ether transfers.
When the crowdsale ends, if there are still tokens left, the crowdsale contract owner should call finalize() function of the crowdsale contract. Then all the unsold tokens will be sent back to BANKEX.