The Potential ICO Contract That Might End All of the Nonsense

in #ethereum7 years ago

The two problems facing an Ethereum ICO:

  • Network contstraints rendering the blockchain unusable for a period of time and/or unequal acceptance of bids.
  • The potential for míners to inject themselves between users and token contracts during an ICO.

I'm going to layout an ICO contract design that will solve these two biggest issues Ethereum is facing reference ICO's.

The ICO issuer creates a contract with capped issuance. The cap should be stated in ether. This contract takes bids from EOA's over a period of 30 days. All bids are taken, for the entire 30 days. The bids are sent with value and the addresses and value sent are bound in an iterable array within the issuing contract. This contract includes a generateToken function. After the 30 days, the owner of the issuing contract executes the generateToken function (and yes pays for the execution of this function.)

The generateToken function creates the ERC20 token contract and then executes a random number generator. Each random number represents the index of the chosen bid in the iterable storage, puts that bid into the token contract, and keeps track of the total value pulled from the bid array. Once the cap is hit, it puts the remaining bids in a map and allows those not selected to withdraw their ether. After 30 days, if the ICO issuer does not execute the token generator, a map is automatically created to allow everyone to withdraw their ether.

The actual number of ERC20 tokens issued is arbitrary and should be automatically computed so as if the value sent in a selected bid = 10% of the cap then that address receives 10% of the tokens issued.

As an example, if the issuer wants to have 1M tokens and issue 100k tokens, then the generateToken function would produce the contract so that it has the 1M tokens and a bid for 10% of the cap would allocate 10% of the issuable tokens, so 100k * 10% = 10k tokens.

As an aside, to reduce costs of memory allocation during the ERC20 contract creation, then the function could deploy the token contract before the iterations and then the iteration function could execute and immediately populate the token contract.

Sort:  

Would the blockchain not still be effectively swamped when the contract issuer runs the generateToken after the 30Days? i.e. over the course of the 30days everyone submits their offers. on d30+x contract issuer runs genToken iterating the offers and generating the tokens onto the block chain. this would still overload the blockchain transaction process.

maybe I'm not clear on the cycle.

Thanks for the share, but now I need to go do some homework on what this actually means. :-)

I do however agree that the whole Etherium ICO debacle needs some better direction and possibly user driven regulation.

Ive been reading the last badly written contract ICO caused the transaction meltdown how can they allow that to slow down the main chain? Has ethereum done something to prevent this in the future?

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:

ICO by SAFT is like kicking a dying dog. - Next time you stand in a checkout line at a supermarket just read the T&Cs for a Starbucks or Movie gift card. - And, if you are not building the coffee shop or the movie theater your SAFT won't help you ..

So make sure that the firm sold you the juice (SAFT is german for juice) will pick up the tap when the sugar hits the fan ...