[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\"es2015\", \"stage-2\", \"stage-3\"]\n}\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n    \"env\": {\n        \"browser\": true,\n        \"es6\": true,\n        \"node\": true,\n        \"mocha\": true\n    },\n    \"extends\": \"airbnb\",\n    \"parser\": \"babel-eslint\",\n    \"rules\": {\n        // indentation\n        \"indent\": [ 2, 4 ],\n\n        // spacing\n        \"template-curly-spacing\": [ 2, \"always\" ],\n        \"array-bracket-spacing\": [ 2, \"always\" ],\n        \"object-curly-spacing\": [ 2, \"always\" ],\n        \"computed-property-spacing\": [ 2, \"always\" ],\n        \"no-multiple-empty-lines\": [ 2, { \"max\": 1, \"maxEOF\": 0, \"maxBOF\": 0 } ],\n\n        // strings\n        \"quotes\": [ 2, \"double\", \"avoid-escape\" ],\n\n        // code arrangement matter\n        \"no-use-before-define\": [ 2, { \"functions\": false } ],\n\n        // make it meaningful\n        \"prefer-const\": 1,\n\n        // keep it simple\n        \"complexity\": [ 1, 5 ],\n\n        // Consisten return\n        \"consistent-return\": 0,\n\n        \"import/no-extraneous-dependencies\": [\"error\", {\"devDependencies\": [\"**/*.test.js\", \"**/*.spec.js\", \"**/compile.js\", \"**/test/*.js\"]}],\n\n        // react\n        \"react/prefer-es6-class\": 0,\n        \"react/jsx-filename-extension\": 0,\n        \"react/jsx-indent\": [ 2, 4 ]\n    },\n    \"globals\": {\n        \"artifacts\": true,\n        \"web3\": true,\n        \"contract\": true,\n        \"assert\": true\n    }\n}\n"
  },
  {
    "path": ".flake8",
    "content": "[flake8]\nmax-line-length = 99\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules/\nbuild/\n.DS_Store\n\n.mypy_cache\n__pycache__\n"
  },
  {
    "path": ".pylintrc",
    "content": "[BASIC]\ngood-names=i,j,k,n,ex,Run,_\n\n[FORMAT]\nmax-line-length = 99\ndisable=locally-disabled,locally-enabled\n"
  },
  {
    "path": ".travis.yml",
    "content": "dist: 'trusty'\ngroup: 'beta'\n\nlanguage: 'node_js'\nsudo: false\nnode_js:\n  - '8'\n\ncache:\n    yarn: true\n\nscript:\n  - 'truffle compile'\n  - 'testrpc --network-id 15 --mnemonic ''status mnemonic status mnemonic status mnemonic status mnemonic status mnemonic status mnemonic'' > /dev/null &'\n  - 'truffle test --network development'\n  - 'truffle migrate --reset --network development_migrate'\n"
  },
  {
    "path": "INSTRUCTIONS.md",
    "content": "## Before starting\n\n* Install `yarn` and `npm`.\n* Run `yarn` at the repo root.\n* Use the same BIP39 compatible mnemonic in both `truffle.js` (can be set by environment variable `TEST_MNEMONIC`) and for your client.\n* Change the `from` key in `truffle.js` for any network that requires it.\n* Compile contracts:\n  ```\n  ./node_modules/.bin/truffle compile\n  ```\n* Start your Ethereum client:\n  ```\n  ./node_modules/.bin/testrpc --network-id 15 --mnemonic 'status mnemonic status mnemonic status mnemonic status mnemonic status mnemonic status mnemonic'\n  ```\n\n## Run tests\n\n* Run tests\n  ```\n  ./node_modules/.bin/truffle test --network development\n  ```\n\n## Deploy\n\n* Change the config constants in `migrations/2_deploy_contracts.js` to match your addresses and parameters.\n* Deploy contracts (choose network from `truffle.js`). The following command deploys up to migration step 2:\n  ```\n  ./node_modules/.bin/truffle migrate --network development_migrate -f 2\n  ```\n\n## Calculations\n\n* Install `python3.6`.\n* Caculate outcomes of different ceilings by running:\n  ```\n  ./scripts/ceiling_curve_calc.py --limit=6100000000000000000000 --curve-factor=300 --fee-token=0.1\n  ```\n* Run the following to see all options:\n  ```\n  ./scripts/ceiling_curve_calc.py --help\n  ```\n"
  },
  {
    "path": "LICENSE",
    "content": "Jarrad Hope (Status Research & Development) Copyright (C) 2017\nJorge Izquierdo (Aragon Foundation) Copyright (C) 2017\nJordi Baylina (Giveth) Copyright (C) 2017\n\n                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRSNTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRSNTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRSNTIES OF MERCHSNTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Jorge Izquierdo (Aragon Foundation) Copyright (C) 2017\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRSNTY; without even the implied warranty of\n    MERCHSNTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    Jorge Izquierdo (Aragon Foundation) Copyright (C) 2017\n    This program comes with ABSOLUTELY NO WARRSNTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "MINIME_README.md",
    "content": "# Status Network Token\n\nThe MiniMeToken contract is a standard ERC20 token with extra functionality:\n\n### The token is easy to clone!\n\nAnybody can create a new clone token from any token using this contract with an initial distribution identical to the original token at a specified block. The address calling the `createCloneToken` function will become the token controller and the token's default settings can be specified in the function call.\n\n    function createCloneToken(\n        string _cloneTokenName,\n        uint8 _cloneDecimalUnits,\n        string _cloneTokenSymbol,\n        uint _snapshotBlock,\n        bool _isConstant\n        ) returns(address) {\n\nOnce the clone token is created, it acts as a completely independent token, with it's own unique functionalities.\n\n### Balance history is registered and available to be queried\n\nAll MiniMe Tokens maintain a history of the balance changes that occur during each block. Two calls are introduced to read the totalSupply and the balance of any address at any block in the past.\n\n    function totalSupplyAt(uint _blockNumber) constant returns(uint)\n\n    function balanceOfAt(address _holder, uint _blockNumber) constant returns (uint)\n\n### Optional token controller\n\nThe controller of the contract can generate/destroy/transfer tokens at its own discretion. The controller can be a regular account, but the intention is for the controller to be another contract that imposes transparent rules on the token's issuance and functionality. The Token Controller is not required for the MiniMe token to function, if there is no reason to generate/destroy/transfer tokens, the token controller can be set to 0x0 and this functionality will be disabled.\n\nFor example, a Token Creation contract can be set as the controller of the MiniMe Token and at the end of the token creation period, the controller can be transferred to the 0x0 address, to guarantee that no new tokens will be created.\n\nTo create and destroy tokens, these two functions are introduced:\n\n    function generateTokens(address _holder, uint _value) onlyController\n\n    function destroyTokens(address _holder, uint _value) onlyController\n\n### The Token's Controller can freeze transfers.\n\nIf transfersEnabled == false, tokens cannot be transferred by the users, however they can still be created, destroyed, and transferred by the controller. The controller can also toggle this flag.\n\n    // Allows tokens to be transferred if true or frozen if false\n    function enableTransfers(bool _transfersEnabled) onlyController\n\n\n## Applications\n\nIf this token contract is used as the base token, then clones of itself can be easily generated at any given block number, this allows for incredibly powerful functionality, effectively the ability for anyone to give extra features to the token holders without having to migrate to a new contract. Some of the applications that the MiniMe token contract can be used for are:\n\n1. Generating a voting token that is burned when you vote.\n2. Generating a discount \"coupon\" that is redeemed when you use it.\n3. Generating a token for a \"spinoff\" DAO.\n4. Generating a token that can be used to give explicit support to an action or a campaign, like polling.\n5. Generating a token to enable the token holders to collect daily, monthly or yearly payments.\n6. Generating a token to limit participation in a contribution period or similar event to holders of a specific token.\n7. Generating token that allows a central party complete control to transfer/generate/destroy tokens at will.\n8. Lots of other applications including all the applications the standard ERC 20 token can be used for.\n\nAll these applications and more are enabled by the MiniMe Token Contract. The most amazing part being that anyone that wants to add these features can, in a permissionless yet safe manner without affecting the parent token's intended functionality.\n\n# How to deploy a campaign\n\n1. Deploy the MinimeTokenFactory\n2. Deploy the MinimeToken\n3. Deploy the campaign\n4. Assign the controller of the MinimeToken to the campaign.\n"
  },
  {
    "path": "MULTISIG.md",
    "content": "# Status Community Multisig [0xbbf0cc1c63f509d48a4674e270d26d80ccaf6022](https://etherscan.io/address/0xbbf0cc1c63f509d48a4674e270d26d80ccaf6022)\n\nRequired signatures: 3/5\n\n## Signers\n\n- Jordi Baylina, [Giveth](http://www.giveth.io/). [Address](https://etherscan.io/address/0x6b9ef02657339310e28a7a9d4b5f25f7c1f68d61).\n- Joe Urgo, [district0x](https://district0x.io/), [Sourcerers](http://sourcerers.io/). [Address](https://etherscan.io/address/0x904Ef6ff8E82478c5604d99884EB9Bcd7F73Cc36).\n- Hudson Jameson, [Oaken Innovations](https://www.projectoaken.com/). [Address](https://etherscan.io/address/0x02E3F16cA21cf0508835B190933ECbdE2f7f14DF).\n- Jorge Izquierdo, [Aragon](https://aragon.one/). [Address](https://etherscan.io/address/0x4838eab6f43841e0d233db4cea47bd64f614f0c5).\n- Status Research & Development Multisig. [Address](https://etherscan.io/address/0xa646e29877d52b9e2de457eca09c724ff16d0a2b).\n\n\n## Responsibilities\n\n- The Status Community Multisig will serve SNT holders and the broader crypto community to ensure Status' stated mission is carried.\n- The Status Community Multisig manages the 29% reserve SNT allocation.\n- The Status Community Multisig can be used to solve hypothetical deadlock problems in the Status Research & Development Multisig to ensure resources won't get locked and the project will continue its course.\n\n\n# Status Research & Development Multisig – [0xa646e29877d52b9e2de457eca09c724ff16d0a2b](https://etherscan.io/address/0xa646e29877d52b9e2de457eca09c724ff16d0a2b)\n\nRequired signatures: 2/3\n\n## Signers\n\n- Jarrad Hope, Status Research & Development CEO. [Address](https://etherscan.io/address/0x3ac6cb2ccfd8c8aae3ba31d7ed44c20d241b16a4).\n- Carl Bennetts, Status Research & Development CMO. [Address](https://etherscan.io/address/0xdBD6ffD3CB205576367915Dd2f8De0aF7edcCeeF).\n- Status Community Multisig – [Address](https://etherscan.io/address/0xbbf0cc1c63f509d48a4674e270d26d80ccaf6022).\n\n\n## Responsibilities\n\n- Status Research & Development Multisig will hold the Status Research & Development ether funds and SNT tokens."
  },
  {
    "path": "README.md",
    "content": "# Status Network Token\n[![Build Status](https://travis-ci.org/status-im/status-network-token.svg?branch=master)](https://travis-ci.org/status-im/status-network-token)\n\n- [Whitepaper](https://status.im/whitepaper.pdf)\n- [Contribution Period Specification](/SPEC.md)\n- [The Importance of Distribution](https://blog.status.im/distribution-dynamic-ceilings-e2f427f5cca) blogpost.\n- [Encoding the Status ‘Genesis Block’](https://blog.status.im/encoding-the-status-genesis-block-d73d287a750) blogpost.\n\n## Technical definition\n\nAt the technical level SGT & SNT are a ERC20-compliant tokens, derived from the [MiniMe Token](https://github.com/Giveth/minime) that allows for token cloning (forking), which will be useful for many future use-cases.\n\nAlso built in the token is a vesting schedule for limiting SNT transferability over time. Status Project Founders tokens are vesting.\n\n## Contracts\n\n- [SNT.sol](/contracts/SNT.sol): Main contract for the token.\n- [SGT.sol](/contracts/SGT.sol): Token contract for early adopters. Deployed to [0xd248B0D48E44aaF9c49aea0312be7E13a6dc1468](https://etherscan.io/address/0xd248B0D48E44aaF9c49aea0312be7E13a6dc1468#readContract)\n- [MiniMeToken.sol](/contracts/MiniMeToken.sol): Token implementation.\n- [StatusContribution.sol](/contracts/StatusContribution.sol): Implementation of the initial distribution of SNT.\n- [DynamicCeiling.sol](/contracts/DynamicCeiling.sol): Auxiliary contract to manage the dynamic ceiling during the contribution period.\n- [SNTPlaceHolder.sol](/contracts/SNTPlaceHolder.sol): Placeholder for the Status Network before its deployment.\n- [ContributionWallet.sol](/contracts/ContributionWallet.sol): Simple contract that will hold all funds until final block of the contribution period.\n- [MultiSigWallet.sol](/contracts/MultiSigWallet.sol): ConsenSys multisig used for Status and community multisigs.\n- [DevTokensHolder.sol](/contracts/DevTokensHolder.sol): Contract where tokens belonging to developers will be held. This contract will release this tokens in a vested timing.\n- [SGTExchanger.sol](/contracts/SGTExchanger.sol): Contract responsible for crediting SNTs to the SGT holders after the contribution period ends.\n\nSee [INSTRUCTIONS.md](/INSTRUCTIONS.md) for instructions on how to test and deploy the contracts.\n\n## Reviewers and audits.\n\nCode for the SNT token and the offering is being reviewed by:\n\n- Jordi Baylina, Author.\n- [Smart Contract Solutions (OpenZeppelin)](https://smartcontractsolutions.com/). [Pending audit results](/) [Preliminary](/audits/prelim-smartcontractsolutions-ef163f1b6fd6fb0630a4b8c78d3b706f3fe1da33.md)\n- [CoinFabrik](http://www.coinfabrik.com/). [2152b17aa2ef584a2aea95533c707a345c6ccf69](/audits/coinfabrik-2152b17aa2ef584a2aea95533c707a345c6ccf69.pdf)\n- [BlockchainLabs.nz](http://blockchainlabs.nz/). [Audit results](/audits/BlockchainLabs-SNT-audit-report.md)\n- [Bok Consulting](https://www.bokconsulting.com.au/). [Pending audit results](/)\n- YYYYYY. [Pending audit results](/)\n\nA bug bounty for the SNT token and offering started on 14/6/2017. [More details](https://blog.status.im/status-network-token-bug-bounty-a66fc2324359)\n"
  },
  {
    "path": "SPEC.md",
    "content": "# Status Network Contribution Period\n## Functional Specification\n\n### Distribution\n- 29% is for reserve (multisig)\n- 20% goes to the status team and founders (multisig, 2 Year Vesting Contract, 6 month cliffs)\n- Remaining 51% is divided between the initial contribution period itself and SGT, where SGT is <= 10% of total supply.\n\n### Whitelist\nAddresses can be whitelisted and have guaranteed participation up to a set maximum amount, ignores Dynamic Ceiling. Sending ETH to the smart contract address should be no different, whether whitelisted or not.\nStatus Genesis Tokens\nSGT is a Minime Token that’s total supply of 500,000,000 maps to, and cannot exceed 10% of the total supply.\nie. If 250,000,000 of SGT is allocated then SGT maps to 5% of the total supply.\nSGT can be redeemed for SNT after contribution period.\n\n### Dynamic Ceiling\nA Curve that specifies a series of hidden hard caps at specific block intervals, that can be revealed at anytime during the contribution period. The entire curve must be revealed before finalising the contribution period. Finalising the contribution period can happen at any moment during the curve, as long as entire curve has been revealed. Whitelisted addresses ignore ceiling.\n\n### Misc\nTokens are not transferrable for 1 week after contribution period and are minted at 10,000 SNT per 1 ETH.\n"
  },
  {
    "path": "audits/BlockchainLabs-SNT-audit-report.md",
    "content": "# Status Network Token Audit\n\n## Preamble\nThis audit report was undertaken by BlockchainLabs.nz for the purpose of providing feedback to Status Research & Development Gmbh. It has subsequently been shared publicly without any express or implied warranty.\n\nSolidity contracts were sourced from the public Github repo [status-im/status-network-token](https://github.com/status-im/status-network-token) prior to commit [79419f86c1b4bfcfcd18f08aecee168ff1f73fc4](https://github.com/status-im/status-network-token/tree/79419f86c1b4bfcfcd18f08aecee168ff1f73fc4) - we would encourage all community members and token holders to make their own assessment of the contracts.\n\n## Scope\nAll Solidity code contained in [/contracts](https://github.com/status-im/status-network-token/tree/master/contracts) was considered in scope along with the tests contained in [/test](https://github.com/status-im/status-network-token/tree/master/test) as a basis for static and dynamic analysis.\n\n## Focus Areas\nThe audit report is focused on the following key areas - though this is *not an exhaustive list*.\n\n### Correctness\n* No correctness defects uncovered during static analysis?\n* No implemented contract violations uncovered during execution?\n* No other generic incorrect behavior detected during execution?\n* Adherence to adopted standards such as ERC20?\n\n### Testability\n* Test coverage across all functions and events?\n* Test cases for both expected behaviour and failure modes?\n* Settings for easy testing of a range of parameters?\n* No reliance on nested callback functions or console logs?\n* Avoidance of test scenarios calling other test scenarios?\n\n### Security\n* No presence of known security weaknesses?\n* No funds at risk of malicious attempts to withdraw/transfer?\n* No funds at risk of control fraud?\n* Prevention of Integer Overflow or Underflow?\n\n### Best Practice\n* Explicit labeling for the visibility of functions and state variables?\n* Proper management of gas limits and nested execution?\n* Latest version of the Solidity compiler?\n\n## Classification\n\n### Defect Severity\n* **Minor** - A defect that does not have a material impact on the contract execution and is likely to be subjective.\n* **Moderate** - A defect that could impact the desired outcome of the contract execution in a specific scenario.\n* **Major** - A defect that impacts the desired outcome of the contract execution or introduces a weakness that may be exploited.\n* **Critical** - A defect that presents a significant security vulnerability or failure of the contract across a range of scenarios.\n\n## Findings\n### Minor\n\n**SGT Exchanger** - While testing the correctness of SGTExchanger, we found that it was possible for a user with no SGT tokens to call the collect() function. It was also possible for a user with SGT tokens to call the collect() function for a second time, after having already collected their SNT.\n\nHowever, this is a minor issue because in both cases no SNT was issued. Since commit `450fbc85fd7a4a0dc17d22fc7a6ab5071277fb46`, PR 106 on 16th June an exception is now thrown:\nhttps://github.com/status-im/status-network-token/pull/106\n\n**Test Failures** - Tests designed to check for failures were encapsulated within a `catch` and were never properly evaluated. The fix for this issue was addressed on https://github.com/status-im/status-network-token#70 and later improved on https://github.com/status-im/status-network-token#133\n\n**SGT after Contribution** - As of 19 June, attempts to generate additional SGT tokens after the contribution period has begun do not throw an exception.\n\nPrior to 19 June this resulted in a thrown exception, which is preferable.\n\n~~However, no new tokens are created so this is only a minor issue.~~ _Status have advised that SGT can be issued after the contribution period._\n\n### Moderate\n_No moderate defects were found during this audit._\n\n### Major\n\n**Short Address** - The current implementation of MiniMeToken is vulnerable to ERC20 Short Address 'Attack'\n\nhttp://vessenes.com/the-erc20-short-address-attack-explained/\nhttps://blog.golemproject.net/how-to-find-10m-by-just-reading-blockchain-6ae9d39fcd95\n\nWhile this isn't a critical issue as it only comes into play with user error, we suggest making the fix to MiniMeToken.\n\nA simple fix would be to add a modifier to check address size, and apply this modifier to the transfer function of the MiniMeToken:\n```\n    modifier onlyPayloadSize(uint size) {\n       assert(msg.data.length == size + 4);\n       _;\n    }\n\n    function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) {\n      //function body unchanged\n    }\n```\n**DevTokensHolder** - The function collectTokens on the DevTokensHolder contract will mistakenly floor the division of any period of time by 24 months. Making it impossible for developers to collect any token until 2 years. The fix was merged on status-im/status-network-token#105\n\n### Critical\n_No critical defects were found during this audit._\n\n## Conclusion\nOverall we have been satisfied with the quality of the code and responsiveness of the developers in fixing defects. There was good test coverage for some components such as MultiSigWallet and MiniMeToken as they've been used in other projects, meanwhile tests for the other contracts/functions were written during the audit period to improve the testability of the project as a whole.\n\nThe developers have followed common best practices and demonstrated an awareness of security weaknesses that could put funds at risk. During the audit the **Short Address** advisory was published and we recommend that this be handled upstream as a modifier in the MiniMeToken contract itself.\n"
  },
  {
    "path": "audits/prelim-smartcontractsolutions-ef163f1b6fd6fb0630a4b8c78d3b706f3fe1da33.md",
    "content": "Hi all!\n\nHere are the severe issues we've found so far:\n\n#### Cloning a MiniMeToken with snapshot block set to the current block is subject to a value change attack.\n\nIf a `MiniMeToken` is cloned by calling the `createCloneToken` function on [line 384 of MiniMeToken.sol](https://github.com/status-im/status-network-token/blob/2152b17aa2ef584a2aea95533c707a345c6ccf69/contracts/MiniMeToken.sol#L384) with the `_snapshotBlock` parameter set to zero or `block.number`, the clone will be creating using the current block as `parentSnapShotBlock`.\n\nThis opens a small window of time for an attacker to see this transaction in the network, and insert `transfer` transactions in the same block. Given these will be [in the context of the current block too](https://github.com/status-im/status-network-token/blob/2152b17aa2ef584a2aea95533c707a345c6ccf69/contracts/MiniMeToken.sol#L500), the values used for the clone token will contain the modifications by the attacker. This would be confusing for the user creating the clone at the very least, and potentially dangerous. \n\nLuckily this can be very easily fixed. Consider replacing [line 391 of MiniMeToken.sol](https://github.com/status-im/status-network-token/blob/2152b17aa2ef584a2aea95533c707a345c6ccf69/contracts/MiniMeToken.sol#L391) for a check that will throw if `_snapshotBlock` equals `block.number`. Consider adding the same check [in the MiniMeToken constructor](https://github.com/status-im/status-network-token/blob/2152b17aa2ef584a2aea95533c707a345c6ccf69/contracts/MiniMeToken.sol#L156) too, for `_parentSnapShotBlock`.\n\n#### ContributionWallet finalBlock can be different from StatusContribution stopBlock\n\nWithdrawal from the `ContributionWallet` contract is enabled once [the contribution is finalized](https://github.com/status-im/status-network-token/blob/2152b17aa2ef584a2aea95533c707a345c6ccf69/contracts/ContributionWallet.sol#L58) or when the current block is after `finalBlock`, a state variable. For the contract to serve its purpose, `finalBlock` should be the same as the contribution's `stopBlock` or greater. Otherwise, the funds could be withdrawn [before the contribution is finalized](https://github.com/status-im/status-network-token/blob/2152b17aa2ef584a2aea95533c707a345c6ccf69/contracts/ContributionWallet.sol#L57), which would defeat the purpose of `ContributionWallet`. \n\nConsider using `contribution.stopBlock()` in place of `finalBlock` or checking that `finalBlock` is greater or equal than `stopBlock`.\n\n**Addendum**\n\nWe also have and additional comment about [a PR you merged adding gas price cap to transactions](https://github.com/status-im/status-network-token/pull/20/files) and [a pending PR adding a cap to call frequency by address](https://github.com/status-im/status-network-token/pull/67/files). Both are out of the audit's commit scope, but we want to let you guys know our thoughts anyway as a friendly help. We don't this this additions are a good idea, and recommend you revert them. \n\nSee [Vitalik's post](http://vitalik.ca/general/2017/06/09/sales.html) about the gas price cap issue, and the frequency cap can be easily circumvented so it doesn't add security but does add complexity and attack surface.\n\nLet me know your thoughts/questions. The final report will be delivered on Friday, as agreed.\n\nHappy to be working on this together,\n\nCheers,\n\nManuel Araoz\n\n[openzeppelin.com](https://openzeppelin.com/)"
  },
  {
    "path": "contracts/ContributionWallet.sol",
    "content": "pragma solidity ^0.4.11;\n\n/*\n    Copyright 2017, Jordi Baylina\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/// @title ContributionWallet Contract\n/// @author Jordi Baylina\n/// @dev This contract will be hold the Ether during the contribution period.\n///  The idea of this contract is to avoid recycling Ether during the contribution\n///  period. So all the ETH collected will be locked here until the contribution\n///  period ends\n\n// @dev Contract to hold sale raised funds during the sale period.\n// Prevents attack in which the Aragon Multisig sends raised ether\n// to the sale contract to mint tokens to itself, and getting the\n// funds back immediately.\n\n\nimport \"./StatusContribution.sol\";\n\n\ncontract ContributionWallet {\n\n    // Public variables\n    address public multisig;\n    uint256 public endBlock;\n    StatusContribution public contribution;\n\n    // @dev Constructor initializes public variables\n    // @param _multisig The address of the multisig that will receive the funds\n    // @param _endBlock Block after which the multisig can request the funds\n    // @param _contribution Address of the StatusContribution contract\n    function ContributionWallet(address _multisig, uint256 _endBlock, address _contribution) {\n        require(_multisig != 0x0);\n        require(_contribution != 0x0);\n        require(_endBlock != 0 && _endBlock <= 4000000);\n        multisig = _multisig;\n        endBlock = _endBlock;\n        contribution = StatusContribution(_contribution);\n    }\n\n    // @dev Receive all sent funds without any further logic\n    function () public payable {}\n\n    // @dev Withdraw function sends all the funds to the wallet if conditions are correct\n    function withdraw() public {\n        require(msg.sender == multisig);              // Only the multisig can request it\n        require(block.number > endBlock ||            // Allow after end block\n                contribution.finalizedBlock() != 0);  // Allow when sale is finalized\n        multisig.transfer(this.balance);\n    }\n\n}\n"
  },
  {
    "path": "contracts/DevTokensHolder.sol",
    "content": "pragma solidity ^0.4.11;\n\n/*\n    Copyright 2017, Jordi Baylina\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/// @title DevTokensHolder Contract\n/// @author Jordi Baylina\n/// @dev This contract will hold the tokens of the developers.\n///  Tokens will not be able to be collected until 6 months after the contribution\n///  period ends. And it will be increasing linearly until 2 years.\n\n\n//  collectable tokens\n//   |                         _/--------   vestedTokens rect\n//   |                       _/\n//   |                     _/\n//   |                   _/\n//   |                 _/\n//   |               _/\n//   |             _/\n//   |           _/\n//   |          |\n//   |        . |\n//   |      .   |\n//   |    .     |\n//   +===+======+--------------+----------> time\n//     Contrib   6 Months       24 Months\n//       End\n\n\nimport \"./MiniMeToken.sol\";\nimport \"./StatusContribution.sol\";\nimport \"./SafeMath.sol\";\nimport \"./ERC20Token.sol\";\n\n\ncontract DevTokensHolder is Owned {\n    using SafeMath for uint256;\n\n    uint256 collectedTokens;\n    StatusContribution contribution;\n    MiniMeToken snt;\n\n    function DevTokensHolder(address _owner, address _contribution, address _snt) {\n        owner = _owner;\n        contribution = StatusContribution(_contribution);\n        snt = MiniMeToken(_snt);\n    }\n\n\n    /// @notice The Dev (Owner) will call this method to extract the tokens\n    function collectTokens() public onlyOwner {\n        uint256 balance = snt.balanceOf(address(this));\n        uint256 total = collectedTokens.add(balance);\n\n        uint256 finalizedTime = contribution.finalizedTime();\n\n        require(finalizedTime > 0 && getTime() > finalizedTime.add(months(6)));\n\n        uint256 canExtract = total.mul(getTime().sub(finalizedTime)).div(months(24));\n\n        canExtract = canExtract.sub(collectedTokens);\n\n        if (canExtract > balance) {\n            canExtract = balance;\n        }\n\n        collectedTokens = collectedTokens.add(canExtract);\n        assert(snt.transfer(owner, canExtract));\n\n        TokensWithdrawn(owner, canExtract);\n    }\n\n    function months(uint256 m) internal returns (uint256) {\n        return m.mul(30 days);\n    }\n\n    function getTime() internal returns (uint256) {\n        return now;\n    }\n\n\n    //////////\n    // Safety Methods\n    //////////\n\n    /// @notice This method can be used by the controller to extract mistakenly\n    ///  sent tokens to this contract.\n    /// @param _token The address of the token contract that you want to recover\n    ///  set to 0 in case you want to extract ether.\n    function claimTokens(address _token) public onlyOwner {\n        require(_token != address(snt));\n        if (_token == 0x0) {\n            owner.transfer(this.balance);\n            return;\n        }\n\n        ERC20Token token = ERC20Token(_token);\n        uint256 balance = token.balanceOf(this);\n        token.transfer(owner, balance);\n        ClaimedTokens(_token, owner, balance);\n    }\n\n    event ClaimedTokens(address indexed _token, address indexed _controller, uint256 _amount);\n    event TokensWithdrawn(address indexed _holder, uint256 _amount);\n}\n"
  },
  {
    "path": "contracts/DynamicCeiling.sol",
    "content": "pragma solidity ^0.4.11;\n\n/*\n    Copyright 2017, Jordi Baylina\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/// @title DynamicCeiling Contract\n/// @author Jordi Baylina\n/// @dev This contract calculates the ceiling from a series of curves.\n///  These curves are committed first and revealed later.\n///  All the curves must be in increasing order and the last curve is marked\n///  as the last one.\n///  This contract allows to hide and reveal the ceiling at will of the owner.\n\n\nimport \"./SafeMath.sol\";\nimport \"./Owned.sol\";\n\n\ncontract DynamicCeiling is Owned {\n    using SafeMath for uint256;\n\n    struct Curve {\n        bytes32 hash;\n        // Absolute limit for this curve\n        uint256 limit;\n        // The funds remaining to be collected are divided by `slopeFactor` smooth ceiling\n        // with a long tail where big and small buyers can take part.\n        uint256 slopeFactor;\n        // This keeps the curve flat at this number, until funds to be collected is less than this\n        uint256 collectMinimum;\n    }\n\n    address public contribution;\n\n    Curve[] public curves;\n    uint256 public currentIndex;\n    uint256 public revealedCurves;\n    bool public allRevealed;\n\n    /// @dev `contribution` is the only address that can call a function with this\n    /// modifier\n    modifier onlyContribution {\n        require(msg.sender == contribution);\n        _;\n    }\n\n    function DynamicCeiling(address _owner, address _contribution) {\n        owner = _owner;\n        contribution = _contribution;\n    }\n\n    /// @notice This should be called by the creator of the contract to commit\n    ///  all the curves.\n    /// @param _curveHashes Array of hashes of each curve. Each hash is calculated\n    ///  by the `calculateHash` method. More hashes than actual curves can be\n    ///  committed in order to hide also the number of curves.\n    ///  The remaining hashes can be just random numbers.\n    function setHiddenCurves(bytes32[] _curveHashes) public onlyOwner {\n        require(curves.length == 0);\n\n        curves.length = _curveHashes.length;\n        for (uint256 i = 0; i < _curveHashes.length; i = i.add(1)) {\n            curves[i].hash = _curveHashes[i];\n        }\n    }\n\n\n    /// @notice Anybody can reveal the next curve if he knows it.\n    /// @param _limit Ceiling cap.\n    ///  (must be greater or equal to the previous one).\n    /// @param _last `true` if it's the last curve.\n    /// @param _salt Random number used to commit the curve\n    function revealCurve(uint256 _limit, uint256 _slopeFactor, uint256 _collectMinimum,\n                         bool _last, bytes32 _salt) public {\n        require(!allRevealed);\n\n        require(curves[revealedCurves].hash == calculateHash(_limit, _slopeFactor, _collectMinimum,\n                                                             _last, _salt));\n\n        require(_limit != 0 && _slopeFactor != 0 && _collectMinimum != 0);\n        if (revealedCurves > 0) {\n            require(_limit >= curves[revealedCurves.sub(1)].limit);\n        }\n\n        curves[revealedCurves].limit = _limit;\n        curves[revealedCurves].slopeFactor = _slopeFactor;\n        curves[revealedCurves].collectMinimum = _collectMinimum;\n        revealedCurves = revealedCurves.add(1);\n\n        if (_last) allRevealed = true;\n    }\n\n    /// @notice Reveal multiple curves at once\n    function revealMulti(uint256[] _limits, uint256[] _slopeFactors, uint256[] _collectMinimums,\n                         bool[] _lasts, bytes32[] _salts) public {\n        // Do not allow none and needs to be same length for all parameters\n        require(_limits.length != 0 &&\n                _limits.length == _slopeFactors.length &&\n                _limits.length == _collectMinimums.length &&\n                _limits.length == _lasts.length &&\n                _limits.length == _salts.length);\n\n        for (uint256 i = 0; i < _limits.length; i = i.add(1)) {\n            revealCurve(_limits[i], _slopeFactors[i], _collectMinimums[i],\n                        _lasts[i], _salts[i]);\n        }\n    }\n\n    /// @notice Move to curve, used as a failsafe\n    function moveTo(uint256 _index) public onlyOwner {\n        require(_index < revealedCurves &&       // No more curves\n                _index == currentIndex.add(1));  // Only move one index at a time\n        currentIndex = _index;\n    }\n\n    /// @return Return the funds to collect for the current point on the curve\n    ///  (or 0 if no curves revealed yet)\n    function toCollect(uint256 collected) public onlyContribution returns (uint256) {\n        if (revealedCurves == 0) return 0;\n\n        // Move to the next curve\n        if (collected >= curves[currentIndex].limit) {  // Catches `limit == 0`\n            uint256 nextIndex = currentIndex.add(1);\n            if (nextIndex >= revealedCurves) return 0;  // No more curves\n            currentIndex = nextIndex;\n            if (collected >= curves[currentIndex].limit) return 0;  // Catches `limit == 0`\n        }\n\n        // Everything left to collect from this limit\n        uint256 difference = curves[currentIndex].limit.sub(collected);\n\n        // Current point on the curve\n        uint256 collect = difference.div(curves[currentIndex].slopeFactor);\n\n        // Prevents paying too much fees vs to be collected; breaks long tail\n        if (collect <= curves[currentIndex].collectMinimum) {\n            if (difference > curves[currentIndex].collectMinimum) {\n                return curves[currentIndex].collectMinimum;\n            } else {\n                return difference;\n            }\n        } else {\n            return collect;\n        }\n    }\n\n    /// @notice Calculates the hash of a curve.\n    /// @param _limit Ceiling cap.\n    /// @param _last `true` if it's the last curve.\n    /// @param _salt Random number that will be needed to reveal this curve.\n    /// @return The calculated hash of this curve to be used in the `setHiddenCurves` method\n    function calculateHash(uint256 _limit, uint256 _slopeFactor, uint256 _collectMinimum,\n                           bool _last, bytes32 _salt) public constant returns (bytes32) {\n        return keccak256(_limit, _slopeFactor, _collectMinimum, _last, _salt);\n    }\n\n    /// @return Return the total number of curves committed\n    ///  (can be larger than the number of actual curves on the curve to hide\n    ///  the real number of curves)\n    function nCurves() public constant returns (uint256) {\n        return curves.length;\n    }\n\n}\n"
  },
  {
    "path": "contracts/ERC20Token.sol",
    "content": "// Abstract contract for the full ERC 20 Token standard\n// https://github.com/ethereum/EIPs/issues/20\npragma solidity ^0.4.11;\n\ncontract ERC20Token {\n    /* This is a slight change to the ERC20 base standard.\n    function totalSupply() constant returns (uint256 supply);\n    is replaced with:\n    uint256 public totalSupply;\n    This automatically creates a getter function for the totalSupply.\n    This is moved to the base contract since public getter functions are not\n    currently recognised as an implementation of the matching abstract\n    function by the compiler.\n    */\n    /// total amount of tokens\n    uint256 public totalSupply;\n\n    /// @param _owner The address from which the balance will be retrieved\n    /// @return The balance\n    function balanceOf(address _owner) constant returns (uint256 balance);\n\n    /// @notice send `_value` token to `_to` from `msg.sender`\n    /// @param _to The address of the recipient\n    /// @param _value The amount of token to be transferred\n    /// @return Whether the transfer was successful or not\n    function transfer(address _to, uint256 _value) returns (bool success);\n\n    /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`\n    /// @param _from The address of the sender\n    /// @param _to The address of the recipient\n    /// @param _value The amount of token to be transferred\n    /// @return Whether the transfer was successful or not\n    function transferFrom(address _from, address _to, uint256 _value) returns (bool success);\n\n    /// @notice `msg.sender` approves `_spender` to spend `_value` tokens\n    /// @param _spender The address of the account able to transfer the tokens\n    /// @param _value The amount of tokens to be approved for transfer\n    /// @return Whether the approval was successful or not\n    function approve(address _spender, uint256 _value) returns (bool success);\n\n    /// @param _owner The address of the account owning tokens\n    /// @param _spender The address of the account able to transfer the tokens\n    /// @return Amount of remaining tokens allowed to spent\n    function allowance(address _owner, address _spender) constant returns (uint256 remaining);\n\n    event Transfer(address indexed _from, address indexed _to, uint256 _value);\n    event Approval(address indexed _owner, address indexed _spender, uint256 _value);\n}\n"
  },
  {
    "path": "contracts/MiniMeToken.sol",
    "content": "pragma solidity ^0.4.11;\n\n\nimport \"./ERC20Token.sol\";\n\n/*\n    Copyright 2016, Jordi Baylina\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/// @title MiniMeToken Contract\n/// @author Jordi Baylina\n/// @dev This token contract's goal is to make it easy for anyone to clone this\n///  token using the token distribution at a given block, this will allow DAO's\n///  and DApps to upgrade their features in a decentralized manner without\n///  affecting the original token\n/// @dev It is ERC20 compliant, but still needs to under go further testing.\n\n\n/// @dev The token controller contract must implement these functions\ncontract TokenController {\n    /// @notice Called when `_owner` sends ether to the MiniMe Token contract\n    /// @param _owner The address that sent the ether to create tokens\n    /// @return True if the ether is accepted, false if it throws\n    function proxyPayment(address _owner) payable returns(bool);\n\n    /// @notice Notifies the controller about a token transfer allowing the\n    ///  controller to react if desired\n    /// @param _from The origin of the transfer\n    /// @param _to The destination of the transfer\n    /// @param _amount The amount of the transfer\n    /// @return False if the controller does not authorize the transfer\n    function onTransfer(address _from, address _to, uint _amount) returns(bool);\n\n    /// @notice Notifies the controller about an approval allowing the\n    ///  controller to react if desired\n    /// @param _owner The address that calls `approve()`\n    /// @param _spender The spender in the `approve()` call\n    /// @param _amount The amount in the `approve()` call\n    /// @return False if the controller does not authorize the approval\n    function onApprove(address _owner, address _spender, uint _amount)\n        returns(bool);\n}\n\ncontract Controlled {\n    /// @notice The address of the controller is the only address that can call\n    ///  a function with this modifier\n    modifier onlyController { if (msg.sender != controller) throw; _; }\n\n    address public controller;\n\n    function Controlled() { controller = msg.sender;}\n\n    /// @notice Changes the controller of the contract\n    /// @param _newController The new controller of the contract\n    function changeController(address _newController) onlyController {\n        controller = _newController;\n    }\n}\n\ncontract ApproveAndCallFallBack {\n    function receiveApproval(address from, uint256 _amount, address _token, bytes _data);\n}\n\n/// @dev The actual token contract, the default controller is the msg.sender\n///  that deploys the contract, so usually this token will be deployed by a\n///  token controller contract, which Giveth will call a \"Campaign\"\ncontract MiniMeToken is Controlled {\n\n    string public name;                //The Token's name: e.g. DigixDAO Tokens\n    uint8 public decimals;             //Number of decimals of the smallest unit\n    string public symbol;              //An identifier: e.g. REP\n    string public version = 'MMT_0.1'; //An arbitrary versioning scheme\n\n\n    /// @dev `Checkpoint` is the structure that attaches a block number to a\n    ///  given value, the block number attached is the one that last changed the\n    ///  value\n    struct  Checkpoint {\n\n        // `fromBlock` is the block number that the value was generated from\n        uint128 fromBlock;\n\n        // `value` is the amount of tokens at a specific block number\n        uint128 value;\n    }\n\n    // `parentToken` is the Token address that was cloned to produce this token;\n    //  it will be 0x0 for a token that was not cloned\n    MiniMeToken public parentToken;\n\n    // `parentSnapShotBlock` is the block number from the Parent Token that was\n    //  used to determine the initial distribution of the Clone Token\n    uint public parentSnapShotBlock;\n\n    // `creationBlock` is the block number that the Clone Token was created\n    uint public creationBlock;\n\n    // `balances` is the map that tracks the balance of each address, in this\n    //  contract when the balance changes the block number that the change\n    //  occurred is also included in the map\n    mapping (address => Checkpoint[]) balances;\n\n    // `allowed` tracks any extra transfer rights as in all ERC20 tokens\n    mapping (address => mapping (address => uint256)) allowed;\n\n    // Tracks the history of the `totalSupply` of the token\n    Checkpoint[] totalSupplyHistory;\n\n    // Flag that determines if the token is transferable or not.\n    bool public transfersEnabled;\n\n    // The factory used to create new clone tokens\n    MiniMeTokenFactory public tokenFactory;\n\n////////////////\n// Constructor\n////////////////\n\n    /// @notice Constructor to create a MiniMeToken\n    /// @param _tokenFactory The address of the MiniMeTokenFactory contract that\n    ///  will create the Clone token contracts, the token factory needs to be\n    ///  deployed first\n    /// @param _parentToken Address of the parent token, set to 0x0 if it is a\n    ///  new token\n    /// @param _parentSnapShotBlock Block of the parent token that will\n    ///  determine the initial distribution of the clone token, set to 0 if it\n    ///  is a new token\n    /// @param _tokenName Name of the new token\n    /// @param _decimalUnits Number of decimals of the new token\n    /// @param _tokenSymbol Token Symbol for the new token\n    /// @param _transfersEnabled If true, tokens will be able to be transferred\n    function MiniMeToken(\n        address _tokenFactory,\n        address _parentToken,\n        uint _parentSnapShotBlock,\n        string _tokenName,\n        uint8 _decimalUnits,\n        string _tokenSymbol,\n        bool _transfersEnabled\n    ) {\n        tokenFactory = MiniMeTokenFactory(_tokenFactory);\n        name = _tokenName;                                 // Set the name\n        decimals = _decimalUnits;                          // Set the decimals\n        symbol = _tokenSymbol;                             // Set the symbol\n        parentToken = MiniMeToken(_parentToken);\n        parentSnapShotBlock = _parentSnapShotBlock;\n        transfersEnabled = _transfersEnabled;\n        creationBlock = getBlockNumber();\n    }\n\n\n///////////////////\n// ERC20 Methods\n///////////////////\n\n    /// @notice Send `_amount` tokens to `_to` from `msg.sender`\n    /// @param _to The address of the recipient\n    /// @param _amount The amount of tokens to be transferred\n    /// @return Whether the transfer was successful or not\n    function transfer(address _to, uint256 _amount) returns (bool success) {\n        if (!transfersEnabled) throw;\n        return doTransfer(msg.sender, _to, _amount);\n    }\n\n    /// @notice Send `_amount` tokens to `_to` from `_from` on the condition it\n    ///  is approved by `_from`\n    /// @param _from The address holding the tokens being transferred\n    /// @param _to The address of the recipient\n    /// @param _amount The amount of tokens to be transferred\n    /// @return True if the transfer was successful\n    function transferFrom(address _from, address _to, uint256 _amount\n    ) returns (bool success) {\n\n        // The controller of this contract can move tokens around at will,\n        //  this is important to recognize! Confirm that you trust the\n        //  controller of this contract, which in most situations should be\n        //  another open source smart contract or 0x0\n        if (msg.sender != controller) {\n            if (!transfersEnabled) throw;\n\n            // The standard ERC 20 transferFrom functionality\n            if (allowed[_from][msg.sender] < _amount) return false;\n            allowed[_from][msg.sender] -= _amount;\n        }\n        return doTransfer(_from, _to, _amount);\n    }\n\n    /// @dev This is the actual transfer function in the token contract, it can\n    ///  only be called by other functions in this contract.\n    /// @param _from The address holding the tokens being transferred\n    /// @param _to The address of the recipient\n    /// @param _amount The amount of tokens to be transferred\n    /// @return True if the transfer was successful\n    function doTransfer(address _from, address _to, uint _amount\n    ) internal returns(bool) {\n\n           if (_amount == 0) {\n               return true;\n           }\n\n           if (parentSnapShotBlock >= getBlockNumber()) throw;\n\n           // Do not allow transfer to 0x0 or the token contract itself\n           if ((_to == 0) || (_to == address(this))) throw;\n\n           // If the amount being transfered is more than the balance of the\n           //  account the transfer returns false\n           var previousBalanceFrom = balanceOfAt(_from, getBlockNumber());\n           if (previousBalanceFrom < _amount) {\n               return false;\n           }\n\n           // Alerts the token controller of the transfer\n           if (isContract(controller)) {\n               if (!TokenController(controller).onTransfer(_from, _to, _amount))\n               throw;\n           }\n\n           // First update the balance array with the new value for the address\n           //  sending the tokens\n           updateValueAtNow(balances[_from], previousBalanceFrom - _amount);\n\n           // Then update the balance array with the new value for the address\n           //  receiving the tokens\n           var previousBalanceTo = balanceOfAt(_to, getBlockNumber());\n           if (previousBalanceTo + _amount < previousBalanceTo) throw; // Check for overflow\n           updateValueAtNow(balances[_to], previousBalanceTo + _amount);\n\n           // An event to make the transfer easy to find on the blockchain\n           Transfer(_from, _to, _amount);\n\n           return true;\n    }\n\n    /// @param _owner The address that's balance is being requested\n    /// @return The balance of `_owner` at the current block\n    function balanceOf(address _owner) constant returns (uint256 balance) {\n        return balanceOfAt(_owner, getBlockNumber());\n    }\n\n    /// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on\n    ///  its behalf. This is a modified version of the ERC20 approve function\n    ///  to be a little bit safer\n    /// @param _spender The address of the account able to transfer the tokens\n    /// @param _amount The amount of tokens to be approved for transfer\n    /// @return True if the approval was successful\n    function approve(address _spender, uint256 _amount) returns (bool success) {\n        if (!transfersEnabled) throw;\n\n        // To change the approve amount you first have to reduce the addresses`\n        //  allowance to zero by calling `approve(_spender,0)` if it is not\n        //  already 0 to mitigate the race condition described here:\n        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n        if ((_amount!=0) && (allowed[msg.sender][_spender] !=0)) throw;\n\n        // Alerts the token controller of the approve function call\n        if (isContract(controller)) {\n            if (!TokenController(controller).onApprove(msg.sender, _spender, _amount))\n                throw;\n        }\n\n        allowed[msg.sender][_spender] = _amount;\n        Approval(msg.sender, _spender, _amount);\n        return true;\n    }\n\n    /// @dev This function makes it easy to read the `allowed[]` map\n    /// @param _owner The address of the account that owns the token\n    /// @param _spender The address of the account able to transfer the tokens\n    /// @return Amount of remaining tokens of _owner that _spender is allowed\n    ///  to spend\n    function allowance(address _owner, address _spender\n    ) constant returns (uint256 remaining) {\n        return allowed[_owner][_spender];\n    }\n\n    /// @notice `msg.sender` approves `_spender` to send `_amount` tokens on\n    ///  its behalf, and then a function is triggered in the contract that is\n    ///  being approved, `_spender`. This allows users to use their tokens to\n    ///  interact with contracts in one function call instead of two\n    /// @param _spender The address of the contract able to transfer the tokens\n    /// @param _amount The amount of tokens to be approved for transfer\n    /// @return True if the function call was successful\n    function approveAndCall(address _spender, uint256 _amount, bytes _extraData\n    ) returns (bool success) {\n        if (!approve(_spender, _amount)) throw;\n\n        ApproveAndCallFallBack(_spender).receiveApproval(\n            msg.sender,\n            _amount,\n            this,\n            _extraData\n        );\n\n        return true;\n    }\n\n    /// @dev This function makes it easy to get the total number of tokens\n    /// @return The total number of tokens\n    function totalSupply() constant returns (uint) {\n        return totalSupplyAt(getBlockNumber());\n    }\n\n\n////////////////\n// Query balance and totalSupply in History\n////////////////\n\n    /// @dev Queries the balance of `_owner` at a specific `_blockNumber`\n    /// @param _owner The address from which the balance will be retrieved\n    /// @param _blockNumber The block number when the balance is queried\n    /// @return The balance at `_blockNumber`\n    function balanceOfAt(address _owner, uint _blockNumber) constant\n        returns (uint) {\n\n        // These next few lines are used when the balance of the token is\n        //  requested before a check point was ever created for this token, it\n        //  requires that the `parentToken.balanceOfAt` be queried at the\n        //  genesis block for that token as this contains initial balance of\n        //  this token\n        if ((balances[_owner].length == 0)\n            || (balances[_owner][0].fromBlock > _blockNumber)) {\n            if (address(parentToken) != 0) {\n                return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock));\n            } else {\n                // Has no parent\n                return 0;\n            }\n\n        // This will return the expected balance during normal situations\n        } else {\n            return getValueAt(balances[_owner], _blockNumber);\n        }\n    }\n\n    /// @notice Total amount of tokens at a specific `_blockNumber`.\n    /// @param _blockNumber The block number when the totalSupply is queried\n    /// @return The total amount of tokens at `_blockNumber`\n    function totalSupplyAt(uint _blockNumber) constant returns(uint) {\n\n        // These next few lines are used when the totalSupply of the token is\n        //  requested before a check point was ever created for this token, it\n        //  requires that the `parentToken.totalSupplyAt` be queried at the\n        //  genesis block for this token as that contains totalSupply of this\n        //  token at this block number.\n        if ((totalSupplyHistory.length == 0)\n            || (totalSupplyHistory[0].fromBlock > _blockNumber)) {\n            if (address(parentToken) != 0) {\n                return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock));\n            } else {\n                return 0;\n            }\n\n        // This will return the expected totalSupply during normal situations\n        } else {\n            return getValueAt(totalSupplyHistory, _blockNumber);\n        }\n    }\n\n////////////////\n// Clone Token Method\n////////////////\n\n    /// @notice Creates a new clone token with the initial distribution being\n    ///  this token at `_snapshotBlock`\n    /// @param _cloneTokenName Name of the clone token\n    /// @param _cloneDecimalUnits Number of decimals of the smallest unit\n    /// @param _cloneTokenSymbol Symbol of the clone token\n    /// @param _snapshotBlock Block when the distribution of the parent token is\n    ///  copied to set the initial distribution of the new clone token;\n    ///  if the block is zero than the actual block, the current block is used\n    /// @param _transfersEnabled True if transfers are allowed in the clone\n    /// @return The address of the new MiniMeToken Contract\n    function createCloneToken(\n        string _cloneTokenName,\n        uint8 _cloneDecimalUnits,\n        string _cloneTokenSymbol,\n        uint _snapshotBlock,\n        bool _transfersEnabled\n        ) returns(address) {\n        if (_snapshotBlock == 0) _snapshotBlock = getBlockNumber();\n        MiniMeToken cloneToken = tokenFactory.createCloneToken(\n            this,\n            _snapshotBlock,\n            _cloneTokenName,\n            _cloneDecimalUnits,\n            _cloneTokenSymbol,\n            _transfersEnabled\n            );\n\n        cloneToken.changeController(msg.sender);\n\n        // An event to make the token easy to find on the blockchain\n        NewCloneToken(address(cloneToken), _snapshotBlock);\n        return address(cloneToken);\n    }\n\n////////////////\n// Generate and destroy tokens\n////////////////\n\n    /// @notice Generates `_amount` tokens that are assigned to `_owner`\n    /// @param _owner The address that will be assigned the new tokens\n    /// @param _amount The quantity of tokens generated\n    /// @return True if the tokens are generated correctly\n    function generateTokens(address _owner, uint _amount\n    ) onlyController returns (bool) {\n        uint curTotalSupply = getValueAt(totalSupplyHistory, getBlockNumber());\n        if (curTotalSupply + _amount < curTotalSupply) throw; // Check for overflow\n        updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);\n        var previousBalanceTo = balanceOf(_owner);\n        if (previousBalanceTo + _amount < previousBalanceTo) throw; // Check for overflow\n        updateValueAtNow(balances[_owner], previousBalanceTo + _amount);\n        Transfer(0, _owner, _amount);\n        return true;\n    }\n\n\n    /// @notice Burns `_amount` tokens from `_owner`\n    /// @param _owner The address that will lose the tokens\n    /// @param _amount The quantity of tokens to burn\n    /// @return True if the tokens are burned correctly\n    function destroyTokens(address _owner, uint _amount\n    ) onlyController returns (bool) {\n        uint curTotalSupply = getValueAt(totalSupplyHistory, getBlockNumber());\n        if (curTotalSupply < _amount) throw;\n        updateValueAtNow(totalSupplyHistory, curTotalSupply - _amount);\n        var previousBalanceFrom = balanceOf(_owner);\n        if (previousBalanceFrom < _amount) throw;\n        updateValueAtNow(balances[_owner], previousBalanceFrom - _amount);\n        Transfer(_owner, 0, _amount);\n        return true;\n    }\n\n////////////////\n// Enable tokens transfers\n////////////////\n\n\n    /// @notice Enables token holders to transfer their tokens freely if true\n    /// @param _transfersEnabled True if transfers are allowed in the clone\n    function enableTransfers(bool _transfersEnabled) onlyController {\n        transfersEnabled = _transfersEnabled;\n    }\n\n////////////////\n// Internal helper functions to query and set a value in a snapshot array\n////////////////\n\n    /// @dev `getValueAt` retrieves the number of tokens at a given block number\n    /// @param checkpoints The history of values being queried\n    /// @param _block The block number to retrieve the value at\n    /// @return The number of tokens being queried\n    function getValueAt(Checkpoint[] storage checkpoints, uint _block\n    ) constant internal returns (uint) {\n        if (checkpoints.length == 0) return 0;\n\n        // Shortcut for the actual value\n        if (_block >= checkpoints[checkpoints.length-1].fromBlock)\n            return checkpoints[checkpoints.length-1].value;\n        if (_block < checkpoints[0].fromBlock) return 0;\n\n        // Binary search of the value in the array\n        uint min = 0;\n        uint max = checkpoints.length-1;\n        while (max > min) {\n            uint mid = (max + min + 1)/ 2;\n            if (checkpoints[mid].fromBlock<=_block) {\n                min = mid;\n            } else {\n                max = mid-1;\n            }\n        }\n        return checkpoints[min].value;\n    }\n\n    /// @dev `updateValueAtNow` used to update the `balances` map and the\n    ///  `totalSupplyHistory`\n    /// @param checkpoints The history of data being updated\n    /// @param _value The new number of tokens\n    function updateValueAtNow(Checkpoint[] storage checkpoints, uint _value\n    ) internal  {\n        if ((checkpoints.length == 0)\n        || (checkpoints[checkpoints.length -1].fromBlock < getBlockNumber())) {\n               Checkpoint newCheckPoint = checkpoints[ checkpoints.length++ ];\n               newCheckPoint.fromBlock =  uint128(getBlockNumber());\n               newCheckPoint.value = uint128(_value);\n           } else {\n               Checkpoint oldCheckPoint = checkpoints[checkpoints.length-1];\n               oldCheckPoint.value = uint128(_value);\n           }\n    }\n\n    /// @dev Internal function to determine if an address is a contract\n    /// @param _addr The address being queried\n    /// @return True if `_addr` is a contract\n    function isContract(address _addr) constant internal returns(bool) {\n        uint size;\n        if (_addr == 0) return false;\n        assembly {\n            size := extcodesize(_addr)\n        }\n        return size>0;\n    }\n\n    /// @dev Helper function to return a min betwen the two uints\n    function min(uint a, uint b) internal returns (uint) {\n        return a < b ? a : b;\n    }\n\n    /// @notice The fallback function: If the contract's controller has not been\n    ///  set to 0, then the `proxyPayment` method is called which relays the\n    ///  ether and creates tokens as described in the token controller contract\n    function ()  payable {\n        if (isContract(controller)) {\n            if (! TokenController(controller).proxyPayment.value(msg.value)(msg.sender))\n                throw;\n        } else {\n            throw;\n        }\n    }\n\n\n//////////\n// Testing specific methods\n//////////\n\n    /// @notice This function is overridden by the test Mocks.\n    function getBlockNumber() internal constant returns (uint256) {\n        return block.number;\n    }\n\n//////////\n// Safety Methods\n//////////\n\n    /// @notice This method can be used by the controller to extract mistakenly\n    ///  sent tokens to this contract.\n    /// @param _token The address of the token contract that you want to recover\n    ///  set to 0 in case you want to extract ether.\n    function claimTokens(address _token) onlyController {\n        if (_token == 0x0) {\n            controller.transfer(this.balance);\n            return;\n        }\n\n        ERC20Token token = ERC20Token(_token);\n        uint balance = token.balanceOf(this);\n        token.transfer(controller, balance);\n        ClaimedTokens(_token, controller, balance);\n    }\n\n////////////////\n// Events\n////////////////\n\n    event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);\n    event Transfer(address indexed _from, address indexed _to, uint256 _amount);\n    event NewCloneToken(address indexed _cloneToken, uint _snapshotBlock);\n    event Approval(\n        address indexed _owner,\n        address indexed _spender,\n        uint256 _amount\n        );\n\n}\n\n\n////////////////\n// MiniMeTokenFactory\n////////////////\n\n/// @dev This contract is used to generate clone contracts from a contract.\n///  In solidity this is the way to create a contract from a contract of the\n///  same class\ncontract MiniMeTokenFactory {\n\n    /// @notice Update the DApp by creating a new token with new functionalities\n    ///  the msg.sender becomes the controller of this clone token\n    /// @param _parentToken Address of the token being cloned\n    /// @param _snapshotBlock Block of the parent token that will\n    ///  determine the initial distribution of the clone token\n    /// @param _tokenName Name of the new token\n    /// @param _decimalUnits Number of decimals of the new token\n    /// @param _tokenSymbol Token Symbol for the new token\n    /// @param _transfersEnabled If true, tokens will be able to be transferred\n    /// @return The address of the new token contract\n    function createCloneToken(\n        address _parentToken,\n        uint _snapshotBlock,\n        string _tokenName,\n        uint8 _decimalUnits,\n        string _tokenSymbol,\n        bool _transfersEnabled\n    ) returns (MiniMeToken) {\n        MiniMeToken newToken = new MiniMeToken(\n            this,\n            _parentToken,\n            _snapshotBlock,\n            _tokenName,\n            _decimalUnits,\n            _tokenSymbol,\n            _transfersEnabled\n            );\n\n        newToken.changeController(msg.sender);\n        return newToken;\n    }\n}\n"
  },
  {
    "path": "contracts/MultiSigWallet.sol",
    "content": "pragma solidity ^0.4.11;\n\n\n/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.\n/// @author Stefan George - <stefan.george@consensys.net>\ncontract MultiSigWallet {\n\n    uint constant public MAX_OWNER_COUNT = 50;\n\n    event Confirmation(address indexed _sender, uint indexed _transactionId);\n    event Revocation(address indexed _sender, uint indexed _transactionId);\n    event Submission(uint indexed _transactionId);\n    event Execution(uint indexed _transactionId);\n    event ExecutionFailure(uint indexed _transactionId);\n    event Deposit(address indexed _sender, uint _value);\n    event OwnerAddition(address indexed _owner);\n    event OwnerRemoval(address indexed _owner);\n    event RequirementChange(uint _required);\n\n    mapping (uint => Transaction) public transactions;\n    mapping (uint => mapping (address => bool)) public confirmations;\n    mapping (address => bool) public isOwner;\n    address[] public owners;\n    uint public required;\n    uint public transactionCount;\n\n    struct Transaction {\n        address destination;\n        uint value;\n        bytes data;\n        bool executed;\n    }\n\n    modifier onlyWallet() {\n        if (msg.sender != address(this))\n            throw;\n        _;\n    }\n\n    modifier ownerDoesNotExist(address owner) {\n        if (isOwner[owner])\n            throw;\n        _;\n    }\n\n    modifier ownerExists(address owner) {\n        if (!isOwner[owner])\n            throw;\n        _;\n    }\n\n    modifier transactionExists(uint transactionId) {\n        if (transactions[transactionId].destination == 0)\n            throw;\n        _;\n    }\n\n    modifier confirmed(uint transactionId, address owner) {\n        if (!confirmations[transactionId][owner])\n            throw;\n        _;\n    }\n\n    modifier notConfirmed(uint transactionId, address owner) {\n        if (confirmations[transactionId][owner])\n            throw;\n        _;\n    }\n\n    modifier notExecuted(uint transactionId) {\n        if (transactions[transactionId].executed)\n            throw;\n        _;\n    }\n\n    modifier notNull(address _address) {\n        if (_address == 0)\n            throw;\n        _;\n    }\n\n    modifier validRequirement(uint ownerCount, uint _required) {\n        if (   ownerCount > MAX_OWNER_COUNT\n            || _required > ownerCount\n            || _required == 0\n            || ownerCount == 0)\n            throw;\n        _;\n    }\n\n    /// @dev Fallback function allows to deposit ether.\n    function()\n        payable\n    {\n        if (msg.value > 0)\n            Deposit(msg.sender, msg.value);\n    }\n\n    /*\n     * Public functions\n     */\n    /// @dev Contract constructor sets initial owners and required number of confirmations.\n    /// @param _owners List of initial owners.\n    /// @param _required Number of required confirmations.\n    function MultiSigWallet(address[] _owners, uint _required)\n        public\n        validRequirement(_owners.length, _required)\n    {\n        for (uint i=0; i<_owners.length; i++) {\n            if (isOwner[_owners[i]] || _owners[i] == 0)\n                throw;\n            isOwner[_owners[i]] = true;\n        }\n        owners = _owners;\n        required = _required;\n    }\n\n    /// @dev Allows to add a new owner. Transaction has to be sent by wallet.\n    /// @param owner Address of new owner.\n    function addOwner(address owner)\n        public\n        onlyWallet\n        ownerDoesNotExist(owner)\n        notNull(owner)\n        validRequirement(owners.length + 1, required)\n    {\n        isOwner[owner] = true;\n        owners.push(owner);\n        OwnerAddition(owner);\n    }\n\n    /// @dev Allows to remove an owner. Transaction has to be sent by wallet.\n    /// @param owner Address of owner.\n    function removeOwner(address owner)\n        public\n        onlyWallet\n        ownerExists(owner)\n    {\n        isOwner[owner] = false;\n        for (uint i=0; i<owners.length - 1; i++)\n            if (owners[i] == owner) {\n                owners[i] = owners[owners.length - 1];\n                break;\n            }\n        owners.length -= 1;\n        if (required > owners.length)\n            changeRequirement(owners.length);\n        OwnerRemoval(owner);\n    }\n\n    /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.\n    /// @param owner Address of owner to be replaced.\n    /// @param owner Address of new owner.\n    function replaceOwner(address owner, address newOwner)\n        public\n        onlyWallet\n        ownerExists(owner)\n        ownerDoesNotExist(newOwner)\n    {\n        for (uint i=0; i<owners.length; i++)\n            if (owners[i] == owner) {\n                owners[i] = newOwner;\n                break;\n            }\n        isOwner[owner] = false;\n        isOwner[newOwner] = true;\n        OwnerRemoval(owner);\n        OwnerAddition(newOwner);\n    }\n\n    /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.\n    /// @param _required Number of required confirmations.\n    function changeRequirement(uint _required)\n        public\n        onlyWallet\n        validRequirement(owners.length, _required)\n    {\n        required = _required;\n        RequirementChange(_required);\n    }\n\n    /// @dev Allows an owner to submit and confirm a transaction.\n    /// @param destination Transaction target address.\n    /// @param value Transaction ether value.\n    /// @param data Transaction data payload.\n    /// @return Returns transaction ID.\n    function submitTransaction(address destination, uint value, bytes data)\n        public\n        returns (uint transactionId)\n    {\n        transactionId = addTransaction(destination, value, data);\n        confirmTransaction(transactionId);\n    }\n\n    /// @dev Allows an owner to confirm a transaction.\n    /// @param transactionId Transaction ID.\n    function confirmTransaction(uint transactionId)\n        public\n        ownerExists(msg.sender)\n        transactionExists(transactionId)\n        notConfirmed(transactionId, msg.sender)\n    {\n        confirmations[transactionId][msg.sender] = true;\n        Confirmation(msg.sender, transactionId);\n        executeTransaction(transactionId);\n    }\n\n    /// @dev Allows an owner to revoke a confirmation for a transaction.\n    /// @param transactionId Transaction ID.\n    function revokeConfirmation(uint transactionId)\n        public\n        ownerExists(msg.sender)\n        confirmed(transactionId, msg.sender)\n        notExecuted(transactionId)\n    {\n        confirmations[transactionId][msg.sender] = false;\n        Revocation(msg.sender, transactionId);\n    }\n\n    /// @dev Allows anyone to execute a confirmed transaction.\n    /// @param transactionId Transaction ID.\n    function executeTransaction(uint transactionId)\n        public\n        notExecuted(transactionId)\n    {\n        if (isConfirmed(transactionId)) {\n            Transaction tx = transactions[transactionId];\n            tx.executed = true;\n            if (tx.destination.call.value(tx.value)(tx.data))\n                Execution(transactionId);\n            else {\n                ExecutionFailure(transactionId);\n                tx.executed = false;\n            }\n        }\n    }\n\n    /// @dev Returns the confirmation status of a transaction.\n    /// @param transactionId Transaction ID.\n    /// @return Confirmation status.\n    function isConfirmed(uint transactionId)\n        public\n        constant\n        returns (bool)\n    {\n        uint count = 0;\n        for (uint i=0; i<owners.length; i++) {\n            if (confirmations[transactionId][owners[i]])\n                count += 1;\n            if (count == required)\n                return true;\n        }\n    }\n\n    /*\n     * Internal functions\n     */\n    /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.\n    /// @param destination Transaction target address.\n    /// @param value Transaction ether value.\n    /// @param data Transaction data payload.\n    /// @return Returns transaction ID.\n    function addTransaction(address destination, uint value, bytes data)\n        internal\n        notNull(destination)\n        returns (uint transactionId)\n    {\n        transactionId = transactionCount;\n        transactions[transactionId] = Transaction({\n            destination: destination,\n            value: value,\n            data: data,\n            executed: false\n        });\n        transactionCount += 1;\n        Submission(transactionId);\n    }\n\n    /*\n     * Web3 call functions\n     */\n    /// @dev Returns number of confirmations of a transaction.\n    /// @param transactionId Transaction ID.\n    /// @return Number of confirmations.\n    function getConfirmationCount(uint transactionId)\n        public\n        constant\n        returns (uint count)\n    {\n        for (uint i=0; i<owners.length; i++)\n            if (confirmations[transactionId][owners[i]])\n                count += 1;\n    }\n\n    /// @dev Returns total number of transactions after filters are applied.\n    /// @param pending Include pending transactions.\n    /// @param executed Include executed transactions.\n    /// @return Total number of transactions after filters are applied.\n    function getTransactionCount(bool pending, bool executed)\n        public\n        constant\n        returns (uint count)\n    {\n        for (uint i=0; i<transactionCount; i++)\n            if (   pending && !transactions[i].executed\n                || executed && transactions[i].executed)\n                count += 1;\n    }\n\n    /// @dev Returns list of owners.\n    /// @return List of owner addresses.\n    function getOwners()\n        public\n        constant\n        returns (address[])\n    {\n        return owners;\n    }\n\n    /// @dev Returns array with owner addresses, which confirmed transaction.\n    /// @param transactionId Transaction ID.\n    /// @return Returns array of owner addresses.\n    function getConfirmations(uint transactionId)\n        public\n        constant\n        returns (address[] _confirmations)\n    {\n        address[] memory confirmationsTemp = new address[](owners.length);\n        uint count = 0;\n        uint i;\n        for (i=0; i<owners.length; i++)\n            if (confirmations[transactionId][owners[i]]) {\n                confirmationsTemp[count] = owners[i];\n                count += 1;\n            }\n        _confirmations = new address[](count);\n        for (i=0; i<count; i++)\n            _confirmations[i] = confirmationsTemp[i];\n    }\n\n    /// @dev Returns list of transaction IDs in defined range.\n    /// @param from Index start position of transaction array.\n    /// @param to Index end position of transaction array.\n    /// @param pending Include pending transactions.\n    /// @param executed Include executed transactions.\n    /// @return Returns array of transaction IDs.\n    function getTransactionIds(uint from, uint to, bool pending, bool executed)\n        public\n        constant\n        returns (uint[] _transactionIds)\n    {\n        uint[] memory transactionIdsTemp = new uint[](transactionCount);\n        uint count = 0;\n        uint i;\n        for (i=0; i<transactionCount; i++)\n            if (   pending && !transactions[i].executed\n                || executed && transactions[i].executed)\n            {\n                transactionIdsTemp[count] = i;\n                count += 1;\n            }\n        _transactionIds = new uint[](to - from);\n        for (i=from; i<to; i++)\n            _transactionIds[i - from] = transactionIdsTemp[i];\n    }\n}\n"
  },
  {
    "path": "contracts/Owned.sol",
    "content": "pragma solidity ^0.4.11;\n\n\n/// @dev `Owned` is a base level contract that assigns an `owner` that can be\n///  later changed\ncontract Owned {\n\n    /// @dev `owner` is the only address that can call a function with this\n    /// modifier\n    modifier onlyOwner() {\n        require(msg.sender == owner);\n        _;\n    }\n\n    address public owner;\n\n    /// @notice The Constructor assigns the message sender to be `owner`\n    function Owned() {\n        owner = msg.sender;\n    }\n\n    address public newOwner;\n\n    /// @notice `owner` can step down and assign some other address to this role\n    /// @param _newOwner The address of the new owner. 0x0 can be used to create\n    ///  an unowned neutral vault, however that cannot be undone\n    function changeOwner(address _newOwner) onlyOwner {\n        newOwner = _newOwner;\n    }\n\n\n    function acceptOwnership() {\n        if (msg.sender == newOwner) {\n            owner = newOwner;\n        }\n    }\n}\n"
  },
  {
    "path": "contracts/SGT.sol",
    "content": "pragma solidity ^0.4.11;\n\n/*\n    Copyright 2017, Jarrad Hope (Status Research & Development GmbH)\n*/\n\n\nimport \"./MiniMeToken.sol\";\n\n\ncontract SGT is MiniMeToken {\n\n    uint256 constant D160 = 0x0010000000000000000000000000000000000000000;\n\n    function SGT(address _tokenFactory)\n            MiniMeToken(\n                _tokenFactory,\n                0x0,                     // no parent token\n                0,                       // no snapshot block number from parent\n                \"Status Genesis Token\",  // Token name\n                1,                       // Decimals\n                \"SGT\",                   // Symbol\n                false                    // Enable transfers\n            ) {}\n\n    // data is an array of uint256s. Each uint256 represents a transfer.\n    // The 160 LSB is the destination of the address that wants to be sent\n    // The 96 MSB is the amount of tokens that wants to be sent.\n    function multiMint(uint256[] data) public onlyController {\n        for (uint256 i = 0; i < data.length; i++) {\n            address addr = address(data[i] & (D160 - 1));\n            uint256 amount = data[i] / D160;\n\n            assert(generateTokens(addr, amount));\n        }\n    }\n\n}\n"
  },
  {
    "path": "contracts/SGTExchanger.sol",
    "content": "pragma solidity ^0.4.11;\n\n/*\n    Copyright 2017, Jordi Baylina\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/// @title SGTExchanger Contract\n/// @author Jordi Baylina\n/// @dev This contract will be used to distribute SNT between SGT holders.\n///  SGT token is not transferable, and we just keep an accounting between all tokens\n///  deposited and the tokens collected.\n///  The controllerShip of SGT should be transferred to this contract before the\n///  contribution period starts.\n\n\nimport \"./MiniMeToken.sol\";\nimport \"./SafeMath.sol\";\nimport \"./Owned.sol\";\nimport \"./StatusContribution.sol\";\nimport \"./ERC20Token.sol\";\n\ncontract SGTExchanger is TokenController, Owned {\n    using SafeMath for uint256;\n\n    mapping (address => uint256) public collected;\n    uint256 public totalCollected;\n    MiniMeToken public sgt;\n    MiniMeToken public snt;\n    StatusContribution public statusContribution;\n\n    function SGTExchanger(address _sgt, address _snt, address _statusContribution) {\n        sgt = MiniMeToken(_sgt);\n        snt = MiniMeToken(_snt);\n        statusContribution = StatusContribution(_statusContribution);\n    }\n\n    /// @notice This method should be called by the SGT holders to collect their\n    ///  corresponding SNTs\n    function collect() public {\n        uint256 finalizedBlock = statusContribution.finalizedBlock();\n\n        require(finalizedBlock != 0);\n        require(getBlockNumber() > finalizedBlock);\n\n        uint256 total = totalCollected.add(snt.balanceOf(address(this)));\n\n        uint256 balance = sgt.balanceOfAt(msg.sender, finalizedBlock);\n\n        // First calculate how much correspond to him\n        uint256 amount = total.mul(balance).div(sgt.totalSupplyAt(finalizedBlock));\n\n        // And then subtract the amount already collected\n        amount = amount.sub(collected[msg.sender]);\n\n        require(amount > 0);  // Notify the user that there are no tokens to exchange\n\n        totalCollected = totalCollected.add(amount);\n        collected[msg.sender] = collected[msg.sender].add(amount);\n\n        assert(snt.transfer(msg.sender, amount));\n\n        TokensCollected(msg.sender, amount);\n    }\n\n    function proxyPayment(address) public payable returns (bool) {\n        throw;\n    }\n\n    function onTransfer(address, address, uint256) public returns (bool) {\n        return false;\n    }\n\n    function onApprove(address, address, uint256) public returns (bool) {\n        return false;\n    }\n\n    //////////\n    // Testing specific methods\n    //////////\n\n    /// @notice This function is overridden by the test Mocks.\n    function getBlockNumber() internal constant returns (uint256) {\n        return block.number;\n    }\n\n    //////////\n    // Safety Method\n    //////////\n\n    /// @notice This method can be used by the controller to extract mistakenly\n    ///  sent tokens to this contract.\n    /// @param _token The address of the token contract that you want to recover\n    ///  set to 0 in case you want to extract ether.\n    function claimTokens(address _token) public onlyOwner {\n        require(_token != address(snt));\n        if (_token == 0x0) {\n            owner.transfer(this.balance);\n            return;\n        }\n\n        ERC20Token token = ERC20Token(_token);\n        uint256 balance = token.balanceOf(this);\n        token.transfer(owner, balance);\n        ClaimedTokens(_token, owner, balance);\n    }\n\n    event ClaimedTokens(address indexed _token, address indexed _controller, uint256 _amount);\n    event TokensCollected(address indexed _holder, uint256 _amount);\n\n}\n"
  },
  {
    "path": "contracts/SNT.sol",
    "content": "pragma solidity ^0.4.11;\n\n/*\n    Copyright 2017, Jarrad Hope (Status Research & Development GmbH)\n*/\n\n\nimport \"./MiniMeToken.sol\";\n\n\ncontract SNT is MiniMeToken {\n    // @dev SNT constructor just parametrizes the MiniMeIrrevocableVestedToken constructor\n    function SNT(address _tokenFactory)\n            MiniMeToken(\n                _tokenFactory,\n                0x0,                     // no parent token\n                0,                       // no snapshot block number from parent\n                \"Status Network Token\",  // Token name\n                18,                      // Decimals\n                \"SNT\",                   // Symbol\n                true                     // Enable transfers\n            ) {}\n}\n"
  },
  {
    "path": "contracts/SNTPlaceHolder.sol",
    "content": "pragma solidity ^0.4.11;\n\n/*\n    Copyright 2017, Jordi Baylina\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/// @title SNTPlaceholder Contract\n/// @author Jordi Baylina\n/// @dev The SNTPlaceholder contract will take control over the SNT after the contribution\n///  is finalized and before the Status Network is deployed.\n///  The contract allows for SNT transfers and transferFrom and implements the\n///  logic for transferring control of the token to the network when the offering\n///  asks it to do so.\n\n\nimport \"./MiniMeToken.sol\";\nimport \"./StatusContribution.sol\";\nimport \"./SafeMath.sol\";\nimport \"./Owned.sol\";\nimport \"./ERC20Token.sol\";\n\n\ncontract SNTPlaceHolder is TokenController, Owned {\n    using SafeMath for uint256;\n\n    MiniMeToken public snt;\n    StatusContribution public contribution;\n    uint256 public activationTime;\n    address public sgtExchanger;\n\n    /// @notice Constructor\n    /// @param _owner Trusted owner for this contract.\n    /// @param _snt SNT token contract address\n    /// @param _contribution StatusContribution contract address\n    /// @param _sgtExchanger SGT-SNT Exchange address. (During the first week\n    ///  only this exchanger will be able to move tokens)\n    function SNTPlaceHolder(address _owner, address _snt, address _contribution, address _sgtExchanger) {\n        owner = _owner;\n        snt = MiniMeToken(_snt);\n        contribution = StatusContribution(_contribution);\n        sgtExchanger = _sgtExchanger;\n    }\n\n    /// @notice The owner of this contract can change the controller of the SNT token\n    ///  Please, be sure that the owner is a trusted agent or 0x0 address.\n    /// @param _newController The address of the new controller\n\n    function changeController(address _newController) public onlyOwner {\n        snt.changeController(_newController);\n        ControllerChanged(_newController);\n    }\n\n\n    //////////\n    // MiniMe Controller Interface functions\n    //////////\n\n    // In between the offering and the network. Default settings for allowing token transfers.\n    function proxyPayment(address) public payable returns (bool) {\n        return false;\n    }\n\n    function onTransfer(address _from, address, uint256) public returns (bool) {\n        return transferable(_from);\n    }\n\n    function onApprove(address _from, address, uint256) public returns (bool) {\n        return transferable(_from);\n    }\n\n    function transferable(address _from) internal returns (bool) {\n        // Allow the exchanger to work from the beginning\n        if (activationTime == 0) {\n            uint256 f = contribution.finalizedTime();\n            if (f > 0) {\n                activationTime = f.add(1 weeks);\n            } else {\n                return false;\n            }\n        }\n        return (getTime() > activationTime) || (_from == sgtExchanger);\n    }\n\n\n    //////////\n    // Testing specific methods\n    //////////\n\n    /// @notice This function is overrided by the test Mocks.\n    function getTime() internal returns (uint256) {\n        return now;\n    }\n\n\n    //////////\n    // Safety Methods\n    //////////\n\n    /// @notice This method can be used by the controller to extract mistakenly\n    ///  sent tokens to this contract.\n    /// @param _token The address of the token contract that you want to recover\n    ///  set to 0 in case you want to extract ether.\n    function claimTokens(address _token) public onlyOwner {\n        if (snt.controller() == address(this)) {\n            snt.claimTokens(_token);\n        }\n        if (_token == 0x0) {\n            owner.transfer(this.balance);\n            return;\n        }\n\n        ERC20Token token = ERC20Token(_token);\n        uint256 balance = token.balanceOf(this);\n        token.transfer(owner, balance);\n        ClaimedTokens(_token, owner, balance);\n    }\n\n    event ClaimedTokens(address indexed _token, address indexed _controller, uint256 _amount);\n    event ControllerChanged(address indexed _newController);\n}\n"
  },
  {
    "path": "contracts/SafeMath.sol",
    "content": "pragma solidity ^0.4.11;\n\n\n/**\n * Math operations with safety checks\n */\nlibrary SafeMath {\n  function mul(uint a, uint b) internal returns (uint) {\n    uint c = a * b;\n    assert(a == 0 || c / a == b);\n    return c;\n  }\n\n  function div(uint a, uint b) internal returns (uint) {\n    // assert(b > 0); // Solidity automatically throws when dividing by 0\n    uint c = a / b;\n    // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n    return c;\n  }\n\n  function sub(uint a, uint b) internal returns (uint) {\n    assert(b <= a);\n    return a - b;\n  }\n\n  function add(uint a, uint b) internal returns (uint) {\n    uint c = a + b;\n    assert(c >= a);\n    return c;\n  }\n\n  function max64(uint64 a, uint64 b) internal constant returns (uint64) {\n    return a >= b ? a : b;\n  }\n\n  function min64(uint64 a, uint64 b) internal constant returns (uint64) {\n    return a < b ? a : b;\n  }\n\n  function max256(uint256 a, uint256 b) internal constant returns (uint256) {\n    return a >= b ? a : b;\n  }\n\n  function min256(uint256 a, uint256 b) internal constant returns (uint256) {\n    return a < b ? a : b;\n  }\n}\n"
  },
  {
    "path": "contracts/StatusContribution.sol",
    "content": "pragma solidity ^0.4.11;\n\n/*\n    Copyright 2017, Jordi Baylina\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\n/// @title StatusContribution Contract\n/// @author Jordi Baylina\n/// @dev This contract will be the SNT controller during the contribution period.\n///  This contract will determine the rules during this period.\n///  Final users will generally not interact directly with this contract. ETH will\n///  be sent to the SNT token contract. The ETH is sent to this contract and from here,\n///  ETH is sent to the contribution walled and SNTs are mined according to the defined\n///  rules.\n\n\nimport \"./Owned.sol\";\nimport \"./MiniMeToken.sol\";\nimport \"./DynamicCeiling.sol\";\nimport \"./SafeMath.sol\";\nimport \"./ERC20Token.sol\";\n\n\ncontract StatusContribution is Owned, TokenController {\n    using SafeMath for uint256;\n\n    uint256 constant public failSafeLimit = 300000 ether;\n    uint256 constant public maxGuaranteedLimit = 30000 ether;\n    uint256 constant public exchangeRate = 10000;\n    uint256 constant public maxGasPrice = 50000000000;\n    uint256 constant public maxCallFrequency = 100;\n\n    MiniMeToken public SGT;\n    MiniMeToken public SNT;\n    uint256 public startBlock;\n    uint256 public endBlock;\n\n    address public destEthDevs;\n\n    address public destTokensDevs;\n    address public destTokensReserve;\n    uint256 public maxSGTSupply;\n    address public destTokensSgt;\n    DynamicCeiling public dynamicCeiling;\n\n    address public sntController;\n\n    mapping (address => uint256) public guaranteedBuyersLimit;\n    mapping (address => uint256) public guaranteedBuyersBought;\n\n    uint256 public totalGuaranteedCollected;\n    uint256 public totalNormalCollected;\n\n    uint256 public finalizedBlock;\n    uint256 public finalizedTime;\n\n    mapping (address => uint256) public lastCallBlock;\n\n    bool public paused;\n\n    modifier initialized() {\n        require(address(SNT) != 0x0);\n        _;\n    }\n\n    modifier contributionOpen() {\n        require(getBlockNumber() >= startBlock &&\n                getBlockNumber() <= endBlock &&\n                finalizedBlock == 0 &&\n                address(SNT) != 0x0);\n        _;\n    }\n\n    modifier notPaused() {\n        require(!paused);\n        _;\n    }\n\n    function StatusContribution() {\n        paused = false;\n    }\n\n\n    /// @notice This method should be called by the owner before the contribution\n    ///  period starts This initializes most of the parameters\n    /// @param _snt Address of the SNT token contract\n    /// @param _sntController Token controller for the SNT that will be transferred after\n    ///  the contribution finalizes.\n    /// @param _startBlock Block when the contribution period starts\n    /// @param _endBlock The last block that the contribution period is active\n    /// @param _dynamicCeiling Address of the contract that controls the ceiling\n    /// @param _destEthDevs Destination address where the contribution ether is sent\n    /// @param _destTokensReserve Address where the tokens for the reserve are sent\n    /// @param _destTokensSgt Address of the exchanger SGT-SNT where the SNT are sent\n    ///  to be distributed to the SGT holders.\n    /// @param _destTokensDevs Address where the tokens for the dev are sent\n    /// @param _sgt Address of the SGT token contract\n    /// @param _maxSGTSupply Quantity of SGT tokens that would represent 10% of status.\n    function initialize(\n        address _snt,\n        address _sntController,\n\n        uint256 _startBlock,\n        uint256 _endBlock,\n\n        address _dynamicCeiling,\n\n        address _destEthDevs,\n\n        address _destTokensReserve,\n        address _destTokensSgt,\n        address _destTokensDevs,\n\n        address _sgt,\n        uint256 _maxSGTSupply\n    ) public onlyOwner {\n        // Initialize only once\n        require(address(SNT) == 0x0);\n\n        SNT = MiniMeToken(_snt);\n        require(SNT.totalSupply() == 0);\n        require(SNT.controller() == address(this));\n        require(SNT.decimals() == 18);  // Same amount of decimals as ETH\n\n        require(_sntController != 0x0);\n        sntController = _sntController;\n\n        require(_startBlock >= getBlockNumber());\n        require(_startBlock < _endBlock);\n        startBlock = _startBlock;\n        endBlock = _endBlock;\n\n        require(_dynamicCeiling != 0x0);\n        dynamicCeiling = DynamicCeiling(_dynamicCeiling);\n\n        require(_destEthDevs != 0x0);\n        destEthDevs = _destEthDevs;\n\n        require(_destTokensReserve != 0x0);\n        destTokensReserve = _destTokensReserve;\n\n        require(_destTokensSgt != 0x0);\n        destTokensSgt = _destTokensSgt;\n\n        require(_destTokensDevs != 0x0);\n        destTokensDevs = _destTokensDevs;\n\n        require(_sgt != 0x0);\n        SGT = MiniMeToken(_sgt);\n\n        require(_maxSGTSupply >= MiniMeToken(SGT).totalSupply());\n        maxSGTSupply = _maxSGTSupply;\n    }\n\n    /// @notice Sets the limit for a guaranteed address. All the guaranteed addresses\n    ///  will be able to get SNTs during the contribution period with his own\n    ///  specific limit.\n    ///  This method should be called by the owner after the initialization\n    ///  and before the contribution starts.\n    /// @param _th Guaranteed address\n    /// @param _limit Limit for the guaranteed address.\n    function setGuaranteedAddress(address _th, uint256 _limit) public initialized onlyOwner {\n        require(getBlockNumber() < startBlock);\n        require(_limit > 0 && _limit <= maxGuaranteedLimit);\n        guaranteedBuyersLimit[_th] = _limit;\n        GuaranteedAddress(_th, _limit);\n    }\n\n    /// @notice If anybody sends Ether directly to this contract, consider he is\n    ///  getting SNTs.\n    function () public payable notPaused {\n        proxyPayment(msg.sender);\n    }\n\n\n    //////////\n    // MiniMe Controller functions\n    //////////\n\n    /// @notice This method will generally be called by the SNT token contract to\n    ///  acquire SNTs. Or directly from third parties that want to acquire SNTs in\n    ///  behalf of a token holder.\n    /// @param _th SNT holder where the SNTs will be minted.\n    function proxyPayment(address _th) public payable notPaused initialized contributionOpen returns (bool) {\n        require(_th != 0x0);\n        if (guaranteedBuyersLimit[_th] > 0) {\n            buyGuaranteed(_th);\n        } else {\n            buyNormal(_th);\n        }\n        return true;\n    }\n\n    function onTransfer(address, address, uint256) public returns (bool) {\n        return false;\n    }\n\n    function onApprove(address, address, uint256) public returns (bool) {\n        return false;\n    }\n\n    function buyNormal(address _th) internal {\n        require(tx.gasprice <= maxGasPrice);\n\n        // Antispam mechanism\n        address caller;\n        if (msg.sender == address(SNT)) {\n            caller = _th;\n        } else {\n            caller = msg.sender;\n        }\n\n        // Do not allow contracts to game the system\n        require(!isContract(caller));\n\n        require(getBlockNumber().sub(lastCallBlock[caller]) >= maxCallFrequency);\n        lastCallBlock[caller] = getBlockNumber();\n\n        uint256 toCollect = dynamicCeiling.toCollect(totalNormalCollected);\n\n        uint256 toFund;\n        if (msg.value <= toCollect) {\n            toFund = msg.value;\n        } else {\n            toFund = toCollect;\n        }\n\n        totalNormalCollected = totalNormalCollected.add(toFund);\n        doBuy(_th, toFund, false);\n    }\n\n    function buyGuaranteed(address _th) internal {\n        uint256 toCollect = guaranteedBuyersLimit[_th];\n\n        uint256 toFund;\n        if (guaranteedBuyersBought[_th].add(msg.value) > toCollect) {\n            toFund = toCollect.sub(guaranteedBuyersBought[_th]);\n        } else {\n            toFund = msg.value;\n        }\n\n        guaranteedBuyersBought[_th] = guaranteedBuyersBought[_th].add(toFund);\n        totalGuaranteedCollected = totalGuaranteedCollected.add(toFund);\n        doBuy(_th, toFund, true);\n    }\n\n    function doBuy(address _th, uint256 _toFund, bool _guaranteed) internal {\n        assert(msg.value >= _toFund);  // Not needed, but double check.\n        assert(totalCollected() <= failSafeLimit);\n\n        if (_toFund > 0) {\n            uint256 tokensGenerated = _toFund.mul(exchangeRate);\n            assert(SNT.generateTokens(_th, tokensGenerated));\n            destEthDevs.transfer(_toFund);\n            NewSale(_th, _toFund, tokensGenerated, _guaranteed);\n        }\n\n        uint256 toReturn = msg.value.sub(_toFund);\n        if (toReturn > 0) {\n            // If the call comes from the Token controller,\n            // then we return it to the token Holder.\n            // Otherwise we return to the sender.\n            if (msg.sender == address(SNT)) {\n                _th.transfer(toReturn);\n            } else {\n                msg.sender.transfer(toReturn);\n            }\n        }\n    }\n\n    // NOTE on Percentage format\n    // Right now, Solidity does not support decimal numbers. (This will change very soon)\n    //  So in this contract we use a representation of a percentage that consist in\n    //  expressing the percentage in \"x per 10**18\"\n    // This format has a precision of 16 digits for a percent.\n    // Examples:\n    //  3%   =   3*(10**16)\n    //  100% = 100*(10**16) = 10**18\n    //\n    // To get a percentage of a value we do it by first multiplying it by the percentage in  (x per 10^18)\n    //  and then divide it by 10**18\n    //\n    //              Y * X(in x per 10**18)\n    //  X% of Y = -------------------------\n    //               100(in x per 10**18)\n    //\n\n\n    /// @notice This method will can be called by the owner before the contribution period\n    ///  end or by anybody after the `endBlock`. This method finalizes the contribution period\n    ///  by creating the remaining tokens and transferring the controller to the configured\n    ///  controller.\n    function finalize() public initialized {\n        require(getBlockNumber() >= startBlock);\n        require(msg.sender == owner || getBlockNumber() > endBlock);\n        require(finalizedBlock == 0);\n\n        // Do not allow termination until all curves revealed.\n        require(dynamicCeiling.allRevealed());\n\n        // Allow premature finalization if final limit is reached\n        if (getBlockNumber() <= endBlock) {\n            var (,lastLimit,,) = dynamicCeiling.curves(dynamicCeiling.revealedCurves().sub(1));\n            require(totalNormalCollected >= lastLimit);\n        }\n\n        finalizedBlock = getBlockNumber();\n        finalizedTime = now;\n\n        uint256 percentageToSgt;\n        if (SGT.totalSupply() >= maxSGTSupply) {\n            percentageToSgt = percent(10);  // 10%\n        } else {\n\n            //\n            //                           SGT.totalSupply()\n            //  percentageToSgt = 10% * -------------------\n            //                             maxSGTSupply\n            //\n            percentageToSgt = percent(10).mul(SGT.totalSupply()).div(maxSGTSupply);\n        }\n\n        uint256 percentageToDevs = percent(20);  // 20%\n\n\n        //\n        //  % To Contributors = 41% + (10% - % to SGT holders)\n        //\n        uint256 percentageToContributors = percent(41).add(percent(10).sub(percentageToSgt));\n\n        uint256 percentageToReserve = percent(29);\n\n\n        // SNT.totalSupply() -> Tokens minted during the contribution\n        //  totalTokens  -> Total tokens that should be after the allocation\n        //                   of devTokens, sgtTokens and reserve\n        //  percentageToContributors -> Which percentage should go to the\n        //                               contribution participants\n        //                               (x per 10**18 format)\n        //  percent(100) -> 100% in (x per 10**18 format)\n        //\n        //                       percentageToContributors\n        //  SNT.totalSupply() = -------------------------- * totalTokens  =>\n        //                             percent(100)\n        //\n        //\n        //                            percent(100)\n        //  =>  totalTokens = ---------------------------- * SNT.totalSupply()\n        //                      percentageToContributors\n        //\n        uint256 totalTokens = SNT.totalSupply().mul(percent(100)).div(percentageToContributors);\n\n\n        // Generate tokens for SGT Holders.\n\n        //\n        //                    percentageToReserve\n        //  reserveTokens = ----------------------- * totalTokens\n        //                      percentage(100)\n        //\n        assert(SNT.generateTokens(\n            destTokensReserve,\n            totalTokens.mul(percentageToReserve).div(percent(100))));\n\n        //\n        //                  percentageToSgt\n        //  sgtTokens = ----------------------- * totalTokens\n        //                   percentage(100)\n        //\n        assert(SNT.generateTokens(\n            destTokensSgt,\n            totalTokens.mul(percentageToSgt).div(percent(100))));\n\n\n        //\n        //                   percentageToDevs\n        //  devTokens = ----------------------- * totalTokens\n        //                   percentage(100)\n        //\n        assert(SNT.generateTokens(\n            destTokensDevs,\n            totalTokens.mul(percentageToDevs).div(percent(100))));\n\n        SNT.changeController(sntController);\n\n        Finalized();\n    }\n\n    function percent(uint256 p) internal returns (uint256) {\n        return p.mul(10**16);\n    }\n\n    /// @dev Internal function to determine if an address is a contract\n    /// @param _addr The address being queried\n    /// @return True if `_addr` is a contract\n    function isContract(address _addr) constant internal returns (bool) {\n        if (_addr == 0) return false;\n        uint256 size;\n        assembly {\n            size := extcodesize(_addr)\n        }\n        return (size > 0);\n    }\n\n\n    //////////\n    // Constant functions\n    //////////\n\n    /// @return Total tokens issued in weis.\n    function tokensIssued() public constant returns (uint256) {\n        return SNT.totalSupply();\n    }\n\n    /// @return Total Ether collected.\n    function totalCollected() public constant returns (uint256) {\n        return totalNormalCollected.add(totalGuaranteedCollected);\n    }\n\n\n    //////////\n    // Testing specific methods\n    //////////\n\n    /// @notice This function is overridden by the test Mocks.\n    function getBlockNumber() internal constant returns (uint256) {\n        return block.number;\n    }\n\n\n    //////////\n    // Safety Methods\n    //////////\n\n    /// @notice This method can be used by the controller to extract mistakenly\n    ///  sent tokens to this contract.\n    /// @param _token The address of the token contract that you want to recover\n    ///  set to 0 in case you want to extract ether.\n    function claimTokens(address _token) public onlyOwner {\n        if (SNT.controller() == address(this)) {\n            SNT.claimTokens(_token);\n        }\n        if (_token == 0x0) {\n            owner.transfer(this.balance);\n            return;\n        }\n\n        ERC20Token token = ERC20Token(_token);\n        uint256 balance = token.balanceOf(this);\n        token.transfer(owner, balance);\n        ClaimedTokens(_token, owner, balance);\n    }\n\n\n    /// @notice Pauses the contribution if there is any issue\n    function pauseContribution() onlyOwner {\n        paused = true;\n    }\n\n    /// @notice Resumes the contribution\n    function resumeContribution() onlyOwner {\n        paused = false;\n    }\n\n    event ClaimedTokens(address indexed _token, address indexed _controller, uint256 _amount);\n    event NewSale(address indexed _th, uint256 _amount, uint256 _tokens, bool _guaranteed);\n    event GuaranteedAddress(address indexed _th, uint256 _limit);\n    event Finalized();\n}\n"
  },
  {
    "path": "contracts/test/DevTokensHolderMock.sol",
    "content": "pragma solidity ^0.4.11;\n\nimport '../DevTokensHolder.sol';\n\n// @dev DevTokensHolderMock mocks current block number\n\ncontract DevTokensHolderMock is DevTokensHolder {\n\n    uint mock_time;\n\n    function DevTokensHolderMock(address _owner, address _contribution, address _snt)\n    DevTokensHolder(_owner, _contribution, _snt) {\n        mock_time = now;\n    }\n\n    function getTime() internal returns (uint) {\n        return mock_time;\n    }\n\n    function setMockedTime(uint _t) {\n        mock_time = _t;\n    }\n}\n"
  },
  {
    "path": "contracts/test/ExternalToken.sol",
    "content": "pragma solidity ^0.4.11;\n\nimport \"../MiniMeToken.sol\";\n\ncontract ExternalToken is MiniMeToken {\n\n    function ExternalToken(address _tokenFactory)\n            MiniMeToken(\n                _tokenFactory,\n                0x0,                           // no parent token\n                0,                             // no snapshot block number from parent\n                \"External Token for testing\",  // Token name\n                1,                             // Decimals\n                \"EXT\",                         // Symbol\n                true                           // Enable transfers\n            ) {}\n}\n"
  },
  {
    "path": "contracts/test/Migrations.sol",
    "content": "pragma solidity ^0.4.11;\n\ncontract Migrations {\n  address public owner;\n  uint public last_completed_migration;\n\n  modifier restricted() {\n    if (msg.sender == owner) _;\n  }\n\n  function Migrations() {\n    owner = msg.sender;\n  }\n\n  function setCompleted(uint completed) restricted {\n    last_completed_migration = completed;\n  }\n\n  function upgrade(address new_address) restricted {\n    Migrations upgraded = Migrations(new_address);\n    upgraded.setCompleted(last_completed_migration);\n  }\n}\n"
  },
  {
    "path": "contracts/test/SGTExchangerMock.sol",
    "content": "pragma solidity ^0.4.11;\n\nimport '../SGTExchanger.sol';\n\n// @dev SGTExchangerMock mocks current block number\n\ncontract SGTExchangerMock is SGTExchanger {\n\n    function SGTExchangerMock(address _sgt, address _snt, address _statusContribution)\n        SGTExchanger(_sgt,  _snt, _statusContribution) {}\n\n    function getBlockNumber() internal constant returns (uint) {\n        return mock_blockNumber;\n    }\n\n    function setMockedBlockNumber(uint _b) public {\n        mock_blockNumber = _b;\n    }\n\n    uint public mock_blockNumber = 1;\n}\n"
  },
  {
    "path": "contracts/test/SGTMock.sol",
    "content": "pragma solidity ^0.4.11;\n\nimport '../SGT.sol';\n\n// @dev SGTMock mocks current block number\n\ncontract SGTMock is SGT {\n\n    function SGTMock(address _tokenFactory) SGT(_tokenFactory) {}\n\n    function getBlockNumber() internal constant returns (uint) {\n        return mock_blockNumber;\n    }\n\n    function setMockedBlockNumber(uint _b) public {\n        mock_blockNumber = _b;\n    }\n\n    uint mock_blockNumber = 1;\n}\n"
  },
  {
    "path": "contracts/test/SNTMock.sol",
    "content": "pragma solidity ^0.4.11;\n\nimport '../SNT.sol';\n\n// @dev SNTMock mocks current block number\n\ncontract SNTMock is SNT {\n\n    function SNTMock(address _tokenFactory) SNT(_tokenFactory) {}\n\n    function getBlockNumber() internal constant returns (uint) {\n        return mock_blockNumber;\n    }\n\n    function setMockedBlockNumber(uint _b) public {\n        mock_blockNumber = _b;\n    }\n\n    uint mock_blockNumber = 1;\n}\n"
  },
  {
    "path": "contracts/test/SNTPlaceHolderMock.sol",
    "content": "pragma solidity ^0.4.11;\n\nimport '../SNTPlaceHolder.sol';\n\n// @dev SNTPlaceHolderMock mocks current block number\n\ncontract SNTPlaceHolderMock is SNTPlaceHolder {\n\n    uint mock_time;\n\n    function SNTPlaceHolderMock(address _owner, address _snt, address _contribution, address _sgtExchanger)\n            SNTPlaceHolder(_owner, _snt, _contribution, _sgtExchanger) {\n        mock_time = now;\n    }\n\n    function getTime() internal returns (uint) {\n        return mock_time;\n    }\n\n    function setMockedTime(uint _t) public {\n        mock_time = _t;\n    }\n}\n"
  },
  {
    "path": "contracts/test/StatusContributionMock.sol",
    "content": "pragma solidity ^0.4.11;\n\nimport '../StatusContribution.sol';\n\n// @dev StatusContributionMock mocks current block number\n\ncontract StatusContributionMock is StatusContribution {\n\n    function StatusContributionMock() StatusContribution() {}\n\n    function getBlockNumber() internal constant returns (uint) {\n        return mock_blockNumber;\n    }\n\n    function setMockedBlockNumber(uint _b) public {\n        mock_blockNumber = _b;\n    }\n\n    uint mock_blockNumber = 1;\n}\n"
  },
  {
    "path": "migrations/1_initial_migration.js",
    "content": "var Migrations = artifacts.require(\"./Migrations.sol\");\n\nmodule.exports = function(deployer) {\n    deployer.deploy(Migrations);\n};\n"
  },
  {
    "path": "migrations/2_deploy_contracts.js",
    "content": "const randomBytes = require(\"random-bytes\");\n\nconst MultiSigWallet = artifacts.require(\"MultiSigWallet\");\nconst MiniMeTokenFactory = artifacts.require(\"MiniMeTokenFactory\");\nconst SGT = artifacts.require(\"SGT\");\nconst SNT = artifacts.require(\"SNT\");\nconst StatusContribution= artifacts.require(\"StatusContribution\");\nconst ContributionWallet = artifacts.require(\"ContributionWallet\");\nconst DevTokensHolder = artifacts.require(\"DevTokensHolder\");\nconst SGTExchanger = artifacts.require(\"SGTExchanger\");\nconst DynamicCeiling = artifacts.require(\"DynamicCeiling\");\nconst SNTPlaceHolder = artifacts.require(\"SNTPlaceHolder\");\n\n\n// Set hidden curves\nconst setHiddenCurves = async function(dynamicCeiling, curves, nHiddenCurves) {\n    let hashes = [];\n    let i = 0;\n    for (let c of curves) {\n        let salt = await randomBytes(32);\n        console.log(`Curve ${i} has salt: ${salt.toString(\"hex\")}`);\n        let h = await dynamicCeiling.calculateHash(c[0], c[1], c[2], i === curves.length - 1, salt);\n        hashes.push(h);\n        i += 1;\n    }\n    for (; i < nHiddenCurves; i += 1) {\n        let salt = randomBytes(32);\n        hashes.push(web3.sha3(salt));\n    }\n    await dynamicCeiling.setHiddenCurves(hashes);\n    console.log(`${i} curves set!`);\n};\n\n\n// All of these constants need to be configured before deploy\nconst addressOwner = \"0xf93df8c288b9020e76583a6997362e89e0599e99\";\nconst addressesStatus = [\n    \"0x2ca9d4d0fd9622b08de76c1d484e69a6311db765\",\n];\nconst multisigStatusReqs = 1\nconst addressesCommunity = [\n    \"0x166ddbcfe4d5849b0c62063747966a13706a4af7\",\n];\nconst multisigCommunityReqs = 1\nconst addressesReserve = [\n    \"0x4781fee94e7257ffb6e3a3dcc5f8571ddcc02109\",\n];\nconst multisigReserveReqs = 1\nconst addressesDevs = [\n    \"0xcee9f54a23324867d8537589ba8dc6c8a6e9d0b9\",\n];\nconst multisigDevsReqs = 1\nconst addressSGT = \"\";\n\nconst startBlock = 3800000;\nconst endBlock = 3900000;\n\nconst maxSGTSupply = 500000000;\n\nconst curves = [\n    [web3.toWei(1000), 30, 10**12],\n    [web3.toWei(21000), 30, 10**12],\n    [web3.toWei(61000), 30, 10**12],\n];\nconst nHiddenCurves = 7;\n\n\nmodule.exports = async function(deployer, network, accounts) {\n    if (network === \"development\") return;  // Don't deploy on tests\n\n    // MultiSigWallet send\n    let multisigStatusFuture = MultiSigWallet.new(addressesStatus, multisigStatusReqs);\n    let multisigCommunityFuture = MultiSigWallet.new(addressesCommunity, multisigCommunityReqs);\n    let multisigReserveFuture = MultiSigWallet.new(addressesReserve, multisigReserveReqs);\n    let multisigDevsFuture = MultiSigWallet.new(addressesDevs, multisigDevsReqs);\n    // MiniMeTokenFactory send\n    let miniMeTokenFactoryFuture = MiniMeTokenFactory.new();\n\n    // MultiSigWallet wait\n    let multisigStatus = await multisigStatusFuture;\n    console.log(\"\\nMultiSigWallet Status: \" + multisigStatus.address);\n    let multisigCommunity = await multisigCommunityFuture;\n    console.log(\"MultiSigWallet Community: \" + multisigCommunity.address);\n    let multisigReserve = await multisigReserveFuture;\n    console.log(\"MultiSigWallet Reserve: \" + multisigReserve.address);\n    let multisigDevs = await multisigDevsFuture;\n    console.log(\"MultiSigWallet Devs: \" + multisigDevs.address);\n    // MiniMeTokenFactory wait\n    let miniMeTokenFactory = await miniMeTokenFactoryFuture;\n    console.log(\"MiniMeTokenFactory: \" + miniMeTokenFactory.address);\n    console.log();\n\n    // SGT send\n    let sgtFuture;\n    if (addressSGT.length === 0) {  // Testnet\n        sgtFuture = SGT.new(miniMeTokenFactory.address);\n    } else {\n        sgtFuture = SGT.at(addressSGT);\n    }\n    // SNT send\n    let sntFuture = SNT.new(miniMeTokenFactory.address);\n    // StatusContribution send\n    let statusContributionFuture = StatusContribution.new();\n\n    // SGT wait\n    let sgt = await sgtFuture;\n    console.log(\"SGT: \" + sgt.address);\n    // SNT wait\n    let snt = await sntFuture;\n    console.log(\"SNT: \" + snt.address);\n    // StatusContribution wait\n    let statusContribution = await statusContributionFuture;\n    console.log(\"StatusContribution: \" + statusContribution.address);\n    console.log();\n\n    // SNT initialize checkpoints for 0th TX gas savings\n    await snt.generateTokens('0x0', 1);\n    await snt.destroyTokens('0x0', 1);\n\n    // SNT changeController send\n    let sntChangeControllerFuture = snt.changeController(statusContribution.address);\n    // ContributionWallet send\n    let contributionWalletFuture = ContributionWallet.new(\n        multisigStatus.address,\n        endBlock,\n        statusContribution.address);\n    // DevTokensHolder send\n    let devTokensHolderFuture = DevTokensHolder.new(\n        multisigDevs.address,\n        statusContribution.address,\n        snt.address);\n    // SGTExchanger send\n    let sgtExchangerFuture = SGTExchanger.new(sgt.address, snt.address, statusContribution.address);\n    // DynamicCeiling send\n    let dynamicCeilingFuture = DynamicCeiling.new(addressOwner, statusContribution.address);\n\n    // SNT changeController wait\n    await sntChangeControllerFuture;\n    console.log(\"SNT changed controller!\");\n    // ContributionWallet wait\n    let contributionWallet = await contributionWalletFuture;\n    console.log(\"ContributionWallet: \" + contributionWallet.address);\n    // DevTokensHolder wait\n    let devTokensHolder = await devTokensHolderFuture;\n    console.log(\"DevTokensHolder: \" + devTokensHolder.address);\n    // SGTExchanger wait\n    let sgtExchanger = await sgtExchangerFuture;\n    console.log(\"SGTExchanger: \" + sgtExchanger.address);\n    // DynamicCeiling wait\n    let dynamicCeiling = await dynamicCeilingFuture;\n    console.log(\"DynamicCeiling: \" + dynamicCeiling.address);\n    console.log();\n\n    // DynamicCeiling setHiddenCurves send\n    let dynamicCeilingSetHiddenCurvesFuture = setHiddenCurves(dynamicCeiling, curves, nHiddenCurves);\n    console.log();\n    // SNTPlaceHolder send\n    let sntPlaceHolderFuture = SNTPlaceHolder.new(\n        multisigCommunity.address,\n        snt.address,\n        statusContribution.address,\n        sgtExchanger.address);\n\n    // DynamicCeiling setHiddenCurves wait\n    await dynamicCeilingSetHiddenCurvesFuture;\n    console.log(\"DynamicCeiling hidden curves set!\");\n    // SNTPlaceHolder wait\n    let sntPlaceHolder = await sntPlaceHolderFuture;\n    console.log(\"SNTPlaceHolder: \" + sntPlaceHolder.address);\n    console.log();\n\n    // StatusContribution initialize send/wait\n    await statusContribution.initialize(\n        snt.address,\n        sntPlaceHolder.address,\n\n        startBlock,\n        endBlock,\n\n        dynamicCeiling.address,\n\n        contributionWallet.address,\n\n        multisigReserve.address,\n        sgtExchanger.address,\n        devTokensHolder.address,\n\n        sgt.address,\n        maxSGTSupply);\n    console.log(\"StatusContribution initialized!\");\n};\n"
  },
  {
    "path": "mypy.ini",
    "content": "[mypy]\nwarn_redundant_casts = True\nwarn_unused_ignores = True\nstrict_optional = True\ndisallow_untyped_calls = True\ndisallow_untyped_defs = True\ndisallow_subclassing_any = True\ncheck_untyped_defs = True\nwarn_return_any = True\n"
  },
  {
    "path": "package.json",
    "content": "{\n    \"name\": \"status-network-token\",\n    \"version\": \"0.1.0\",\n    \"description\": \"Status network token\",\n    \"repository\": {\n        \"type\": \"git\",\n        \"url\": \"git+https://github.com/status-im/status-network-token.git\"\n    },\n    \"license\": \"GPL-3.0\",\n    \"bugs\": {\n        \"url\": \"https://github.com/status-im/status-network-token/issues\"\n    },\n    \"homepage\": \"https://github.com/status-im/status-network-token\",\n    \"devDependencies\": {\n        \"async\": \"^2.4.0\",\n        \"bignumber.js\": \"^4.0.2\",\n        \"ethereumjs-testrpc\": \"^3.0.5\",\n        \"random-bytes\": \"^1.0.0\",\n        \"truffle\": \"3.2.4\",\n        \"truffle-hdwallet-provider\": \"0.0.3\",\n        \"web3\": \"^0.18.4\"\n    },\n    \"dependencies\": {},\n    \"main\": \"truffle.js\",\n    \"directories\": {\n        \"test\": \"test\"\n    },\n    \"scripts\": {\n        \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\"\n    },\n    \"author\": \"Status Research & Development\"\n}\n"
  },
  {
    "path": "scripts/ceiling_curve_calc.py",
    "content": "#!/usr/bin/env python3\n''' Calculate ceiling characteristics based on curve parameters '''\n\n\nimport argparse\nimport decimal\nfrom decimal import Decimal\nimport math\nimport statistics\nimport sys\nfrom typing import List, Sequence\n\n\ndecimal.getcontext().rounding = decimal.ROUND_DOWN\n\n\ndef args_parse(arguments: Sequence[str] = None) -> argparse.Namespace:\n    ''' Parse arguments '''\n    par0 = argparse.ArgumentParser(\n        description='Calculate ceiling characteristics based on curve parameters')\n\n    # Required\n    par0.add_argument('--limit', metavar='LIMIT', required=True, type=Decimal,\n                      help='Ceiling limit')\n    par0.add_argument('--curve-factor', metavar='FACTOR', required=True, type=Decimal,\n                      help='Curve factor')\n    # Optional\n    par0.add_argument('--collected-start', metavar='WEI', type=Decimal,\n                      default=Decimal('0'), help='Amount collected at start of curve')\n    par0.add_argument('--gas-per-tx-1st', metavar='AMOUNT', type=Decimal,\n                      default=Decimal('151070'), help='Gas used per 1st transaction')\n    par0.add_argument('--gas-per-tx-2nd', metavar='AMOUNT', type=Decimal,\n                      default=Decimal('123765'), help='Gas used for all subsequent transactions')\n    par0.add_argument('--gas-price', metavar='WEI', type=Decimal,\n                      default=Decimal('50000000000'), help='Gas price')\n    par0.add_argument('--fee-token', metavar='FRACTION', type=Decimal,\n                      default=Decimal('0.1'), help='Max fee cost as fraction of token value')\n    par0.add_argument('--collect-min', metavar='WEI', type=Decimal,\n                      help='Minimum collection amount')\n    par0.add_argument('--gas-limit', metavar='AMOUNT', type=Decimal,\n                      default=Decimal('4700000'), help='Gas limit per block')\n    par0.add_argument('--secs-per-block', metavar='SECONDS', type=Decimal,\n                      default=Decimal('16.07'), help='Average seconds per block')\n    par0.add_argument('--print-txs', action='store_true',\n                      default=False, help='Print every individual transaction')\n    par0.add_argument('--txs-per-address', metavar='NUMBER', type=Decimal,\n                      default=Decimal('1'), help='Average number of TXs per address')\n    par0.add_argument(\n        '--congestion', metavar='FRACTION', type=Decimal,\n        default=Decimal('0.8'),\n        help='Chance of contribution TXs being confirmed due to network congestion'\n    )\n    par0.add_argument('--collect-mean', metavar='FRACTION', type=Decimal,\n                      default=Decimal('0.9'), help='Collected of TX from amount possible')\n\n    args0 = par0.parse_args(arguments)\n\n    if args0.txs_per_address < 1:\n        print('--txs-per-address can\\'t be less than 1', file=sys.stderr)\n        sys.exit(1)\n\n    return args0\n\n\ndef transactions_calc(\n        limit: Decimal,\n        curve_factor: Decimal,\n        collect_minimum: Decimal,\n        collect_mean: Decimal,\n        collected_start: Decimal = Decimal(0),\n) -> List[Decimal]:\n    ''' Calculate transactions '''\n    collected = collected_start\n    transactions = []\n    while True:\n        difference = limit - collected\n        to_collect = difference / curve_factor\n\n        if to_collect <= collect_minimum:\n            if difference > collect_minimum:\n                to_collect = collect_minimum\n                to_collect *= collect_mean\n            else:\n                to_collect = difference\n        else:\n            to_collect *= collect_mean\n\n        collected += to_collect\n        transactions.append(to_collect)\n\n        if collected >= limit:\n            break\n\n    return transactions\n\n\ndef fmt_wei(value: Decimal, shift: bool = True) -> str:\n    ''' Format wei value '''\n    fmt_val = f'{value:.0f}'\n    if shift:\n        return f'{\"w\" + fmt_val: >26}'  # type: ignore\n    return f'{\"w\" + fmt_val}'  # type: ignore\n\n\ndef fmt_eth(value: Decimal, shift: bool = True) -> str:\n    ''' Format wei value into ether '''\n    fmt_val = f'{value / 10**18:.18f}'\n    if shift:\n        return f'{\"Ξ\" + fmt_val: >26}'  # type: ignore\n    return f'{\"Ξ\" + fmt_val}'  # type: ignore\n\n\ndef main() -> None:  # pylint: disable=too-many-locals\n    ''' Main '''\n    if ARGS.txs_per_address == 1:\n        gas_per_tx = ARGS.gas_per_tx_1st\n    else:\n        gas_per_tx = ((ARGS.gas_per_tx_1st + (ARGS.gas_per_tx_2nd * (ARGS.txs_per_address - 1)))\n                      / ARGS.txs_per_address).to_integral_value(rounding=decimal.ROUND_HALF_EVEN)\n    tx_fee = gas_per_tx * ARGS.gas_price\n    tx_fee_token_limit = tx_fee / ARGS.fee_token\n    collect_min = ARGS.collect_min if ARGS.collect_min is not None else tx_fee_token_limit\n\n    transactions = transactions_calc(\n        ARGS.limit,\n        ARGS.curve_factor,\n        collect_min,\n        ARGS.collect_mean,\n        collected_start=ARGS.collected_start,\n    )\n\n    collect_fee_total = 0\n    collect_minimum_total = 0\n    for n, transaction in enumerate(transactions):\n        if transaction <= collect_min:\n            collect_minimum_total += 1\n\n        if transaction < tx_fee_token_limit:\n            collect_fee_total += 1\n\n        if ARGS.print_txs:\n            print(f'{(n + 1): >4}: {fmt_wei(transaction, shift=True)} '\n                  f' {fmt_eth(transaction, shift=True)}')\n    print()\n\n    print(\n        f'Average gas per TX: {gas_per_tx}\\n'\n        f'Average TX fee:  {fmt_wei(tx_fee)} {fmt_eth(tx_fee)}\\n'\n        f'Token fee limit: {fmt_wei(tx_fee_token_limit)} {fmt_eth(tx_fee_token_limit)}\\n'\n        f'Minimum collect: {fmt_wei(collect_min)} {fmt_eth(collect_min)}'\n    )\n\n    print()\n\n    transactions_len = len(transactions)\n    print(\n        f'Number of TXs: {transactions_len}\\n'\n        f'Number of TXs <= minimum collect: {collect_minimum_total}\\n'\n        f'Number of TXs < token fee limit: {collect_fee_total}\\n'\n        f'Number of addresses: {transactions_len / ARGS.txs_per_address:.0f}'\n    )\n    decimal.getcontext().rounding = decimal.ROUND_HALF_EVEN\n    blocks = math.ceil((transactions_len * gas_per_tx) / (ARGS.gas_limit * ARGS.congestion))\n    print(\n        f'Minimum blocks: {blocks}\\n'\n        f'Minimum time: {blocks * ARGS.secs_per_block:.2f}s'\n    )\n    decimal.getcontext().rounding = decimal.ROUND_DOWN\n\n    print()\n\n    max_ = max(transactions)\n    min_ = min(transactions)\n    mean = statistics.mean(transactions)\n    median = statistics.median(transactions)\n    print(\n        'Collected:\\n'\n        f'Max:      {fmt_wei(max_)} {fmt_eth(max_)}\\n'\n        f'Min:      {fmt_wei(min_)} {fmt_eth(min_)}\\n'\n        f'Mean:     {fmt_wei(mean)} {fmt_eth(mean)}\\n'\n        f'Median:   {fmt_wei(median)} {fmt_eth(median)}'\n    )\n    if transactions_len >= 2:\n        stdev = statistics.stdev(transactions)\n        print(\n            f'Stdev:    {fmt_wei(stdev)} {fmt_eth(stdev)}\\n'\n        )\n\n\nif __name__ == '__main__':\n    ARGS = args_parse()\n    main()\n"
  },
  {
    "path": "scripts/sgtGeneration/deploy.js",
    "content": "var minimeFactoryAbi = [{\"constant\":false,\"inputs\":[{\"name\":\"_parentToken\",\"type\":\"address\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_tokenName\",\"type\":\"string\"},{\"name\":\"_decimalUnits\",\"type\":\"uint8\"},{\"name\":\"_tokenSymbol\",\"type\":\"string\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"}];\nvar minimeFactoryContract = web3.eth.contract(minimeFactoryAbi);\nvar minimeFactory = minimeFactoryContract.new(\n    {\n        from: web3.eth.accounts[0],\n        data: '0x6060604052341561000c57fe5b5b611e968061001c6000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416635b7b72c1811461003a575bfe5b341561004257fe5b604080516020600460443581810135601f81018490048402850184019095528484526100e6948235600160a060020a031694602480359560649492939190920191819084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a60ff8b35169a9099940197509195509182019350915081908401838280828437509496505050509135151591506101029050565b60408051600160a060020a039092168252519081900360200190f35b60006000308888888888886101156102db565b600160a060020a03808916825287166020808301919091526040820187905260ff8516608083015282151560c083015260e0606083018181528751918401919091528651909160a08401916101008501918901908083838215610193575b80518252602083111561019357601f199092019160209182019101610173565b505050905090810190601f1680156101bf5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156101fe575b8051825260208311156101fe57601f1990920191602091820191016101de565b505050905090810190601f16801561022a5780820380516001836020036101000a031916815260200191505b509950505050505050505050604051809103906000f080151561024957fe5b905080600160a060020a0316633cebb823336040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b15156102bb57fe5b6102c65a03f115156102c957fe5b5050508091505b509695505050505050565b604051611b7f806102ec83390190560060a0604052600760608190527f4d4d545f302e3100000000000000000000000000000000000000000000000000608090815262000040916004919062000146565b5034156200004a57fe5b60405162001b7f38038062001b7f83398101604090815281516020830151918301516060840151608085015160a086015160c0870151949693949284019391929101905b5b60008054600160a060020a03191633600160a060020a03161790555b600b805461010060a860020a031916610100600160a060020a038a16021790558351620000e090600190602087019062000146565b506002805460ff191660ff851617905581516200010590600390602085019062000146565b5060058054600160a060020a031916600160a060020a0388161790556006859055600b805460ff1916821515179055436007555b50505050505050620001f0565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200018957805160ff1916838001178555620001b9565b82800160010185558215620001b9579182015b82811115620001b95782518255916020019190600101906200019c565b5b50620001c8929150620001cc565b5090565b620001ed91905b80821115620001c85760008155600101620001d3565b5090565b90565b61197f80620002006000396000f300606060405236156101225763ffffffff60e060020a60003504166306fdde0381146101e1578063095ea7b31461027157806317634514146102a457806318160ddd146102c657806323b872dd146102e8578063313ce567146103215780633cebb823146103475780634ee2cd7e1461036557806354fd4d50146103965780636638c0871461042657806370a08231146104e657806380a5400114610514578063827f32c01461054057806395d89b4114610573578063981b24d014610603578063a9059cbb14610628578063bef97c871461065b578063c5bcc4f11461067f578063cae9ca51146106a1578063d3ce77fe14610718578063dd62ed3e1461074b578063e77772fe1461077f578063f41e60c5146107ab578063f77c4791146107c2575b6101df5b60005461013b90600160a060020a03166107ee565b156101d657600080546040805160209081019390935280517ff48c3054000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301529151919092169263f48c30549234926024808301939282900301818588803b15156101ad57fe5b6125ee5a03f115156101bb57fe5b505060405151151591506101d190505760006000fd5b6101dc565b60006000fd5b5b565b005b34156101e957fe5b6101f161081b565b604080516020808252835181830152835191928392908301918501908083838215610237575b80518252602083111561023757601f199092019160209182019101610217565b505050905090810190601f1680156102635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561027957fe5b610290600160a060020a03600435166024356108a8565b604080519115158252519081900360200190f35b34156102ac57fe5b6102b4610a1a565b60408051918252519081900360200190f35b34156102ce57fe5b6102b4610a20565b60408051918252519081900360200190f35b34156102f057fe5b610290600160a060020a0360043581169060243516604435610a31565b604080519115158252519081900360200190f35b341561032957fe5b610331610ad4565b6040805160ff9092168252519081900360200190f35b341561034f57fe5b6101df600160a060020a0360043516610add565b005b341561036d57fe5b6102b4600160a060020a0360043516602435610b26565b60408051918252519081900360200190f35b341561039e57fe5b6101f1610c72565b604080516020808252835181830152835191928392908301918501908083838215610237575b80518252602083111561023757601f199092019160209182019101610217565b505050905090810190601f1680156102635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561042e57fe5b6104ca600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a60ff8b35169a909994019750919550918201935091508190840183828082843750949650508435946020013515159350610d0092505050565b60408051600160a060020a039092168252519081900360200190f35b34156104ee57fe5b6102b4600160a060020a0360043516610f60565b60408051918252519081900360200190f35b341561051c57fe5b6104ca610f74565b60408051600160a060020a039092168252519081900360200190f35b341561054857fe5b610290600160a060020a0360043516602435610f83565b604080519115158252519081900360200190f35b341561057b57fe5b6101f161105c565b604080516020808252835181830152835191928392908301918501908083838215610237575b80518252602083111561023757601f199092019160209182019101610217565b505050905090810190601f1680156102635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561060b57fe5b6102b46004356110ea565b60408051918252519081900360200190f35b341561063057fe5b610290600160a060020a03600435166024356111dc565b604080519115158252519081900360200190f35b341561066357fe5b610290611205565b604080519115158252519081900360200190f35b341561068757fe5b6102b461120e565b60408051918252519081900360200190f35b34156106a957fe5b604080516020600460443581810135601f8101849004840285018401909552848452610290948235600160a060020a031694602480359560649492939190920191819084018382808284375094965061121495505050505050565b604080519115158252519081900360200190f35b341561072057fe5b610290600160a060020a0360043516602435611339565b604080519115158252519081900360200190f35b341561075357fe5b6102b4600160a060020a036004358116906024351661140e565b60408051918252519081900360200190f35b341561078757fe5b6104ca61143b565b60408051600160a060020a039092168252519081900360200190f35b34156107b357fe5b6101df600435151561144f565b005b34156107ca57fe5b6104ca61147e565b60408051600160a060020a039092168252519081900360200190f35b600080600160a060020a038316151561080a5760009150610815565b823b90506000811191505b50919050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108a05780601f10610875576101008083540402835291602001916108a0565b820191906000526020600020905b81548152906001019060200180831161088357829003601f168201915b505050505081565b600b5460009060ff1615156108bd5760006000fd5b81158015906108f05750600160a060020a0333811660009081526009602090815260408083209387168352929052205415155b156108fb5760006000fd5b60005461091090600160a060020a03166107ee565b156109b2576000805460408051602090810184905281517fda682aeb000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301528881166024830152604482018890529251929093169363da682aeb9360648082019492918390030190829087803b151561099057fe5b6102c65a03f1151561099e57fe5b505060405151151590506109b25760006000fd5b5b600160a060020a03338116600081815260096020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b92915050565b60075481565b6000610a2b436110ea565b90505b90565b6000805433600160a060020a03908116911614610abf57600b5460ff161515610a5a5760006000fd5b600160a060020a038085166000908152600960209081526040808320339094168352929052205482901015610a9157506000610acd565b600160a060020a03808516600090815260096020908152604080832033909416835292905220805483900390555b610aca84848461148d565b90505b9392505050565b60025460ff1681565b60005433600160a060020a03908116911614610af95760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382166000908152600860205260408120541580610b865750600160a060020a038316600090815260086020526040812080548492908110610b6b57fe5b906000526020600020900160005b50546001608060020a0316115b15610c4257600554600160a060020a031615610c3557600554600654600160a060020a0390911690634ee2cd7e908590610bc1908690611675565b6000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1515610c1857fe5b6102c65a03f11515610c2657fe5b5050604051519150610a149050565b506000610a14565b610a14565b600160a060020a0383166000908152600860205260409020610c64908361168f565b9050610a14565b5b92915050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108a05780601f10610875576101008083540402835291602001916108a0565b820191906000526020600020905b81548152906001019060200180831161088357829003601f168201915b505050505081565b600080831515610d0e574393505b600b60019054906101000a9004600160a060020a0316600160a060020a0316635b7b72c130868a8a8a896000604051602001526040518763ffffffff1660e060020a0281526004018087600160a060020a0316600160a060020a03168152602001868152602001806020018560ff1660ff1681526020018060200184151515158152602001838103835287818151815260200191508051906020019080838360008314610dd6575b805182526020831115610dd657601f199092019160209182019101610db6565b505050905090810190601f168015610e025780820380516001836020036101000a031916815260200191505b5083810382528551815285516020918201918701908083838215610e41575b805182526020831115610e4157601f199092019160209182019101610e21565b505050905090810190601f168015610e6d5780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b1515610e8e57fe5b6102c65a03f11515610e9c57fe5b50506040805180517f3cebb823000000000000000000000000000000000000000000000000000000008252600160a060020a03338116600484015292519094509184169250633cebb82391602480830192600092919082900301818387803b1515610f0357fe5b6102c65a03f11515610f1157fe5b5050604080518681529051600160a060020a03841692507f086c875b377f900b07ce03575813022f05dd10ed7640b5282cf6d3c3fc352ade9181900360200190a28091505b5095945050505050565b6000610f6c8243610b26565b90505b919050565b600554600160a060020a031681565b600080548190819033600160a060020a03908116911614610fa45760006000fd5b610faf600a4361168f565b9150818483011015610fc15760006000fd5b610fce600a858401611805565b610fd785610f60565b9050808482011015610fe95760006000fd5b600160a060020a038516600090815260086020526040902061100d90828601611805565b604080518581529051600160a060020a038716916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600192505b5b505092915050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108a05780601f10610875576101008083540402835291602001916108a0565b820191906000526020600020905b81548152906001019060200180831161088357829003601f168201915b505050505081565b600a546000901580611123575081600a600081548110151561110857fe5b906000526020600020900160005b50546001608060020a0316115b156111c457600554600160a060020a0316156111b757600554600654600160a060020a039091169063981b24d09061115c908590611675565b6000604051602001526040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b151561119a57fe5b6102c65a03f115156111a857fe5b5050604051519150610f6f9050565b506000610f6f565b610f6f565b6111cf600a8361168f565b9050610f6f565b5b919050565b600b5460009060ff1615156111f15760006000fd5b6111fc33848461148d565b90505b92915050565b600b5460ff1681565b60065481565b600061122084846108a8565b151561122c5760006000fd5b83600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001806020018281038252838181518152602001915080519060200190808383600083146112d2575b8051825260208311156112d257601f1990920191602091820191016112b2565b505050905090810190601f1680156112fe5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561131c57fe5b6102c65a03f1151561132a57fe5b505050600190505b9392505050565b600080548190819033600160a060020a0390811691161461135a5760006000fd5b611365600a4361168f565b9150838210156113755760006000fd5b611382600a858403611805565b61138b85610f60565b90508381101561139b5760006000fd5b600160a060020a03851660009081526008602052604090206113bf90858303611805565b604080518581529051600091600160a060020a038816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600192505b5b505092915050565b600160a060020a038083166000908152600960209081526040808320938516835292905220545b92915050565b600b546101009004600160a060020a031681565b60005433600160a060020a0390811691161461146b5760006000fd5b600b805460ff19168215151790555b5b50565b600054600160a060020a031681565b600080808315156114a1576001925061166c565b6006544390106114b15760006000fd5b600160a060020a03851615806114d8575030600160a060020a031685600160a060020a0316145b156114e35760006000fd5b6114ed8643610b26565b915083821015611500576000925061166c565b60005461151590600160a060020a03166107ee565b156115b7576000805460408051602090810184905281517f4a393149000000000000000000000000000000000000000000000000000000008152600160a060020a038b811660048301528a81166024830152604482018a905292519290931693634a3931499360648082019492918390030190829087803b151561159557fe5b6102c65a03f115156115a357fe5b505060405151151590506115b75760006000fd5b5b600160a060020a03861660009081526008602052604090206115dc90858403611805565b6115e68543610b26565b90508084820110156115f85760006000fd5b600160a060020a038516600090815260086020526040902061161c90828601611805565b84600160a060020a031686600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600192505b50509392505050565b600081831061168457816111fc565b825b90505b92915050565b60006000600060008580549050600014156116ad57600093506117fc565b8554869060001981019081106116bf57fe5b906000526020600020900160005b50546001608060020a03168510611724578554869060001981019081106116f057fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a031693506117fc565b85600081548110151561173357fe5b906000526020600020900160005b50546001608060020a031685101561175c57600093506117fc565b8554600093506000190191505b828211156117be5760026001838501015b04905084868281548110151561178c57fe5b906000526020600020900160005b50546001608060020a0316116117b2578092506117b9565b6001810391505b611769565b85838154811015156117cc57fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a031693505b50505092915050565b8154600090819015806118425750835443908590600019810190811061182757fe5b906000526020600020900160005b50546001608060020a0316105b156118b857835484906118588260018301611908565b8154811061186257fe5b906000526020600020900160005b5080546001608060020a03858116700100000000000000000000000000000000024382166fffffffffffffffffffffffffffffffff1990931692909217161781559150611901565b8354849060001981019081106118ca57fe5b906000526020600020900160005b5080546001608060020a0380861670010000000000000000000000000000000002911617815590505b5b50505050565b81548183558181151161192c5760008381526020902061192c918101908301611932565b5b505050565b610a2e91905b8082111561194c5760008155600101611938565b5090565b905600a165627a7a7230582057348ca0297970bb01202ce8022511ab041096fc938e17a211f6de719789f54e0029a165627a7a723058207f08e59b3da88e7db6ae63182ac584f5a56ccbe53f3a10d2ca155d5729ede5540029',\n        gas: '3900000',\n        gasPrice: eth.gasPrice.mul(1.1).floor()\n    }, function (e, contract){\n        console.log(e, contract);\n        if (typeof contract.address !== 'undefined') {\n            console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);\n        }\n    });\n\n\nvar _tokenFactory = minimeFactory.address ;\nvar sgtAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"creationBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newController\",\"type\":\"address\"}],\"name\":\"changeController\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_cloneTokenName\",\"type\":\"string\"},{\"name\":\"_cloneDecimalUnits\",\"type\":\"uint8\"},{\"name\":\"_cloneTokenSymbol\",\"type\":\"string\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"generateTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"data\",\"type\":\"uint256[]\"}],\"name\":\"multiMint\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"transfersEnabled\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentSnapShotBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"destroyTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenFactory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"enableTransfers\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"_tokenFactory\",\"type\":\"address\"}],\"payable\":false,\"type\":\"constructor\"},{\"payable\":true,\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_cloneToken\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_snapshotBlock\",\"type\":\"uint256\"}],\"name\":\"NewCloneToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}];\nvar sgtContract = web3.eth.contract(sgtAbi);\nvar sgt = sgtContract.new(\n    _tokenFactory,\n    {\n        from: web3.eth.accounts[0],\n        data: '0x60a0604052600760608190527f4d4d545f302e310000000000000000000000000000000000000000000000000060809081526200004091600491906200018f565b5034156200004a57fe5b60405160208062001cdf83398101604052515b8060006000604060405190810160405280601481526020017f5374617475732047656e6573697320546f6b656e0000000000000000000000008152506001604060405190810160405280600381526020017f534754000000000000000000000000000000000000000000000000000000000081525060005b5b60008054600160a060020a03191633600160a060020a03161790555b600b805461010060a860020a031916610100600160a060020a038a16021790558351620001279060019060208701906200018f565b506002805460ff191660ff851617905581516200014c9060039060208501906200018f565b5060058054600160a060020a031916600160a060020a0388161790556006859055600b805460ff1916821515179055436007555b505050505050505b5062000239565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001d257805160ff191683800117855562000202565b8280016001018555821562000202579182015b8281111562000202578251825591602001919060010190620001e5565b5b506200021192915062000215565b5090565b6200023691905b808211156200021157600081556001016200021c565b5090565b90565b611a9680620002496000396000f3006060604052361561012d5763ffffffff60e060020a60003504166306fdde0381146101ec578063095ea7b31461027c57806317634514146102af57806318160ddd146102d157806323b872dd146102f3578063313ce5671461032c5780633cebb823146103525780634ee2cd7e1461037057806354fd4d50146103a15780636638c0871461043157806370a08231146104f157806380a540011461051f578063827f32c01461054b57806395d89b411461057e578063981b24d01461060e5780639a0e4ebb14610633578063a9059cbb14610688578063bef97c87146106bb578063c5bcc4f1146106df578063cae9ca5114610701578063d3ce77fe14610778578063dd62ed3e146107ab578063e77772fe146107df578063f41e60c51461080b578063f77c479114610822575b6101ea5b60005461014690600160a060020a031661084e565b156101e157600080546040805160209081019390935280517ff48c3054000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301529151919092169263f48c30549234926024808301939282900301818588803b15156101b857fe5b6125ee5a03f115156101c657fe5b505060405151151591506101dc90505760006000fd5b6101e7565b60006000fd5b5b565b005b34156101f457fe5b6101fc61087b565b604080516020808252835181830152835191928392908301918501908083838215610242575b80518252602083111561024257601f199092019160209182019101610222565b505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561028457fe5b61029b600160a060020a0360043516602435610908565b604080519115158252519081900360200190f35b34156102b757fe5b6102bf610a7a565b60408051918252519081900360200190f35b34156102d957fe5b6102bf610a80565b60408051918252519081900360200190f35b34156102fb57fe5b61029b600160a060020a0360043581169060243516604435610a91565b604080519115158252519081900360200190f35b341561033457fe5b61033c610b34565b6040805160ff9092168252519081900360200190f35b341561035a57fe5b6101ea600160a060020a0360043516610b3d565b005b341561037857fe5b6102bf600160a060020a0360043516602435610b86565b60408051918252519081900360200190f35b34156103a957fe5b6101fc610cd2565b604080516020808252835181830152835191928392908301918501908083838215610242575b80518252602083111561024257601f199092019160209182019101610222565b505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561043957fe5b6104d5600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a60ff8b35169a909994019750919550918201935091508190840183828082843750949650508435946020013515159350610d6092505050565b60408051600160a060020a039092168252519081900360200190f35b34156104f957fe5b6102bf600160a060020a0360043516610fc0565b60408051918252519081900360200190f35b341561052757fe5b6104d5610fd4565b60408051600160a060020a039092168252519081900360200190f35b341561055357fe5b61029b600160a060020a0360043516602435610fe3565b604080519115158252519081900360200190f35b341561058657fe5b6101fc6110bc565b604080516020808252835181830152835191928392908301918501908083838215610242575b80518252602083111561024257601f199092019160209182019101610222565b505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061657fe5b6102bf60043561114a565b60408051918252519081900360200190f35b341561063b57fe5b6101ea60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061123c95505050505050565b005b341561069057fe5b61029b600160a060020a03600435166024356112f3565b604080519115158252519081900360200190f35b34156106c357fe5b61029b61131c565b604080519115158252519081900360200190f35b34156106e757fe5b6102bf611325565b60408051918252519081900360200190f35b341561070957fe5b604080516020600460443581810135601f810184900484028501840190955284845261029b948235600160a060020a031694602480359560649492939190920191819084018382808284375094965061132b95505050505050565b604080519115158252519081900360200190f35b341561078057fe5b61029b600160a060020a0360043516602435611450565b604080519115158252519081900360200190f35b34156107b357fe5b6102bf600160a060020a0360043581169060243516611525565b60408051918252519081900360200190f35b34156107e757fe5b6104d5611552565b60408051600160a060020a039092168252519081900360200190f35b341561081357fe5b6101ea6004351515611566565b005b341561082a57fe5b6104d5611595565b60408051600160a060020a039092168252519081900360200190f35b600080600160a060020a038316151561086a5760009150610875565b823b90506000811191505b50919050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b505050505081565b600b5460009060ff16151561091d5760006000fd5b81158015906109505750600160a060020a0333811660009081526009602090815260408083209387168352929052205415155b1561095b5760006000fd5b60005461097090600160a060020a031661084e565b15610a12576000805460408051602090810184905281517fda682aeb000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301528881166024830152604482018890529251929093169363da682aeb9360648082019492918390030190829087803b15156109f057fe5b6102c65a03f115156109fe57fe5b50506040515115159050610a125760006000fd5b5b600160a060020a03338116600081815260096020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b92915050565b60075481565b6000610a8b4361114a565b90505b90565b6000805433600160a060020a03908116911614610b1f57600b5460ff161515610aba5760006000fd5b600160a060020a038085166000908152600960209081526040808320339094168352929052205482901015610af157506000610b2d565b600160a060020a03808516600090815260096020908152604080832033909416835292905220805483900390555b610b2a8484846115a4565b90505b9392505050565b60025460ff1681565b60005433600160a060020a03908116911614610b595760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382166000908152600860205260408120541580610be65750600160a060020a038316600090815260086020526040812080548492908110610bcb57fe5b906000526020600020900160005b50546001608060020a0316115b15610ca257600554600160a060020a031615610c9557600554600654600160a060020a0390911690634ee2cd7e908590610c2190869061178c565b6000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1515610c7857fe5b6102c65a03f11515610c8657fe5b5050604051519150610a749050565b506000610a74565b610a74565b600160a060020a0383166000908152600860205260409020610cc490836117a6565b9050610a74565b5b92915050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b505050505081565b600080831515610d6e574393505b600b60019054906101000a9004600160a060020a0316600160a060020a0316635b7b72c130868a8a8a896000604051602001526040518763ffffffff1660e060020a0281526004018087600160a060020a0316600160a060020a03168152602001868152602001806020018560ff1660ff1681526020018060200184151515158152602001838103835287818151815260200191508051906020019080838360008314610e36575b805182526020831115610e3657601f199092019160209182019101610e16565b505050905090810190601f168015610e625780820380516001836020036101000a031916815260200191505b5083810382528551815285516020918201918701908083838215610ea1575b805182526020831115610ea157601f199092019160209182019101610e81565b505050905090810190601f168015610ecd5780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b1515610eee57fe5b6102c65a03f11515610efc57fe5b50506040805180517f3cebb823000000000000000000000000000000000000000000000000000000008252600160a060020a03338116600484015292519094509184169250633cebb82391602480830192600092919082900301818387803b1515610f6357fe5b6102c65a03f11515610f7157fe5b5050604080518681529051600160a060020a03841692507f086c875b377f900b07ce03575813022f05dd10ed7640b5282cf6d3c3fc352ade9181900360200190a28091505b5095945050505050565b6000610fcc8243610b86565b90505b919050565b600554600160a060020a031681565b600080548190819033600160a060020a039081169116146110045760006000fd5b61100f600a436117a6565b91508184830110156110215760006000fd5b61102e600a85840161191c565b61103785610fc0565b90508084820110156110495760006000fd5b600160a060020a038516600090815260086020526040902061106d9082860161191c565b604080518581529051600160a060020a038716916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600192505b5b505092915050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b505050505081565b600a546000901580611183575081600a600081548110151561116857fe5b906000526020600020900160005b50546001608060020a0316115b1561122457600554600160a060020a03161561121757600554600654600160a060020a039091169063981b24d0906111bc90859061178c565b6000604051602001526040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b15156111fa57fe5b6102c65a03f1151561120857fe5b5050604051519150610fcf9050565b506000610fcf565b610fcf565b61122f600a836117a6565b9050610fcf565b5b919050565b600080548190819033600160a060020a0390811691161461125d5760006000fd5b600092505b83518310156112eb578351600160a060020a039085908590811061128257fe5b906020019060200201511691507401000000000000000000000000000000000000000084848151811015156112b357fe5b906020019060200201518115156112c657fe5b0490506112d38282610fe3565b15156112df5760006000fd5b5b600190920191611262565b5b5b50505050565b600b5460009060ff1615156113085760006000fd5b6113133384846115a4565b90505b92915050565b600b5460ff1681565b60065481565b60006113378484610908565b15156113435760006000fd5b83600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001806020018281038252838181518152602001915080519060200190808383600083146113e9575b8051825260208311156113e957601f1990920191602091820191016113c9565b505050905090810190601f1680156114155780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561143357fe5b6102c65a03f1151561144157fe5b505050600190505b9392505050565b600080548190819033600160a060020a039081169116146114715760006000fd5b61147c600a436117a6565b91508382101561148c5760006000fd5b611499600a85840361191c565b6114a285610fc0565b9050838110156114b25760006000fd5b600160a060020a03851660009081526008602052604090206114d69085830361191c565b604080518581529051600091600160a060020a038816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600192505b5b505092915050565b600160a060020a038083166000908152600960209081526040808320938516835292905220545b92915050565b600b546101009004600160a060020a031681565b60005433600160a060020a039081169116146115825760006000fd5b600b805460ff19168215151790555b5b50565b600054600160a060020a031681565b600080808315156115b85760019250611783565b6006544390106115c85760006000fd5b600160a060020a03851615806115ef575030600160a060020a031685600160a060020a0316145b156115fa5760006000fd5b6116048643610b86565b9150838210156116175760009250611783565b60005461162c90600160a060020a031661084e565b156116ce576000805460408051602090810184905281517f4a393149000000000000000000000000000000000000000000000000000000008152600160a060020a038b811660048301528a81166024830152604482018a905292519290931693634a3931499360648082019492918390030190829087803b15156116ac57fe5b6102c65a03f115156116ba57fe5b505060405151151590506116ce5760006000fd5b5b600160a060020a03861660009081526008602052604090206116f39085840361191c565b6116fd8543610b86565b905080848201101561170f5760006000fd5b600160a060020a03851660009081526008602052604090206117339082860161191c565b84600160a060020a031686600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600192505b50509392505050565b600081831061179b5781611313565b825b90505b92915050565b60006000600060008580549050600014156117c45760009350611913565b8554869060001981019081106117d657fe5b906000526020600020900160005b50546001608060020a0316851061183b5785548690600019810190811061180757fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a03169350611913565b85600081548110151561184a57fe5b906000526020600020900160005b50546001608060020a03168510156118735760009350611913565b8554600093506000190191505b828211156118d55760026001838501015b0490508486828154811015156118a357fe5b906000526020600020900160005b50546001608060020a0316116118c9578092506118d0565b6001810391505b611880565b85838154811015156118e357fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a031693505b50505092915050565b8154600090819015806119595750835443908590600019810190811061193e57fe5b906000526020600020900160005b50546001608060020a0316105b156119cf578354849061196f8260018301611a1f565b8154811061197957fe5b906000526020600020900160005b5080546001608060020a03858116700100000000000000000000000000000000024382166fffffffffffffffffffffffffffffffff19909316929092171617815591506112eb565b8354849060001981019081106119e157fe5b906000526020600020900160005b5080546001608060020a0380861670010000000000000000000000000000000002911617815590505b5b50505050565b815481835581811511611a4357600083815260209020611a43918101908301611a49565b5b505050565b610a8e91905b80821115611a635760008155600101611a4f565b5090565b905600a165627a7a7230582089f20df28756d7605d82438014b8d7a74992c4df8692e8aec73af24dbc1fffa80029',\n        gas: '3900000',\n        gasPrice: eth.gasPrice.mul(1.1).floor()\n    }, function (e, contract){\n        console.log(e, contract);\n        if (typeof contract.address !== 'undefined') {\n            console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);\n        }\n    });\n\n\n////////\n\nvar minimeFactoryAbi = [{\"constant\":false,\"inputs\":[{\"name\":\"_parentToken\",\"type\":\"address\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_tokenName\",\"type\":\"string\"},{\"name\":\"_decimalUnits\",\"type\":\"uint8\"},{\"name\":\"_tokenSymbol\",\"type\":\"string\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"}];\nvar minimeFactory = eth.contract(minimeFactoryAbi).at(\"0x1308a7ec3e82bcd3b63ada5f5dc27586ad8605ba\");\n\nvar sgtAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"creationBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newController\",\"type\":\"address\"}],\"name\":\"changeController\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_cloneTokenName\",\"type\":\"string\"},{\"name\":\"_cloneDecimalUnits\",\"type\":\"uint8\"},{\"name\":\"_cloneTokenSymbol\",\"type\":\"string\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"generateTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"data\",\"type\":\"uint256[]\"}],\"name\":\"multiMint\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"transfersEnabled\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentSnapShotBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"destroyTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenFactory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"enableTransfers\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"_tokenFactory\",\"type\":\"address\"}],\"payable\":false,\"type\":\"constructor\"},{\"payable\":true,\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_cloneToken\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_snapshotBlock\",\"type\":\"uint256\"}],\"name\":\"NewCloneToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}];\nvar sgt = eth.contract(sgtAbi).at(\"0xd248b0d48e44aaf9c49aea0312be7e13a6dc1468\")\n"
  },
  {
    "path": "scripts/sgtGeneration/deploy_test.js",
    "content": "var minimeFactoryAbi = [{\"constant\":false,\"inputs\":[{\"name\":\"_parentToken\",\"type\":\"address\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_tokenName\",\"type\":\"string\"},{\"name\":\"_decimalUnits\",\"type\":\"uint8\"},{\"name\":\"_tokenSymbol\",\"type\":\"string\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"}];\nvar minimeFactoryContract = web3.eth.contract(minimeFactoryAbi);\nvar minimeFactory = minimeFactoryContract.new(\n    {\n        from: web3.eth.accounts[0],\n        data: '0x6060604052341561000c57fe5b5b611e968061001c6000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416635b7b72c1811461003a575bfe5b341561004257fe5b604080516020600460443581810135601f81018490048402850184019095528484526100e6948235600160a060020a031694602480359560649492939190920191819084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a60ff8b35169a9099940197509195509182019350915081908401838280828437509496505050509135151591506101029050565b60408051600160a060020a039092168252519081900360200190f35b60006000308888888888886101156102db565b600160a060020a03808916825287166020808301919091526040820187905260ff8516608083015282151560c083015260e0606083018181528751918401919091528651909160a08401916101008501918901908083838215610193575b80518252602083111561019357601f199092019160209182019101610173565b505050905090810190601f1680156101bf5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838382156101fe575b8051825260208311156101fe57601f1990920191602091820191016101de565b505050905090810190601f16801561022a5780820380516001836020036101000a031916815260200191505b509950505050505050505050604051809103906000f080151561024957fe5b905080600160a060020a0316633cebb823336040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050600060405180830381600087803b15156102bb57fe5b6102c65a03f115156102c957fe5b5050508091505b509695505050505050565b604051611b7f806102ec83390190560060a0604052600760608190527f4d4d545f302e3100000000000000000000000000000000000000000000000000608090815262000040916004919062000146565b5034156200004a57fe5b60405162001b7f38038062001b7f83398101604090815281516020830151918301516060840151608085015160a086015160c0870151949693949284019391929101905b5b60008054600160a060020a03191633600160a060020a03161790555b600b805461010060a860020a031916610100600160a060020a038a16021790558351620000e090600190602087019062000146565b506002805460ff191660ff851617905581516200010590600390602085019062000146565b5060058054600160a060020a031916600160a060020a0388161790556006859055600b805460ff1916821515179055436007555b50505050505050620001f0565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200018957805160ff1916838001178555620001b9565b82800160010185558215620001b9579182015b82811115620001b95782518255916020019190600101906200019c565b5b50620001c8929150620001cc565b5090565b620001ed91905b80821115620001c85760008155600101620001d3565b5090565b90565b61197f80620002006000396000f300606060405236156101225763ffffffff60e060020a60003504166306fdde0381146101e1578063095ea7b31461027157806317634514146102a457806318160ddd146102c657806323b872dd146102e8578063313ce567146103215780633cebb823146103475780634ee2cd7e1461036557806354fd4d50146103965780636638c0871461042657806370a08231146104e657806380a5400114610514578063827f32c01461054057806395d89b4114610573578063981b24d014610603578063a9059cbb14610628578063bef97c871461065b578063c5bcc4f11461067f578063cae9ca51146106a1578063d3ce77fe14610718578063dd62ed3e1461074b578063e77772fe1461077f578063f41e60c5146107ab578063f77c4791146107c2575b6101df5b60005461013b90600160a060020a03166107ee565b156101d657600080546040805160209081019390935280517ff48c3054000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301529151919092169263f48c30549234926024808301939282900301818588803b15156101ad57fe5b6125ee5a03f115156101bb57fe5b505060405151151591506101d190505760006000fd5b6101dc565b60006000fd5b5b565b005b34156101e957fe5b6101f161081b565b604080516020808252835181830152835191928392908301918501908083838215610237575b80518252602083111561023757601f199092019160209182019101610217565b505050905090810190601f1680156102635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561027957fe5b610290600160a060020a03600435166024356108a8565b604080519115158252519081900360200190f35b34156102ac57fe5b6102b4610a1a565b60408051918252519081900360200190f35b34156102ce57fe5b6102b4610a20565b60408051918252519081900360200190f35b34156102f057fe5b610290600160a060020a0360043581169060243516604435610a31565b604080519115158252519081900360200190f35b341561032957fe5b610331610ad4565b6040805160ff9092168252519081900360200190f35b341561034f57fe5b6101df600160a060020a0360043516610add565b005b341561036d57fe5b6102b4600160a060020a0360043516602435610b26565b60408051918252519081900360200190f35b341561039e57fe5b6101f1610c72565b604080516020808252835181830152835191928392908301918501908083838215610237575b80518252602083111561023757601f199092019160209182019101610217565b505050905090810190601f1680156102635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561042e57fe5b6104ca600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a60ff8b35169a909994019750919550918201935091508190840183828082843750949650508435946020013515159350610d0092505050565b60408051600160a060020a039092168252519081900360200190f35b34156104ee57fe5b6102b4600160a060020a0360043516610f60565b60408051918252519081900360200190f35b341561051c57fe5b6104ca610f74565b60408051600160a060020a039092168252519081900360200190f35b341561054857fe5b610290600160a060020a0360043516602435610f83565b604080519115158252519081900360200190f35b341561057b57fe5b6101f161105c565b604080516020808252835181830152835191928392908301918501908083838215610237575b80518252602083111561023757601f199092019160209182019101610217565b505050905090810190601f1680156102635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561060b57fe5b6102b46004356110ea565b60408051918252519081900360200190f35b341561063057fe5b610290600160a060020a03600435166024356111dc565b604080519115158252519081900360200190f35b341561066357fe5b610290611205565b604080519115158252519081900360200190f35b341561068757fe5b6102b461120e565b60408051918252519081900360200190f35b34156106a957fe5b604080516020600460443581810135601f8101849004840285018401909552848452610290948235600160a060020a031694602480359560649492939190920191819084018382808284375094965061121495505050505050565b604080519115158252519081900360200190f35b341561072057fe5b610290600160a060020a0360043516602435611339565b604080519115158252519081900360200190f35b341561075357fe5b6102b4600160a060020a036004358116906024351661140e565b60408051918252519081900360200190f35b341561078757fe5b6104ca61143b565b60408051600160a060020a039092168252519081900360200190f35b34156107b357fe5b6101df600435151561144f565b005b34156107ca57fe5b6104ca61147e565b60408051600160a060020a039092168252519081900360200190f35b600080600160a060020a038316151561080a5760009150610815565b823b90506000811191505b50919050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108a05780601f10610875576101008083540402835291602001916108a0565b820191906000526020600020905b81548152906001019060200180831161088357829003601f168201915b505050505081565b600b5460009060ff1615156108bd5760006000fd5b81158015906108f05750600160a060020a0333811660009081526009602090815260408083209387168352929052205415155b156108fb5760006000fd5b60005461091090600160a060020a03166107ee565b156109b2576000805460408051602090810184905281517fda682aeb000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301528881166024830152604482018890529251929093169363da682aeb9360648082019492918390030190829087803b151561099057fe5b6102c65a03f1151561099e57fe5b505060405151151590506109b25760006000fd5b5b600160a060020a03338116600081815260096020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b92915050565b60075481565b6000610a2b436110ea565b90505b90565b6000805433600160a060020a03908116911614610abf57600b5460ff161515610a5a5760006000fd5b600160a060020a038085166000908152600960209081526040808320339094168352929052205482901015610a9157506000610acd565b600160a060020a03808516600090815260096020908152604080832033909416835292905220805483900390555b610aca84848461148d565b90505b9392505050565b60025460ff1681565b60005433600160a060020a03908116911614610af95760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382166000908152600860205260408120541580610b865750600160a060020a038316600090815260086020526040812080548492908110610b6b57fe5b906000526020600020900160005b50546001608060020a0316115b15610c4257600554600160a060020a031615610c3557600554600654600160a060020a0390911690634ee2cd7e908590610bc1908690611675565b6000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1515610c1857fe5b6102c65a03f11515610c2657fe5b5050604051519150610a149050565b506000610a14565b610a14565b600160a060020a0383166000908152600860205260409020610c64908361168f565b9050610a14565b5b92915050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108a05780601f10610875576101008083540402835291602001916108a0565b820191906000526020600020905b81548152906001019060200180831161088357829003601f168201915b505050505081565b600080831515610d0e574393505b600b60019054906101000a9004600160a060020a0316600160a060020a0316635b7b72c130868a8a8a896000604051602001526040518763ffffffff1660e060020a0281526004018087600160a060020a0316600160a060020a03168152602001868152602001806020018560ff1660ff1681526020018060200184151515158152602001838103835287818151815260200191508051906020019080838360008314610dd6575b805182526020831115610dd657601f199092019160209182019101610db6565b505050905090810190601f168015610e025780820380516001836020036101000a031916815260200191505b5083810382528551815285516020918201918701908083838215610e41575b805182526020831115610e4157601f199092019160209182019101610e21565b505050905090810190601f168015610e6d5780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b1515610e8e57fe5b6102c65a03f11515610e9c57fe5b50506040805180517f3cebb823000000000000000000000000000000000000000000000000000000008252600160a060020a03338116600484015292519094509184169250633cebb82391602480830192600092919082900301818387803b1515610f0357fe5b6102c65a03f11515610f1157fe5b5050604080518681529051600160a060020a03841692507f086c875b377f900b07ce03575813022f05dd10ed7640b5282cf6d3c3fc352ade9181900360200190a28091505b5095945050505050565b6000610f6c8243610b26565b90505b919050565b600554600160a060020a031681565b600080548190819033600160a060020a03908116911614610fa45760006000fd5b610faf600a4361168f565b9150818483011015610fc15760006000fd5b610fce600a858401611805565b610fd785610f60565b9050808482011015610fe95760006000fd5b600160a060020a038516600090815260086020526040902061100d90828601611805565b604080518581529051600160a060020a038716916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600192505b5b505092915050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108a05780601f10610875576101008083540402835291602001916108a0565b820191906000526020600020905b81548152906001019060200180831161088357829003601f168201915b505050505081565b600a546000901580611123575081600a600081548110151561110857fe5b906000526020600020900160005b50546001608060020a0316115b156111c457600554600160a060020a0316156111b757600554600654600160a060020a039091169063981b24d09061115c908590611675565b6000604051602001526040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b151561119a57fe5b6102c65a03f115156111a857fe5b5050604051519150610f6f9050565b506000610f6f565b610f6f565b6111cf600a8361168f565b9050610f6f565b5b919050565b600b5460009060ff1615156111f15760006000fd5b6111fc33848461148d565b90505b92915050565b600b5460ff1681565b60065481565b600061122084846108a8565b151561122c5760006000fd5b83600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001806020018281038252838181518152602001915080519060200190808383600083146112d2575b8051825260208311156112d257601f1990920191602091820191016112b2565b505050905090810190601f1680156112fe5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561131c57fe5b6102c65a03f1151561132a57fe5b505050600190505b9392505050565b600080548190819033600160a060020a0390811691161461135a5760006000fd5b611365600a4361168f565b9150838210156113755760006000fd5b611382600a858403611805565b61138b85610f60565b90508381101561139b5760006000fd5b600160a060020a03851660009081526008602052604090206113bf90858303611805565b604080518581529051600091600160a060020a038816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600192505b5b505092915050565b600160a060020a038083166000908152600960209081526040808320938516835292905220545b92915050565b600b546101009004600160a060020a031681565b60005433600160a060020a0390811691161461146b5760006000fd5b600b805460ff19168215151790555b5b50565b600054600160a060020a031681565b600080808315156114a1576001925061166c565b6006544390106114b15760006000fd5b600160a060020a03851615806114d8575030600160a060020a031685600160a060020a0316145b156114e35760006000fd5b6114ed8643610b26565b915083821015611500576000925061166c565b60005461151590600160a060020a03166107ee565b156115b7576000805460408051602090810184905281517f4a393149000000000000000000000000000000000000000000000000000000008152600160a060020a038b811660048301528a81166024830152604482018a905292519290931693634a3931499360648082019492918390030190829087803b151561159557fe5b6102c65a03f115156115a357fe5b505060405151151590506115b75760006000fd5b5b600160a060020a03861660009081526008602052604090206115dc90858403611805565b6115e68543610b26565b90508084820110156115f85760006000fd5b600160a060020a038516600090815260086020526040902061161c90828601611805565b84600160a060020a031686600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600192505b50509392505050565b600081831061168457816111fc565b825b90505b92915050565b60006000600060008580549050600014156116ad57600093506117fc565b8554869060001981019081106116bf57fe5b906000526020600020900160005b50546001608060020a03168510611724578554869060001981019081106116f057fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a031693506117fc565b85600081548110151561173357fe5b906000526020600020900160005b50546001608060020a031685101561175c57600093506117fc565b8554600093506000190191505b828211156117be5760026001838501015b04905084868281548110151561178c57fe5b906000526020600020900160005b50546001608060020a0316116117b2578092506117b9565b6001810391505b611769565b85838154811015156117cc57fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a031693505b50505092915050565b8154600090819015806118425750835443908590600019810190811061182757fe5b906000526020600020900160005b50546001608060020a0316105b156118b857835484906118588260018301611908565b8154811061186257fe5b906000526020600020900160005b5080546001608060020a03858116700100000000000000000000000000000000024382166fffffffffffffffffffffffffffffffff1990931692909217161781559150611901565b8354849060001981019081106118ca57fe5b906000526020600020900160005b5080546001608060020a0380861670010000000000000000000000000000000002911617815590505b5b50505050565b81548183558181151161192c5760008381526020902061192c918101908301611932565b5b505050565b610a2e91905b8082111561194c5760008155600101611938565b5090565b905600a165627a7a7230582057348ca0297970bb01202ce8022511ab041096fc938e17a211f6de719789f54e0029a165627a7a723058207f08e59b3da88e7db6ae63182ac584f5a56ccbe53f3a10d2ca155d5729ede5540029',\n        gas: '3900000',\n        gasPrice: eth.gasPrice.mul(1.1).floor()\n    }, function (e, contract){\n        console.log(e, contract);\n        if (typeof contract.address !== 'undefined') {\n            console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);\n        }\n    });\n\n\nvar _tokenFactory = minimeFactory.address ;\nvar sgtAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"creationBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newController\",\"type\":\"address\"}],\"name\":\"changeController\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_cloneTokenName\",\"type\":\"string\"},{\"name\":\"_cloneDecimalUnits\",\"type\":\"uint8\"},{\"name\":\"_cloneTokenSymbol\",\"type\":\"string\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"generateTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"data\",\"type\":\"uint256[]\"}],\"name\":\"multiMint\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"transfersEnabled\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentSnapShotBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"destroyTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenFactory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"enableTransfers\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"_tokenFactory\",\"type\":\"address\"}],\"payable\":false,\"type\":\"constructor\"},{\"payable\":true,\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_cloneToken\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_snapshotBlock\",\"type\":\"uint256\"}],\"name\":\"NewCloneToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}];\nvar sgtContract = web3.eth.contract(sgtAbi);\nvar sgt = sgtContract.new(\n    _tokenFactory,\n    {\n        from: web3.eth.accounts[0],\n        data: '0x60a0604052600760608190527f4d4d545f302e310000000000000000000000000000000000000000000000000060809081526200004091600491906200018f565b5034156200004a57fe5b60405160208062001cdf83398101604052515b8060006000604060405190810160405280601481526020017f5374617475732047656e6573697320546f6b656e0000000000000000000000008152506001604060405190810160405280600381526020017f534754000000000000000000000000000000000000000000000000000000000081525060005b5b60008054600160a060020a03191633600160a060020a03161790555b600b805461010060a860020a031916610100600160a060020a038a16021790558351620001279060019060208701906200018f565b506002805460ff191660ff851617905581516200014c9060039060208501906200018f565b5060058054600160a060020a031916600160a060020a0388161790556006859055600b805460ff1916821515179055436007555b505050505050505b5062000239565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001d257805160ff191683800117855562000202565b8280016001018555821562000202579182015b8281111562000202578251825591602001919060010190620001e5565b5b506200021192915062000215565b5090565b6200023691905b808211156200021157600081556001016200021c565b5090565b90565b611a9680620002496000396000f3006060604052361561012d5763ffffffff60e060020a60003504166306fdde0381146101ec578063095ea7b31461027c57806317634514146102af57806318160ddd146102d157806323b872dd146102f3578063313ce5671461032c5780633cebb823146103525780634ee2cd7e1461037057806354fd4d50146103a15780636638c0871461043157806370a08231146104f157806380a540011461051f578063827f32c01461054b57806395d89b411461057e578063981b24d01461060e5780639a0e4ebb14610633578063a9059cbb14610688578063bef97c87146106bb578063c5bcc4f1146106df578063cae9ca5114610701578063d3ce77fe14610778578063dd62ed3e146107ab578063e77772fe146107df578063f41e60c51461080b578063f77c479114610822575b6101ea5b60005461014690600160a060020a031661084e565b156101e157600080546040805160209081019390935280517ff48c3054000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301529151919092169263f48c30549234926024808301939282900301818588803b15156101b857fe5b6125ee5a03f115156101c657fe5b505060405151151591506101dc90505760006000fd5b6101e7565b60006000fd5b5b565b005b34156101f457fe5b6101fc61087b565b604080516020808252835181830152835191928392908301918501908083838215610242575b80518252602083111561024257601f199092019160209182019101610222565b505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561028457fe5b61029b600160a060020a0360043516602435610908565b604080519115158252519081900360200190f35b34156102b757fe5b6102bf610a7a565b60408051918252519081900360200190f35b34156102d957fe5b6102bf610a80565b60408051918252519081900360200190f35b34156102fb57fe5b61029b600160a060020a0360043581169060243516604435610a91565b604080519115158252519081900360200190f35b341561033457fe5b61033c610b34565b6040805160ff9092168252519081900360200190f35b341561035a57fe5b6101ea600160a060020a0360043516610b3d565b005b341561037857fe5b6102bf600160a060020a0360043516602435610b86565b60408051918252519081900360200190f35b34156103a957fe5b6101fc610cd2565b604080516020808252835181830152835191928392908301918501908083838215610242575b80518252602083111561024257601f199092019160209182019101610222565b505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561043957fe5b6104d5600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989a60ff8b35169a909994019750919550918201935091508190840183828082843750949650508435946020013515159350610d6092505050565b60408051600160a060020a039092168252519081900360200190f35b34156104f957fe5b6102bf600160a060020a0360043516610fc0565b60408051918252519081900360200190f35b341561052757fe5b6104d5610fd4565b60408051600160a060020a039092168252519081900360200190f35b341561055357fe5b61029b600160a060020a0360043516602435610fe3565b604080519115158252519081900360200190f35b341561058657fe5b6101fc6110bc565b604080516020808252835181830152835191928392908301918501908083838215610242575b80518252602083111561024257601f199092019160209182019101610222565b505050905090810190601f16801561026e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561061657fe5b6102bf60043561114a565b60408051918252519081900360200190f35b341561063b57fe5b6101ea60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061123c95505050505050565b005b341561069057fe5b61029b600160a060020a03600435166024356112f3565b604080519115158252519081900360200190f35b34156106c357fe5b61029b61131c565b604080519115158252519081900360200190f35b34156106e757fe5b6102bf611325565b60408051918252519081900360200190f35b341561070957fe5b604080516020600460443581810135601f810184900484028501840190955284845261029b948235600160a060020a031694602480359560649492939190920191819084018382808284375094965061132b95505050505050565b604080519115158252519081900360200190f35b341561078057fe5b61029b600160a060020a0360043516602435611450565b604080519115158252519081900360200190f35b34156107b357fe5b6102bf600160a060020a0360043581169060243516611525565b60408051918252519081900360200190f35b34156107e757fe5b6104d5611552565b60408051600160a060020a039092168252519081900360200190f35b341561081357fe5b6101ea6004351515611566565b005b341561082a57fe5b6104d5611595565b60408051600160a060020a039092168252519081900360200190f35b600080600160a060020a038316151561086a5760009150610875565b823b90506000811191505b50919050565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b505050505081565b600b5460009060ff16151561091d5760006000fd5b81158015906109505750600160a060020a0333811660009081526009602090815260408083209387168352929052205415155b1561095b5760006000fd5b60005461097090600160a060020a031661084e565b15610a12576000805460408051602090810184905281517fda682aeb000000000000000000000000000000000000000000000000000000008152600160a060020a0333811660048301528881166024830152604482018890529251929093169363da682aeb9360648082019492918390030190829087803b15156109f057fe5b6102c65a03f115156109fe57fe5b50506040515115159050610a125760006000fd5b5b600160a060020a03338116600081815260096020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b92915050565b60075481565b6000610a8b4361114a565b90505b90565b6000805433600160a060020a03908116911614610b1f57600b5460ff161515610aba5760006000fd5b600160a060020a038085166000908152600960209081526040808320339094168352929052205482901015610af157506000610b2d565b600160a060020a03808516600090815260096020908152604080832033909416835292905220805483900390555b610b2a8484846115a4565b90505b9392505050565b60025460ff1681565b60005433600160a060020a03908116911614610b595760006000fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382166000908152600860205260408120541580610be65750600160a060020a038316600090815260086020526040812080548492908110610bcb57fe5b906000526020600020900160005b50546001608060020a0316115b15610ca257600554600160a060020a031615610c9557600554600654600160a060020a0390911690634ee2cd7e908590610c2190869061178c565b6000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1515610c7857fe5b6102c65a03f11515610c8657fe5b5050604051519150610a749050565b506000610a74565b610a74565b600160a060020a0383166000908152600860205260409020610cc490836117a6565b9050610a74565b5b92915050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b505050505081565b600080831515610d6e574393505b600b60019054906101000a9004600160a060020a0316600160a060020a0316635b7b72c130868a8a8a896000604051602001526040518763ffffffff1660e060020a0281526004018087600160a060020a0316600160a060020a03168152602001868152602001806020018560ff1660ff1681526020018060200184151515158152602001838103835287818151815260200191508051906020019080838360008314610e36575b805182526020831115610e3657601f199092019160209182019101610e16565b505050905090810190601f168015610e625780820380516001836020036101000a031916815260200191505b5083810382528551815285516020918201918701908083838215610ea1575b805182526020831115610ea157601f199092019160209182019101610e81565b505050905090810190601f168015610ecd5780820380516001836020036101000a031916815260200191505b5098505050505050505050602060405180830381600087803b1515610eee57fe5b6102c65a03f11515610efc57fe5b50506040805180517f3cebb823000000000000000000000000000000000000000000000000000000008252600160a060020a03338116600484015292519094509184169250633cebb82391602480830192600092919082900301818387803b1515610f6357fe5b6102c65a03f11515610f7157fe5b5050604080518681529051600160a060020a03841692507f086c875b377f900b07ce03575813022f05dd10ed7640b5282cf6d3c3fc352ade9181900360200190a28091505b5095945050505050565b6000610fcc8243610b86565b90505b919050565b600554600160a060020a031681565b600080548190819033600160a060020a039081169116146110045760006000fd5b61100f600a436117a6565b91508184830110156110215760006000fd5b61102e600a85840161191c565b61103785610fc0565b90508084820110156110495760006000fd5b600160a060020a038516600090815260086020526040902061106d9082860161191c565b604080518581529051600160a060020a038716916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600192505b5b505092915050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109005780601f106108d557610100808354040283529160200191610900565b820191906000526020600020905b8154815290600101906020018083116108e357829003601f168201915b505050505081565b600a546000901580611183575081600a600081548110151561116857fe5b906000526020600020900160005b50546001608060020a0316115b1561122457600554600160a060020a03161561121757600554600654600160a060020a039091169063981b24d0906111bc90859061178c565b6000604051602001526040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b15156111fa57fe5b6102c65a03f1151561120857fe5b5050604051519150610fcf9050565b506000610fcf565b610fcf565b61122f600a836117a6565b9050610fcf565b5b919050565b600080548190819033600160a060020a0390811691161461125d5760006000fd5b600092505b83518310156112eb578351600160a060020a039085908590811061128257fe5b906020019060200201511691507401000000000000000000000000000000000000000084848151811015156112b357fe5b906020019060200201518115156112c657fe5b0490506112d38282610fe3565b15156112df5760006000fd5b5b600190920191611262565b5b5b50505050565b600b5460009060ff1615156113085760006000fd5b6113133384846115a4565b90505b92915050565b600b5460ff1681565b60065481565b60006113378484610908565b15156113435760006000fd5b83600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001806020018281038252838181518152602001915080519060200190808383600083146113e9575b8051825260208311156113e957601f1990920191602091820191016113c9565b505050905090810190601f1680156114155780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561143357fe5b6102c65a03f1151561144157fe5b505050600190505b9392505050565b600080548190819033600160a060020a039081169116146114715760006000fd5b61147c600a436117a6565b91508382101561148c5760006000fd5b611499600a85840361191c565b6114a285610fc0565b9050838110156114b25760006000fd5b600160a060020a03851660009081526008602052604090206114d69085830361191c565b604080518581529051600091600160a060020a038816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3600192505b5b505092915050565b600160a060020a038083166000908152600960209081526040808320938516835292905220545b92915050565b600b546101009004600160a060020a031681565b60005433600160a060020a039081169116146115825760006000fd5b600b805460ff19168215151790555b5b50565b600054600160a060020a031681565b600080808315156115b85760019250611783565b6006544390106115c85760006000fd5b600160a060020a03851615806115ef575030600160a060020a031685600160a060020a0316145b156115fa5760006000fd5b6116048643610b86565b9150838210156116175760009250611783565b60005461162c90600160a060020a031661084e565b156116ce576000805460408051602090810184905281517f4a393149000000000000000000000000000000000000000000000000000000008152600160a060020a038b811660048301528a81166024830152604482018a905292519290931693634a3931499360648082019492918390030190829087803b15156116ac57fe5b6102c65a03f115156116ba57fe5b505060405151151590506116ce5760006000fd5b5b600160a060020a03861660009081526008602052604090206116f39085840361191c565b6116fd8543610b86565b905080848201101561170f5760006000fd5b600160a060020a03851660009081526008602052604090206117339082860161191c565b84600160a060020a031686600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600192505b50509392505050565b600081831061179b5781611313565b825b90505b92915050565b60006000600060008580549050600014156117c45760009350611913565b8554869060001981019081106117d657fe5b906000526020600020900160005b50546001608060020a0316851061183b5785548690600019810190811061180757fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a03169350611913565b85600081548110151561184a57fe5b906000526020600020900160005b50546001608060020a03168510156118735760009350611913565b8554600093506000190191505b828211156118d55760026001838501015b0490508486828154811015156118a357fe5b906000526020600020900160005b50546001608060020a0316116118c9578092506118d0565b6001810391505b611880565b85838154811015156118e357fe5b906000526020600020900160005b505470010000000000000000000000000000000090046001608060020a031693505b50505092915050565b8154600090819015806119595750835443908590600019810190811061193e57fe5b906000526020600020900160005b50546001608060020a0316105b156119cf578354849061196f8260018301611a1f565b8154811061197957fe5b906000526020600020900160005b5080546001608060020a03858116700100000000000000000000000000000000024382166fffffffffffffffffffffffffffffffff19909316929092171617815591506112eb565b8354849060001981019081106119e157fe5b906000526020600020900160005b5080546001608060020a0380861670010000000000000000000000000000000002911617815590505b5b50505050565b815481835581811511611a4357600083815260209020611a43918101908301611a49565b5b505050565b610a8e91905b80821115611a635760008155600101611a4f565b5090565b905600a165627a7a7230582089f20df28756d7605d82438014b8d7a74992c4df8692e8aec73af24dbc1fffa80029',\n        gas: '3900000',\n        gasPrice: eth.gasPrice.mul(1.1).floor()\n    }, function (e, contract){\n        console.log(e, contract);\n        if (typeof contract.address !== 'undefined') {\n            console.log('Contract mined! address: ' + contract.address + ' transactionHash: ' + contract.transactionHash);\n        }\n    });\n\n\n////////\n\nvar minimeFactoryAbi = [{\"constant\":false,\"inputs\":[{\"name\":\"_parentToken\",\"type\":\"address\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_tokenName\",\"type\":\"string\"},{\"name\":\"_decimalUnits\",\"type\":\"uint8\"},{\"name\":\"_tokenSymbol\",\"type\":\"string\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"}];\nvar minimeFactory = eth.contract(minimeFactoryAbi).at(\"0x94bda9e40d82a09b8965e2082e5d286593246927\");\n\nvar sgtAbi = [{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"creationBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newController\",\"type\":\"address\"}],\"name\":\"changeController\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_cloneTokenName\",\"type\":\"string\"},{\"name\":\"_cloneDecimalUnits\",\"type\":\"uint8\"},{\"name\":\"_cloneTokenSymbol\",\"type\":\"string\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"generateTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"data\",\"type\":\"uint256[]\"}],\"name\":\"multiMint\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"transfersEnabled\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentSnapShotBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"destroyTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenFactory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"enableTransfers\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"_tokenFactory\",\"type\":\"address\"}],\"payable\":false,\"type\":\"constructor\"},{\"payable\":true,\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_cloneToken\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_snapshotBlock\",\"type\":\"uint256\"}],\"name\":\"NewCloneToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}];\nvar sgt = eth.contract(sgtAbi).at(\"0x4bdA828F1fE628973c39366263B78B7cd9d6D8fe\")\n"
  },
  {
    "path": "scripts/sgtGeneration/initialBalance.csv",
    "content": "0xeD33259a056F4fb449FFB7B7E2eCB43a9B5685Bf,4166666\n0x2962DE226076CCE421147b5268921eF88cF0069B,1666666\n0x74748d441d2cF255a5EA6c032B08471b85D5218B,1041666\n0xF2da5ADd7C6f8A47997EfA04049EE7888542744b,3333333\n0xfF7b6a8D0EDe69158B0C6Ffc82942cD9C8E00FF1,16666666\n0x1dc622a664505af72b5e6cc1be755335bfcc3834,5000000\n0xa7Cfd581060EC66414790691681732dB249502BD,29166666\n0x99AeF27CF577D599214C5e775D713aab2Bac5761,10416666\n0x5276cb99f022398701b205ce97fc3e73e3379ffb,5000000\n0x6068B12921e44A430fB6C5A0c9f7d72d836b5DBd,10416666\n0x00a365457Ba80285C2D7208Fb0d04D50CfC1aC17,416666\n0x88ECfD9B73858478C894FEecA993c960b19cDeB4,16666666\n0x004769ac372a0c970522fe33c66d946863a52a8c,10416666\n0x6e8276F4EDee6EEff01a25215770C326783d7147,104166\n0x0071e681554a08aB1F1174D3746d16F2F4A43642,625000\n0x283D0C13A8eFb35d0eCEbB9c71D9182102e663FA,291666\n0x5d0C10Ebc713012f82F2859E2F47A9Ee8d1318a3,416666\n0x00e18d54DB9d663d28f19eE139a94191410f9A4c,208333\n0x6fD4E1Dbf05033A7C4290477D7448e9b0A25bABF,104166\n0xf16CFD73Fe21E1d2ffdC68C6348489AD917e8546,208333\n0xDaCC0fd259CE0DE2829B38A0765970e7ab65346C,104166\n0x32d44db61df0b10Ccf0164Df3D9cbeE72E3dF02c,208333\n0x0030B7B79D9F2A6b19D5b63f5e63D82678D94c24,104166\n0x839395e20bbB182fa440d08F850E6c7A8f6F0780,416666\n0xEc9cE6E59ce95248Ecef070408E7cF35bBc79989,104166\n0xEe82DDb350f48dd5712d54072172AA1A97c677C8,41666\n0x6Fe7DdeE460DF1511ccdC4F87140D3AA2A801a19,104166\n0x9ea3baa124aeea99ce5cb980088d523625acd512,104166\n0x2a2A57a98a07D3CA5a46A0e1d51dEFffBeF54E4F,104166\n0x00C016c2BDe2f068142F0887889306fc2A447B39,416666\n0x2d19FDE5B4Cac4e1AfA54ee749C368C68c18316c,208333\n0x9A5E4d421d72bc1835E6a7b9658CA1924D12d0E0,416666\n0x9FDcD86062Be5287A81B692Bd2793Fb1787f6197,20833\n0xA47e5562f5264059D75C6BD2C1080D2736a1CDd5,833333\n0x36a0488f0d80202c2a1b3eb2d83ba71fc62860da,104166\n0x59795FccFBe2F166651c6B73d10a7a1522A0ed89,416666\n0x2d9D60C2257e7F60c15e82912Fd72D2eC9B84Bb7,416666\n0x00C4904FB17A6eCBfACb609273c89791aBA0a5cd,104166\n0xcc7560eB40E336949b7d5e933D3744b49609de1B,104166\n0x00D2C876544bcaF8761282f4c95F434763aCeF60,416666\n0xb1a2b43a7433dd150bb82227ed519cd6b142d382,416666\n0x9F4860c577C5D0928d9b38153db8cb69112E346b,416666\n0x21F7DC526b2132BCC4772E1707FBc2E18a281ed9,416666\n0x39F4662bF97200DBfA00ED05e3141c8959151cFa,250000\n0x7155302F5534712A764E1D3c0b0F99dEFe4Ad1fe,416666\n0x1cade0dd3da13883d73bac2385e46ba51d981156,625000\n0x45E8ECA25654c21445d3e64886d552c6381fc621,208333\n0x16893e10b99a59afd2c60331e0b49241d4d4d7cc,416666\n0xe7414A2F1Aa6B34f01E8D631444F0f6886fBfc6E,416666\n0x4ECC719aA2AF9498FaB3c2178391A85A9Ac914C7,104166\n0x270B22Be16E84D1383c4F1A0B384089b492E88BC,104166\n0xc8C281EDa1B79d1A385679b31dF3C918247FF04C,416666\n0x5ce0B0D1A987F0f84CD2BBafbb36fb2339383b6f,104166\n0x575AAfAFDdc1Dff3f4072532f5d580105b6835Cb,416666\n0x518611649eE8fEFeD0A4DA3D47bAB213c79ce9b5,416666\n0xAade95376d00c9e9cDc0d7049dE055f2df6114b5,208333\n0x264E5e87C8Dae4D2b526e94Cb51B2665B20e76E1,104166\n0x1dba1131000664b884a1ba238464159892252d3a,8333333\n0xAb232434C1E6eFC8118D12DEA87F6457e47FAd5E,416666\n0x8D8ED0BBB8C0DD8D14c8652DE6fE362DFdD401a9,416666\n0x4b7d1cc8005dfd224bcbf71d83f35e9650418242,104166\n0x25e1d410112AfC80691B85f3fFD0994A1e5Ea140,208333\n0x00676ef58700aA3c0F2F0b7C935b31470e373Eb8,208333\n0x719acb379d309cf8b0a020c4c94568b6016a840b,104166\n0xE05268C92117CBA26852A387F4657E9578304059,83333\n0x9c6f14119C5039AdE67e7383B1C89f53729C629f,1041666\n0x37DD4e12E09CbF64FA8B1D2B1Ac37730ACDc7529,208333\n0x78179dCAb7e906F02f3F172233B152E4A5178F13,416666\n0xfB755331Bf33E9E8376a56054DdA19c47E4D0627,208333\n0x80d63799b1e08a80f73fb7a83264b5c31600bf3a,416666\n0x882aA9BA810892C606FC29E6DbA057e8A317A36C,416666\n0x6Eee7B3E4e19518f31c009cC351bb3a6C0714AA5,416666\n0x35bED8269Dd2De8389254Cc72De8DeDfa8298B17,104166\n0xfDb33f8AC7ce72d7D4795Dd8610E323B4C122fbB,833333\n0x02E816AFC1b5C0f39852131959D946eb3b07b5ad,833333\n0x8EDDa5513D44aDF8e7C7541Ba0de80f8d7F2FC96,833333\n0x0037A6B811ffeB6e072DA21179d11B1406371C63,416666\n0x98D7cb23644eE749C2A5dc85b606ffc3Da749396,416666\n0x1db3439a222c519ab44bb1144fc28167b4fa6ee6,833333\n0x5ed8cee6b63b1c6afce3ad7c92f4fd7e1b8fad9f,4166666\n0x8811FdF0F988f0CD1B7E9DE252ABfA5b18c1cDb1,416666\n0x426ab035E8ae39f2a094f824A9e96B4152ed0c92,208333\n0xA495A5fc30C3ea0b999a2d36A759fFf9fa5224d4,104166\n0x24B139E561874594b738C2735A24B8ea52b82571,416666\n0x00ec3b9e2e7ba7ffbd1d77d100a29f8055c258bb,1250000\n0x6aBdC251e5e99B628EA4261d178e2661f59b90EA,833333\n0x76dF436353Ae2266b0e45dbF5A6f7Ad47829098d,104166\n0x0aba55c93cf7292f71067b0ba0d8b464592895ca,416666\n0x5b1025b0c08bd9f8601139cc5fb5c392da31bb8e,416666\n0x6edd429c77803606cBd6Bb501CC701a6CAD6be01,416666\n0x71ce2aa5f171c89887101b2ee709d9138921a6ba,416666\n0xf388A47e25495Bd3F1Ae276Bfbfdc4b29eD6161a,104166\n0xe0eff9aace3d6e027fe063ab06149cc6a4a504c3,416666\n0x04CB1AdE2Bd72aCD758d4f7abacbC633fC532857,208333\n0x0AcE2fe8b189d069020b06DF341998FAc33e94Bb,20833\n0xf4FdA67fA9B6e3829D41f01b9A710D2E2F6BA784,20833\n0xb3990e73a2ddb005b11946fe00891518e0c65ab8,20833\n0x7BE8dA14C273005B1186f3DeB5EA5BC1A18C1c4F,20833\n0x8962a1EC854f95A1829EFB5D48fe2EC19aC24136,20833\n0xBEc9c12c124bfCbf8546580cda997CA9c0042E4E,20833\n0x964d220e848fb3e70898ec4c4bf8ac39c7350543,20833\n0xc2059ee0e3cd4f440743972b2c1a120bc26581f4,20833\n0xDDf8f475EE3b847117ED3df673e85c8b4593bBf3,20833\n0x3FC90B9Ec3dEb1712aed78FA29ef304566aD42EC,20833\n0x37F1D672c89671F886B9a6AF09E0144E7f470B05,20833\n0x36e72fafa7a7b1a9ce0609ed057f8d104058e5b6,20833\n0x9De7e51Db35Ad3898683A78712185ADBA1B2b163,20833\n0xf1ceea80826a10c1c3d9460da60943662d29e7b3,20833\n0xD74BaF7d6bbb294748394cf6bfD0A39872a76b79,20833\n0x571ad50a227bc03d42e9565ee4bb002ef1fdb226,20833\n0x0868c6a952e5c5b3b29263259ef98a8c53c05729,20833\n0x66E8F875C6840aDEf012320Fb50C7e3264F321ec,20833\n0xFDfBB121935e162834C27f64F1700198493d2c55,20833\n0x3A9c4ab18aE51Bf3f342d4c8c3A6f54ac21A44C4,20833\n0xa49b77305087d961612be78811c5d819928abef4,20833\n0x0BdDc77c4d8fb1D3e0d8F41E0e5f8Bb6E59Ef579,20833\n0xd1324ada7e026211d0cacd90cae5777e340de948,20833\n0x6CCcbf48C39A387fb9265ED56Cb16ABF9d966411,20833\n0x213B09561d0960B90E9A7eC7743317769F1c52b8,20833\n0x6Dd9530b2Cb8B2d7d9f7D5D898b6456EC5D94f08,20833\n0x004b8D39928b9318f7709599ac8d717A3E65e102,20833\n0x9d23e95b11D0FDcff990F473179B66df259d8F4c,20833\n0xa7739b58741e59f358d52ec6ec5f181866cc4cf6,20833\n0x2D28996180b7A6e817bb0aEF6F7013c8c4a2Dfe6,20833\n0xbF6F5e78E154799C7856f4Cf9F269cf7A7201310,20833\n0x8B13796d142822d0CdC6f94Db402F05bB68DA0e6,20833\n0xCC404633DEDf6eC890038e600fD9288Da8c6D143,20833\n0x0008C3707f06Caf0AbF7e7aB296C844851610ccF,20833\n0x6095929ef6bc1f458090d14fD700448CE0973E10,20833\n0x77c5a7084B488A254e7e0643e4BfAB831f9239C2,20833\n0x9BC47064057371a59d1c2A7c907cdC6D7568dB47,20833\n0x0681e6274bd1D606E9D192B550Fb1d20DB47cA85,20833\n0x72c28693308F423B142b755EB6828E51873AA5D2,20833\n0xa9af49f28Fa939Aa6D7a9683DE9A4319D1D8eCBa,20833\n0x7E30D3836a8844E308342ba2981ece5f9f4A1377,20833\n0x3c32f264cc10a01b03c895858532b751748d22e7,20833\n0x52bB24A71aAb5f2DC01Aa1C8730aa27d9548Cd3a,20833\n0x333113fCcF6E55969d71257d8552d194147B160e,20833\n0x62301720DBAcf7B1D9Cd724Adc599dd5a269130a,20833\n0x337e47d72C03399a303ffBeAfB110537348A24f9,20833\n0xc95f7d13e60bc7b916c3925dd74edc0be2189a7a,20833\n0xcb33b5b3365e5A39d51d473D43A5dA783Dc23355,20833\n0x008e04a1EFCBEDfe39F33bAB9bd7b584695fB5D9,20833\n0x7a572856da6f9d19c7396a1c0174708cbb745203,20833\n0xffeaf10d70651cd3112b1e97289433be2bc18f50,20833\n0x7dAfD53AEE8982aB1D767830c2fe50f62E3a98E6,41666\n0x6a8076e1b8fC43D5e07d03Ba090d7a19e1cdafd1,20833\n0xe8c68e9a0b288bfc322f31da297e87af90ab7e83,20833\n0xaF4F46e668Ff2eF4FcC4b34e0B80c4225894B6Cb,20833\n0xd98b8BA6bEcf3694A8BDeBA0c9e9B1918E5C0CD8,20833\n0x4EA888Bb919Df69d82F794012dC94106992b5E7D,20833\n0xe51699E7483d6b51f37efe269048397B27D9FeDd,20833\n0x60e63c2f43f8b5daf32e8f7f2dd2e370100e9432,20833\n0xeb49f9553FA991e133fEa5C0c2724e4409aCAB4A,20833\n0x6e8db8ccdC7F3bEC8AF245FfE7b829A48328AB49,20833\n0xa572215Ba9d59Acb1dC6D3bb372125DE51868abd,20833\n0x009C4632e1688e7a7fe96f4B6013d1DACA075238,20833\n0x9D4428D8E0E2fD00dcBbE4D635AA2B2f75E51e56,20833\n0x739E44719F1C8A439c0eb9F49d046c91D89900d6,20833\n0x6ec1b4bafDA425598549940b96561c8Aa692227B,20833\n0xa5C5720E94a7D19De8eAcB8D905FC862690c9b16,20833\n0x00730Fe3aa6b1a1322933E6263f55FABabC17Eb9,20833\n0x91B45bDcaE669471dDDb613DE2D0E6F50c5e05f3,20833\n0xE0916528e3C5F0dABdF51cd00BDd364e014F48E8,20833\n0xEB8664FCAc34e577D8A0C2FbF6d7AF68439FCC0C,20833\n0xf2b314Dbecfdd47c247d1efcDd4Cf5EF847CD304,62500\n0x003E66C8E6bDc69EcB672B2dACCb05f68851752f,20833\n0x580346022a6a73592718034b905b38167431B71F,20833\n0xf73947cE3d2482168C9F3819522d938DBD5b617b,20833\n0x7D292d9A7fBFEc944f17147c9Eca36bbe8308530,20833\n0x8C4164ea40029a09Aa20C404Ba5b7FD08a7e9777,20833\n0x019EdcB493Bd91e2b25b70f26D5d9041Fd7EF946,20833\n0xc7de06718bb4ae5c17e743781be6baf956c03357,20833\n0x00E912b4080BEF232056E76d34c332dcBA4F1fcF,20833\n0x9082e0eac4b7d13f6db1259dfc8829859ed90329,20833\n0x2554eDB5D81EdAd07Be553090D230a403A4544fa,20833\n0x4bef3eaa68f4ec276ab1e7ecaa96709e4d20b49e,20833\n0x07Dae622630D1136381933D2aD6B22b839d82102,20833\n0xdFB3c8fe62A90965A47a02aF0a34A9C8C78571D7,20833\n0x18a1a57cEC0E8C05859d6a6Be589914ee1dF27B5,20833\n0x6a85883FA4579C4F9A040206B6AfEDf36863cF9c,20833\n0x5cb5F46a655C02889172323760d12d0e5D83CDAf,20833\n0x00affc8138f1056249149a3dfa99fc305507df67,20833\n0x8ad88087765f5e7d87350c31c4782d23dd96eb8a,20833\n0x2628277359d9bDc3075A53654a3E1d9A178086Dc,20833\n0x9d08F84787f26f1eFF9858B04aaF160491395e35,20833\n0x422DD917816Ad1dE921293A9A0996cBAce3ab65E,20833\n0x1608BD64c604379ba250532CB13f31A0e12FdBAf,20833\n0x9e25a3E151323e0bd3dA61F446E2405EfF38Fb9A,20833\n0x8b8Ce7E49669CAf6De14d202561B1b95BD09f6d0,20833\n0xDA8775C5648A83b6BAc69c16E72106d10866e9E7,20833\n0x08251D925C0CaFdc8669c4C4c54b2DEaaCc553A1,20833\n0xc3cc847B10E8D6B95d6F835BbAd9D32F64ec160F,20833\n0x12D9A38A8C34808ef406eb4d09ac2BCD56061112,20833\n0x5D196b547c9A91208a89C6806Fc1A86cea998013,20833\n0x00A10c4B072807B96fF309d32bB1e994c80c7e37,20833\n0x6c0B6a5Ac81E07F89238dA658a9F0E61bE6A0076,20833\n0xf5a61bBcBAba9d2a9a6D0443c84f3E258CeacbB2,20833\n0xaAb37eA6871718F4eE5d499e15b55E9f61822A53,20833\n0xd6988f0bbe339dd24f168d7ed4554751cfc0f8a9,20833\n0x2f32263ef86eE0194689553BAE5F549B50b86B86,20833\n0xa9d4a2bcbe5b9e0869d70f0fe2e1d6aacd45edc5,20833\n0xDEAA2e18867c2c620E13C895d6200Ed096D01D6B,20833\n0x632da81d534400f84c52d137d136a6ec89a59d77,20833\n0x1b00Ffd60332c7B99e5B73f926001Fe4a5d1F6e6,20833\n0x76d5c762Fe0aC7F3539e51e3Ff027Cdf8486CAf2,20833\n0x00267bBA8584c0e2Ab8e8ac5154F42C94Dd7E5aF,20833\n0x0067A53b3EebB967E2831Cf5F9E2B2310C5CA1c9,20833\n0x0fa38abec02bd4dbb87f189df50b674b9db0b468,20833\n0xcEfA4b3763186A6511485b3583560C01A767be7E,20833\n0xbae7329a0d322919f3a4fc56886deeb5ae318faf,20833\n0xFAb70d48021e72c449A6111Fc4F40A004a0E52cc,20833\n0x8888889201803e468f55333B6b3992B262f61951,20833\n0x149F3f7b862CA3711D4c3fAc466b82540C200aA1,20833\n0xd76B2B4E25e7d028d79560ED3ad5f27396639FFc,20833\n0x147af46ae9ccd18bb35ca01b353b51990e49dce1,20833\n0x300Ce242a9101f2eE5e9E0c44784ED2a3d29aE02,20833\n0x4106cF2AB83C71663ADF109f88Ad8c229A92Efe2,20833\n0x2feb16Dc7a240414188521418C9222A182Ee69Ae,20833\n0x9c16a8fd56fe0602ba179543dcc4fdc945c5966a,20833\n0x93AA7363E7fAaD169Af5f170a02faA71b4910C08,20833\n0x8b0a7eE663Ff83E3d340880A6819a319DFaA69cB,20833\n0x54E13ca8E3bE520A6858AcEE04C6e1f562Ddf443,20833\n0x19af83a3dfca021df89eac36372175bebe5b6ff7,20833\n0x3cddcb8cf10c4facfbf960309806d8a3a3f19a40,20833\n0x2F60519a289e2723727b02F3e36C83E1FD512163,20833\n0xB9BEE73ED54E77e76339a78438f148c0E51D482B,20833\n0xf35c15B90A636342d999DBd23CfC23F46caFb636,20833\n0x0c11fa6623df9ce654d9b7e75841cf9156ba99cc,20833\n0x001C9d31A368f89519232335885AA1fd2c9C9b75,20833\n0x620f5f2e0ef2FE140b4270A0C6B624F95d04cb77,20833\n0xaCF0834B453E5418aF7C6801049e7bE592b35915,20833\n0xe6054a228B6dA740684AA4b2eeB9ea790834d48a,20833\n0x2a75853e0d1D896e6A2731Af885Ba27053D0775c,208333\n0x84A6FC38d3F8370f00827409188400E979fC8BB4,20833\n0xC677E066284FACe940584D274200aa73b3f5D0d7,20833\n0x020aC951935B2D31bed8e7030590D63f24A490EE,20833\n0xCa0B5E2ba748422CC4b42C51858247F1567AAE2A,20833\n0xA5Ba162c959ea6a8FcC93aea45Dc2451EE689A76,20833\n0x24Fc2259bEa33690Ff5fB78aDfC0f7549A43BBC7,20833\n0x3316D59f0731Bf91A1170C030882fd24cED4a099,20833\n0xb43f8AA1B9A5E589Cf2f56855d0740f1D4bcd856,20833\n0x0711f7A38d71d343c22635eBA3Cd87E5295Dde5B,20833\n0x7D1cD61f6153efd679963d101C5c49374989C7E7,20833\n0x682a72BFc1b9D4a4fb8BC41A0d35f3Ed082A96dE,20833\n0xfDE06Aa76d3bA3B4C2b61Da4553Fde21f83496e0,20833\n0xa07a7a1907F3CBcB995088cA5D08B74596fe741b,20833\n0xB2EA97F18717f7431dCbBCe468A77a37F4e5B31C,20833\n0xCf743E8b5DC5AF37697cAF0F3c4dd5c3bEa81b2D,20833\n0xabFFC14B3754F34f059facF5E7EC8019B96f765a,20833\n0x30c415a95986011bAcf74b75d8454ea893032fAE,20833\n0x09884aF62d26D21442f130a1fCa4915958D40E0f,20833\n0x67bc21d3e53298d8e7f0b63fe48f4c606c877bfb,20833\n0x1d118f04b63d423fbd257ff79218f1a16711c4da,20833\n0x0CE60Eb7aDd9B9112c8b306816a86162482503f0,20833\n0x0C65122FF927F5b8453D74d0bdfAb0aAE4c876eb,20833\n0x0489076A0D17394835aF93cd62ACFf703B6814a9,20833\n0x3221E683701E7b5683A4c0e768f0EE481c5B67Fb,104166\n0x9CDc2ec2AadA2E397e9Ae9d64B0b11c40Acd7b31,20833\n0x56A7E72942A25D07Ba05fA1A4F736Cd11830E171,20833\n0xD7f264e5cB3373dCc79beAd89aF6E6DD5Bc695c6,20833\n0x277E4b7F5DaB01C8E4389B930d3Bd1c9690CE1E8,20833\n0xe33695f8c7c73ea161272a7d3be795e129dc3596,20833\n0x320b5f61E5ce5f386149Dd2F1F65019657724650,20833\n0x00E10D6e2f62E907B4D389DcfD3c168d1C7a06D3,20833\n0xdEE942d5CAF5FAc11421D86B010b458E5c392990,20833\n0xE718617391af09683CAA67B50F4E7C9Fd820765e,20833\n0x8e65B5da5725a6dA0dbf5c886Fbe760d658Fbf61,20833\n0x54E0741624DA089e94d3422A25DF1df59E814b3d,20833\n0xFf651EAD42b8EeA0B9cB88EDc92704ef6af372Ce,20833\n0x075c71a069a1fb42f5933f652703f1c30ef56020,20833\n0x97E121ed83dA3BD26cc63BAEdDC58DA5f203cB24,20833\n0xed50B8B0aDf6b37Ad15635dbC7e53F4a705014B9,20833\n0xCf22CF10072d6BDe4118B99c4deaDd63b1d08512,20833\n0x7B9598468f5eC899fD67CF365B1120be47A694Eb,20833\n0x8B344b8f12099EAb0E8e1E2F91A093a035e8E9B3,20833\n0x70c4eBe752ED72867fea4086d8510778C77E5b87,20833\n0x41ff8F8f50AdFECdBA8e5C0d7D247D246964e931,20833\n0x01984361979195894d8C5262cC9E8560644d5eA7,20833\n0xf0fEb4DA647161c501C6fA06E1A15707796C4589,20833\n0x8b2A834e537ba164cbA8Cb9E27630553F4d14ba3,20833\n0x8e87CB675E0f1F5BA60E06446fAa3CFe4816b9E5,20833\n0x8b5D370Ab5a50CBF6b6b007B09A2EAF22FA57A02,20833\n0x151c662C25E3e7636fc949A88D957642Ff422B48,20833\n0x2B981863A0FBf4e07c8508623De8Bd6d4b28419C,20833\n0xdC7Aa225964267c7E0EfB35f4931426209E90312,20833\n0xba7Fe76cCF1Be61e12CFF94d72C51ab31C6C47b8,20833\n0x01C52d07FED773FC14b5025b41D1742031cD7c8D,20833\n0xf43fcdf0697b31a5adff5343ce21d154d1410116,20833\n0x1140188B7d1EB4001D0A9612152Ee8EAdc196a08,20833\n0xEceF419A072bBc04437c2D77cDE5E0B70848B48F,20833\n0x94337a2880725312bD24766894d375dcf6568556,20833\n0xC118977A7E19076F609689EC8D56E2F16C6Ba90A,20833\n0x2cF75011aad4693d89fcfF1dA50d4DDa145294ff,20833\n0xFD6C5aC853391486D25dDD5cEfB1f7040ee31C2C,20833\n0x1051E355Adf5C153F656c3E950f1a75FE180eF79,20833\n0x760739f49Fc2936A59745644a94a5400c62a4B22,20833\n0x7D98fa238C3bBF0f2BCD1bcE19eFA028474B4E07,20833\n0x9fb63721bE0b1259c41F35BfeEFB8ad543bbDdD2,20833\n0xD9459cc85E78e0336aDb349EAbF257Dbaf9d5a2B,20833\n0x1Fd717A0AD0d3A163Fc7359c449A4a8490866Ce6,20833\n0xeE2E0E56e11faE260f3DE0D6767fc1e970FC69D3,20833\n0x568FcF35D04f92e341883597E14728a5695C2578,20833\n0x3A66369a46F343886bbAcD130Fc2bDA51423aBA0,20833\n0x279D4a00CB930dc6202c2c6153a2289A105831EC,20833\n0x8C51e00804250EbD931211b5fafD048098cF90E2,20833\n0x77Dfdf520a34bBcD87d907310A7cfEF7439CB044,20833\n0x765a2CB437ebF35d0B1EFa79F57EB0C093C5b354,20833\n0xa91A30500A60258dC83F08bD7E29086F19E75E10,20833\n0x003e11FC88fc30C3048087D2BdFEfA2D48C6644c,20833\n0xC761C1896e90D4a88Ab615B2683024974F6C2f26,20833\n0xc30F3e11B4f34259ce948A5558F73f64fDc9Ed7B,20833\n0xD57f6A60958B0D3EAFcD293E90F324De16C5F16b,20833\n0x9b1b1E9e37Eb424daCe0d8Dd7218a8a661105b2d,20833\n0x970A14730b476788B99e3fb706a4B5c6b1777808,20833\n0xc99f67433019D1DA18C311e767FAa2b8EC250886,20833\n0x83662146196a61050D29636b9F9C782750187AFa,20833\n0x5e4cddf0b9d95d4e849Ed22BE228283a2485967D,20833\n0x2d1f8cc4a77DBbDb6cD8B220Fa5B8bc70CC6afbe,20833\n0x0093F93A884Da1D86c07fB6F7DF016957a16cc88,20833\n0x793e06C5c7d23a97B452F90FCC37F54078c56b7B,20833\n0x50d1b9a839270229d63953BCCE253b0C145F9A4a,20833\n0x01a590a5bb729f9d50c70524ba1d1872ae805e2d,20833\n0xEB803dD1bba222fdFE824b7356405b39FcCBFEcD,20833\n0xdb1899Ee356001B97193BC7DEA8Da27dC661E365,20833\n\n"
  },
  {
    "path": "scripts/sgtGeneration/loadBalances.js",
    "content": "// GENERAL PARAMS\n\nconst sourceAccount = \"0x1dba1131000664b884a1ba238464159892252d3a\";\nconst tokenAddress = '0xd248b0d48e44aaf9c49aea0312be7e13a6dc1468';\n\nconst Web3 = require(\"web3\");\nconst fs = require(\"fs\");\nconst async = require(\"async\");\nconst path = require(\"path\");\n// create an instance of web3 using the HTTP provider.\n// NOTE in mist web3 is already available, so check first if its available before instantiating\nconst web3 = new Web3(new Web3.providers.HttpProvider(\"http://localhost:8545\"));\n\nconst BigNumber = require(\"bignumber.js\");\n\nconst eth = web3.eth;\n\nvar tokenAbi =[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"creationBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_newController\",\"type\":\"address\"}],\"name\":\"changeController\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_cloneTokenName\",\"type\":\"string\"},{\"name\":\"_cloneDecimalUnits\",\"type\":\"uint8\"},{\"name\":\"_cloneTokenSymbol\",\"type\":\"string\"},{\"name\":\"_snapshotBlock\",\"type\":\"uint256\"},{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"createCloneToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentToken\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"generateTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_blockNumber\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"data\",\"type\":\"uint256[]\"}],\"name\":\"multiMint\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"transfersEnabled\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"parentSnapShotBlock\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"},{\"name\":\"_extraData\",\"type\":\"bytes\"}],\"name\":\"approveAndCall\",\"outputs\":[{\"name\":\"success\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"destroyTokens\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"},{\"name\":\"_spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"remaining\",\"type\":\"uint256\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tokenFactory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_transfersEnabled\",\"type\":\"bool\"}],\"name\":\"enableTransfers\",\"outputs\":[],\"payable\":false,\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"type\":\"function\"},{\"inputs\":[{\"name\":\"_tokenFactory\",\"type\":\"address\"}],\"payable\":false,\"type\":\"constructor\"},{\"payable\":true,\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_cloneToken\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_snapshotBlock\",\"type\":\"uint256\"}],\"name\":\"NewCloneToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"_spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}];\nvar token = web3.eth.contract(tokenAbi).at(tokenAddress);\n\nconst multiple = 50;\nconst D160 = new BigNumber(\"10000000000000000000000000000000000000000\", 16);\n\nconst loadCsv = (cb) => {\n    const repeated = {};\n    const balances = [];\n    fs.readFile(path.join(__dirname, \"initialBalance.csv\"), \"utf8\", (err, res) => {\n        if (err) {\n            cb(err);\n            return;\n        }\n        const lines = res.split(\"\\n\");\n        for (let i = 0; i < lines.length; i += 1) {\n            const line = lines[ i ].split(\",\");\n            if (line.length === 2) {\n                const addr = line[ 0 ].toLowerCase();\n                if (!web3.isAddress(addr)) {\n                    console.log(\"Invalid address: \", addr);\n                    cb(new Error(`Invalid address ${ addr }`));\n                    return;\n                }\n                if (repeated[ addr ]) {\n                    console.log(\"Address is repeated: \", addr);\n                    cb(new Error(`Address is repeated: ${ addr }`));\n                    return;\n                }\n                repeated[ addr ] = true;\n                const amount = new BigNumber(line[ 1 ]);\n                if (amount.isZero()) {\n                    console.log(\"Address with zero balance: \", addr);\n                    cb(new Error(`Address with zero balance ${ addr }`));\n                    return;\n                }\n                balances.push({\n                    address: line[ 0 ],\n                    amount: amount.toString(10),\n                });\n            }\n        }\n\n        cb(null, balances);\n    });\n};\n\nconst multiSend = (balances, cb) => {\n    let i;\n    const packetbalances = [];\n    for (i = 0; i < balances.length; i += 1) {\n        packetbalances.push(pack(balances[ i ].address, balances[ i ].amount));\n    }\n\n    let pos = 0;\n    async.whilst(\n        () => pos < packetbalances.length,\n        (cb1) => {\n            const sendBalances = packetbalances.slice(pos, pos + multiple);\n            console.log(\"Transaction: \" + pos + \" Length: \" + sendBalances.length);\n            pos += multiple;\n\n            token.multiMint(\n                sendBalances,\n                { from: sourceAccount, gas: 3700000, gasPrice: eth.gasPrice.mul(1.1).floor() },\n                (err, txHash) => {\n                    if (err) return cb(err);\n                    console.log(\"txHash: \", txHash);\n                    cb1();\n                });\n        },\n        cb);\n\n    function pack(address, amount) {\n        const addressNum = new BigNumber(address.substring(2), 16);\n        const amountWei = new BigNumber(amount);\n        const v = D160.mul(amountWei).add(addressNum);\n        return v.toString(10);\n    }\n};\n\nloadCsv((err, balances) => {\n    if (err) {\n        console.log(err);\n    } else {\n        multiSend(balances, (err2) => {\n            if (err2) {\n                console.log(err2);\n            } else {\n                console.log(\"terminated succefully\");\n            }\n        });\n    }\n});\n"
  },
  {
    "path": "test/claimExternal.js",
    "content": "// Simulate a an external claim\n\nconst MultiSigWallet = artifacts.require(\"MultiSigWallet\");\nconst MiniMeTokenFactory = artifacts.require(\"MiniMeTokenFactory\");\nconst SGT = artifacts.require(\"SGT\");\nconst SNT = artifacts.require(\"SNT\");\nconst StatusContributionMock = artifacts.require(\"StatusContributionMock\");\nconst ContributionWallet = artifacts.require(\"ContributionWallet\");\nconst DevTokensHolder = artifacts.require(\"DevTokensHolderMock\");\nconst SGTExchanger = artifacts.require(\"SGTExchanger\");\nconst DynamicCeiling = artifacts.require(\"DynamicCeiling\");\nconst SNTPlaceHolderMock = artifacts.require(\"SNTPlaceHolderMock\");\nconst ExternalToken = artifacts.require(\"ExternalToken\");\n\nconst setHiddenCurves = require(\"./helpers/hiddenCurves.js\").setHiddenCurves;\nconst assertFail = require(\"./helpers/assertFail\");\n\ncontract(\"StatusContribution\", function(accounts) {\n    const addressStatus = accounts[0];\n    const addressCommunity = accounts[1];\n    const addressReserve = accounts[2];\n    const addressDevs = accounts[3];\n    const addressSGTHolder = accounts[4];\n\n    let multisigStatus;\n    let multisigCommunity;\n    let multisigReserve;\n    let multisigDevs;\n    let miniMeTokenFactory;\n    let sgt;\n    let snt;\n    let statusContribution;\n    let contributionWallet;\n    let devTokensHolder;\n    let sgtExchanger;\n    let dynamicCeiling;\n    let sntPlaceHolder;\n    let externalToken;\n\n    const curves = [\n        [web3.toWei(3), 30, 10**12],\n        [web3.toWei(13), 30, 10**12],\n        [web3.toWei(15), 30, 10**12],\n    ];\n    const startBlock = 1000000;\n    const endBlock = 1003000;\n\n    const maxSGTSupply = 5000 * 2;\n\n    it(\"Deploys all contracts\", async function() {\n        multisigStatus = await MultiSigWallet.new([addressStatus], 1);\n        multisigCommunity = await MultiSigWallet.new([addressCommunity], 1);\n        multisigReserve = await MultiSigWallet.new([addressReserve], 1);\n        multisigDevs = await MultiSigWallet.new([addressDevs], 1);\n\n        miniMeTokenFactory = await MiniMeTokenFactory.new();\n\n        sgt = await SGT.new(miniMeTokenFactory.address);\n        await sgt.generateTokens(addressSGTHolder, 5000);\n\n        snt = await SNT.new(miniMeTokenFactory.address);\n        statusContribution = await StatusContributionMock.new();\n        contributionWallet = await ContributionWallet.new(\n            multisigStatus.address,\n            endBlock,\n            statusContribution.address);\n        devTokensHolder = await DevTokensHolder.new(\n            multisigDevs.address,\n            statusContribution.address,\n            snt.address);\n        sgtExchanger = await SGTExchanger.new(sgt.address, snt.address, statusContribution.address);\n        dynamicCeiling = await DynamicCeiling.new(addressStatus, statusContribution.address);\n\n        await setHiddenCurves(dynamicCeiling, curves);\n\n        sntPlaceHolder = await SNTPlaceHolderMock.new(\n            multisigCommunity.address,\n            snt.address,\n            statusContribution.address,\n            sgtExchanger.address);\n\n        await snt.changeController(statusContribution.address);\n\n        await statusContribution.initialize(\n            snt.address,\n            sntPlaceHolder.address,\n\n            startBlock,\n            endBlock,\n\n            dynamicCeiling.address,\n\n            contributionWallet.address,\n\n            multisigReserve.address,\n            sgtExchanger.address,\n            devTokensHolder.address,\n\n            sgt.address,\n            maxSGTSupply);\n\n        externalToken = await ExternalToken.new();\n        await externalToken.generateTokens(addressStatus, 1000);\n    });\n\n    it(\"Sends to and recover tokens from the StatusContribution\", async function() {\n        await externalToken.transfer(statusContribution.address, 100);\n        const balanceBefore = await externalToken.balanceOf(addressStatus);\n        assert.equal(balanceBefore.toNumber(), 900);\n\n        await statusContribution.claimTokens(externalToken.address);\n        const afterBefore = await externalToken.balanceOf(addressStatus);\n        assert.equal(afterBefore.toNumber(), 1000);\n    });\n\n    it(\"Recovers tokens sent to SNT\", async function() {\n        await externalToken.transfer(snt.address, 100);\n        const balanceBefore = await externalToken.balanceOf(addressStatus);\n        assert.equal(balanceBefore.toNumber(), 900);\n\n        await statusContribution.claimTokens(externalToken.address);\n        const afterBefore = await externalToken.balanceOf(addressStatus);\n        assert.equal(afterBefore.toNumber(), 1000);\n    });\n});\n"
  },
  {
    "path": "test/contribution.js",
    "content": "// Simulate a full contribution\n\nconst MultiSigWallet = artifacts.require(\"MultiSigWallet\");\nconst MiniMeTokenFactory = artifacts.require(\"MiniMeTokenFactory\");\nconst SGT = artifacts.require(\"SGTMock\");\nconst SNT = artifacts.require(\"SNTMock\");\nconst StatusContributionMock = artifacts.require(\"StatusContributionMock\");\nconst ContributionWallet = artifacts.require(\"ContributionWallet\");\nconst DevTokensHolder = artifacts.require(\"DevTokensHolderMock\");\nconst SGTExchangerMock = artifacts.require(\"SGTExchangerMock\");\nconst DynamicCeiling = artifacts.require(\"DynamicCeiling\");\nconst SNTPlaceHolderMock = artifacts.require(\"SNTPlaceHolderMock\");\n\nconst setHiddenCurves = require(\"./helpers/hiddenCurves.js\").setHiddenCurves;\nconst assertFail = require(\"./helpers/assertFail\");\n\ncontract(\"StatusContribution\", function(accounts) {\n    const addressStatus = accounts[0];\n    const addressCommunity = accounts[1];\n    const addressReserve = accounts[2];\n    const addressDevs = accounts[3];\n    const addressSGTHolder = accounts[4];\n    const addressGuaranteed0 = accounts[7];\n    const addressGuaranteed1 = accounts[8];\n\n    let multisigStatus;\n    let multisigCommunity;\n    let multisigReserve;\n    let multisigDevs;\n    let miniMeTokenFactory;\n    let sgt;\n    let snt;\n    let statusContribution;\n    let contributionWallet;\n    let devTokensHolder;\n    let sgtExchanger;\n    let dynamicCeiling;\n    let sntPlaceHolder;\n    let lim;\n    let cur;\n    const divs = 30;\n\n    const curves = [\n        [web3.toWei(3), 30, 10**12],\n        [web3.toWei(8), 30, 10**12],\n        [web3.toWei(15), 30, 10**12],\n    ];\n    const startBlock = 1000000;\n    const endBlock = 1040000;\n\n    const maxSGTSupply = 5000 * 2;\n\n    it(\"Deploys all contracts\", async function() {\n        multisigStatus = await MultiSigWallet.new([addressStatus], 1);\n        multisigCommunity = await MultiSigWallet.new([addressCommunity], 1);\n        multisigReserve = await MultiSigWallet.new([addressReserve], 1);\n        multisigDevs = await MultiSigWallet.new([addressDevs], 1);\n\n        miniMeTokenFactory = await MiniMeTokenFactory.new();\n\n        sgt = await SGT.new(miniMeTokenFactory.address);\n        await sgt.generateTokens(addressSGTHolder, 2500);\n        await sgt.generateTokens(addressStatus, 2500);\n\n        snt = await SNT.new(miniMeTokenFactory.address);\n        statusContribution = await StatusContributionMock.new();\n        contributionWallet = await ContributionWallet.new(\n            multisigStatus.address,\n            endBlock,\n            statusContribution.address);\n        devTokensHolder = await DevTokensHolder.new(\n            multisigDevs.address,\n            statusContribution.address,\n            snt.address);\n        sgtExchanger = await SGTExchangerMock.new(sgt.address, snt.address, statusContribution.address);\n        dynamicCeiling = await DynamicCeiling.new(addressStatus, statusContribution.address);\n\n        await setHiddenCurves(dynamicCeiling, curves);\n\n        sntPlaceHolder = await SNTPlaceHolderMock.new(\n            multisigCommunity.address,\n            snt.address,\n            statusContribution.address,\n            sgtExchanger.address);\n\n        await snt.changeController(statusContribution.address);\n\n        await statusContribution.initialize(\n            snt.address,\n            sntPlaceHolder.address,\n\n            startBlock,\n            endBlock,\n\n            dynamicCeiling.address,\n\n            contributionWallet.address,\n\n            multisigReserve.address,\n            sgtExchanger.address,\n            devTokensHolder.address,\n\n            sgt.address,\n            maxSGTSupply);\n    });\n\n    it(\"Checks initial parameters\", async function() {\n        assert.equal(await snt.controller(), statusContribution.address);\n    });\n\n    it(\"Checks that nobody can buy before the sale starts\", async function() {\n        await assertFail(async function() {\n            await snt.send(web3.toWei(1));\n        });\n    });\n\n    it(\"Adds 2 guaranteed addresses \", async function() {\n        await statusContribution.setGuaranteedAddress(addressGuaranteed0, web3.toWei(1));\n        await statusContribution.setGuaranteedAddress(addressGuaranteed1, web3.toWei(2));\n\n        const permited7 = await statusContribution.guaranteedBuyersLimit(addressGuaranteed0);\n        const permited8 = await statusContribution.guaranteedBuyersLimit(addressGuaranteed1);\n\n        assert.equal(web3.fromWei(permited7).toNumber(), 1);\n        assert.equal(web3.fromWei(permited8).toNumber(), 2);\n    });\n\n    it(\"Reveals a curve, moves time to start of the ICO, and does the first buy\", async function() {\n        await dynamicCeiling.revealCurve(\n            curves[0][0],\n            curves[0][1],\n            curves[0][2],\n            false,\n            web3.sha3(\"pwd0\"));\n\n        await statusContribution.setMockedBlockNumber(1000000);\n        await sgt.setMockedBlockNumber(1000000);\n        await snt.setMockedBlockNumber(1000000);\n\n        lim = 3;\n        cur = 0;\n\n        await snt.sendTransaction({value: web3.toWei(1), gas: 300000, gasPrice: \"20000000000\", from: addressStatus});\n\n        const b = Math.min(1, ((lim - cur) / divs));\n        cur += b;\n\n        const balance = await snt.balanceOf(addressStatus);\n\n        assert.equal(web3.fromWei(balance).toNumber(), b * 10000);\n    });\n    it(\"Pauses and resumes the contribution \", async function() {\n        await statusContribution.setMockedBlockNumber(1005000);\n        await sgt.setMockedBlockNumber(1005000);\n        await snt.setMockedBlockNumber(1005000);\n        await statusContribution.pauseContribution();\n        await assertFail(async function() {\n            await snt.sendTransaction({value: web3.toWei(5), gas: 300000, gasPrice: \"20000000000\"});\n        });\n        await statusContribution.resumeContribution();\n    });\n    it(\"Returns the remaining of the last transaction \", async function() {\n        const initialBalance = await web3.eth.getBalance(addressStatus);\n        await snt.sendTransaction({value: web3.toWei(5), gas: 300000, gasPrice: \"20000000000\"});\n        const finalBalance = await web3.eth.getBalance(addressStatus);\n\n        const b = Math.min(5, ((lim - cur) / divs));\n        cur += b;\n\n        const spent = web3.fromWei(initialBalance.sub(finalBalance)).toNumber();\n        assert.isAbove(spent, b);\n        assert.isBelow(spent, b + 0.02);\n\n        const totalCollected = await statusContribution.totalCollected();\n        assert.equal(web3.fromWei(totalCollected), cur);\n\n        const balanceContributionWallet = await web3.eth.getBalance(contributionWallet.address);\n        assert.equal(web3.fromWei(balanceContributionWallet), cur);\n    });\n\n    it(\"Reveals second curve and checks that the limit is right\", async function() {\n        await dynamicCeiling.revealCurve(\n            curves[1][0],\n            curves[1][1],\n            curves[1][2],\n            false,\n            web3.sha3(\"pwd1\"));\n        await dynamicCeiling.moveTo(1);\n\n        await statusContribution.setMockedBlockNumber(1005200);\n        await sgt.setMockedBlockNumber(1005200);\n        await snt.setMockedBlockNumber(1005200);\n\n        const initialBalance = await web3.eth.getBalance(addressStatus);\n        await snt.sendTransaction({value: web3.toWei(10), gas: 300000, gasPrice: \"20000000000\"});\n        const finalBalance = await web3.eth.getBalance(addressStatus);\n\n        lim = 8;\n        const b = Math.min(5, ((lim - cur) / divs));\n        cur += b;\n\n        const spent = web3.fromWei(initialBalance.sub(finalBalance)).toNumber();\n        assert.isAbove(spent, b);\n        assert.isBelow(spent, b + 0.02);\n\n        const totalCollected = await statusContribution.totalCollected();\n        assert.equal(web3.fromWei(totalCollected), cur);\n\n        const balanceContributionWallet = await web3.eth.getBalance(contributionWallet.address);\n        assert.equal(web3.fromWei(balanceContributionWallet), cur);\n    });\n\n    it(\"Reveals last curve and fills the collaboration\", async function() {\n        await dynamicCeiling.revealCurve(\n            curves[2][0],\n            curves[2][1],\n            curves[2][2],\n            true,\n            web3.sha3(\"pwd2\"));\n        await dynamicCeiling.moveTo(2);\n\n        let blk = 1025100;\n        await statusContribution.setMockedBlockNumber(blk);\n        await sgt.setMockedBlockNumber(blk);\n        await snt.setMockedBlockNumber(blk);\n        blk += 100;\n\n        const initialBalance = await web3.eth.getBalance(addressStatus);\n        await statusContribution.proxyPayment(\n            addressCommunity,\n            {value: web3.toWei(15), gas: 300000, from: addressStatus, gasPrice: \"20000000000\"});\n\n        lim = 15;\n        const b = Math.min(5, ((lim - cur) / divs));\n        cur += b;\n\n        const finalBalance = await web3.eth.getBalance(addressStatus);\n\n        const balance1 = await snt.balanceOf(addressCommunity);\n\n        assert.equal(web3.fromWei(balance1).toNumber(), b * 10000);\n\n        const spent = web3.fromWei(initialBalance.sub(finalBalance)).toNumber();\n        assert.isAbove(spent, b);\n        assert.isBelow(spent, b + 0.02);\n\n        const totalCollected = await statusContribution.totalCollected();\n        assert.equal(web3.fromWei(totalCollected), cur);\n\n        const balanceContributionWallet = await web3.eth.getBalance(contributionWallet.address);\n        assert.equal(web3.fromWei(balanceContributionWallet), cur);\n\n        while (cur < 14) {\n            await statusContribution.setMockedBlockNumber(blk);\n            blk += 101;\n\n            await statusContribution.proxyPayment(\n                addressCommunity,\n                {value: web3.toWei(15), gas: 300000, from: addressStatus, gasPrice: \"20000000000\"});\n\n            const b2 = Math.min(5, ((lim - cur) / divs));\n            cur += b2;\n\n\n            const balanceContributionWallet2 =\n                await web3.eth.getBalance(contributionWallet.address);\n\n            assert.isBelow(Math.abs(web3.fromWei(balanceContributionWallet2).toNumber() - cur), 0.0001);\n        }\n    });\n\n    it(\"Doesn't allow transfers during contribution period\", async function() {\n        await assertFail(async function() {\n            await snt.transfer(addressSGTHolder, web3.toWei(1000));\n        });\n    });\n\n    it(\"Checks that Guaranteed addresses are able to buy\", async function() {\n        await snt.sendTransaction({value: web3.toWei(3), gas: 300000, from: addressGuaranteed0});\n        await snt.sendTransaction({value: web3.toWei(3), gas: 300000, from: addressGuaranteed1});\n\n        const balance7 = await snt.balanceOf(addressGuaranteed0);\n        const balance8 = await snt.balanceOf(addressGuaranteed1);\n\n        assert.equal(web3.fromWei(balance7).toNumber(), 10000);\n        assert.equal(web3.fromWei(balance8).toNumber(), 20000);\n    });\n\n    it(\"Finalizes\", async function() {\n        await statusContribution.setMockedBlockNumber(endBlock + 1);\n        await statusContribution.finalize();\n\n        const totalSupply = await snt.totalSupply();\n\n        assert.isBelow(web3.fromWei(totalSupply).toNumber() - (180000 / 0.46), 0.01);\n\n        const balanceSGT = await snt.balanceOf(sgtExchanger.address);\n        assert.equal(balanceSGT.toNumber(), totalSupply.mul(0.05).toNumber());\n\n        const balanceDevs = await snt.balanceOf(devTokensHolder.address);\n        assert.equal(balanceDevs.toNumber(), totalSupply.mul(0.20).toNumber());\n\n        const balanceSecondary = await snt.balanceOf(multisigReserve.address);\n        assert.equal(balanceSecondary.toNumber(), totalSupply.mul(0.29).toNumber());\n    });\n\n    it(\"Moves the Ether to the final multisig\", async function() {\n        await sgtExchanger.setMockedBlockNumber(endBlock + 5);\n        await multisigStatus.submitTransaction(\n            contributionWallet.address,\n            0,\n            contributionWallet.contract.withdraw.getData());\n\n        const balance = await web3.eth.getBalance(multisigStatus.address);\n\n        assert.isBelow(Math.abs(web3.fromWei(balance).toNumber() - (cur+3)), 0.00001);\n    });\n\n    it(\"Exchanges SGT by SNT\", async function() {\n        await sgtExchanger.collect({from: addressSGTHolder});\n\n        const balance = await snt.balanceOf(addressSGTHolder);\n        const totalSupply = await snt.totalSupply();\n\n        assert.equal(totalSupply.mul(0.025).toNumber(), balance.toNumber());\n    });\n\n    it(\"Doesn't allow transfers in the 1 week period\", async function() {\n        await assertFail(async function() {\n            await snt.transfer(addressSGTHolder, web3.toWei(1000));\n        });\n    });\n\n    it(\"Allows transfers after 1 week period\", async function() {\n        const t = Math.floor(new Date().getTime() / 1000) + (86400 * 7) + 1000;\n        await sntPlaceHolder.setMockedTime(t);\n\n        await snt.transfer(accounts[5], web3.toWei(1000));\n\n        const balance2 = await snt.balanceOf(accounts[5]);\n\n        assert.equal(web3.fromWei(balance2).toNumber(), 1000);\n    });\n\n    it(\"Disallows devs from transfering before 6 months have past\", async function() {\n        const t = Math.floor(new Date().getTime() / 1000) + (86400 * 7) + 1000;\n        await devTokensHolder.setMockedTime(t);\n\n        // This function will fail in the multisig\n        await multisigDevs.submitTransaction(\n            devTokensHolder.address,\n            0,\n            devTokensHolder.contract.collectTokens.getData(),\n            {from: addressDevs, gas: 1000000});\n\n        const balance = await snt.balanceOf(multisigDevs.address);\n        assert.equal(balance,0);\n    });\n\n    it(\"Allows devs to extract after 6 months\", async function() {\n        const t = (await statusContribution.finalizedTime()).toNumber() + (86400 * 360);\n        await devTokensHolder.setMockedTime(t);\n\n        const totalSupply = await snt.totalSupply();\n\n        await multisigDevs.submitTransaction(\n            devTokensHolder.address,\n            0,\n            devTokensHolder.contract.collectTokens.getData(),\n            {from: addressDevs});\n\n        const balance = await snt.balanceOf(multisigDevs.address);\n\n        const calcTokens = web3.fromWei(totalSupply.mul(0.20).mul(0.5)).toNumber();\n        const realTokens = web3.fromWei(balance).toNumber();\n\n        assert.equal(realTokens, calcTokens);\n    });\n\n    it(\"Allows devs to extract everything after 24 months\", async function() {\n        const t = Math.floor(new Date().getTime() / 1000) + (86400 * 360 * 2);\n        await devTokensHolder.setMockedTime(t);\n\n        const totalSupply = await snt.totalSupply();\n\n        await multisigDevs.submitTransaction(\n            devTokensHolder.address,\n            0,\n            devTokensHolder.contract.collectTokens.getData(),\n            {from: addressDevs});\n\n        const balance = await snt.balanceOf(multisigDevs.address);\n\n        const calcTokens = web3.fromWei(totalSupply.mul(0.20)).toNumber();\n        const realTokens = web3.fromWei(balance).toNumber();\n\n        assert.equal(calcTokens, realTokens);\n    });\n\n    it(\"Checks that SNT's Controller is upgradeable\", async function() {\n        await multisigCommunity.submitTransaction(\n            sntPlaceHolder.address,\n            0,\n            sntPlaceHolder.contract.changeController.getData(accounts[6]),\n            {from: addressCommunity});\n\n        const controller = await snt.controller();\n\n        assert.equal(controller, accounts[6]);\n    });\n});\n"
  },
  {
    "path": "test/dynamicCeiling.js",
    "content": "// Simulate dynamic ceilings\n\nconst DynamicCeiling = artifacts.require(\"DynamicCeiling\");\n\nconst setHiddenCurves = require(\"./helpers/hiddenCurves.js\").setHiddenCurves;\n\ncontract(\"DynamicCeiling\", function(accounts) {\n    let dynamicCeiling;\n\n    const curves = [\n        [web3.toWei(1000), 30, 10**12],\n        [web3.toWei(21000), 30, 10**12],\n        [web3.toWei(61000), 30, 10**12],\n    ];\n\n    it(\"Deploys dynamicCeiling\", async function() {\n        dynamicCeiling = await DynamicCeiling.new(accounts[0], accounts[0]);\n\n        assert.equal(await dynamicCeiling.currentIndex(), 0);\n    });\n\n    it(\"Checks that toCollect is 0 before curves are set\", async function() {\n        assert.equal(await dynamicCeiling.toCollect.call(0), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(10)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(15)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(20)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(30)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(55)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(676)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(5555)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(10**8)), 0);\n\n        assert.equal(await dynamicCeiling.currentIndex(), 0);\n    });\n\n    it(\"Sets the curves\", async function() {\n        await setHiddenCurves(dynamicCeiling, curves);\n        assert.equal(await dynamicCeiling.nCurves(), 10);\n    });\n\n    it(\"Checks that toCollect is 0 before curves are revealed\", async function() {\n        assert.equal(await dynamicCeiling.toCollect.call('0'), '0');\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(10)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(15)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(20)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(30)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(55)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(676)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(5555)), 0);\n        assert.equal(await dynamicCeiling.toCollect.call(web3.toWei(10**8)), 0);\n\n        assert.equal(await dynamicCeiling.currentIndex(), 0);\n    });\n\n    it(\"Reveals 1st curve\", async function() {\n        await dynamicCeiling.revealCurve(\n            curves[0][0],\n            curves[0][1],\n            curves[0][2],\n            false,\n            web3.sha3(\"pwd0\"));\n\n        assert.equal(await dynamicCeiling.revealedCurves(), 1);\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '0');\n        assert.equal(await dynamicCeiling.allRevealed(), false);\n    });\n\n    it(\"Checks toCollect after 1st curve is revealed\", async function() {\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '0');\n        assert.equal((await dynamicCeiling.toCollect.call(0)).toFixed(), '33333333333333333333');\n\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(10))).toFixed(), '33000000000000000000');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(15))).toFixed(), '32833333333333333333');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(20))).toFixed(), '32666666666666666666');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(30))).toFixed(), '32333333333333333333');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(55))).toFixed(), '31500000000000000000');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(676))).toFixed(), '10800000000000000000');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(999))).toFixed(), '33333333333333333');\n\n        assert.equal((await dynamicCeiling.toCollect.call('999999999998999999999')).toFixed(), '1000000001');\n        assert.equal((await dynamicCeiling.toCollect.call('999999999999000000000')).toFixed(), '1000000000');\n        assert.equal((await dynamicCeiling.toCollect.call('999999999999999999999')).toFixed(), '1');\n\n        await dynamicCeiling.toCollect(curves[0][0]);\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '0');\n        assert.equal((await dynamicCeiling.toCollect.call(curves[0][0])).toFixed(), '0');\n    });\n\n    it(\"Reveals 2nd curve\", async function() {\n        await dynamicCeiling.revealCurve(\n            curves[1][0],\n            curves[1][1],\n            curves[1][2],\n            false,\n            web3.sha3(\"pwd1\"));\n\n        assert.equal(await dynamicCeiling.revealedCurves(), 2);\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '0');\n        assert.equal(await dynamicCeiling.allRevealed(), false);\n    });\n\n    it(\"Checks toCollect after 2nd curve is revealed\", async function() {\n        await dynamicCeiling.toCollect(curves[0][0]);\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '1');\n        assert.equal((await dynamicCeiling.toCollect.call(curves[0][0])).toFixed(), '666666666666666666666')\n\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(1010))).toFixed(), '666333333333333333333');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(1015))).toFixed(), '666166666666666666666');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(1020))).toFixed(), '666000000000000000000');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(1030))).toFixed(), '665666666666666666666');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(1055))).toFixed(), '664833333333333333333');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(10676))).toFixed(), '344133333333333333333');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(10999))).toFixed(), '333366666666666666666');\n\n        assert.equal((await dynamicCeiling.toCollect.call('20999999999998999999999')).toFixed(), '1000000001');\n        assert.equal((await dynamicCeiling.toCollect.call('20999999999999000000000')).toFixed(), '1000000000');\n        assert.equal((await dynamicCeiling.toCollect.call('20999999999999999999999')).toFixed(), '1');\n\n        await dynamicCeiling.toCollect(curves[1][0]);\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '1');\n        assert.equal((await dynamicCeiling.toCollect.call(curves[1][0])).toFixed(), '0');\n    });\n\n    it(\"Reveals last curve\", async function() {\n        await dynamicCeiling.revealCurve(\n            curves[2][0],\n            curves[2][1],\n            curves[2][2],\n            true,\n            web3.sha3(\"pwd2\"));\n\n        assert.equal(await dynamicCeiling.revealedCurves(), 3);\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '1');\n        assert.equal(await dynamicCeiling.allRevealed(), true);\n    });\n\n    it(\"Checks toCollect after 3rd curve is revealed\", async function() {\n        await dynamicCeiling.toCollect(curves[1][0]);\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '2');\n        assert.equal((await dynamicCeiling.toCollect.call(curves[1][0])).toFixed(), '1333333333333333333333');\n\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(21010))).toFixed(), '1333000000000000000000');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(21015))).toFixed(), '1332833333333333333333');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(21020))).toFixed(), '1332666666666666666666');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(21030))).toFixed(), '1332333333333333333333');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(21055))).toFixed(), '1331500000000000000000');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(21676))).toFixed(), '1310800000000000000000');\n        assert.equal((await dynamicCeiling.toCollect.call(web3.toWei(21999))).toFixed(), '1300033333333333333333');\n\n        assert.equal((await dynamicCeiling.toCollect.call('60999999999998999999999')).toFixed(), '1000000001');\n        assert.equal((await dynamicCeiling.toCollect.call('60999999999999000000000')).toFixed(), '1000000000');\n        assert.equal((await dynamicCeiling.toCollect.call('60999999999999999999999')).toFixed(), '1');\n\n        await dynamicCeiling.toCollect(curves[2][0]);\n        assert.equal((await dynamicCeiling.currentIndex()).toFixed(), '2');\n        assert.equal((await dynamicCeiling.toCollect.call(curves[2][0])).toFixed(), '0');\n    });\n\n\n    it(\"Deploys dynamicCeiling\", async function() {\n        dynamicCeiling = await DynamicCeiling.new(accounts[0], accounts[0]);\n\n        assert.equal(await dynamicCeiling.currentIndex(), 0);\n    });\n\n    it(\"Sets the curves\", async function() {\n        await setHiddenCurves(dynamicCeiling, curves);\n        assert.equal(await dynamicCeiling.nCurves(), 10);\n    });\n\n    it(\"Reveals multiple curves\", async function() {\n        await dynamicCeiling.revealMulti(\n            [\n                curves[0][0],\n                curves[1][0],\n                curves[2][0],\n            ],\n            [\n                curves[0][1],\n                curves[1][1],\n                curves[2][1],\n            ],\n            [\n                curves[0][2],\n                curves[1][2],\n                curves[2][2],\n            ],\n            [\n                false,\n                false,\n                true,\n            ],\n            [\n                web3.sha3(\"pwd0\"),\n                web3.sha3(\"pwd1\"),\n                web3.sha3(\"pwd2\"),\n            ]\n        );\n\n        assert.equal(await dynamicCeiling.currentIndex(), 0);\n        assert.equal(await dynamicCeiling.revealedCurves(), 3);\n        assert.equal(await dynamicCeiling.allRevealed(), true);\n    });\n\n});\n"
  },
  {
    "path": "test/helpers/assertFail.js",
    "content": "module.exports = async function(callback) {\n    let web3_error_thrown = false;\n    try {\n        await callback();\n    } catch (error) {\n        if (error.message.search(\"invalid opcode\")) web3_error_thrown = true;\n    }\n    assert.ok(web3_error_thrown, \"Transaction should fail\");\n};\n"
  },
  {
    "path": "test/helpers/assertGas.js",
    "content": "module.exports = async function(error) {\n    assert.isAbove(error.message.search('of gas'), -1, 'Out of gas error must be returned');\n}\n"
  },
  {
    "path": "test/helpers/assertJump.js",
    "content": "module.exports = async function(error) {\n    assert.isAbove(error.message.search('invalid JUMP'), -1, 'Invalid JUMP error must be returned');\n}\n"
  },
  {
    "path": "test/helpers/hiddenCurves.js",
    "content": "exports.setHiddenCurves = async function(dynamicCeiling, curves) {\n    const hashes = [];\n    let i = 0;\n    for (let c of curves) {\n        const h = await dynamicCeiling.calculateHash(\n            c[0],\n            c[1],\n            c[2],\n            i === curves.length - 1,\n            web3.sha3(`pwd${ i }`));\n        hashes.push(h);\n        i += 1;\n    }\n    for (; i < 10; i += 1) {\n        hashes.push(web3.sha3(`pwd${ i }`));\n    }\n    await dynamicCeiling.setHiddenCurves(hashes);\n};\n"
  },
  {
    "path": "truffle.js",
    "content": "const HDWalletProvider = require('truffle-hdwallet-provider');\n\nconst mnemonic = process.env.TEST_MNEMONIC || 'status mnemonic status mnemonic status mnemonic status mnemonic status mnemonic status mnemonic';\nconst providerRopsten = new HDWalletProvider(mnemonic, 'https://ropsten.infura.io/', 0);\nconst providerKovan = new HDWalletProvider(mnemonic, 'https://kovan.infura.io', 0);\n\nmodule.exports = {\n    networks: {\n        development: {\n            network_id: 15,\n            host: \"localhost\",\n            port: 8545,\n            gas: 4000000,\n            gasPrice: 20e9,\n        },\n        development_migrate: {\n            network_id: 15,\n            host: \"localhost\",\n            port: 8545,\n            gas: 4000000,\n            gasPrice: 20e9,\n            from: \"0xf93df8c288b9020e76583a6997362e89e0599e99\",\n        },\n        mainnet: {\n            network_id: 1,\n            host: \"localhost\",\n            port: 8545,\n            gas: 4000000,\n            gasPrice: 20e9,\n            from: \"0xf93df8c288b9020e76583a6997362e89e0599e99\",\n        },\n        ropsten: {\n            network_id: 3,\n            provider: providerRopsten,\n            gas: 4000000,\n            gasPrice: 20e9,\n        },\n        kovan: {\n            network_id: 42,\n            provider: providerKovan,\n            gas: 4000000,\n            gasPrice: 20e9,\n        },\n    }\n};\n"
  }
]