Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change price functionality #160

Open
agnesenvaite opened this issue May 18, 2019 · 0 comments
Open

Change price functionality #160

agnesenvaite opened this issue May 18, 2019 · 0 comments

Comments

@agnesenvaite
Copy link

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 change price.

20% (8 of 40) of ICO smart contracts have change price functionality. I suggest to add this feature to MilestonePricing smart contract. Because 7 of 8 smart contracts had milestone pricing and change price features together.

Proposed code for change price feature:

 function setCurrentPrice (uint price) public onlyOwner {
     uint i;

    for(i=0; i<milestones.length; i++) {
      if(now < milestones[i].time) {
        milestones[i-1].price = price;
      }
    }
  }
agnesenvaite added a commit to agnesenvaite/smart-contracts that referenced this issue May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant