Skip to content

Start ICO by calling function functionality #161

@agnesenvaite

Description

@agnesenvaite

I am analyzing features in publicly available ICO smart contracts as my Bachelor's thesis. In the thesis I am comparing how features in ICO smart contracts evolve naturally and in ICO libraries.

In my analysis I selected smart contracts labelled with "token sale" and having more then 700 transactions. Total count of such contracts was 161.

I selected 40 smart contracts which do not have token functionality (thesis scope was ICO smart contracts alone). I used selected smart contracts to create a feature model. Also, I created features model of TokenMarket ICO smart contracts. I compared them. One of the missing features is start ICO by calling function.

15% (6 of 40) of ICO smart contracts have start ICO by calling function functionality. I suggest creating StartableCrowdsale smart contract which extends CrowdsaleBase smart contract.

Proposed code for start ICO by calling function feature:

import "./CrowdsaleBase.sol";

contract StartableCrowdsale is CrowdsaleBase{

  event StartAtChanged(uint newStartAt);

  constructor  (address _token, PricingStrategy _pricingStrategy, 
  address _multisigWallet, uint _start, uint _end, uint _minimumFundingGoal)
    CrowdsaleBase (_token, _pricingStrategy, _multisigWallet, 
    _start, _end, _minimumFundingGoal) public{}
    /**
    * @dev Start Crowdsale
    */
    function startCrowdsale () public onlyOwner inState(State.PreFunding){
      startsAt = now;
      StartAtChanged(startsAt);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions