Skip to content

Instantly share code, notes, and snippets.

@youfoundron
Last active November 23, 2017 18:55
Show Gist options
  • Save youfoundron/53947306a7d896145aa562348560fd9e to your computer and use it in GitHub Desktop.
Save youfoundron/53947306a7d896145aa562348560fd9e to your computer and use it in GitHub Desktop.
Feature description of a token distribution tool.
## Overview
The simplest structure of a token sale consists of a sale contract and token contract.
The sale contract is responsible for such logic including but not limited to:
- the duration of the sale (typically in blocks)
- the addresses allowed to participate in the sale
- the exchange rate of ether to tokens, often as a factor of time
- the ether reserve and hard cap amounts
The token contract is responsible for such logic including but not limited to:
- implementing the ERC20 token standard
- mintability of the token
- divisibility of the token
- other properties of the token
This structure is efficient as it is orchestrated purely via smart contracts,
however it is limited in that sale participants are not able to contribute with currencies such as BTC and USD.
As token sales increase in sophistication and investor scope,
accomodating participatation in currencies other than ETH provides a unique challenge for token distribution.
Contributing addresses must be pre-registered.
Investor contributions from various chains and bank accounts must be safely collected and accurately recorded.
Following the collection period, investors are rightfully anxious to receive their tokens.
Often a process is needed to seed the token contract with the proper balances and distribute tokens safely.
The stress of this process would be made less by means of a generic tool for executing this task.
The following is a description of such a tool.
## Inputs
URL of an rpc address through which the tool may communicate with an Ethereum node
From address of an unlocked account on the Ethereum node
Address of deployed token contract (if token contract is already deployed)
Source code for token contract (if token contract is not yet deployed)
NetworkID to accomodate testing
CSV(s) of token sale investment data (maybe per contribution currency)
Check for whether or not to seed balances by
A) making transactions on a deployed token contract (reccommended)
B) deploying a new token contract with seeded balances as initial value
## Feature Requirements
Wizard form for explaining, validating, and accepting input values
Per-currency view for configuring how to ingest CSV data, with preview of the resulting token balances
Balances override section for manually inputting token allocations and accomodating pre-sale agreements
Real-time statistics on distribution process (gas spent, num / pct tokens distributed, num tx unsent, sent, pending, & validated)
Kill switch to cancel any scheduled transactions or call selfDestruct on the deployed token contract
## Feature Nice-To-Haves
Data visualization of sale breakdown stats
Calling account authentication via MetaMask, Mnemonic Code, private key, etc
Gas cost estimator
Error handling preference config
ENS helper for resolving .eth name to deployed token contract address
## Additional Thoughts
Ensure that size of token allocation does not exceed supply of tokens
Ensure that the calling account has enough ether to pay for estimated gas cost
Dispatch transactions in parallel batches, handle dropped transactions by cancelling distribution entirely or retrying a transaction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment