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

Code refactoring & truffle support #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AntMarras
Copy link

@simondlr
This PR:

  • Add gitignore
  • add backbone of truffle for future testing
  • Refactor the CurationMarkets.sol by splitting it in different files to help future development

Please note that I had to introduce two changes in order to make the contracts compile & deploy:

  1. By compiling I faced the error
    Internal compiler error: Accessors for mapping with dynamically-sized keys not yet implemented.
    this is due to the fact that mapping doesn't support accessors where string is a key. So I had to creat a getter for totalBondsPerCuratorPerSubtopic function getTotalBondsPerCuratorPerSubtopic(address _curator, string _subtopic) returns(uint256); and remove the public accessor from it and from the bonds mapping. (more info: Raise useful error message when using a dynamic type as a key in a mapping ethereum/solidity#633)

  2. in ContinuousToken constructor the line // updateCostOfToken(0); make run of gas the contract creation, so I changed it in
    costPerToken = 2 * baseCost;
    it cames from the formula:

costOfToken = (BaseCost + BaseCost (1.000001618^AvailableSupply)+BaseCost*AvailableSupply/1000)

with an initial AvailableSupply = 0

These are fixes just to make it compile and run. All the code still needs to be polish.

@AntMarras AntMarras changed the title Fix/refactor contractacts Code refactoring & truffle support Mar 2, 2018
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

Successfully merging this pull request may close these issues.

1 participant