├── .eslintrc.json ├── .gitignore ├── .soliumignore ├── .soliumrc.json ├── .travis.yml ├── LICENSE ├── README.md ├── build └── contracts │ ├── BasicToken.json │ ├── ERC20.json │ ├── ERC20Basic.json │ ├── IMintableToken.json │ ├── IouRootsReservationToken.json │ ├── IouRootsToken.json │ ├── Migrations.json │ ├── MintableToken.json │ ├── Ownable.json │ ├── Pausable.json │ ├── PensionFundRelease.json │ ├── PricingStrategy.json │ ├── Reservation.json │ ├── SafeMath.json │ ├── SimpleToken.json │ └── StandardToken.json ├── contracts ├── IouRootsToken.sol ├── Migrations.sol ├── PensionFundRelease.sol ├── ProjectValidation.sol └── reservation │ ├── IMintableToken.sol │ ├── IouRootsReservationToken.sol │ ├── PricingStrategy.sol │ └── Reservation.sol ├── ethpm.json ├── migrations ├── 1_initial_migration.js ├── 2_deploy_IouRootsToken.js ├── 3_deploy_Reservation.js ├── 4_change_PricingStrategy.js ├── 5_deploy_PensionFundRelease.js └── 5_deploy_ProjectValidation.js ├── package-lock.json ├── package.json ├── test ├── IouRootsTokenTest.js ├── PensionFundReleaseTest.js ├── ProjectValidationTest.js └── reservation │ ├── PricingStrategyTest.js │ └── ReservationTest.js └── truffle.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "es6": true, 5 | "mocha": true 6 | }, 7 | "extends": "eslint:recommended", 8 | "parserOptions": { 9 | "sourceType": "module", 10 | "ecmaVersion": 8 11 | }, 12 | "globals": { 13 | "artifacts": true, 14 | "contract": true, 15 | "web3": true, 16 | "assert": true, 17 | "console": true 18 | }, 19 | "rules": { 20 | "indent": [ 21 | "error", 22 | 4 23 | ], 24 | "linebreak-style": [ 25 | "error", 26 | "unix" 27 | ], 28 | "quotes": [ 29 | "error", 30 | "double" 31 | ], 32 | "semi": [ 33 | "error", 34 | "never" 35 | ], 36 | "no-var": "error", 37 | "arrow-parens": [ 38 | "error", 39 | "always" 40 | ], 41 | "prefer-arrow-callback": "error", 42 | "constructor-super": "error", 43 | "no-case-declarations": "error", 44 | "no-catch-shadow": "off", 45 | "no-class-assign": "error", 46 | "no-compare-neg-zero": "error", 47 | "no-cond-assign": "error", 48 | "no-confusing-arrow": "off", 49 | "no-console": "error", 50 | "no-const-assign": "error", 51 | "no-constant-condition": "error", 52 | "no-continue": "off", 53 | "no-control-regex": "error", 54 | "no-debugger": "error", 55 | "no-delete-var": "error", 56 | "no-div-regex": "off", 57 | "no-dupe-args": "error", 58 | "no-dupe-class-members": "error", 59 | "no-dupe-keys": "error", 60 | "no-duplicate-case": "error", 61 | "no-duplicate-imports": "off", 62 | "no-else-return": "off", 63 | "no-empty": "error", 64 | "no-empty-character-class": "error", 65 | "no-empty-function": "off", 66 | "no-empty-pattern": "error", 67 | "no-eq-null": "off", 68 | "no-eval": "off", 69 | "no-ex-assign": "error", 70 | "no-extend-native": "off", 71 | "no-extra-bind": "off", 72 | "no-extra-boolean-cast": "error", 73 | "no-extra-label": "off", 74 | "no-extra-parens": "off", 75 | "no-extra-semi": "error", 76 | "no-fallthrough": "error", 77 | "no-floating-decimal": "off", 78 | "no-func-assign": "error", 79 | "no-global-assign": "error", 80 | "no-implicit-coercion": "off", 81 | "no-implicit-globals": "off", 82 | "no-implied-eval": "off", 83 | "no-inline-comments": "off", 84 | "no-inner-declarations": "error", 85 | "no-invalid-regexp": "error", 86 | "no-invalid-this": "off", 87 | "no-irregular-whitespace": "error", 88 | "no-iterator": "off", 89 | "no-label-var": "off", 90 | "no-labels": "off", 91 | "no-lone-blocks": "off", 92 | "no-lonely-if": "off", 93 | "no-loop-func": "off", 94 | "no-magic-numbers": "off", 95 | "no-mixed-operators": "off", 96 | "no-mixed-requires": "off", 97 | "no-mixed-spaces-and-tabs": "error", 98 | "no-multi-assign": "off", 99 | "no-multi-spaces": "off", 100 | "no-multi-str": "off", 101 | "no-multiple-empty-lines": "off", 102 | "no-native-reassign": "off", 103 | "no-negated-condition": "off", 104 | "no-negated-in-lhs": "off", 105 | "no-nested-ternary": "off", 106 | "no-new": "off", 107 | "no-new-func": "off", 108 | "no-new-object": "off", 109 | "no-new-require": "off", 110 | "no-new-symbol": "error", 111 | "no-new-wrappers": "off", 112 | "no-obj-calls": "error", 113 | "no-octal": "error", 114 | "no-octal-escape": "off", 115 | "no-param-reassign": "off", 116 | "no-path-concat": "off", 117 | "no-plusplus": "off", 118 | "no-process-env": "off", 119 | "no-process-exit": "off", 120 | "no-proto": "off", 121 | "no-prototype-builtins": "off", 122 | "no-redeclare": "error", 123 | "no-regex-spaces": "error", 124 | "no-restricted-globals": "off", 125 | "no-restricted-imports": "off", 126 | "no-restricted-modules": "off", 127 | "no-restricted-properties": "off", 128 | "no-restricted-syntax": "off", 129 | "no-return-assign": "off", 130 | "no-return-await": "off", 131 | "no-script-url": "off", 132 | "no-self-assign": "error", 133 | "no-self-compare": "off", 134 | "no-sequences": "off", 135 | "no-shadow": "off", 136 | "no-shadow-restricted-names": "off", 137 | "no-spaced-func": "off", 138 | "no-sparse-arrays": "error", 139 | "no-sync": "off", 140 | "no-tabs": "off", 141 | "no-template-curly-in-string": "off", 142 | "no-ternary": "off", 143 | "no-this-before-super": "error", 144 | "no-throw-literal": "off", 145 | "no-trailing-spaces": "off", 146 | "no-undef": "error", 147 | "no-undef-init": "off", 148 | "no-undefined": "off", 149 | "no-underscore-dangle": "off", 150 | "no-unexpected-multiline": "error", 151 | "no-unmodified-loop-condition": "off", 152 | "no-unneeded-ternary": "off", 153 | "no-unreachable": "error", 154 | "no-unsafe-finally": "error", 155 | "no-unsafe-negation": "error", 156 | "no-unused-expressions": "off", 157 | "no-unused-labels": "error", 158 | "no-unused-vars": "error", 159 | "no-use-before-define": "off", 160 | "no-useless-call": "off", 161 | "no-useless-computed-key": "off", 162 | "no-useless-concat": "off", 163 | "no-useless-constructor": "off", 164 | "no-useless-escape": "error", 165 | "no-useless-rename": "off", 166 | "no-useless-return": "off", 167 | "no-var": "off", 168 | "no-void": "off", 169 | "no-warning-comments": "off", 170 | "no-whitespace-before-property": "off", 171 | "no-with": "off", 172 | "nonblock-statement-body-position": "off", 173 | "object-curly-newline": "off", 174 | "object-curly-spacing": "off", 175 | "object-property-newline": "off", 176 | "object-shorthand": "off", 177 | "one-var": "off", 178 | "one-var-declaration-per-line": "off", 179 | "operator-assignment": "off", 180 | "operator-linebreak": "off", 181 | "padded-blocks": "off", 182 | "padding-line-between-statements": "off", 183 | "prefer-arrow-callback": "off", 184 | "prefer-const": "off", 185 | "prefer-destructuring": "off", 186 | "prefer-numeric-literals": "off", 187 | "prefer-promise-reject-errors": "off", 188 | "prefer-reflect": "off", 189 | "prefer-rest-params": "off", 190 | "prefer-spread": "off", 191 | "prefer-template": "off", 192 | "quote-props": "off", 193 | "quotes": "off", 194 | "radix": "off", 195 | "require-await": "off", 196 | "require-jsdoc": "off", 197 | "require-yield": "error", 198 | "rest-spread-spacing": "off", 199 | "semi": "off", 200 | "semi-spacing": "off", 201 | "semi-style": "off", 202 | "sort-imports": "off", 203 | "sort-keys": "off", 204 | "sort-vars": "off", 205 | "space-before-blocks": "off", 206 | "space-before-function-paren": "off", 207 | "space-in-parens": "off", 208 | "space-infix-ops": "off", 209 | "space-unary-ops": "off", 210 | "spaced-comment": "off", 211 | "strict": "off", 212 | "switch-colon-spacing": "off", 213 | "symbol-description": "off", 214 | "template-curly-spacing": "off", 215 | "template-tag-spacing": "off", 216 | "unicode-bom": "off", 217 | "use-isnan": "error", 218 | "valid-jsdoc": "off", 219 | "valid-typeof": "error" 220 | 221 | } 222 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | node_modules/ 3 | installed_contracts/ -------------------------------------------------------------------------------- /.soliumignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | installed_contracts -------------------------------------------------------------------------------- /.soliumrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom-rules-filename": null, 3 | "rules": { 4 | "imports-on-top": true, 5 | "variable-declarations": true, 6 | "array-declarations": true, 7 | "operator-whitespace": true, 8 | "lbrace": true, 9 | "mixedcase": false, 10 | "camelcase": true, 11 | "uppercase": true, 12 | "no-with": true, 13 | "no-empty-blocks": true, 14 | "no-unused-vars": true, 15 | "double-quotes": true, 16 | "blank-lines": true, 17 | "indentation": true, 18 | "whitespace": true, 19 | "deprecated-suicide": true, 20 | "pragma-on-top": true 21 | } 22 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | dist: trusty 3 | sudo: false 4 | 5 | node_js: 6 | - "8" 7 | 8 | install: 9 | - npm install -g truffle ethereumjs-testrpc 10 | - npm install 11 | - truffle install 12 | 13 | script: 14 | - testrpc &> /dev/null & npm test 15 | - npm run lint -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RootProject Contracts pre-alpha v0.1 2 | 3 | RootProject is a crowdfunding platform for social projects powered by a crypto currency. 4 | 5 | Website: https://rootproject.co 6 | Telegram: https://t.me/Rootproject 7 | E-mail: info@rootproject.co 8 | 9 | ### Smart Contracts 10 | Smart Contract I: ProjectValidation - under construction. 11 | 12 | Smart Contract II: PensionFundRelease - the "medium-term pension fund", as described in the RootProject whitepaper. The contract freezes funds for a custom period of time, and releases funds continously after the approval of validators. 13 | 14 | ## Specification 15 | 16 | ### Methods 17 | 18 | **vote** 19 | ```cs 20 | function vote(bool approve, string justification) onlyValidator returns (uint index) 21 | ``` 22 | Generates a vote for the fund to release or burn, and it's justification. 23 |
24 |
25 |
26 | **isReleaseApproved** 27 | ```cs 28 | function isReleaseApproved() constant returns (bool approved) 29 | ``` 30 | Checks if release approved by all validators. 31 |
32 |
33 |
34 | **isBurnApproved** 35 | ```cs 36 | function isBurnApproved() constant returns (bool approved) 37 | ``` 38 | Checks if burn approved by all validators. 39 |
40 |
41 |
42 | **getPaymentAmount** 43 | ```cs 44 | function getPaymentAmount() constant returns (uint amount) 45 | ``` 46 | Executes payment calculation. 47 |
48 |
49 |
50 | **balance** 51 | ```cs 52 | function balance() constant returns (uint amount) 53 | ``` 54 | Returns current fund balance in ROOTs. 55 |
56 |
57 |
58 | **releaseRoots** 59 | ```cs 60 | function releaseRoots() returns (uint releasedAmount) 61 | ``` 62 | Executes fund release. 63 |
64 |
65 |
66 | ### Events 67 | 68 | **Voted** 69 | ```cs 70 | event Voted(bool approve, address validator, string justification) 71 | ``` 72 | Triggered when new vote is deployed. 73 |
74 |
75 |
76 | **Released** 77 | ```cs 78 | event Released(uint amount, address worker) 79 | ``` 80 | Triggered when fund is released. 81 |
82 |
83 |
84 | ## Requirements 85 | 86 | ### General: 87 | 88 | * Node.js v7.6.0+ 89 | * truffle v3.2.2+ 90 | * testrpc v3.0.5+ 91 | 92 | ### Requirements installation steps: 93 | 94 | * npm install -g truffle ethereumjs-testrpc 95 | * npm install 96 | * truffle install 97 | 98 | ## Testing 99 | 100 | To run the test, execute the following commands from the project's root folder: 101 | * testrpc &> /dev/null & npm test 102 | 103 | ## Collaborators 104 | * **[Alex Bazhanau](https://github.com/frostiq)** 105 | * **[Anton Kraminkin](https://github.com/akraminkin)** 106 | 107 | 108 | # License 109 | 110 | All smart contracts are open source and distributed under the GNU GPL v.3 111 | 112 | -------------------------------------------------------------------------------- /build/contracts/BasicToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "BasicToken", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "totalSupply", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "uint256" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [ 20 | { 21 | "name": "_owner", 22 | "type": "address" 23 | } 24 | ], 25 | "name": "balanceOf", 26 | "outputs": [ 27 | { 28 | "name": "balance", 29 | "type": "uint256" 30 | } 31 | ], 32 | "payable": false, 33 | "type": "function" 34 | }, 35 | { 36 | "constant": false, 37 | "inputs": [ 38 | { 39 | "name": "_to", 40 | "type": "address" 41 | }, 42 | { 43 | "name": "_value", 44 | "type": "uint256" 45 | } 46 | ], 47 | "name": "transfer", 48 | "outputs": [ 49 | { 50 | "name": "", 51 | "type": "bool" 52 | } 53 | ], 54 | "payable": false, 55 | "type": "function" 56 | }, 57 | { 58 | "anonymous": false, 59 | "inputs": [ 60 | { 61 | "indexed": true, 62 | "name": "from", 63 | "type": "address" 64 | }, 65 | { 66 | "indexed": true, 67 | "name": "to", 68 | "type": "address" 69 | }, 70 | { 71 | "indexed": false, 72 | "name": "value", 73 | "type": "uint256" 74 | } 75 | ], 76 | "name": "Transfer", 77 | "type": "event" 78 | } 79 | ], 80 | "unlinked_binary": "0x6060604052341561000f57600080fd5b5b6102218061001f6000396000f300606060405263ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318160ddd811461005357806370a0823114610078578063a9059cbb146100a9575b600080fd5b341561005e57600080fd5b6100666100df565b60405190815260200160405180910390f35b341561008357600080fd5b610066600160a060020a03600435166100e5565b60405190815260200160405180910390f35b34156100b457600080fd5b6100cb600160a060020a0360043516602435610104565b604051901515815260200160405180910390f35b60005481565b600160a060020a0381166000908152600160205260409020545b919050565b600160a060020a03331660009081526001602052604081205461012d908363ffffffff6101c416565b600160a060020a033381166000908152600160205260408082209390935590851681522054610162908363ffffffff6101db16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b6000828211156101d057fe5b508082035b92915050565b6000828201838110156101ea57fe5b8091505b50929150505600a165627a7a72305820ad63889bbfaab03b7885ab8beaf867b337e350f167bfd45b165e0634a06128270029", 81 | "networks": {}, 82 | "schema_version": "0.0.5", 83 | "updated_at": 1503225330317 84 | } -------------------------------------------------------------------------------- /build/contracts/ERC20.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "ERC20", 3 | "abi": [ 4 | { 5 | "constant": false, 6 | "inputs": [ 7 | { 8 | "name": "spender", 9 | "type": "address" 10 | }, 11 | { 12 | "name": "value", 13 | "type": "uint256" 14 | } 15 | ], 16 | "name": "approve", 17 | "outputs": [ 18 | { 19 | "name": "", 20 | "type": "bool" 21 | } 22 | ], 23 | "payable": false, 24 | "type": "function" 25 | }, 26 | { 27 | "constant": true, 28 | "inputs": [], 29 | "name": "totalSupply", 30 | "outputs": [ 31 | { 32 | "name": "", 33 | "type": "uint256" 34 | } 35 | ], 36 | "payable": false, 37 | "type": "function" 38 | }, 39 | { 40 | "constant": false, 41 | "inputs": [ 42 | { 43 | "name": "from", 44 | "type": "address" 45 | }, 46 | { 47 | "name": "to", 48 | "type": "address" 49 | }, 50 | { 51 | "name": "value", 52 | "type": "uint256" 53 | } 54 | ], 55 | "name": "transferFrom", 56 | "outputs": [ 57 | { 58 | "name": "", 59 | "type": "bool" 60 | } 61 | ], 62 | "payable": false, 63 | "type": "function" 64 | }, 65 | { 66 | "constant": true, 67 | "inputs": [ 68 | { 69 | "name": "who", 70 | "type": "address" 71 | } 72 | ], 73 | "name": "balanceOf", 74 | "outputs": [ 75 | { 76 | "name": "", 77 | "type": "uint256" 78 | } 79 | ], 80 | "payable": false, 81 | "type": "function" 82 | }, 83 | { 84 | "constant": false, 85 | "inputs": [ 86 | { 87 | "name": "to", 88 | "type": "address" 89 | }, 90 | { 91 | "name": "value", 92 | "type": "uint256" 93 | } 94 | ], 95 | "name": "transfer", 96 | "outputs": [ 97 | { 98 | "name": "", 99 | "type": "bool" 100 | } 101 | ], 102 | "payable": false, 103 | "type": "function" 104 | }, 105 | { 106 | "constant": true, 107 | "inputs": [ 108 | { 109 | "name": "owner", 110 | "type": "address" 111 | }, 112 | { 113 | "name": "spender", 114 | "type": "address" 115 | } 116 | ], 117 | "name": "allowance", 118 | "outputs": [ 119 | { 120 | "name": "", 121 | "type": "uint256" 122 | } 123 | ], 124 | "payable": false, 125 | "type": "function" 126 | }, 127 | { 128 | "anonymous": false, 129 | "inputs": [ 130 | { 131 | "indexed": true, 132 | "name": "owner", 133 | "type": "address" 134 | }, 135 | { 136 | "indexed": true, 137 | "name": "spender", 138 | "type": "address" 139 | }, 140 | { 141 | "indexed": false, 142 | "name": "value", 143 | "type": "uint256" 144 | } 145 | ], 146 | "name": "Approval", 147 | "type": "event" 148 | }, 149 | { 150 | "anonymous": false, 151 | "inputs": [ 152 | { 153 | "indexed": true, 154 | "name": "from", 155 | "type": "address" 156 | }, 157 | { 158 | "indexed": true, 159 | "name": "to", 160 | "type": "address" 161 | }, 162 | { 163 | "indexed": false, 164 | "name": "value", 165 | "type": "uint256" 166 | } 167 | ], 168 | "name": "Transfer", 169 | "type": "event" 170 | } 171 | ], 172 | "unlinked_binary": "0x", 173 | "networks": {}, 174 | "schema_version": "0.0.5", 175 | "updated_at": 1503225330317 176 | } -------------------------------------------------------------------------------- /build/contracts/ERC20Basic.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "ERC20Basic", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "totalSupply", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "uint256" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [ 20 | { 21 | "name": "who", 22 | "type": "address" 23 | } 24 | ], 25 | "name": "balanceOf", 26 | "outputs": [ 27 | { 28 | "name": "", 29 | "type": "uint256" 30 | } 31 | ], 32 | "payable": false, 33 | "type": "function" 34 | }, 35 | { 36 | "constant": false, 37 | "inputs": [ 38 | { 39 | "name": "to", 40 | "type": "address" 41 | }, 42 | { 43 | "name": "value", 44 | "type": "uint256" 45 | } 46 | ], 47 | "name": "transfer", 48 | "outputs": [ 49 | { 50 | "name": "", 51 | "type": "bool" 52 | } 53 | ], 54 | "payable": false, 55 | "type": "function" 56 | }, 57 | { 58 | "anonymous": false, 59 | "inputs": [ 60 | { 61 | "indexed": true, 62 | "name": "from", 63 | "type": "address" 64 | }, 65 | { 66 | "indexed": true, 67 | "name": "to", 68 | "type": "address" 69 | }, 70 | { 71 | "indexed": false, 72 | "name": "value", 73 | "type": "uint256" 74 | } 75 | ], 76 | "name": "Transfer", 77 | "type": "event" 78 | } 79 | ], 80 | "unlinked_binary": "0x", 81 | "networks": {}, 82 | "schema_version": "0.0.5", 83 | "updated_at": 1503225330317 84 | } -------------------------------------------------------------------------------- /build/contracts/IMintableToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "IMintableToken", 3 | "abi": [ 4 | { 5 | "constant": false, 6 | "inputs": [ 7 | { 8 | "name": "_to", 9 | "type": "address" 10 | }, 11 | { 12 | "name": "_amount", 13 | "type": "uint256" 14 | } 15 | ], 16 | "name": "mint", 17 | "outputs": [ 18 | { 19 | "name": "", 20 | "type": "bool" 21 | } 22 | ], 23 | "payable": false, 24 | "type": "function" 25 | }, 26 | { 27 | "constant": false, 28 | "inputs": [], 29 | "name": "finishMinting", 30 | "outputs": [ 31 | { 32 | "name": "", 33 | "type": "bool" 34 | } 35 | ], 36 | "payable": false, 37 | "type": "function" 38 | } 39 | ], 40 | "unlinked_binary": "0x", 41 | "networks": {}, 42 | "schema_version": "0.0.5", 43 | "updated_at": 1503225285612 44 | } -------------------------------------------------------------------------------- /build/contracts/IouRootsReservationToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "IouRootsReservationToken", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "mintingFinished", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "bool" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [], 20 | "name": "name", 21 | "outputs": [ 22 | { 23 | "name": "", 24 | "type": "string" 25 | } 26 | ], 27 | "payable": false, 28 | "type": "function" 29 | }, 30 | { 31 | "constant": false, 32 | "inputs": [ 33 | { 34 | "name": "_spender", 35 | "type": "address" 36 | }, 37 | { 38 | "name": "_value", 39 | "type": "uint256" 40 | } 41 | ], 42 | "name": "approve", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "bool" 47 | } 48 | ], 49 | "payable": false, 50 | "type": "function" 51 | }, 52 | { 53 | "constant": true, 54 | "inputs": [], 55 | "name": "totalSupply", 56 | "outputs": [ 57 | { 58 | "name": "", 59 | "type": "uint256" 60 | } 61 | ], 62 | "payable": false, 63 | "type": "function" 64 | }, 65 | { 66 | "constant": false, 67 | "inputs": [ 68 | { 69 | "name": "_from", 70 | "type": "address" 71 | }, 72 | { 73 | "name": "_to", 74 | "type": "address" 75 | }, 76 | { 77 | "name": "_value", 78 | "type": "uint256" 79 | } 80 | ], 81 | "name": "transferFrom", 82 | "outputs": [ 83 | { 84 | "name": "", 85 | "type": "bool" 86 | } 87 | ], 88 | "payable": false, 89 | "type": "function" 90 | }, 91 | { 92 | "constant": true, 93 | "inputs": [], 94 | "name": "decimals", 95 | "outputs": [ 96 | { 97 | "name": "", 98 | "type": "uint8" 99 | } 100 | ], 101 | "payable": false, 102 | "type": "function" 103 | }, 104 | { 105 | "constant": false, 106 | "inputs": [ 107 | { 108 | "name": "_to", 109 | "type": "address" 110 | }, 111 | { 112 | "name": "_amount", 113 | "type": "uint256" 114 | } 115 | ], 116 | "name": "mint", 117 | "outputs": [ 118 | { 119 | "name": "", 120 | "type": "bool" 121 | } 122 | ], 123 | "payable": false, 124 | "type": "function" 125 | }, 126 | { 127 | "constant": true, 128 | "inputs": [ 129 | { 130 | "name": "_owner", 131 | "type": "address" 132 | } 133 | ], 134 | "name": "balanceOf", 135 | "outputs": [ 136 | { 137 | "name": "balance", 138 | "type": "uint256" 139 | } 140 | ], 141 | "payable": false, 142 | "type": "function" 143 | }, 144 | { 145 | "constant": false, 146 | "inputs": [], 147 | "name": "finishMinting", 148 | "outputs": [ 149 | { 150 | "name": "", 151 | "type": "bool" 152 | } 153 | ], 154 | "payable": false, 155 | "type": "function" 156 | }, 157 | { 158 | "constant": true, 159 | "inputs": [], 160 | "name": "owner", 161 | "outputs": [ 162 | { 163 | "name": "", 164 | "type": "address" 165 | } 166 | ], 167 | "payable": false, 168 | "type": "function" 169 | }, 170 | { 171 | "constant": true, 172 | "inputs": [], 173 | "name": "symbol", 174 | "outputs": [ 175 | { 176 | "name": "", 177 | "type": "string" 178 | } 179 | ], 180 | "payable": false, 181 | "type": "function" 182 | }, 183 | { 184 | "constant": false, 185 | "inputs": [ 186 | { 187 | "name": "_to", 188 | "type": "address" 189 | }, 190 | { 191 | "name": "_value", 192 | "type": "uint256" 193 | } 194 | ], 195 | "name": "transfer", 196 | "outputs": [ 197 | { 198 | "name": "", 199 | "type": "bool" 200 | } 201 | ], 202 | "payable": false, 203 | "type": "function" 204 | }, 205 | { 206 | "constant": true, 207 | "inputs": [ 208 | { 209 | "name": "_owner", 210 | "type": "address" 211 | }, 212 | { 213 | "name": "_spender", 214 | "type": "address" 215 | } 216 | ], 217 | "name": "allowance", 218 | "outputs": [ 219 | { 220 | "name": "remaining", 221 | "type": "uint256" 222 | } 223 | ], 224 | "payable": false, 225 | "type": "function" 226 | }, 227 | { 228 | "constant": false, 229 | "inputs": [ 230 | { 231 | "name": "newOwner", 232 | "type": "address" 233 | } 234 | ], 235 | "name": "transferOwnership", 236 | "outputs": [], 237 | "payable": false, 238 | "type": "function" 239 | }, 240 | { 241 | "inputs": [ 242 | { 243 | "name": "_name", 244 | "type": "string" 245 | }, 246 | { 247 | "name": "_symbol", 248 | "type": "string" 249 | }, 250 | { 251 | "name": "_decimals", 252 | "type": "uint8" 253 | } 254 | ], 255 | "payable": false, 256 | "type": "constructor" 257 | }, 258 | { 259 | "anonymous": false, 260 | "inputs": [ 261 | { 262 | "indexed": true, 263 | "name": "to", 264 | "type": "address" 265 | }, 266 | { 267 | "indexed": false, 268 | "name": "amount", 269 | "type": "uint256" 270 | } 271 | ], 272 | "name": "Mint", 273 | "type": "event" 274 | }, 275 | { 276 | "anonymous": false, 277 | "inputs": [], 278 | "name": "MintFinished", 279 | "type": "event" 280 | }, 281 | { 282 | "anonymous": false, 283 | "inputs": [ 284 | { 285 | "indexed": true, 286 | "name": "owner", 287 | "type": "address" 288 | }, 289 | { 290 | "indexed": true, 291 | "name": "spender", 292 | "type": "address" 293 | }, 294 | { 295 | "indexed": false, 296 | "name": "value", 297 | "type": "uint256" 298 | } 299 | ], 300 | "name": "Approval", 301 | "type": "event" 302 | }, 303 | { 304 | "anonymous": false, 305 | "inputs": [ 306 | { 307 | "indexed": true, 308 | "name": "from", 309 | "type": "address" 310 | }, 311 | { 312 | "indexed": true, 313 | "name": "to", 314 | "type": "address" 315 | }, 316 | { 317 | "indexed": false, 318 | "name": "value", 319 | "type": "uint256" 320 | } 321 | ], 322 | "name": "Transfer", 323 | "type": "event" 324 | } 325 | ], 326 | "unlinked_binary": "0x60606040526003805460a060020a60ff0219169055341561001f57600080fd5b604051610c38380380610c38833981016040528080518201919060200180518201919060200180519150505b5b60038054600160a060020a03191633600160a060020a03161790555b600483805161007b9291602001906100a8565b50600582805161008f9291602001906100a8565b506006805460ff191660ff83161790555b505050610148565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100e957805160ff1916838001178555610116565b82800160010185558215610116579182015b828111156101165782518255916020019190600101906100fb565b5b50610123929150610127565b5090565b61014591905b80821115610123576000815560010161012d565b5090565b90565b610ae1806101576000396000f300606060405236156100cd5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100d257806306fdde03146100f9578063095ea7b31461018457806318160ddd146101ba57806323b872dd146101df578063313ce5671461021b57806340c10f191461024457806370a082311461027a5780637d64bcb4146102ab5780638da5cb5b146102d257806395d89b4114610301578063a9059cbb1461038c578063dd62ed3e146103c2578063f2fde38b146103f9575b600080fd5b34156100dd57600080fd5b6100e561041a565b604051901515815260200160405180910390f35b341561010457600080fd5b61010c61043b565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101495780820151818401525b602001610130565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018f57600080fd5b6100e5600160a060020a03600435166024356104d9565b604051901515815260200160405180910390f35b34156101c557600080fd5b6101cd610580565b60405190815260200160405180910390f35b34156101ea57600080fd5b6100e5600160a060020a0360043581169060243516604435610586565b604051901515815260200160405180910390f35b341561022657600080fd5b61022e6105ba565b60405160ff909116815260200160405180910390f35b341561024f57600080fd5b6100e5600160a060020a03600435166024356105c3565b604051901515815260200160405180910390f35b341561028557600080fd5b6101cd600160a060020a03600435166106a5565b60405190815260200160405180910390f35b34156102b657600080fd5b6100e56106c4565b604051901515815260200160405180910390f35b34156102dd57600080fd5b6102e561074b565b604051600160a060020a03909116815260200160405180910390f35b341561030c57600080fd5b61010c61075a565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101495780820151818401525b602001610130565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561039757600080fd5b6100e5600160a060020a03600435166024356107f8565b604051901515815260200160405180910390f35b34156103cd57600080fd5b6101cd600160a060020a036004358116906024351661082a565b60405190815260200160405180910390f35b341561040457600080fd5b610418600160a060020a0360043516610857565b005b60035474010000000000000000000000000000000000000000900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104d15780601f106104a6576101008083540402835291602001916104d1565b820191906000526020600020905b8154815290600101906020018083116104b457829003601f168201915b505050505081565b600081158061050b5750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561051657600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b60035460009033600160a060020a039081169116146105a457600080fd5b6105af8484846108af565b90505b5b9392505050565b60065460ff1681565b60035460009033600160a060020a039081169116146105e157600080fd5b60035474010000000000000000000000000000000000000000900460ff161561060957600080fd5b60005461061c908363ffffffff6109c416565b6000908155600160a060020a038416815260016020526040902054610647908363ffffffff6109c416565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a25060015b5b5b92915050565b600160a060020a0381166000908152600160205260409020545b919050565b60035460009033600160a060020a039081169116146106e257600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a15060015b5b90565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104d15780601f106104a6576101008083540402835291602001916104d1565b820191906000526020600020905b8154815290600101906020018083116104b457829003601f168201915b505050505081565b60035460009033600160a060020a0390811691161461081657600080fd5b61082083836109de565b90505b5b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a0390811691161461087257600080fd5b600160a060020a038116156108aa576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b600160a060020a0380841660009081526002602090815260408083203385168452825280832054938616835260019091528120549091906108f6908463ffffffff6109c416565b600160a060020a03808616600090815260016020526040808220939093559087168152205461092b908463ffffffff610a9e16565b600160a060020a038616600090815260016020526040902055610954818463ffffffff610a9e16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b6000828201838110156109d357fe5b8091505b5092915050565b600160a060020a033316600090815260016020526040812054610a07908363ffffffff610a9e16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610a3c908363ffffffff6109c416565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600082821115610aaa57fe5b508082035b929150505600a165627a7a723058203e6c69bdf04a2d3f679842cb3e8ffaefed599036aaeb46182e36baba734c69b70029", 327 | "networks": { 328 | "1": { 329 | "events": { 330 | "0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885": { 331 | "anonymous": false, 332 | "inputs": [ 333 | { 334 | "indexed": true, 335 | "name": "to", 336 | "type": "address" 337 | }, 338 | { 339 | "indexed": false, 340 | "name": "amount", 341 | "type": "uint256" 342 | } 343 | ], 344 | "name": "Mint", 345 | "type": "event" 346 | }, 347 | "0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08": { 348 | "anonymous": false, 349 | "inputs": [], 350 | "name": "MintFinished", 351 | "type": "event" 352 | }, 353 | "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { 354 | "anonymous": false, 355 | "inputs": [ 356 | { 357 | "indexed": true, 358 | "name": "owner", 359 | "type": "address" 360 | }, 361 | { 362 | "indexed": true, 363 | "name": "spender", 364 | "type": "address" 365 | }, 366 | { 367 | "indexed": false, 368 | "name": "value", 369 | "type": "uint256" 370 | } 371 | ], 372 | "name": "Approval", 373 | "type": "event" 374 | }, 375 | "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { 376 | "anonymous": false, 377 | "inputs": [ 378 | { 379 | "indexed": true, 380 | "name": "from", 381 | "type": "address" 382 | }, 383 | { 384 | "indexed": true, 385 | "name": "to", 386 | "type": "address" 387 | }, 388 | { 389 | "indexed": false, 390 | "name": "value", 391 | "type": "uint256" 392 | } 393 | ], 394 | "name": "Transfer", 395 | "type": "event" 396 | } 397 | }, 398 | "links": {}, 399 | "address": "0x22a903f2faf8093853591e4fe3188c2e46fdeefb", 400 | "updated_at": 1503222063114 401 | }, 402 | "42": { 403 | "links": {}, 404 | "events": { 405 | "0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885": { 406 | "anonymous": false, 407 | "inputs": [ 408 | { 409 | "indexed": true, 410 | "name": "to", 411 | "type": "address" 412 | }, 413 | { 414 | "indexed": false, 415 | "name": "amount", 416 | "type": "uint256" 417 | } 418 | ], 419 | "name": "Mint", 420 | "type": "event" 421 | }, 422 | "0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08": { 423 | "anonymous": false, 424 | "inputs": [], 425 | "name": "MintFinished", 426 | "type": "event" 427 | }, 428 | "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { 429 | "anonymous": false, 430 | "inputs": [ 431 | { 432 | "indexed": true, 433 | "name": "owner", 434 | "type": "address" 435 | }, 436 | { 437 | "indexed": true, 438 | "name": "spender", 439 | "type": "address" 440 | }, 441 | { 442 | "indexed": false, 443 | "name": "value", 444 | "type": "uint256" 445 | } 446 | ], 447 | "name": "Approval", 448 | "type": "event" 449 | }, 450 | "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { 451 | "anonymous": false, 452 | "inputs": [ 453 | { 454 | "indexed": true, 455 | "name": "from", 456 | "type": "address" 457 | }, 458 | { 459 | "indexed": true, 460 | "name": "to", 461 | "type": "address" 462 | }, 463 | { 464 | "indexed": false, 465 | "name": "value", 466 | "type": "uint256" 467 | } 468 | ], 469 | "name": "Transfer", 470 | "type": "event" 471 | } 472 | }, 473 | "updated_at": 1503219512870 474 | } 475 | }, 476 | "schema_version": "0.0.5", 477 | "updated_at": 1503222063114 478 | } -------------------------------------------------------------------------------- /build/contracts/IouRootsToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "IouRootsToken", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "mintingFinished", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "bool" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [], 20 | "name": "name", 21 | "outputs": [ 22 | { 23 | "name": "", 24 | "type": "string" 25 | } 26 | ], 27 | "payable": false, 28 | "type": "function" 29 | }, 30 | { 31 | "constant": false, 32 | "inputs": [ 33 | { 34 | "name": "_spender", 35 | "type": "address" 36 | }, 37 | { 38 | "name": "_value", 39 | "type": "uint256" 40 | } 41 | ], 42 | "name": "approve", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "bool" 47 | } 48 | ], 49 | "payable": false, 50 | "type": "function" 51 | }, 52 | { 53 | "constant": true, 54 | "inputs": [], 55 | "name": "totalSupply", 56 | "outputs": [ 57 | { 58 | "name": "", 59 | "type": "uint256" 60 | } 61 | ], 62 | "payable": false, 63 | "type": "function" 64 | }, 65 | { 66 | "constant": false, 67 | "inputs": [ 68 | { 69 | "name": "_from", 70 | "type": "address" 71 | }, 72 | { 73 | "name": "_to", 74 | "type": "address" 75 | }, 76 | { 77 | "name": "_value", 78 | "type": "uint256" 79 | } 80 | ], 81 | "name": "transferFrom", 82 | "outputs": [ 83 | { 84 | "name": "", 85 | "type": "bool" 86 | } 87 | ], 88 | "payable": false, 89 | "type": "function" 90 | }, 91 | { 92 | "constant": true, 93 | "inputs": [], 94 | "name": "rate", 95 | "outputs": [ 96 | { 97 | "name": "", 98 | "type": "uint256" 99 | } 100 | ], 101 | "payable": false, 102 | "type": "function" 103 | }, 104 | { 105 | "constant": true, 106 | "inputs": [], 107 | "name": "decimals", 108 | "outputs": [ 109 | { 110 | "name": "", 111 | "type": "uint8" 112 | } 113 | ], 114 | "payable": false, 115 | "type": "function" 116 | }, 117 | { 118 | "constant": false, 119 | "inputs": [ 120 | { 121 | "name": "_to", 122 | "type": "address" 123 | }, 124 | { 125 | "name": "_amount", 126 | "type": "uint256" 127 | } 128 | ], 129 | "name": "mint", 130 | "outputs": [ 131 | { 132 | "name": "", 133 | "type": "bool" 134 | } 135 | ], 136 | "payable": false, 137 | "type": "function" 138 | }, 139 | { 140 | "constant": true, 141 | "inputs": [], 142 | "name": "wallet", 143 | "outputs": [ 144 | { 145 | "name": "", 146 | "type": "address" 147 | } 148 | ], 149 | "payable": false, 150 | "type": "function" 151 | }, 152 | { 153 | "constant": true, 154 | "inputs": [ 155 | { 156 | "name": "_owner", 157 | "type": "address" 158 | } 159 | ], 160 | "name": "balanceOf", 161 | "outputs": [ 162 | { 163 | "name": "balance", 164 | "type": "uint256" 165 | } 166 | ], 167 | "payable": false, 168 | "type": "function" 169 | }, 170 | { 171 | "constant": false, 172 | "inputs": [], 173 | "name": "finishMinting", 174 | "outputs": [ 175 | { 176 | "name": "", 177 | "type": "bool" 178 | } 179 | ], 180 | "payable": false, 181 | "type": "function" 182 | }, 183 | { 184 | "constant": true, 185 | "inputs": [], 186 | "name": "owner", 187 | "outputs": [ 188 | { 189 | "name": "", 190 | "type": "address" 191 | } 192 | ], 193 | "payable": false, 194 | "type": "function" 195 | }, 196 | { 197 | "constant": true, 198 | "inputs": [], 199 | "name": "symbol", 200 | "outputs": [ 201 | { 202 | "name": "", 203 | "type": "string" 204 | } 205 | ], 206 | "payable": false, 207 | "type": "function" 208 | }, 209 | { 210 | "constant": false, 211 | "inputs": [ 212 | { 213 | "name": "_to", 214 | "type": "address" 215 | }, 216 | { 217 | "name": "_value", 218 | "type": "uint256" 219 | } 220 | ], 221 | "name": "transfer", 222 | "outputs": [ 223 | { 224 | "name": "", 225 | "type": "bool" 226 | } 227 | ], 228 | "payable": false, 229 | "type": "function" 230 | }, 231 | { 232 | "constant": true, 233 | "inputs": [ 234 | { 235 | "name": "_owner", 236 | "type": "address" 237 | }, 238 | { 239 | "name": "_spender", 240 | "type": "address" 241 | } 242 | ], 243 | "name": "allowance", 244 | "outputs": [ 245 | { 246 | "name": "remaining", 247 | "type": "uint256" 248 | } 249 | ], 250 | "payable": false, 251 | "type": "function" 252 | }, 253 | { 254 | "constant": false, 255 | "inputs": [ 256 | { 257 | "name": "beneficiary", 258 | "type": "address" 259 | } 260 | ], 261 | "name": "buyTokens", 262 | "outputs": [], 263 | "payable": true, 264 | "type": "function" 265 | }, 266 | { 267 | "constant": false, 268 | "inputs": [ 269 | { 270 | "name": "newOwner", 271 | "type": "address" 272 | } 273 | ], 274 | "name": "transferOwnership", 275 | "outputs": [], 276 | "payable": false, 277 | "type": "function" 278 | }, 279 | { 280 | "inputs": [ 281 | { 282 | "name": "_rate", 283 | "type": "uint256" 284 | }, 285 | { 286 | "name": "_wallet", 287 | "type": "address" 288 | }, 289 | { 290 | "name": "_name", 291 | "type": "string" 292 | }, 293 | { 294 | "name": "_symbol", 295 | "type": "string" 296 | }, 297 | { 298 | "name": "_decimals", 299 | "type": "uint8" 300 | } 301 | ], 302 | "payable": false, 303 | "type": "constructor" 304 | }, 305 | { 306 | "payable": true, 307 | "type": "fallback" 308 | }, 309 | { 310 | "anonymous": false, 311 | "inputs": [ 312 | { 313 | "indexed": true, 314 | "name": "purchaser", 315 | "type": "address" 316 | }, 317 | { 318 | "indexed": true, 319 | "name": "beneficiary", 320 | "type": "address" 321 | }, 322 | { 323 | "indexed": false, 324 | "name": "value", 325 | "type": "uint256" 326 | }, 327 | { 328 | "indexed": false, 329 | "name": "amount", 330 | "type": "uint256" 331 | } 332 | ], 333 | "name": "TokenPurchase", 334 | "type": "event" 335 | }, 336 | { 337 | "anonymous": false, 338 | "inputs": [ 339 | { 340 | "indexed": true, 341 | "name": "to", 342 | "type": "address" 343 | }, 344 | { 345 | "indexed": false, 346 | "name": "amount", 347 | "type": "uint256" 348 | } 349 | ], 350 | "name": "Mint", 351 | "type": "event" 352 | }, 353 | { 354 | "anonymous": false, 355 | "inputs": [], 356 | "name": "MintFinished", 357 | "type": "event" 358 | }, 359 | { 360 | "anonymous": false, 361 | "inputs": [ 362 | { 363 | "indexed": true, 364 | "name": "owner", 365 | "type": "address" 366 | }, 367 | { 368 | "indexed": true, 369 | "name": "spender", 370 | "type": "address" 371 | }, 372 | { 373 | "indexed": false, 374 | "name": "value", 375 | "type": "uint256" 376 | } 377 | ], 378 | "name": "Approval", 379 | "type": "event" 380 | }, 381 | { 382 | "anonymous": false, 383 | "inputs": [ 384 | { 385 | "indexed": true, 386 | "name": "from", 387 | "type": "address" 388 | }, 389 | { 390 | "indexed": true, 391 | "name": "to", 392 | "type": "address" 393 | }, 394 | { 395 | "indexed": false, 396 | "name": "value", 397 | "type": "uint256" 398 | } 399 | ], 400 | "name": "Transfer", 401 | "type": "event" 402 | } 403 | ], 404 | "unlinked_binary": "0x60606040526003805460a060020a60ff0219169055341561001f57600080fd5b604051610e63380380610e638339810160405280805191906020018051919060200180518201919060200180518201919060200180519150505b5b60038054600160a060020a03191633600160a060020a03161790555b6000851161008357600080fd5b600160a060020a038416151561009857600080fd5b60078590556006805461010060a860020a031916610100600160a060020a0387160217905560048380516100d09291602001906100ff565b5060058280516100e49291602001906100ff565b506006805460ff191660ff83161790555b505050505061019f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061014057805160ff191683800117855561016d565b8280016001018555821561016d579182015b8281111561016d578251825591602001919060010190610152565b5b5061017a92915061017e565b5090565b61019c91905b8082111561017a5760008155600101610184565b5090565b90565b610cb5806101ae6000396000f300606060405236156100ee5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100fb57806306fdde0314610122578063095ea7b3146101ad57806318160ddd146101e357806323b872dd146102085780632c4e722e14610244578063313ce5671461026957806340c10f1914610292578063521eb273146102c857806370a08231146102f75780637d64bcb4146103285780638da5cb5b1461034f57806395d89b411461037e578063a9059cbb14610409578063dd62ed3e1461043f578063ec8ac4d814610476578063f2fde38b1461048c575b5b6100f8336104ad565b5b005b341561010657600080fd5b61010e610552565b604051901515815260200160405180910390f35b341561012d57600080fd5b610135610573565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101725780820151818401525b602001610159565b50505050905090810190601f16801561019f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b857600080fd5b61010e600160a060020a0360043516602435610611565b604051901515815260200160405180910390f35b34156101ee57600080fd5b6101f66106b8565b60405190815260200160405180910390f35b341561021357600080fd5b61010e600160a060020a03600435811690602435166044356106be565b604051901515815260200160405180910390f35b341561024f57600080fd5b6101f66106f2565b60405190815260200160405180910390f35b341561027457600080fd5b61027c6106f8565b60405160ff909116815260200160405180910390f35b341561029d57600080fd5b61010e600160a060020a0360043516602435610701565b604051901515815260200160405180910390f35b34156102d357600080fd5b6102db610733565b604051600160a060020a03909116815260200160405180910390f35b341561030257600080fd5b6101f6600160a060020a0360043516610747565b60405190815260200160405180910390f35b341561033357600080fd5b61010e610766565b604051901515815260200160405180910390f35b341561035a57600080fd5b6102db6107ed565b604051600160a060020a03909116815260200160405180910390f35b341561038957600080fd5b6101356107fc565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101725780820151818401525b602001610159565b50505050905090810190601f16801561019f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561041457600080fd5b61010e600160a060020a036004351660243561089a565b604051901515815260200160405180910390f35b341561044a57600080fd5b6101f6600160a060020a03600435811690602435166108cc565b60405190815260200160405180910390f35b6100f8600160a060020a03600435166104ad565b005b341561049757600080fd5b6100f8600160a060020a03600435166108f9565b005b600080600160a060020a03831615156104c557600080fd5b600034116104d257600080fd5b6007543492506104e990839063ffffffff61095116565b90506104f58382610980565b5082600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18848460405191825260208201526040908101905180910390a361054c610a46565b5b505050565b60035474010000000000000000000000000000000000000000900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106095780601f106105de57610100808354040283529160200191610609565b820191906000526020600020905b8154815290600101906020018083116105ec57829003601f168201915b505050505081565b60008115806106435750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561064e57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b60035460009033600160a060020a039081169116146106dc57600080fd5b6106e7848484610a83565b90505b5b9392505050565b60075481565b60065460ff1681565b60035460009033600160a060020a0390811691161461071f57600080fd5b6107298383610980565b90505b5b92915050565b6006546101009004600160a060020a031681565b600160a060020a0381166000908152600160205260409020545b919050565b60035460009033600160a060020a0390811691161461078457600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a15060015b5b90565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106095780601f106105de57610100808354040283529160200191610609565b820191906000526020600020905b8154815290600101906020018083116105ec57829003601f168201915b505050505081565b60035460009033600160a060020a039081169116146108b857600080fd5b6107298383610b98565b90505b5b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a0390811691161461091457600080fd5b600160a060020a0381161561094c576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b600082820283158061096d575082848281151561096a57fe5b04145b151561097557fe5b8091505b5092915050565b60035460009074010000000000000000000000000000000000000000900460ff16156109ab57600080fd5b6000546109be908363ffffffff610c5816565b6000908155600160a060020a0384168152600160205260409020546109e9908363ffffffff610c5816565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a25060015b5b92915050565b600654600160a060020a03610100909104163480156108fc0290604051600060405180830381858888f193505050501515610a8057600080fd5b5b565b600160a060020a038084166000908152600260209081526040808320338516845282528083205493861683526001909152812054909190610aca908463ffffffff610c5816565b600160a060020a038086166000908152600160205260408082209390935590871681522054610aff908463ffffffff610c7216565b600160a060020a038616600090815260016020526040902055610b28818463ffffffff610c7216565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b600160a060020a033316600090815260016020526040812054610bc1908363ffffffff610c7216565b600160a060020a033381166000908152600160205260408082209390935590851681522054610bf6908363ffffffff610c5816565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b60008282018381101561097557fe5b8091505b5092915050565b600082821115610c7e57fe5b508082035b929150505600a165627a7a7230582041ea078ea7fe617e3f633259017b1e87ffe2d3ab366028b93b6fc2136e9129300029", 405 | "networks": { 406 | "1": { 407 | "events": {}, 408 | "links": {}, 409 | "address": "0x694d95c4d3B8B4BAfB72a8B8095058B865D9a320", 410 | "updated_at": 1501080322537 411 | }, 412 | "42": { 413 | "events": { 414 | "0x623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18": { 415 | "anonymous": false, 416 | "inputs": [ 417 | { 418 | "indexed": true, 419 | "name": "purchaser", 420 | "type": "address" 421 | }, 422 | { 423 | "indexed": true, 424 | "name": "beneficiary", 425 | "type": "address" 426 | }, 427 | { 428 | "indexed": false, 429 | "name": "value", 430 | "type": "uint256" 431 | }, 432 | { 433 | "indexed": false, 434 | "name": "amount", 435 | "type": "uint256" 436 | } 437 | ], 438 | "name": "TokenPurchase", 439 | "type": "event" 440 | }, 441 | "0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885": { 442 | "anonymous": false, 443 | "inputs": [ 444 | { 445 | "indexed": true, 446 | "name": "to", 447 | "type": "address" 448 | }, 449 | { 450 | "indexed": false, 451 | "name": "amount", 452 | "type": "uint256" 453 | } 454 | ], 455 | "name": "Mint", 456 | "type": "event" 457 | }, 458 | "0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08": { 459 | "anonymous": false, 460 | "inputs": [], 461 | "name": "MintFinished", 462 | "type": "event" 463 | }, 464 | "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { 465 | "anonymous": false, 466 | "inputs": [ 467 | { 468 | "indexed": true, 469 | "name": "owner", 470 | "type": "address" 471 | }, 472 | { 473 | "indexed": true, 474 | "name": "spender", 475 | "type": "address" 476 | }, 477 | { 478 | "indexed": false, 479 | "name": "value", 480 | "type": "uint256" 481 | } 482 | ], 483 | "name": "Approval", 484 | "type": "event" 485 | }, 486 | "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { 487 | "anonymous": false, 488 | "inputs": [ 489 | { 490 | "indexed": true, 491 | "name": "from", 492 | "type": "address" 493 | }, 494 | { 495 | "indexed": true, 496 | "name": "to", 497 | "type": "address" 498 | }, 499 | { 500 | "indexed": false, 501 | "name": "value", 502 | "type": "uint256" 503 | } 504 | ], 505 | "name": "Transfer", 506 | "type": "event" 507 | } 508 | }, 509 | "links": {}, 510 | "address": "0x7d7404115b0e33006b65b4d86bc7a8f9a80c6108", 511 | "updated_at": 1503219492827 512 | }, 513 | "1503221243841": { 514 | "events": { 515 | "0x623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18": { 516 | "anonymous": false, 517 | "inputs": [ 518 | { 519 | "indexed": true, 520 | "name": "purchaser", 521 | "type": "address" 522 | }, 523 | { 524 | "indexed": true, 525 | "name": "beneficiary", 526 | "type": "address" 527 | }, 528 | { 529 | "indexed": false, 530 | "name": "value", 531 | "type": "uint256" 532 | }, 533 | { 534 | "indexed": false, 535 | "name": "amount", 536 | "type": "uint256" 537 | } 538 | ], 539 | "name": "TokenPurchase", 540 | "type": "event" 541 | }, 542 | "0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885": { 543 | "anonymous": false, 544 | "inputs": [ 545 | { 546 | "indexed": true, 547 | "name": "to", 548 | "type": "address" 549 | }, 550 | { 551 | "indexed": false, 552 | "name": "amount", 553 | "type": "uint256" 554 | } 555 | ], 556 | "name": "Mint", 557 | "type": "event" 558 | }, 559 | "0xae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa08": { 560 | "anonymous": false, 561 | "inputs": [], 562 | "name": "MintFinished", 563 | "type": "event" 564 | }, 565 | "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { 566 | "anonymous": false, 567 | "inputs": [ 568 | { 569 | "indexed": true, 570 | "name": "owner", 571 | "type": "address" 572 | }, 573 | { 574 | "indexed": true, 575 | "name": "spender", 576 | "type": "address" 577 | }, 578 | { 579 | "indexed": false, 580 | "name": "value", 581 | "type": "uint256" 582 | } 583 | ], 584 | "name": "Approval", 585 | "type": "event" 586 | }, 587 | "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { 588 | "anonymous": false, 589 | "inputs": [ 590 | { 591 | "indexed": true, 592 | "name": "from", 593 | "type": "address" 594 | }, 595 | { 596 | "indexed": true, 597 | "name": "to", 598 | "type": "address" 599 | }, 600 | { 601 | "indexed": false, 602 | "name": "value", 603 | "type": "uint256" 604 | } 605 | ], 606 | "name": "Transfer", 607 | "type": "event" 608 | } 609 | }, 610 | "links": {}, 611 | "address": "0x365a74df6a6c9d867a20e86744dc9e30e1aebfdd", 612 | "updated_at": 1503221278765 613 | } 614 | }, 615 | "schema_version": "0.0.5", 616 | "updated_at": 1503225330316 617 | } -------------------------------------------------------------------------------- /build/contracts/Migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "Migrations", 3 | "abi": [ 4 | { 5 | "constant": false, 6 | "inputs": [ 7 | { 8 | "name": "newAddress", 9 | "type": "address" 10 | } 11 | ], 12 | "name": "upgrade", 13 | "outputs": [], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [], 20 | "name": "last_completed_migration", 21 | "outputs": [ 22 | { 23 | "name": "", 24 | "type": "uint256" 25 | } 26 | ], 27 | "payable": false, 28 | "type": "function" 29 | }, 30 | { 31 | "constant": true, 32 | "inputs": [], 33 | "name": "owner", 34 | "outputs": [ 35 | { 36 | "name": "", 37 | "type": "address" 38 | } 39 | ], 40 | "payable": false, 41 | "type": "function" 42 | }, 43 | { 44 | "constant": false, 45 | "inputs": [ 46 | { 47 | "name": "completed", 48 | "type": "uint256" 49 | } 50 | ], 51 | "name": "setCompleted", 52 | "outputs": [], 53 | "payable": false, 54 | "type": "function" 55 | }, 56 | { 57 | "inputs": [], 58 | "payable": false, 59 | "type": "constructor" 60 | } 61 | ], 62 | "unlinked_binary": "0x6060604052341561000f57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b6101e58061003c6000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630900f010811461005e578063445df0ac1461007f5780638da5cb5b146100a4578063fdacd576146100d3575b600080fd5b341561006957600080fd5b61007d600160a060020a03600435166100eb565b005b341561008a57600080fd5b610092610182565b60405190815260200160405180910390f35b34156100af57600080fd5b6100b7610188565b604051600160a060020a03909116815260200160405180910390f35b34156100de57600080fd5b61007d600435610197565b005b6000805433600160a060020a039081169116141561017c5781905080600160a060020a031663fdacd5766001546040517c010000000000000000000000000000000000000000000000000000000063ffffffff84160281526004810191909152602401600060405180830381600087803b151561016757600080fd5b6102c65a03f1151561017857600080fd5b5050505b5b5b5050565b60015481565b600054600160a060020a031681565b60005433600160a060020a03908116911614156101b45760018190555b5b5b505600a165627a7a72305820e1f5b37a0077521b746285fa710051ec4c6f15ce43191c7b28c6a795691849a10029", 63 | "networks": { 64 | "1": { 65 | "events": {}, 66 | "links": {}, 67 | "address": "0x9b825e59a6b258102943fdffbf17666ca4c855a0", 68 | "updated_at": 1503222063127 69 | }, 70 | "42": { 71 | "events": {}, 72 | "links": {}, 73 | "address": "0x44002ba93be9bbdf84553bd30a1caf28ae1ff7a0", 74 | "updated_at": 1503219512874 75 | }, 76 | "1503221243841": { 77 | "events": {}, 78 | "links": {}, 79 | "address": "0xd76a200948a5aeb3f499929a12b9d72d4e48ba9b", 80 | "updated_at": 1503221280536 81 | } 82 | }, 83 | "schema_version": "0.0.5", 84 | "updated_at": 1503222063127 85 | } -------------------------------------------------------------------------------- /build/contracts/MintableToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "MintableToken", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "mintingFinished", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "bool" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": false, 19 | "inputs": [ 20 | { 21 | "name": "_spender", 22 | "type": "address" 23 | }, 24 | { 25 | "name": "_value", 26 | "type": "uint256" 27 | } 28 | ], 29 | "name": "approve", 30 | "outputs": [ 31 | { 32 | "name": "", 33 | "type": "bool" 34 | } 35 | ], 36 | "payable": false, 37 | "type": "function" 38 | }, 39 | { 40 | "constant": true, 41 | "inputs": [], 42 | "name": "totalSupply", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "uint256" 47 | } 48 | ], 49 | "payable": false, 50 | "type": "function" 51 | }, 52 | { 53 | "constant": false, 54 | "inputs": [ 55 | { 56 | "name": "_from", 57 | "type": "address" 58 | }, 59 | { 60 | "name": "_to", 61 | "type": "address" 62 | }, 63 | { 64 | "name": "_value", 65 | "type": "uint256" 66 | } 67 | ], 68 | "name": "transferFrom", 69 | "outputs": [ 70 | { 71 | "name": "", 72 | "type": "bool" 73 | } 74 | ], 75 | "payable": false, 76 | "type": "function" 77 | }, 78 | { 79 | "constant": false, 80 | "inputs": [ 81 | { 82 | "name": "_to", 83 | "type": "address" 84 | }, 85 | { 86 | "name": "_amount", 87 | "type": "uint256" 88 | } 89 | ], 90 | "name": "mint", 91 | "outputs": [ 92 | { 93 | "name": "", 94 | "type": "bool" 95 | } 96 | ], 97 | "payable": false, 98 | "type": "function" 99 | }, 100 | { 101 | "constant": true, 102 | "inputs": [ 103 | { 104 | "name": "_owner", 105 | "type": "address" 106 | } 107 | ], 108 | "name": "balanceOf", 109 | "outputs": [ 110 | { 111 | "name": "balance", 112 | "type": "uint256" 113 | } 114 | ], 115 | "payable": false, 116 | "type": "function" 117 | }, 118 | { 119 | "constant": false, 120 | "inputs": [], 121 | "name": "finishMinting", 122 | "outputs": [ 123 | { 124 | "name": "", 125 | "type": "bool" 126 | } 127 | ], 128 | "payable": false, 129 | "type": "function" 130 | }, 131 | { 132 | "constant": true, 133 | "inputs": [], 134 | "name": "owner", 135 | "outputs": [ 136 | { 137 | "name": "", 138 | "type": "address" 139 | } 140 | ], 141 | "payable": false, 142 | "type": "function" 143 | }, 144 | { 145 | "constant": false, 146 | "inputs": [ 147 | { 148 | "name": "_to", 149 | "type": "address" 150 | }, 151 | { 152 | "name": "_value", 153 | "type": "uint256" 154 | } 155 | ], 156 | "name": "transfer", 157 | "outputs": [ 158 | { 159 | "name": "", 160 | "type": "bool" 161 | } 162 | ], 163 | "payable": false, 164 | "type": "function" 165 | }, 166 | { 167 | "constant": true, 168 | "inputs": [ 169 | { 170 | "name": "_owner", 171 | "type": "address" 172 | }, 173 | { 174 | "name": "_spender", 175 | "type": "address" 176 | } 177 | ], 178 | "name": "allowance", 179 | "outputs": [ 180 | { 181 | "name": "remaining", 182 | "type": "uint256" 183 | } 184 | ], 185 | "payable": false, 186 | "type": "function" 187 | }, 188 | { 189 | "constant": false, 190 | "inputs": [ 191 | { 192 | "name": "newOwner", 193 | "type": "address" 194 | } 195 | ], 196 | "name": "transferOwnership", 197 | "outputs": [], 198 | "payable": false, 199 | "type": "function" 200 | }, 201 | { 202 | "anonymous": false, 203 | "inputs": [ 204 | { 205 | "indexed": true, 206 | "name": "to", 207 | "type": "address" 208 | }, 209 | { 210 | "indexed": false, 211 | "name": "amount", 212 | "type": "uint256" 213 | } 214 | ], 215 | "name": "Mint", 216 | "type": "event" 217 | }, 218 | { 219 | "anonymous": false, 220 | "inputs": [], 221 | "name": "MintFinished", 222 | "type": "event" 223 | }, 224 | { 225 | "anonymous": false, 226 | "inputs": [ 227 | { 228 | "indexed": true, 229 | "name": "owner", 230 | "type": "address" 231 | }, 232 | { 233 | "indexed": true, 234 | "name": "spender", 235 | "type": "address" 236 | }, 237 | { 238 | "indexed": false, 239 | "name": "value", 240 | "type": "uint256" 241 | } 242 | ], 243 | "name": "Approval", 244 | "type": "event" 245 | }, 246 | { 247 | "anonymous": false, 248 | "inputs": [ 249 | { 250 | "indexed": true, 251 | "name": "from", 252 | "type": "address" 253 | }, 254 | { 255 | "indexed": true, 256 | "name": "to", 257 | "type": "address" 258 | }, 259 | { 260 | "indexed": false, 261 | "name": "value", 262 | "type": "uint256" 263 | } 264 | ], 265 | "name": "Transfer", 266 | "type": "event" 267 | } 268 | ], 269 | "unlinked_binary": "0x60606040526003805460a060020a60ff02191690555b60038054600160a060020a03191633600160a060020a03161790555b5b6107ec806100416000396000f300606060405236156100ac5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100b1578063095ea7b3146100d857806318160ddd1461010e57806323b872dd1461013357806340c10f191461016f57806370a08231146101a55780637d64bcb4146101d65780638da5cb5b146101fd578063a9059cbb1461022c578063dd62ed3e14610262578063f2fde38b14610299575b600080fd5b34156100bc57600080fd5b6100c46102ba565b604051901515815260200160405180910390f35b34156100e357600080fd5b6100c4600160a060020a03600435166024356102db565b604051901515815260200160405180910390f35b341561011957600080fd5b610121610382565b60405190815260200160405180910390f35b341561013e57600080fd5b6100c4600160a060020a0360043581169060243516604435610388565b604051901515815260200160405180910390f35b341561017a57600080fd5b6100c4600160a060020a036004351660243561049d565b604051901515815260200160405180910390f35b34156101b057600080fd5b610121600160a060020a03600435166104cf565b60405190815260200160405180910390f35b34156101e157600080fd5b6100c46104ee565b604051901515815260200160405180910390f35b341561020857600080fd5b610210610575565b604051600160a060020a03909116815260200160405180910390f35b341561023757600080fd5b6100c4600160a060020a0360043516602435610584565b604051901515815260200160405180910390f35b341561026d57600080fd5b610121600160a060020a0360043581169060243516610644565b60405190815260200160405180910390f35b34156102a457600080fd5b6102b8600160a060020a0360043516610671565b005b60035474010000000000000000000000000000000000000000900460ff1681565b600081158061030d5750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561031857600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b600160a060020a0380841660009081526002602090815260408083203385168452825280832054938616835260019091528120549091906103cf908463ffffffff6106c916565b600160a060020a038086166000908152600160205260408082209390935590871681522054610404908463ffffffff6106e316565b600160a060020a03861660009081526001602052604090205561042d818463ffffffff6106e316565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b60035460009033600160a060020a039081169116146104bb57600080fd5b6104c583836106fa565b90505b5b92915050565b600160a060020a0381166000908152600160205260409020545b919050565b60035460009033600160a060020a0390811691161461050c57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a15060015b5b90565b600354600160a060020a031681565b600160a060020a0333166000908152600160205260408120546105ad908363ffffffff6106e316565b600160a060020a0333811660009081526001602052604080822093909355908516815220546105e2908363ffffffff6106c916565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60035433600160a060020a0390811691161461068c57600080fd5b600160a060020a038116156106c4576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b6000828201838110156106d857fe5b8091505b5092915050565b6000828211156106ef57fe5b508082035b92915050565b60035460009074010000000000000000000000000000000000000000900460ff161561072557600080fd5b600054610738908363ffffffff6106c916565b6000908155600160a060020a038416815260016020526040902054610763908363ffffffff6106c916565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a25060015b5b929150505600a165627a7a723058200dbf001a3a2d6d0e285f4f72a4dcb6ea96c441f5274ab7d3be5173e031f7c1d80029", 270 | "networks": {}, 271 | "schema_version": "0.0.5", 272 | "updated_at": 1503225330316 273 | } -------------------------------------------------------------------------------- /build/contracts/Ownable.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "Ownable", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "owner", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "address" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": false, 19 | "inputs": [ 20 | { 21 | "name": "newOwner", 22 | "type": "address" 23 | } 24 | ], 25 | "name": "transferOwnership", 26 | "outputs": [], 27 | "payable": false, 28 | "type": "function" 29 | }, 30 | { 31 | "inputs": [], 32 | "payable": false, 33 | "type": "constructor" 34 | } 35 | ], 36 | "unlinked_binary": "0x6060604052341561000f57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b6101218061003c6000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416638da5cb5b81146046578063f2fde38b146072575b600080fd5b3415605057600080fd5b60566090565b604051600160a060020a03909116815260200160405180910390f35b3415607c57600080fd5b608e600160a060020a0360043516609f565b005b600054600160a060020a031681565b60005433600160a060020a0390811691161460b957600080fd5b600160a060020a0381161560f0576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b505600a165627a7a7230582070e493b3c56283f84da938b7a23054aa33118d0f07f824fedad9535e1f45ac2b0029", 37 | "networks": {}, 38 | "schema_version": "0.0.5", 39 | "updated_at": 1503225330317 40 | } -------------------------------------------------------------------------------- /build/contracts/Pausable.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "Pausable", 3 | "abi": [ 4 | { 5 | "constant": false, 6 | "inputs": [], 7 | "name": "unpause", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "bool" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [], 20 | "name": "paused", 21 | "outputs": [ 22 | { 23 | "name": "", 24 | "type": "bool" 25 | } 26 | ], 27 | "payable": false, 28 | "type": "function" 29 | }, 30 | { 31 | "constant": false, 32 | "inputs": [], 33 | "name": "pause", 34 | "outputs": [ 35 | { 36 | "name": "", 37 | "type": "bool" 38 | } 39 | ], 40 | "payable": false, 41 | "type": "function" 42 | }, 43 | { 44 | "constant": true, 45 | "inputs": [], 46 | "name": "owner", 47 | "outputs": [ 48 | { 49 | "name": "", 50 | "type": "address" 51 | } 52 | ], 53 | "payable": false, 54 | "type": "function" 55 | }, 56 | { 57 | "constant": false, 58 | "inputs": [ 59 | { 60 | "name": "newOwner", 61 | "type": "address" 62 | } 63 | ], 64 | "name": "transferOwnership", 65 | "outputs": [], 66 | "payable": false, 67 | "type": "function" 68 | }, 69 | { 70 | "anonymous": false, 71 | "inputs": [], 72 | "name": "Pause", 73 | "type": "event" 74 | }, 75 | { 76 | "anonymous": false, 77 | "inputs": [], 78 | "name": "Unpause", 79 | "type": "event" 80 | } 81 | ], 82 | "unlinked_binary": "0x60606040526000805460a060020a60ff02191690555b60008054600160a060020a03191633600160a060020a03161790555b5b6102e4806100416000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633f4ba83a81146100695780635c975abb146100905780638456cb59146100b75780638da5cb5b146100de578063f2fde38b1461010d575b600080fd5b341561007457600080fd5b61007c61012e565b604051901515815260200160405180910390f35b341561009b57600080fd5b61007c6101b5565b604051901515815260200160405180910390f35b34156100c257600080fd5b61007c6101c5565b604051901515815260200160405180910390f35b34156100e957600080fd5b6100f1610251565b604051600160a060020a03909116815260200160405180910390f35b341561011857600080fd5b61012c600160a060020a0360043516610260565b005b6000805433600160a060020a0390811691161461014a57600080fd5b60005460a060020a900460ff16151561016257600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15060015b5b5b90565b60005460a060020a900460ff1681565b6000805433600160a060020a039081169116146101e157600080fd5b60005460a060020a900460ff16156101f857600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a15060015b5b5b90565b600054600160a060020a031681565b60005433600160a060020a0390811691161461027b57600080fd5b600160a060020a038116156102b3576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b505600a165627a7a72305820d582f53c785669089e6a618c2dd9a713eb0d9b9f3de212f410d22a959794ade20029", 83 | "networks": {}, 84 | "schema_version": "0.0.5", 85 | "updated_at": 1503225285612 86 | } -------------------------------------------------------------------------------- /build/contracts/PensionFundRelease.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "PensionFundRelease", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "firtPaymentReleased", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "bool" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [], 20 | "name": "paymentTime", 21 | "outputs": [ 22 | { 23 | "name": "", 24 | "type": "uint256" 25 | } 26 | ], 27 | "payable": false, 28 | "type": "function" 29 | }, 30 | { 31 | "constant": true, 32 | "inputs": [], 33 | "name": "isFundFreezePeriodEnded", 34 | "outputs": [ 35 | { 36 | "name": "ended", 37 | "type": "bool" 38 | } 39 | ], 40 | "payable": false, 41 | "type": "function" 42 | }, 43 | { 44 | "constant": true, 45 | "inputs": [ 46 | { 47 | "name": "", 48 | "type": "uint256" 49 | } 50 | ], 51 | "name": "validators", 52 | "outputs": [ 53 | { 54 | "name": "", 55 | "type": "address" 56 | } 57 | ], 58 | "payable": false, 59 | "type": "function" 60 | }, 61 | { 62 | "constant": true, 63 | "inputs": [], 64 | "name": "roots", 65 | "outputs": [ 66 | { 67 | "name": "", 68 | "type": "address" 69 | } 70 | ], 71 | "payable": false, 72 | "type": "function" 73 | }, 74 | { 75 | "constant": true, 76 | "inputs": [], 77 | "name": "getPaymentAmount", 78 | "outputs": [ 79 | { 80 | "name": "amount", 81 | "type": "uint256" 82 | } 83 | ], 84 | "payable": false, 85 | "type": "function" 86 | }, 87 | { 88 | "constant": true, 89 | "inputs": [], 90 | "name": "worker", 91 | "outputs": [ 92 | { 93 | "name": "", 94 | "type": "address" 95 | } 96 | ], 97 | "payable": false, 98 | "type": "function" 99 | }, 100 | { 101 | "constant": true, 102 | "inputs": [ 103 | { 104 | "name": "", 105 | "type": "address" 106 | } 107 | ], 108 | "name": "voteIndex", 109 | "outputs": [ 110 | { 111 | "name": "", 112 | "type": "uint256" 113 | } 114 | ], 115 | "payable": false, 116 | "type": "function" 117 | }, 118 | { 119 | "constant": true, 120 | "inputs": [ 121 | { 122 | "name": "", 123 | "type": "uint256" 124 | } 125 | ], 126 | "name": "votes", 127 | "outputs": [ 128 | { 129 | "name": "approve", 130 | "type": "bool" 131 | }, 132 | { 133 | "name": "validator", 134 | "type": "address" 135 | }, 136 | { 137 | "name": "justification", 138 | "type": "string" 139 | } 140 | ], 141 | "payable": false, 142 | "type": "function" 143 | }, 144 | { 145 | "constant": true, 146 | "inputs": [], 147 | "name": "recurrentPaymentInterval", 148 | "outputs": [ 149 | { 150 | "name": "", 151 | "type": "uint256" 152 | } 153 | ], 154 | "payable": false, 155 | "type": "function" 156 | }, 157 | { 158 | "constant": false, 159 | "inputs": [], 160 | "name": "releaseRoots", 161 | "outputs": [ 162 | { 163 | "name": "releasedAmount", 164 | "type": "uint256" 165 | } 166 | ], 167 | "payable": false, 168 | "type": "function" 169 | }, 170 | { 171 | "constant": true, 172 | "inputs": [], 173 | "name": "recurrentPaymentPercent", 174 | "outputs": [ 175 | { 176 | "name": "", 177 | "type": "uint8" 178 | } 179 | ], 180 | "payable": false, 181 | "type": "function" 182 | }, 183 | { 184 | "constant": true, 185 | "inputs": [], 186 | "name": "balance", 187 | "outputs": [ 188 | { 189 | "name": "amount", 190 | "type": "uint256" 191 | } 192 | ], 193 | "payable": false, 194 | "type": "function" 195 | }, 196 | { 197 | "constant": true, 198 | "inputs": [], 199 | "name": "isReleaseApproved", 200 | "outputs": [ 201 | { 202 | "name": "approved", 203 | "type": "bool" 204 | } 205 | ], 206 | "payable": false, 207 | "type": "function" 208 | }, 209 | { 210 | "constant": true, 211 | "inputs": [], 212 | "name": "initialFunds", 213 | "outputs": [ 214 | { 215 | "name": "", 216 | "type": "uint256" 217 | } 218 | ], 219 | "payable": false, 220 | "type": "function" 221 | }, 222 | { 223 | "constant": true, 224 | "inputs": [], 225 | "name": "isBurnApproved", 226 | "outputs": [ 227 | { 228 | "name": "approved", 229 | "type": "bool" 230 | } 231 | ], 232 | "payable": false, 233 | "type": "function" 234 | }, 235 | { 236 | "constant": false, 237 | "inputs": [ 238 | { 239 | "name": "approve", 240 | "type": "bool" 241 | }, 242 | { 243 | "name": "justification", 244 | "type": "string" 245 | } 246 | ], 247 | "name": "vote", 248 | "outputs": [ 249 | { 250 | "name": "index", 251 | "type": "uint256" 252 | } 253 | ], 254 | "payable": false, 255 | "type": "function" 256 | }, 257 | { 258 | "constant": true, 259 | "inputs": [], 260 | "name": "firstPaymentPercent", 261 | "outputs": [ 262 | { 263 | "name": "", 264 | "type": "uint8" 265 | } 266 | ], 267 | "payable": false, 268 | "type": "function" 269 | }, 270 | { 271 | "inputs": [ 272 | { 273 | "name": "_validators", 274 | "type": "address[]" 275 | }, 276 | { 277 | "name": "_worker", 278 | "type": "address" 279 | }, 280 | { 281 | "name": "_firstPaymentPercent", 282 | "type": "uint8" 283 | }, 284 | { 285 | "name": "_firstPaymentTime", 286 | "type": "uint256" 287 | }, 288 | { 289 | "name": "_recurrentPaymentInterval", 290 | "type": "uint256" 291 | }, 292 | { 293 | "name": "_recurrentPaymentPercent", 294 | "type": "uint8" 295 | }, 296 | { 297 | "name": "_rootsAddress", 298 | "type": "address" 299 | } 300 | ], 301 | "payable": false, 302 | "type": "constructor" 303 | }, 304 | { 305 | "anonymous": false, 306 | "inputs": [ 307 | { 308 | "indexed": false, 309 | "name": "approve", 310 | "type": "bool" 311 | }, 312 | { 313 | "indexed": false, 314 | "name": "validator", 315 | "type": "address" 316 | }, 317 | { 318 | "indexed": false, 319 | "name": "justification", 320 | "type": "string" 321 | } 322 | ], 323 | "name": "Voted", 324 | "type": "event" 325 | }, 326 | { 327 | "anonymous": false, 328 | "inputs": [ 329 | { 330 | "indexed": false, 331 | "name": "amount", 332 | "type": "uint256" 333 | }, 334 | { 335 | "indexed": false, 336 | "name": "worker", 337 | "type": "address" 338 | } 339 | ], 340 | "name": "Released", 341 | "type": "event" 342 | } 343 | ], 344 | "unlinked_binary": "0x60606040526004805460ff1916905534156200001a57600080fd5b6040516200114f3803806200114f8339810160405280805182019190602001805191906020018051919060200180519190602001805191906020018051919060200180519150505b60008751116200007157600080fd5b600160a060020a03861615156200008757600080fd5b606460ff861611156200009957600080fd5b606460ff83161115620000ab57600080fd5b6000878051620000c092916020019062000220565b5060018054600286905560038590556004805461010060a860020a031916610100600160a060020a038681169190910291909117909155600160a060020a03199091169088161760a060020a60ff0219167401000000000000000000000000000000000000000060ff888116919091029190911760a860020a60ff02191675010000000000000000000000000000000000000000009185169190910217815560078054909181016200017383826200028d565b916000526020600020906002020160005b6060604051908101604052806000151581526020016000600160a060020a0316815260200160206040519081016040526000815290529190508151815460ff191690151517815560208201518154600160a060020a03919091166101000261010060a860020a03199091161781556040820151816001019080516200020e929160200190620002c2565b505050505b5050505050505062000426565b8280548282559060005260206000209081019282156200027a579160200282015b828111156200027a5782518254600160a060020a031916600160a060020a03919091161782556020929092019160019091019062000241565b5b506200028992915062000348565b5090565b815481835581811511620002bc57600202816002028360005260206000209182019101620002bc919062000376565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200030557805160ff191683800117855562000335565b8280016001018555821562000335579182015b828111156200033557825182559160200191906001019062000318565b5b5062000289929150620003b6565b5090565b6200037391905b8082111562000289578054600160a060020a03191681556001016200034f565b5090565b90565b6200037391905b8082111562000289578054600160a860020a03191681556000620003a56001830182620003da565b506002016200037d565b5090565b90565b6200037391905b80821115620002895760008155600101620003bd565b5090565b90565b50805460018160011615610100020316600290046000825580601f1062000402575062000422565b601f016020900490600052602060002090810190620004229190620003b6565b5b50565b610d1980620004366000396000f300606060405236156100df5763ffffffff60e060020a6000350416628f2cdf81146100e45780630419677c1461010b578063343214ae1461013057806335aa2e4414610157578063393fe1cd146101895780633e8817aa146101b85780634d547ada146101dd5780635cd7d4e81461020c5780635df813301461023d57806378b4f003146102f45780638c701ba814610319578063968395331461033e578063b69ef8a814610367578063ceffbaf11461038c578063d55e725b146103b3578063e6107cbb146103d8578063efcee869146103ff578063fa82016d14610469575b600080fd5b34156100ef57600080fd5b6100f7610492565b604051901515815260200160405180910390f35b341561011657600080fd5b61011e61049b565b60405190815260200160405180910390f35b341561013b57600080fd5b6100f76104a1565b604051901515815260200160405180910390f35b341561016257600080fd5b61016d6004356104aa565b604051600160a060020a03909116815260200160405180910390f35b341561019457600080fd5b61016d6104dc565b604051600160a060020a03909116815260200160405180910390f35b34156101c357600080fd5b61011e6104f0565b60405190815260200160405180910390f35b34156101e857600080fd5b61016d610564565b604051600160a060020a03909116815260200160405180910390f35b341561021757600080fd5b61011e600160a060020a0360043516610573565b60405190815260200160405180910390f35b341561024857600080fd5b610253600435610585565b6040518315158152600160a060020a0383166020820152606060408201818152835460026000196101006001841615020190911604918301829052906080830190849080156102e35780601f106102b8576101008083540402835291602001916102e3565b820191906000526020600020905b8154815290600101906020018083116102c657829003601f168201915b505094505050505060405180910390f35b34156102ff57600080fd5b61011e6105c2565b60405190815260200160405180910390f35b341561032457600080fd5b61011e6105c8565b60405190815260200160405180910390f35b341561034957600080fd5b61035161072e565b60405160ff909116815260200160405180910390f35b341561037257600080fd5b61011e610750565b60405190815260200160405180910390f35b341561039757600080fd5b6100f76107d0565b604051901515815260200160405180910390f35b34156103be57600080fd5b61011e610826565b60405190815260200160405180910390f35b34156103e357600080fd5b6100f761082c565b604051901515815260200160405180910390f35b341561040a57600080fd5b61011e6004803515159060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061088395505050505050565b60405190815260200160405180910390f35b341561047457600080fd5b610351610b31565b60405160ff909116815260200160405180910390f35b60045460ff1681565b60025481565b60025442115b90565b60008054829081106104b857fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b6004546101009004600160a060020a031681565b60045460009060ff16151561052d5760015460055460649174010000000000000000000000000000000000000000900460ff16025b0490506104a7565b6001546005546064917501000000000000000000000000000000000000000000900460ff1602610525565b0490506104a7565b5b90565b600154600160a060020a031681565b60066020526000908152604090205481565b600780548290811061059357fe5b906000526020600020906002020160005b50805460ff811692506101009004600160a060020a03169060010183565b60035481565b60006105d26107d0565b15156105dd57600080fd5b6105e56104a1565b15156105f057600080fd5b60045460ff16151561062357610604610750565b60055561060f6104f0565b6004805460ff19166001179055905061062e565b61062b6104f0565b90505b610636610750565b81111561064857610645610750565b90505b600354600280549091019055600454600154600160a060020a0361010090920482169163a9059cbb91168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156106bf57600080fd5b6102c65a03f115156106d057600080fd5b505050604051805150506001547f4d436de77f1139fda664b657c73ad6c3bde4a1984d3aabeab7c3998556b93b63908290600160a060020a0316604051918252600160a060020a031660208201526040908101905180910390a15b90565b6001547501000000000000000000000000000000000000000000900460ff1681565b6004546000906101009004600160a060020a03166370a0823130836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156107b057600080fd5b6102c65a03f115156107c157600080fd5b50505060405180519150505b90565b60008060015b6007548110156108195760078054829081106107ee57fe5b906000526020600020906002020160005b505460ff1615610810576001909101905b5b6001016107d6565b600054821492505b505090565b60055481565b60008060015b60075481101561081957600780548290811061084a57fe5b906000526020600020906002020160005b505460ff16151561086d576001909101905b5b600101610832565b600054821492505b505090565b600061088d610b52565b6000805b6000548110156108f05781806108e5575060008054829081106108b057fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031633600160a060020a0316145b91505b600101610891565b8115156108fc57600080fd5b600160a060020a033316600090815260066020526040908190205494506060905190810160409081528715158252600160a060020a0333166020830152810186905292508315156109f05760078054600160a060020a0333166000908152600660205260409020819055945084600181016109778382610b78565b916000526020600020906002020160005b5084908151815460ff191690151517815560208201518154600160a060020a03919091166101000274ffffffffffffffffffffffffffffffffffffffff00199091161781556040820151816001019080516109e7929160200190610baa565b50505050610a72565b82600785815481101515610a0057fe5b906000526020600020906002020160005b508151815460ff191690151517815560208201518154600160a060020a03919091166101000274ffffffffffffffffffffffffffffffffffffffff0019909116178155604082015181600101908051610a6e929160200190610baa565b5050505b7f88ed097124e4226b2db7951d117e2dd075d3a87529cd515bb3008043ce5e7b7c8633876040518315158152600160a060020a038316602082015260606040820181815290820183818151815260200191508051906020019080838360005b83811015610aea5780820151818401525b602001610ad1565b50505050905090810190601f168015610b175780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a15b5b50505092915050565b60015474010000000000000000000000000000000000000000900460ff1681565b60606040519081016040908152600080835260208301528101610b73610c29565b905290565b815481835581811511610ba457600202816002028360005260206000209182019101610ba49190610c3b565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610beb57805160ff1916838001178555610c18565b82800160010185558215610c18579182015b82811115610c18578251825591602001919060010190610bfd565b5b50610c25929150610c84565b5090565b60206040519081016040526000815290565b6104a791905b80821115610c2557805474ffffffffffffffffffffffffffffffffffffffffff191681556000610c746001830182610ca5565b50600201610c41565b5090565b90565b6104a791905b80821115610c255760008155600101610c8a565b5090565b90565b50805460018160011615610100020316600290046000825580601f10610ccb5750610ce9565b601f016020900490600052602060002090810190610ce99190610c84565b5b505600a165627a7a7230582005ade400deb792568e6d5f24e485f44dbd2bb0b6665edc064c25f95457ef236a0029", 345 | "networks": { 346 | }, 347 | "schema_version": "0.0.5", 348 | "updated_at": 1502735999545 349 | } -------------------------------------------------------------------------------- /build/contracts/PricingStrategy.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "PricingStrategy", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "isPricingStrategy", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "bool" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [], 20 | "name": "minimumWeiAmount", 21 | "outputs": [ 22 | { 23 | "name": "", 24 | "type": "uint256" 25 | } 26 | ], 27 | "payable": false, 28 | "type": "function" 29 | }, 30 | { 31 | "constant": true, 32 | "inputs": [], 33 | "name": "newRateTime", 34 | "outputs": [ 35 | { 36 | "name": "", 37 | "type": "uint256" 38 | } 39 | ], 40 | "payable": false, 41 | "type": "function" 42 | }, 43 | { 44 | "constant": true, 45 | "inputs": [ 46 | { 47 | "name": "weiAmount", 48 | "type": "uint256" 49 | } 50 | ], 51 | "name": "calculateTokenAmount", 52 | "outputs": [ 53 | { 54 | "name": "tokenAmount", 55 | "type": "uint256" 56 | } 57 | ], 58 | "payable": false, 59 | "type": "function" 60 | }, 61 | { 62 | "constant": true, 63 | "inputs": [], 64 | "name": "rate1", 65 | "outputs": [ 66 | { 67 | "name": "", 68 | "type": "uint256" 69 | } 70 | ], 71 | "payable": false, 72 | "type": "function" 73 | }, 74 | { 75 | "constant": true, 76 | "inputs": [], 77 | "name": "rate2", 78 | "outputs": [ 79 | { 80 | "name": "", 81 | "type": "uint256" 82 | } 83 | ], 84 | "payable": false, 85 | "type": "function" 86 | }, 87 | { 88 | "inputs": [ 89 | { 90 | "name": "_newRateTime", 91 | "type": "uint256" 92 | }, 93 | { 94 | "name": "_rate1", 95 | "type": "uint256" 96 | }, 97 | { 98 | "name": "_rate2", 99 | "type": "uint256" 100 | }, 101 | { 102 | "name": "_minimumWeiAmount", 103 | "type": "uint256" 104 | } 105 | ], 106 | "payable": false, 107 | "type": "constructor" 108 | } 109 | ], 110 | "unlinked_binary": "0x6060604052341561000f57600080fd5b6040516080806102ae833981016040528080519190602001805191906020018051919060200180519150505b6000841161004857600080fd5b6000831161005557600080fd5b6000821161006257600080fd5b6000811161006f57600080fd5b60008490556001839055600282905560038190555b505050505b610216806100986000396000f300606060405236156100755763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304bbc255811461007a5780632e80e77c146100a15780639899722d146100c6578063a24bcf46146100eb578063cf85496914610113578063f555b81514610138575b600080fd5b341561008557600080fd5b61008d61015d565b604051901515815260200160405180910390f35b34156100ac57600080fd5b6100b4610163565b60405190815260200160405180910390f35b34156100d157600080fd5b6100b4610169565b60405190815260200160405180910390f35b34156100f657600080fd5b6100b460043561016f565b60405190815260200160405180910390f35b341561011e57600080fd5b6100b46101af565b60405190815260200160405180910390f35b341561014357600080fd5b6100b46101b5565b60405190815260200160405180910390f35b60015b90565b60035481565b60005481565b60035460009081908310610195576000544210156101905750600154610195565b506002545b5b6101a6838263ffffffff6101bb16565b91505b50919050565b60015481565b60025481565b60008282028315806101d757508284828115156101d457fe5b04145b15156101df57fe5b8091505b50929150505600a165627a7a723058208b82b2e0637b4cab2200cf6e4455a4b9687257766b3b454ae2c171d0670149270029", 111 | "networks": { 112 | "1": { 113 | "events": {}, 114 | "links": {}, 115 | "address": "0xed9f3f3f22443a8ab92cbff999111b0d9380d640dD", 116 | "updated_at": 1503222063121 117 | }, 118 | "42": { 119 | "links": {}, 120 | "events": {}, 121 | "updated_at": 1503219512870, 122 | "address": "0xc8e0fde0254aff0dc67b0abe4ff02bb1f9f2fde4" 123 | } 124 | }, 125 | "schema_version": "0.0.5", 126 | "updated_at": 1506370865999 127 | } -------------------------------------------------------------------------------- /build/contracts/Reservation.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "Reservation", 3 | "abi": [ 4 | { 5 | "constant": false, 6 | "inputs": [ 7 | { 8 | "name": "receiver", 9 | "type": "address" 10 | } 11 | ], 12 | "name": "invest", 13 | "outputs": [], 14 | "payable": true, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": true, 19 | "inputs": [], 20 | "name": "endsAt", 21 | "outputs": [ 22 | { 23 | "name": "", 24 | "type": "uint256" 25 | } 26 | ], 27 | "payable": false, 28 | "type": "function" 29 | }, 30 | { 31 | "constant": true, 32 | "inputs": [], 33 | "name": "minimumFundingGoal", 34 | "outputs": [ 35 | { 36 | "name": "", 37 | "type": "uint256" 38 | } 39 | ], 40 | "payable": false, 41 | "type": "function" 42 | }, 43 | { 44 | "constant": true, 45 | "inputs": [], 46 | "name": "getState", 47 | "outputs": [ 48 | { 49 | "name": "", 50 | "type": "uint8" 51 | } 52 | ], 53 | "payable": false, 54 | "type": "function" 55 | }, 56 | { 57 | "constant": true, 58 | "inputs": [ 59 | { 60 | "name": "", 61 | "type": "address" 62 | } 63 | ], 64 | "name": "investedAmountOf", 65 | "outputs": [ 66 | { 67 | "name": "", 68 | "type": "uint256" 69 | } 70 | ], 71 | "payable": false, 72 | "type": "function" 73 | }, 74 | { 75 | "constant": false, 76 | "inputs": [], 77 | "name": "unpause", 78 | "outputs": [ 79 | { 80 | "name": "", 81 | "type": "bool" 82 | } 83 | ], 84 | "payable": false, 85 | "type": "function" 86 | }, 87 | { 88 | "constant": true, 89 | "inputs": [], 90 | "name": "weiRaised", 91 | "outputs": [ 92 | { 93 | "name": "", 94 | "type": "uint256" 95 | } 96 | ], 97 | "payable": false, 98 | "type": "function" 99 | }, 100 | { 101 | "constant": false, 102 | "inputs": [ 103 | { 104 | "name": "_pricingStrategy", 105 | "type": "address" 106 | } 107 | ], 108 | "name": "setPricingStrategy", 109 | "outputs": [], 110 | "payable": false, 111 | "type": "function" 112 | }, 113 | { 114 | "constant": true, 115 | "inputs": [], 116 | "name": "tokensSold", 117 | "outputs": [ 118 | { 119 | "name": "", 120 | "type": "uint256" 121 | } 122 | ], 123 | "payable": false, 124 | "type": "function" 125 | }, 126 | { 127 | "constant": false, 128 | "inputs": [], 129 | "name": "refund", 130 | "outputs": [], 131 | "payable": false, 132 | "type": "function" 133 | }, 134 | { 135 | "constant": true, 136 | "inputs": [], 137 | "name": "paused", 138 | "outputs": [ 139 | { 140 | "name": "", 141 | "type": "bool" 142 | } 143 | ], 144 | "payable": false, 145 | "type": "function" 146 | }, 147 | { 148 | "constant": true, 149 | "inputs": [], 150 | "name": "weiRefunded", 151 | "outputs": [ 152 | { 153 | "name": "", 154 | "type": "uint256" 155 | } 156 | ], 157 | "payable": false, 158 | "type": "function" 159 | }, 160 | { 161 | "constant": true, 162 | "inputs": [], 163 | "name": "MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE", 164 | "outputs": [ 165 | { 166 | "name": "", 167 | "type": "uint256" 168 | } 169 | ], 170 | "payable": false, 171 | "type": "function" 172 | }, 173 | { 174 | "constant": false, 175 | "inputs": [ 176 | { 177 | "name": "time", 178 | "type": "uint256" 179 | } 180 | ], 181 | "name": "setEndsAt", 182 | "outputs": [], 183 | "payable": false, 184 | "type": "function" 185 | }, 186 | { 187 | "constant": true, 188 | "inputs": [], 189 | "name": "pricingStrategy", 190 | "outputs": [ 191 | { 192 | "name": "", 193 | "type": "address" 194 | } 195 | ], 196 | "payable": false, 197 | "type": "function" 198 | }, 199 | { 200 | "constant": true, 201 | "inputs": [], 202 | "name": "loadedRefund", 203 | "outputs": [ 204 | { 205 | "name": "", 206 | "type": "uint256" 207 | } 208 | ], 209 | "payable": false, 210 | "type": "function" 211 | }, 212 | { 213 | "constant": true, 214 | "inputs": [], 215 | "name": "isMinimumGoalReached", 216 | "outputs": [ 217 | { 218 | "name": "reached", 219 | "type": "bool" 220 | } 221 | ], 222 | "payable": false, 223 | "type": "function" 224 | }, 225 | { 226 | "constant": false, 227 | "inputs": [], 228 | "name": "pause", 229 | "outputs": [ 230 | { 231 | "name": "", 232 | "type": "bool" 233 | } 234 | ], 235 | "payable": false, 236 | "type": "function" 237 | }, 238 | { 239 | "constant": false, 240 | "inputs": [], 241 | "name": "loadRefund", 242 | "outputs": [], 243 | "payable": true, 244 | "type": "function" 245 | }, 246 | { 247 | "constant": true, 248 | "inputs": [], 249 | "name": "owner", 250 | "outputs": [ 251 | { 252 | "name": "", 253 | "type": "address" 254 | } 255 | ], 256 | "payable": false, 257 | "type": "function" 258 | }, 259 | { 260 | "constant": true, 261 | "inputs": [], 262 | "name": "multisigWallet", 263 | "outputs": [ 264 | { 265 | "name": "", 266 | "type": "address" 267 | } 268 | ], 269 | "payable": false, 270 | "type": "function" 271 | }, 272 | { 273 | "constant": true, 274 | "inputs": [ 275 | { 276 | "name": "", 277 | "type": "address" 278 | } 279 | ], 280 | "name": "tokenAmountOf", 281 | "outputs": [ 282 | { 283 | "name": "", 284 | "type": "uint256" 285 | } 286 | ], 287 | "payable": false, 288 | "type": "function" 289 | }, 290 | { 291 | "constant": true, 292 | "inputs": [], 293 | "name": "isReservationFull", 294 | "outputs": [ 295 | { 296 | "name": "", 297 | "type": "bool" 298 | } 299 | ], 300 | "payable": false, 301 | "type": "function" 302 | }, 303 | { 304 | "constant": true, 305 | "inputs": [], 306 | "name": "startsAt", 307 | "outputs": [ 308 | { 309 | "name": "", 310 | "type": "uint256" 311 | } 312 | ], 313 | "payable": false, 314 | "type": "function" 315 | }, 316 | { 317 | "constant": true, 318 | "inputs": [], 319 | "name": "tokensHardCap", 320 | "outputs": [ 321 | { 322 | "name": "", 323 | "type": "uint256" 324 | } 325 | ], 326 | "payable": false, 327 | "type": "function" 328 | }, 329 | { 330 | "constant": true, 331 | "inputs": [ 332 | { 333 | "name": "", 334 | "type": "address" 335 | } 336 | ], 337 | "name": "earlyParticipantWhitelist", 338 | "outputs": [ 339 | { 340 | "name": "", 341 | "type": "bool" 342 | } 343 | ], 344 | "payable": false, 345 | "type": "function" 346 | }, 347 | { 348 | "constant": true, 349 | "inputs": [], 350 | "name": "investorCount", 351 | "outputs": [ 352 | { 353 | "name": "", 354 | "type": "uint256" 355 | } 356 | ], 357 | "payable": false, 358 | "type": "function" 359 | }, 360 | { 361 | "constant": true, 362 | "inputs": [ 363 | { 364 | "name": "tokensSoldTotal", 365 | "type": "uint256" 366 | } 367 | ], 368 | "name": "isBreakingCap", 369 | "outputs": [ 370 | { 371 | "name": "", 372 | "type": "bool" 373 | } 374 | ], 375 | "payable": false, 376 | "type": "function" 377 | }, 378 | { 379 | "constant": false, 380 | "inputs": [ 381 | { 382 | "name": "addr", 383 | "type": "address" 384 | }, 385 | { 386 | "name": "status", 387 | "type": "bool" 388 | } 389 | ], 390 | "name": "setEarlyParicipantWhitelist", 391 | "outputs": [], 392 | "payable": false, 393 | "type": "function" 394 | }, 395 | { 396 | "constant": false, 397 | "inputs": [ 398 | { 399 | "name": "newOwner", 400 | "type": "address" 401 | } 402 | ], 403 | "name": "transferOwnership", 404 | "outputs": [], 405 | "payable": false, 406 | "type": "function" 407 | }, 408 | { 409 | "constant": false, 410 | "inputs": [ 411 | { 412 | "name": "addr", 413 | "type": "address" 414 | } 415 | ], 416 | "name": "setMultisig", 417 | "outputs": [], 418 | "payable": false, 419 | "type": "function" 420 | }, 421 | { 422 | "constant": true, 423 | "inputs": [], 424 | "name": "token", 425 | "outputs": [ 426 | { 427 | "name": "", 428 | "type": "address" 429 | } 430 | ], 431 | "payable": false, 432 | "type": "function" 433 | }, 434 | { 435 | "inputs": [ 436 | { 437 | "name": "_token", 438 | "type": "address" 439 | }, 440 | { 441 | "name": "_pricingStrategy", 442 | "type": "address" 443 | }, 444 | { 445 | "name": "_multisigWallet", 446 | "type": "address" 447 | }, 448 | { 449 | "name": "_start", 450 | "type": "uint256" 451 | }, 452 | { 453 | "name": "_end", 454 | "type": "uint256" 455 | }, 456 | { 457 | "name": "_tokensHardCap", 458 | "type": "uint256" 459 | }, 460 | { 461 | "name": "_minimumFundingGoal", 462 | "type": "uint256" 463 | } 464 | ], 465 | "payable": false, 466 | "type": "constructor" 467 | }, 468 | { 469 | "payable": true, 470 | "type": "fallback" 471 | }, 472 | { 473 | "anonymous": false, 474 | "inputs": [ 475 | { 476 | "indexed": false, 477 | "name": "investor", 478 | "type": "address" 479 | }, 480 | { 481 | "indexed": false, 482 | "name": "weiAmount", 483 | "type": "uint256" 484 | }, 485 | { 486 | "indexed": false, 487 | "name": "tokenAmount", 488 | "type": "uint256" 489 | } 490 | ], 491 | "name": "Invested", 492 | "type": "event" 493 | }, 494 | { 495 | "anonymous": false, 496 | "inputs": [ 497 | { 498 | "indexed": false, 499 | "name": "investor", 500 | "type": "address" 501 | }, 502 | { 503 | "indexed": false, 504 | "name": "weiAmount", 505 | "type": "uint256" 506 | } 507 | ], 508 | "name": "Refund", 509 | "type": "event" 510 | }, 511 | { 512 | "anonymous": false, 513 | "inputs": [ 514 | { 515 | "indexed": false, 516 | "name": "addr", 517 | "type": "address" 518 | }, 519 | { 520 | "indexed": false, 521 | "name": "status", 522 | "type": "bool" 523 | } 524 | ], 525 | "name": "Whitelisted", 526 | "type": "event" 527 | }, 528 | { 529 | "anonymous": false, 530 | "inputs": [ 531 | { 532 | "indexed": false, 533 | "name": "endsAt", 534 | "type": "uint256" 535 | } 536 | ], 537 | "name": "EndsAtChanged", 538 | "type": "event" 539 | }, 540 | { 541 | "anonymous": false, 542 | "inputs": [], 543 | "name": "Pause", 544 | "type": "event" 545 | }, 546 | { 547 | "anonymous": false, 548 | "inputs": [], 549 | "name": "Unpause", 550 | "type": "event" 551 | } 552 | ], 553 | "unlinked_binary": "0x60606040526000805460a060020a60ff02191681556101f46001556009819055600a819055600b819055600c819055600d5534156200003d57600080fd5b60405160e080620011fd833981016040528080519190602001805191906020018051919060200180519190602001805191906020018051919060200180519150505b5b60008054600160a060020a03191633600160a060020a03161790555b600160a060020a0387161515620000b257600080fd5b600160a060020a0386161515620000c857600080fd5b600160a060020a0385161515620000de57600080fd5b831515620000eb57600080fd5b821515620000f857600080fd5b8284106200010557600080fd5b8115156200011257600080fd5b60028054600160a060020a031916600160a060020a038916179055620001468664010000000062000183810262000a851704565b60048054600160a060020a031916600160a060020a03871617905560068490556007839055600882905560058190555b5050505050505062000244565b60005433600160a060020a039081169116146200019f57600080fd5b60038054600160a060020a031916600160a060020a038381169190911791829055166304bbc2556000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156200021757600080fd5b6102c65a03f115156200022957600080fd5b5050506040518051905015156200023f57600080fd5b5b5b50565b610fa980620002546000396000f3006060604052361561017a5763ffffffff60e060020a60003504166303f9c79381146101875780630a09284a1461019d57806313f4e977146101c25780631865c57d146101e75780631aae34601461021e5780633f4ba83a1461024f5780634042b66f1461027657806350c677341461029b578063518ab2a8146102bc578063590e1ae3146102e15780635c975abb146102f65780635da89ac01461031d5780636203f09f146103425780636e50eb3f1461036757806378b99c241461037f578063797d9437146103ae5780637c2e08a3146103d35780638456cb59146103fa57806387612102146104215780638da5cb5b1461042b5780639075becf1461045a57806397b150ca14610489578063ab6cf42f146104ba578063af468682146104e1578063b5ab05a514610506578063cb16e6d01461052b578063d7e64c001461055e578063df2d33d514610583578063eac24932146105ad578063f2fde38b146105d3578063f3283fba146105f4578063fc0c546a14610615575b5b61018433610644565b5b005b610184600160a060020a0360043516610644565b005b34156101a857600080fd5b6101b0610932565b60405190815260200160405180910390f35b34156101cd57600080fd5b6101b0610938565b60405190815260200160405180910390f35b34156101f257600080fd5b6101fa61093e565b6040518082600681111561020a57fe5b60ff16815260200191505060405180910390f35b341561022957600080fd5b6101b0600160a060020a03600435166109e6565b60405190815260200160405180910390f35b341561025a57600080fd5b6102626109f8565b604051901515815260200160405180910390f35b341561028157600080fd5b6101b0610a7f565b60405190815260200160405180910390f35b34156102a657600080fd5b610184600160a060020a0360043516610a85565b005b34156102c757600080fd5b6101b0610b36565b60405190815260200160405180910390f35b34156102ec57600080fd5b610184610b3c565b005b341561030157600080fd5b610262610c2f565b604051901515815260200160405180910390f35b341561032857600080fd5b6101b0610c3f565b60405190815260200160405180910390f35b341561034d57600080fd5b6101b0610c45565b60405190815260200160405180910390f35b341561037257600080fd5b610184600435610c4b565b005b341561038a57600080fd5b610392610cb1565b604051600160a060020a03909116815260200160405180910390f35b34156103b957600080fd5b6101b0610cc0565b60405190815260200160405180910390f35b34156103de57600080fd5b610262610cc6565b604051901515815260200160405180910390f35b341561040557600080fd5b610262610cd2565b604051901515815260200160405180910390f35b610184610d5e565b005b341561043657600080fd5b610392610da7565b604051600160a060020a03909116815260200160405180910390f35b341561046557600080fd5b610392610db6565b604051600160a060020a03909116815260200160405180910390f35b341561049457600080fd5b6101b0600160a060020a0360043516610dc5565b60405190815260200160405180910390f35b34156104c557600080fd5b610262610dd7565b604051901515815260200160405180910390f35b34156104ec57600080fd5b6101b0610de3565b60405190815260200160405180910390f35b341561051157600080fd5b6101b0610de9565b60405190815260200160405180910390f35b341561053657600080fd5b610262600160a060020a0360043516610def565b604051901515815260200160405180910390f35b341561056957600080fd5b6101b0610e04565b60405190815260200160405180910390f35b341561058e57600080fd5b610262600435610e0a565b604051901515815260200160405180910390f35b34156105b857600080fd5b610184600160a060020a03600435166024351515610e15565b005b34156105de57600080fd5b610184600160a060020a0360043516610ea3565b005b34156105ff57600080fd5b610184600160a060020a0360043516610efb565b005b341561062057600080fd5b610392610f54565b604051600160a060020a03909116815260200160405180910390f35b60008054819060a060020a900460ff161561065e57600080fd5b60025b61066961093e565b600681111561067457fe5b14156106a657600160a060020a03831660009081526010602052604090205460ff1615156106a157600080fd5b6106c6565b60035b6106b161093e565b60068111156106bc57fe5b146106c657600080fd5b5b600354349250600160a060020a031663a24bcf468360006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561071b57600080fd5b6102c65a03f1151561072c57600080fd5b50505060405180519150506000811161074457600080fd5b600160a060020a0383166000908152600e6020526040902054151561076d57600b805460010190555b600160a060020a0383166000908152600e6020526040902054610796908363ffffffff610f6316565b600160a060020a0384166000908152600e6020908152604080832093909355600f905220546107cb908263ffffffff610f6316565b600160a060020a0384166000908152600f6020526040902055600a546107f7908363ffffffff610f6316565b600a5560095461080d908263ffffffff610f6316565b600981905561081b90610e0a565b1561082557600080fd5b600254600160a060020a03166340c10f19848360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561088457600080fd5b6102c65a03f1151561089557600080fd5b50505060405180515050600454600160a060020a031682156108fc0283604051600060405180830381858888f1935050505015156108d257600080fd5b7f9e9d071824fd57d062ca63fd8b786d8da48a6807eebbcb2d83f9e8d21398e28c8383836040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a15b5b505050565b60075481565b60055481565b600354600090600160a060020a0316151561095b575060016109de565b60065442101561096d575060026109de565b60075442111580156109845750610982610dd7565b155b15610991575060036109de565b610999610cc6565b156109a6575060046109de565b6109ae610cc6565b1580156109bd57506000600a54115b80156109cd5750600a54600c5410155b156109da575060066109de565b5060055b5b5b5b5b5b90565b600e6020526000908152604090205481565b6000805433600160a060020a03908116911614610a1457600080fd5b60005460a060020a900460ff161515610a2c57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15060015b5b5b90565b600a5481565b60005433600160a060020a03908116911614610aa057600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038381169190911791829055166304bbc2556000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b0b57600080fd5b6102c65a03f11515610b1c57600080fd5b505050604051805190501515610b3157600080fd5b5b5b50565b60095481565b60006006805b610b4a61093e565b6006811115610b5557fe5b14610b5f57600080fd5b600160a060020a0333166000908152600e602052604081205492508211610b8557600080fd5b600160a060020a0333166000908152600e6020526040812055600d54610bb1908363ffffffff610f6316565b600d557fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d3383604051600160a060020a03909216825260208201526040908101905180910390a1600160a060020a03331682156108fc0283604051600060405180830381858888f193505050501515610c2957600080fd5b5b5b5050565b60005460a060020a900460ff1681565b600d5481565b60015481565b60005433600160a060020a03908116911614610c6657600080fd5b4281901115610c7457600080fd5b60078190557fd34bb772c4ae9baa99db852f622773b31c7827e8ee818449fef20d30980bd3108160405190815260200160405180910390a15b5b50565b600354600160a060020a031681565b600c5481565b600554600a5410155b90565b6000805433600160a060020a03908116911614610cee57600080fd5b60005460a060020a900460ff1615610d0557600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a15060015b5b5b90565b6005805b610d6a61093e565b6006811115610d7557fe5b14610d7f57600080fd5b60003411610d8c57600080fd5b600c54610d9f903463ffffffff610f6316565b600c555b5b50565b600054600160a060020a031681565b600454600160a060020a031681565b600f6020526000908152604090205481565b60085460095410155b90565b60065481565b60085481565b60106020526000908152604090205460ff1681565b600b5481565b60085481115b919050565b60005433600160a060020a03908116911614610e3057600080fd5b600160a060020a03821660009081526010602052604090819020805460ff19168315151790557fa54714518c5d275fdcd3d2a461e4858e4e8cb04fb93cd0bca9d6d34115f26440908390839051600160a060020a039092168252151560208201526040908101905180910390a15b5b5050565b60005433600160a060020a03908116911614610ebe57600080fd5b600160a060020a03811615610b31576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60005433600160a060020a03908116911614610f1657600080fd5b600154600b541115610f2757600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600254600160a060020a031681565b600082820183811015610f7257fe5b8091505b50929150505600a165627a7a7230582099173d9043e5051de7ea9f5f16dbc683d4b7db975093c000eaa8c54d35aca5f50029", 554 | "networks": { 555 | "1": { 556 | "events": {}, 557 | "links": {}, 558 | "address": "0xba54a9aa2a711883aa5fc87ae9e7127ba405dac9", 559 | "updated_at": 1503222063121 560 | } 561 | }, 562 | "schema_version": "0.0.5", 563 | "updated_at": 1503225285603 564 | } -------------------------------------------------------------------------------- /build/contracts/SafeMath.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "SafeMath", 3 | "abi": [], 4 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b603680601c6000396000f30060606040525b600080fd00a165627a7a72305820c8eb8653997699610483edbb1057941916e20c06a92d613cb5122a327a4bdbb00029", 5 | "networks": {}, 6 | "schema_version": "0.0.5", 7 | "updated_at": 1503225330317 8 | } -------------------------------------------------------------------------------- /build/contracts/SimpleToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "SimpleToken", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "name", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "string" 12 | } 13 | ], 14 | "payable": false, 15 | "type": "function" 16 | }, 17 | { 18 | "constant": false, 19 | "inputs": [ 20 | { 21 | "name": "_spender", 22 | "type": "address" 23 | }, 24 | { 25 | "name": "_value", 26 | "type": "uint256" 27 | } 28 | ], 29 | "name": "approve", 30 | "outputs": [ 31 | { 32 | "name": "", 33 | "type": "bool" 34 | } 35 | ], 36 | "payable": false, 37 | "type": "function" 38 | }, 39 | { 40 | "constant": true, 41 | "inputs": [], 42 | "name": "totalSupply", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "uint256" 47 | } 48 | ], 49 | "payable": false, 50 | "type": "function" 51 | }, 52 | { 53 | "constant": false, 54 | "inputs": [ 55 | { 56 | "name": "_from", 57 | "type": "address" 58 | }, 59 | { 60 | "name": "_to", 61 | "type": "address" 62 | }, 63 | { 64 | "name": "_value", 65 | "type": "uint256" 66 | } 67 | ], 68 | "name": "transferFrom", 69 | "outputs": [ 70 | { 71 | "name": "", 72 | "type": "bool" 73 | } 74 | ], 75 | "payable": false, 76 | "type": "function" 77 | }, 78 | { 79 | "constant": true, 80 | "inputs": [], 81 | "name": "INITIAL_SUPPLY", 82 | "outputs": [ 83 | { 84 | "name": "", 85 | "type": "uint256" 86 | } 87 | ], 88 | "payable": false, 89 | "type": "function" 90 | }, 91 | { 92 | "constant": true, 93 | "inputs": [], 94 | "name": "decimals", 95 | "outputs": [ 96 | { 97 | "name": "", 98 | "type": "uint256" 99 | } 100 | ], 101 | "payable": false, 102 | "type": "function" 103 | }, 104 | { 105 | "constant": true, 106 | "inputs": [ 107 | { 108 | "name": "_owner", 109 | "type": "address" 110 | } 111 | ], 112 | "name": "balanceOf", 113 | "outputs": [ 114 | { 115 | "name": "balance", 116 | "type": "uint256" 117 | } 118 | ], 119 | "payable": false, 120 | "type": "function" 121 | }, 122 | { 123 | "constant": true, 124 | "inputs": [], 125 | "name": "symbol", 126 | "outputs": [ 127 | { 128 | "name": "", 129 | "type": "string" 130 | } 131 | ], 132 | "payable": false, 133 | "type": "function" 134 | }, 135 | { 136 | "constant": false, 137 | "inputs": [ 138 | { 139 | "name": "_to", 140 | "type": "address" 141 | }, 142 | { 143 | "name": "_value", 144 | "type": "uint256" 145 | } 146 | ], 147 | "name": "transfer", 148 | "outputs": [ 149 | { 150 | "name": "", 151 | "type": "bool" 152 | } 153 | ], 154 | "payable": false, 155 | "type": "function" 156 | }, 157 | { 158 | "constant": true, 159 | "inputs": [ 160 | { 161 | "name": "_owner", 162 | "type": "address" 163 | }, 164 | { 165 | "name": "_spender", 166 | "type": "address" 167 | } 168 | ], 169 | "name": "allowance", 170 | "outputs": [ 171 | { 172 | "name": "remaining", 173 | "type": "uint256" 174 | } 175 | ], 176 | "payable": false, 177 | "type": "function" 178 | }, 179 | { 180 | "inputs": [], 181 | "payable": false, 182 | "type": "constructor" 183 | }, 184 | { 185 | "anonymous": false, 186 | "inputs": [ 187 | { 188 | "indexed": true, 189 | "name": "owner", 190 | "type": "address" 191 | }, 192 | { 193 | "indexed": true, 194 | "name": "spender", 195 | "type": "address" 196 | }, 197 | { 198 | "indexed": false, 199 | "name": "value", 200 | "type": "uint256" 201 | } 202 | ], 203 | "name": "Approval", 204 | "type": "event" 205 | }, 206 | { 207 | "anonymous": false, 208 | "inputs": [ 209 | { 210 | "indexed": true, 211 | "name": "from", 212 | "type": "address" 213 | }, 214 | { 215 | "indexed": true, 216 | "name": "to", 217 | "type": "address" 218 | }, 219 | { 220 | "indexed": false, 221 | "name": "value", 222 | "type": "uint256" 223 | } 224 | ], 225 | "name": "Transfer", 226 | "type": "event" 227 | } 228 | ], 229 | "unlinked_binary": "0x606060405260408051908101604052600b81527f53696d706c65546f6b656e0000000000000000000000000000000000000000006020820152600390805161004b9291602001906100cf565b5060408051908101604052600381527f53494d0000000000000000000000000000000000000000000000000000000000602082015260049080516100939291602001906100cf565b50601260055561271060065534156100aa57600080fd5b5b6006546000818155600160a060020a0333168152600160205260409020555b61016f565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061011057805160ff191683800117855561013d565b8280016001018555821561013d579182015b8281111561013d578251825591602001919060010190610122565b5b5061014a92915061014e565b5090565b61016c91905b8082111561014a5760008155600101610154565b5090565b90565b6107ae8061017e6000396000f300606060405236156100a15763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100a6578063095ea7b31461013157806318160ddd1461016757806323b872dd1461018c5780632ff2e9dc146101c8578063313ce567146101ed57806370a082311461021257806395d89b4114610243578063a9059cbb146102ce578063dd62ed3e14610304575b600080fd5b34156100b157600080fd5b6100b961033b565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100f65780820151818401525b6020016100dd565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561013c57600080fd5b610153600160a060020a03600435166024356103d9565b604051901515815260200160405180910390f35b341561017257600080fd5b61017a610480565b60405190815260200160405180910390f35b341561019757600080fd5b610153600160a060020a0360043581169060243516604435610486565b604051901515815260200160405180910390f35b34156101d357600080fd5b61017a61059b565b60405190815260200160405180910390f35b34156101f857600080fd5b61017a6105a1565b60405190815260200160405180910390f35b341561021d57600080fd5b61017a600160a060020a03600435166105a7565b60405190815260200160405180910390f35b341561024e57600080fd5b6100b96105c6565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100f65780820151818401525b6020016100dd565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102d957600080fd5b610153600160a060020a0360043516602435610664565b604051901515815260200160405180910390f35b341561030f57600080fd5b61017a600160a060020a0360043581169060243516610724565b60405190815260200160405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103d15780601f106103a6576101008083540402835291602001916103d1565b820191906000526020600020905b8154815290600101906020018083116103b457829003601f168201915b505050505081565b600081158061040b5750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b151561041657600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b600160a060020a0380841660009081526002602090815260408083203385168452825280832054938616835260019091528120549091906104cd908463ffffffff61075116565b600160a060020a038086166000908152600160205260408082209390935590871681522054610502908463ffffffff61076b16565b600160a060020a03861660009081526001602052604090205561052b818463ffffffff61076b16565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b60065481565b60055481565b600160a060020a0381166000908152600160205260409020545b919050565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156103d15780601f106103a6576101008083540402835291602001916103d1565b820191906000526020600020905b8154815290600101906020018083116103b457829003601f168201915b505050505081565b600160a060020a03331660009081526001602052604081205461068d908363ffffffff61076b16565b600160a060020a0333811660009081526001602052604080822093909355908516815220546106c2908363ffffffff61075116565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60008282018381101561076057fe5b8091505b5092915050565b60008282111561077757fe5b508082035b929150505600a165627a7a7230582019b80619e84df4d2d6958614d9b6c3979dfe933b4dde9f870d10f9d23e5f306d0029", 230 | "networks": { 231 | "1502735369630": { 232 | "events": { 233 | "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { 234 | "anonymous": false, 235 | "inputs": [ 236 | { 237 | "indexed": true, 238 | "name": "owner", 239 | "type": "address" 240 | }, 241 | { 242 | "indexed": true, 243 | "name": "spender", 244 | "type": "address" 245 | }, 246 | { 247 | "indexed": false, 248 | "name": "value", 249 | "type": "uint256" 250 | } 251 | ], 252 | "name": "Approval", 253 | "type": "event" 254 | }, 255 | "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { 256 | "anonymous": false, 257 | "inputs": [ 258 | { 259 | "indexed": true, 260 | "name": "from", 261 | "type": "address" 262 | }, 263 | { 264 | "indexed": true, 265 | "name": "to", 266 | "type": "address" 267 | }, 268 | { 269 | "indexed": false, 270 | "name": "value", 271 | "type": "uint256" 272 | } 273 | ], 274 | "name": "Transfer", 275 | "type": "event" 276 | } 277 | }, 278 | "links": {}, 279 | "address": "0xa957686b7c7b9488ce15a3ff4b2230074b0ebcd2", 280 | "updated_at": 1502735999544 281 | } 282 | }, 283 | "schema_version": "0.0.5", 284 | "updated_at": 1502735999544 285 | } -------------------------------------------------------------------------------- /build/contracts/StandardToken.json: -------------------------------------------------------------------------------- 1 | { 2 | "contract_name": "StandardToken", 3 | "abi": [ 4 | { 5 | "constant": false, 6 | "inputs": [ 7 | { 8 | "name": "_spender", 9 | "type": "address" 10 | }, 11 | { 12 | "name": "_value", 13 | "type": "uint256" 14 | } 15 | ], 16 | "name": "approve", 17 | "outputs": [ 18 | { 19 | "name": "", 20 | "type": "bool" 21 | } 22 | ], 23 | "payable": false, 24 | "type": "function" 25 | }, 26 | { 27 | "constant": true, 28 | "inputs": [], 29 | "name": "totalSupply", 30 | "outputs": [ 31 | { 32 | "name": "", 33 | "type": "uint256" 34 | } 35 | ], 36 | "payable": false, 37 | "type": "function" 38 | }, 39 | { 40 | "constant": false, 41 | "inputs": [ 42 | { 43 | "name": "_from", 44 | "type": "address" 45 | }, 46 | { 47 | "name": "_to", 48 | "type": "address" 49 | }, 50 | { 51 | "name": "_value", 52 | "type": "uint256" 53 | } 54 | ], 55 | "name": "transferFrom", 56 | "outputs": [ 57 | { 58 | "name": "", 59 | "type": "bool" 60 | } 61 | ], 62 | "payable": false, 63 | "type": "function" 64 | }, 65 | { 66 | "constant": true, 67 | "inputs": [ 68 | { 69 | "name": "_owner", 70 | "type": "address" 71 | } 72 | ], 73 | "name": "balanceOf", 74 | "outputs": [ 75 | { 76 | "name": "balance", 77 | "type": "uint256" 78 | } 79 | ], 80 | "payable": false, 81 | "type": "function" 82 | }, 83 | { 84 | "constant": false, 85 | "inputs": [ 86 | { 87 | "name": "_to", 88 | "type": "address" 89 | }, 90 | { 91 | "name": "_value", 92 | "type": "uint256" 93 | } 94 | ], 95 | "name": "transfer", 96 | "outputs": [ 97 | { 98 | "name": "", 99 | "type": "bool" 100 | } 101 | ], 102 | "payable": false, 103 | "type": "function" 104 | }, 105 | { 106 | "constant": true, 107 | "inputs": [ 108 | { 109 | "name": "_owner", 110 | "type": "address" 111 | }, 112 | { 113 | "name": "_spender", 114 | "type": "address" 115 | } 116 | ], 117 | "name": "allowance", 118 | "outputs": [ 119 | { 120 | "name": "remaining", 121 | "type": "uint256" 122 | } 123 | ], 124 | "payable": false, 125 | "type": "function" 126 | }, 127 | { 128 | "anonymous": false, 129 | "inputs": [ 130 | { 131 | "indexed": true, 132 | "name": "owner", 133 | "type": "address" 134 | }, 135 | { 136 | "indexed": true, 137 | "name": "spender", 138 | "type": "address" 139 | }, 140 | { 141 | "indexed": false, 142 | "name": "value", 143 | "type": "uint256" 144 | } 145 | ], 146 | "name": "Approval", 147 | "type": "event" 148 | }, 149 | { 150 | "anonymous": false, 151 | "inputs": [ 152 | { 153 | "indexed": true, 154 | "name": "from", 155 | "type": "address" 156 | }, 157 | { 158 | "indexed": true, 159 | "name": "to", 160 | "type": "address" 161 | }, 162 | { 163 | "indexed": false, 164 | "name": "value", 165 | "type": "uint256" 166 | } 167 | ], 168 | "name": "Transfer", 169 | "type": "event" 170 | } 171 | ], 172 | "unlinked_binary": "0x6060604052341561000f57600080fd5b5b6104da8061001f6000396000f300606060405236156100755763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663095ea7b3811461007a57806318160ddd146100b057806323b872dd146100d557806370a0823114610111578063a9059cbb14610142578063dd62ed3e14610178575b600080fd5b341561008557600080fd5b61009c600160a060020a03600435166024356101af565b604051901515815260200160405180910390f35b34156100bb57600080fd5b6100c3610256565b60405190815260200160405180910390f35b34156100e057600080fd5b61009c600160a060020a036004358116906024351660443561025c565b604051901515815260200160405180910390f35b341561011c57600080fd5b6100c3600160a060020a0360043516610371565b60405190815260200160405180910390f35b341561014d57600080fd5b61009c600160a060020a0360043516602435610390565b604051901515815260200160405180910390f35b341561018357600080fd5b6100c3600160a060020a0360043581169060243516610450565b60405190815260200160405180910390f35b60008115806101e15750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156101ec57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b60005481565b600160a060020a0380841660009081526002602090815260408083203385168452825280832054938616835260019091528120549091906102a3908463ffffffff61047d16565b600160a060020a0380861660009081526001602052604080822093909355908716815220546102d8908463ffffffff61049716565b600160a060020a038616600090815260016020526040902055610301818463ffffffff61049716565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b509392505050565b600160a060020a0381166000908152600160205260409020545b919050565b600160a060020a0333166000908152600160205260408120546103b9908363ffffffff61049716565b600160a060020a0333811660009081526001602052604080822093909355908516815220546103ee908363ffffffff61047d16565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060015b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b60008282018381101561048c57fe5b8091505b5092915050565b6000828211156104a357fe5b508082035b929150505600a165627a7a7230582027babed258a349e3c292f63567124eea9078f85ee5423c6e149e5a7da991558c0029", 173 | "networks": {}, 174 | "schema_version": "0.0.5", 175 | "updated_at": 1503225330317 176 | } -------------------------------------------------------------------------------- /contracts/IouRootsToken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.11; 2 | 3 | import 'zeppelin-solidity/contracts/token/StandardToken.sol'; 4 | import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; 5 | 6 | 7 | contract MintableToken is StandardToken, Ownable { 8 | event Mint(address indexed to, uint256 amount); 9 | event MintFinished(); 10 | 11 | bool public mintingFinished = false; 12 | 13 | 14 | modifier canMint() { 15 | require(!mintingFinished); 16 | _; 17 | } 18 | 19 | /** 20 | * @dev Function to mint tokens 21 | * @param _to The address that will recieve the minted tokens. 22 | * @param _amount The amount of tokens to mint. 23 | * @return A boolean that indicates if the operation was successful. 24 | */ 25 | function mint(address _to, uint256 _amount) onlyOwner returns (bool) { 26 | return mintInternal(_to, _amount); 27 | } 28 | 29 | /** 30 | * @dev Function to stop minting new tokens. 31 | * @return True if the operation was successful. 32 | */ 33 | function finishMinting() onlyOwner returns (bool) { 34 | mintingFinished = true; 35 | MintFinished(); 36 | return true; 37 | } 38 | 39 | function mintInternal(address _to, uint256 _amount) internal canMint returns (bool) { 40 | totalSupply = totalSupply.add(_amount); 41 | balances[_to] = balances[_to].add(_amount); 42 | Mint(_to, _amount); 43 | return true; 44 | } 45 | } 46 | 47 | 48 | contract IouRootsToken is MintableToken { 49 | 50 | string public name; 51 | 52 | string public symbol; 53 | 54 | uint8 public decimals; 55 | 56 | // address where funds are collected 57 | address public wallet; 58 | 59 | // how many token units a buyer gets per wei 60 | uint256 public rate; 61 | 62 | event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); 63 | 64 | // This is not a ROOT token. 65 | // This token is used for the preallocation of the ROOT token, that will be issued later. 66 | // Only Owner can transfer balances and mint ROOTS without payment. 67 | // Everybody can buy IOU ROOT token by sending some amount of ETH to the contract. 68 | // Amount of purchased ROOTS determined by the Rate. 69 | // All ETH are going to Wallet address. 70 | // Owner can finalize the contract by `finishMinting` transaction 71 | function IouRootsToken( 72 | uint256 _rate, 73 | address _wallet, 74 | string _name, 75 | string _symbol, 76 | uint8 _decimals 77 | ) { 78 | require(_rate > 0); 79 | require(_wallet != 0x0); 80 | 81 | rate = _rate; 82 | wallet = _wallet; 83 | name = _name; 84 | symbol = _symbol; 85 | decimals = _decimals; 86 | } 87 | 88 | function transfer(address _to, uint _value) onlyOwner returns (bool) { 89 | return super.transfer(_to, _value); 90 | } 91 | 92 | function transferFrom(address _from, address _to, uint _value) onlyOwner returns (bool) { 93 | return super.transferFrom(_from, _to, _value); 94 | } 95 | 96 | function () payable { 97 | buyTokens(msg.sender); 98 | } 99 | 100 | function buyTokens(address beneficiary) payable { 101 | require(beneficiary != 0x0); 102 | require(msg.value > 0); 103 | 104 | uint256 weiAmount = msg.value; 105 | 106 | // calculate token amount to be created 107 | uint256 tokens = weiAmount.mul(rate); 108 | 109 | mintInternal(beneficiary, tokens); 110 | TokenPurchase( 111 | msg.sender, 112 | beneficiary, 113 | weiAmount, 114 | tokens 115 | ); 116 | 117 | forwardFunds(); 118 | } 119 | 120 | // send ether to the fund collection wallet 121 | function forwardFunds() internal { 122 | wallet.transfer(msg.value); 123 | } 124 | 125 | } 126 | -------------------------------------------------------------------------------- /contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.4; 2 | 3 | 4 | contract Migrations { 5 | address public owner; 6 | uint public last_completed_migration; 7 | 8 | modifier restricted() { 9 | if (msg.sender == owner) 10 | _; 11 | } 12 | 13 | function Migrations() { 14 | owner = msg.sender; 15 | } 16 | 17 | function setCompleted(uint completed) restricted { 18 | last_completed_migration = completed; 19 | } 20 | 21 | function upgrade(address newAddress) restricted { 22 | Migrations upgraded = Migrations(newAddress); 23 | upgraded.setCompleted(last_completed_migration); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /contracts/PensionFundRelease.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.10; 2 | 3 | import "zeppelin-solidity/contracts/token/SimpleToken.sol"; 4 | import "zeppelin-solidity/contracts/token/ERC20Basic.sol"; 5 | import 'zeppelin-solidity/contracts/ownership/Ownable.sol'; 6 | 7 | 8 | contract PensionFundRelease { 9 | address[] public validators; 10 | address public worker; 11 | address public master; 12 | uint8 public firstPaymentPercent; 13 | uint8 public recurrentPaymentPercent; 14 | uint public paymentTime; 15 | uint public recurrentPaymentInterval; 16 | bool public firtPaymentReleased = false; 17 | ERC20Basic public roots; 18 | uint public initialFunds; 19 | 20 | struct Vote { 21 | bool approve; 22 | address validator; 23 | string justification; 24 | } 25 | 26 | mapping (address => uint) public voteIndex; 27 | Vote[] public votes; 28 | 29 | event Voted(bool approve, address validator, string justification); 30 | event Released(uint amount, address worker); 31 | event Refunded(uint amount, address master); 32 | 33 | function PensionFundRelease( 34 | address[] _validators, 35 | address _worker, 36 | address _master, 37 | uint8 _firstPaymentPercent, 38 | uint _firstPaymentTime, 39 | uint _recurrentPaymentInterval, 40 | uint8 _recurrentPaymentPercent, 41 | address _rootsAddress 42 | ) { 43 | require(_validators.length > 0); 44 | require(_worker != 0x0); 45 | require(_master != 0x0); 46 | require(_firstPaymentPercent <= 100); 47 | require(_recurrentPaymentPercent <= 100); 48 | 49 | validators = _validators; 50 | worker = _worker; 51 | master = _master; 52 | firstPaymentPercent = _firstPaymentPercent; 53 | paymentTime = _firstPaymentTime; 54 | recurrentPaymentInterval = _recurrentPaymentInterval; 55 | roots = ERC20Basic(_rootsAddress); 56 | recurrentPaymentPercent = _recurrentPaymentPercent; 57 | 58 | votes.push(Vote(false, 0x0, "")); //first dummy vote 59 | } 60 | 61 | //ensure that only validator can perform the action 62 | modifier onlyValidator() { 63 | bool isValidator = false; 64 | for (uint i = 0; i < validators.length; i++) { 65 | isValidator = isValidator || (msg.sender == validators[i]); 66 | } 67 | require(isValidator); 68 | _; 69 | } 70 | 71 | //vote for the fund release or burn 72 | function vote(bool approve, string justification) onlyValidator returns (uint index) { 73 | index = voteIndex[msg.sender]; 74 | Vote memory vote = Vote(approve, msg.sender, justification); 75 | if (index == 0) { 76 | index = votes.length; 77 | voteIndex[msg.sender] = index; 78 | votes.push(vote); 79 | } else { 80 | votes[index] = vote; 81 | } 82 | 83 | Voted(approve, msg.sender, justification); 84 | } 85 | 86 | // check wether validators have approved the release 87 | function isReleaseApproved() constant returns (bool approved) { 88 | uint num = 0; 89 | for (uint i = 1; i < votes.length; i++) { //skip dummy vote 90 | if (votes[i].approve) 91 | num++; 92 | } 93 | 94 | return num == validators.length; 95 | } 96 | 97 | // Check whether the time period on fund dispersal has been reached 98 | function isFundFreezePeriodEnded() constant returns (bool ended) { 99 | return (block.timestamp > paymentTime); 100 | } 101 | 102 | // check wether validators have decided to burn the fund 103 | function isBurnApproved() constant returns (bool approved) { 104 | uint num = 0; 105 | for (uint i = 1; i < votes.length; i++) { //skip dummy vote 106 | if (!votes[i].approve) 107 | num++; 108 | } 109 | 110 | return num == validators.length; 111 | } 112 | 113 | // calculate the amount of payment 114 | function getPaymentAmount() constant returns (uint amount) { 115 | if (!firtPaymentReleased) { 116 | return initialFunds * firstPaymentPercent / 100; 117 | } else { 118 | return initialFunds * recurrentPaymentPercent / 100; 119 | } 120 | } 121 | 122 | // get current fund balance in ROOTs 123 | function balance() constant returns (uint amount) { 124 | return roots.balanceOf(this); 125 | } 126 | 127 | // release the fund 128 | function releaseRoots() returns (uint releasedAmount) { 129 | // Confirm validators have released funds 130 | require(isReleaseApproved()); 131 | // Confirm the next payment is due to be released 132 | require(isFundFreezePeriodEnded()); 133 | if (!firtPaymentReleased) { 134 | initialFunds = balance(); 135 | releasedAmount = getPaymentAmount(); 136 | firtPaymentReleased = true; 137 | } else { 138 | releasedAmount = getPaymentAmount(); 139 | } 140 | if (releasedAmount > balance()) 141 | releasedAmount = balance(); 142 | // Assumes intended interval is meant to recur regardless of claiming funds 143 | paymentTime = paymentTime + recurrentPaymentInterval; 144 | roots.transfer(worker, releasedAmount); 145 | Released(releasedAmount, worker); 146 | } 147 | 148 | function refundRoots() returns (uint refundedAmount) { 149 | // Confirm validators have refunded funds 150 | require(isBurnApproved()); 151 | // Assumes intended interval is meant to recur regardless of claiming funds 152 | refundedAmount = balance(); 153 | roots.transfer(master, refundedAmount); 154 | Refunded(refundedAmount, master); 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /contracts/ProjectValidation.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.10; 2 | 3 | import "zeppelin-solidity/contracts/token/SimpleToken.sol"; 4 | import "zeppelin-solidity/contracts/math/SafeMath.sol"; 5 | 6 | 7 | contract ProjectValidation { 8 | 9 | /** 10 | * projectValidation contract have number of stages: 11 | * 1) CollectingSignatures: accepting signatures from starter and manager of project 12 | * 2) TryToCompleteProjectStage: on this stage validators call tryToCompleteProject() function. 13 | * 3) CheckerWork: this stage is connected with checker work 14 | * 4) ProjectCompleted: this stage is called when project is complete 15 | * 5) ProjectNonCompleted: this stage is called when project is non-complete 16 | * 6) SuccessfullyClosed: this stage is called automatically after ProjectCompleted stage 17 | * 7) UnsuccessfullyClosed: this stage is called automatically after ProjectNonCompleted stage 18 | */ 19 | enum Stages { 20 | CollectingSignatures, 21 | TryToCompleteProjectStage, 22 | CheckerWork, 23 | ProjectCompleted, 24 | ProjectNonCompleted, 25 | SuccessfullyClosed, 26 | UnsuccessfullyClosed 27 | } 28 | 29 | /** 30 | * Checker is the struct which contains next variables: 31 | * addr: the ethereum address of checker 32 | * signature: checker signature(true or false) 33 | * signed: the fact about checker signing(signed = true, if checker already signed the project) 34 | * presence: this variable help us to detect presence of checker on this project 35 | */ 36 | struct Checker { 37 | address addr; 38 | bool signature; 39 | bool signed; 40 | bool presence; 41 | } 42 | 43 | /** address of project starter */ 44 | address public starter; 45 | 46 | /** address of project manager */ 47 | address public manager; 48 | 49 | /** read description about checker struct below */ 50 | Checker public checker; 51 | 52 | /** the address of exchanger contract which convert fundTokens to Roots */ 53 | address public exchangerContract; 54 | 55 | /** balance of project in fundTokens */ 56 | uint public projectBalance; 57 | 58 | /** this variable show part of fundTokens which worker will receive */ 59 | uint public workerRatio = 2; 60 | 61 | /** amount of fundTokens to send to exchanger contract if project successfully complete */ 62 | uint public amountForRoots = 0; 63 | 64 | SimpleToken public fundTokens; 65 | 66 | /** addresses of workers */ 67 | address[] public workers; 68 | 69 | mapping (address => uint) public workersBalances; 70 | 71 | /** signatures of validators */ 72 | mapping (address => bool) public signatures; 73 | 74 | event Signed(address who); 75 | event Closed(); 76 | event StateChanged(Stages previous, Stages current); 77 | 78 | /** show the current stage of contract */ 79 | Stages public stage = Stages.CollectingSignatures; 80 | 81 | function ProjectValidation( 82 | address _manager, 83 | address _checker, 84 | address _exchangerContract, 85 | address[] _workers, 86 | address fundTokenAddress 87 | ) { 88 | starter = msg.sender; 89 | manager = _manager; 90 | checker = Checker( 91 | _checker, 92 | false, 93 | false, 94 | false 95 | ); 96 | exchangerContract = _exchangerContract; 97 | fundTokens = SimpleToken(fundTokenAddress); 98 | workers = _workers; 99 | signatures[starter] = false; 100 | signatures[manager] = false; 101 | } 102 | 103 | modifier onlyValidator() { 104 | require(msg.sender == manager || msg.sender == starter || msg.sender == checker.addr); 105 | _; 106 | } 107 | 108 | modifier onlyChecker(){ 109 | require(msg.sender == checker.addr && checker.presence); 110 | _; 111 | } 112 | 113 | modifier atStage(Stages _stage) { 114 | require(stage == _stage); 115 | _; 116 | } 117 | 118 | function changeStateTo (Stages _stage) internal { 119 | StateChanged(stage, _stage); 120 | stage = _stage; 121 | } 122 | 123 | modifier afterExecutingGoToState(Stages _stage){ 124 | _; 125 | changeStateTo(_stage); 126 | } 127 | 128 | /** allow validators to sign the project only at CollectingSignatures stage */ 129 | function sign() external onlyValidator atStage(Stages.CollectingSignatures) returns (bool signed) { 130 | signatures[msg.sender] = true; 131 | Signed(msg.sender); 132 | return true; 133 | } 134 | 135 | /** allow checker to make a desicion about project */ 136 | function checkerSign(bool signature) external onlyChecker atStage(Stages.CheckerWork) afterExecutingGoToState(Stages.TryToCompleteProjectStage) { 137 | checker.signed = true; 138 | checker.signature = signature; 139 | } 140 | 141 | /** interrupt the CollectingSignatures stage */ 142 | function stopCollectSignatures() external onlyValidator atStage(Stages.CollectingSignatures) { 143 | changeStateTo(Stages.TryToCompleteProjectStage); 144 | } 145 | 146 | /** allow to get worker balance in fundTokens */ 147 | function getWorkerBalance(address worker) external constant returns (uint balance) { 148 | uint fundWorkerBalance = workersBalances[worker]; 149 | balance = fundWorkerBalance * 2 / 3; 150 | } 151 | 152 | /** 153 | * from tryToCompleteProject() function contract execution can go on 1 of 3 branches: 154 | * 1) call the checker and change stage to CheckerWork: if no necessary signatures from starter or manager and checker.precense == false 155 | * 2) successfully complete project: if there are necessary signatures from starter or manager or checker.signature = true 156 | * 3) Unsuccessfully complete project: if no necessary signatures from starter or manager and checker.presence = true and checker.signature = false 157 | */ 158 | function tryToCompleteProject() external onlyValidator atStage(Stages.TryToCompleteProjectStage) { 159 | if (! ( (signatures[starter] && signatures[manager] ) || checker.presence)) { 160 | changeStateTo(Stages.CheckerWork); 161 | checker.presence = true; 162 | } else if ( (checker.signed && checker.signature) || (signatures[starter] && signatures[manager]) ) { 163 | changeStateTo(Stages.ProjectCompleted); 164 | projectBalance = fundTokens.balanceOf(this); 165 | } else { 166 | changeStateTo(Stages.ProjectNonCompleted); 167 | projectBalance = fundTokens.balanceOf(this); 168 | } 169 | } 170 | 171 | /** 172 | * tryToCloseProject() function check the current stage and change it to SuccessfullyClosed stage if ProjectCompleted 173 | * or to UnsuccessfullyClosed stage if ProjectNonCompleted 174 | */ 175 | function tryToCloseProject() external onlyValidator { 176 | require(stage == Stages.ProjectCompleted || stage == Stages.ProjectNonCompleted); 177 | if (stage == Stages.ProjectCompleted) { 178 | changeStateTo(Stages.SuccessfullyClosed); 179 | } else { 180 | changeStateTo(Stages.UnsuccessfullyClosed); 181 | } 182 | Closed(); 183 | } 184 | 185 | /** allow to send to workers their fundTokens and remaining fundTokens send to exchanger contract */ 186 | function sendTokensToWorkers(uint8 _start, uint8 _end) external atStage(Stages.SuccessfullyClosed) returns (uint amount) { 187 | require(_start >= 0 && _end <= workers.length); 188 | for (uint8 i = _start; i < _end; i++) { 189 | uint workerBalance = workersBalances[workers[i]]; 190 | projectBalance -= workerBalance; 191 | assert(fundTokens.transfer(workers[i], workerBalance)); 192 | } 193 | assert(fundTokens.transfer(exchangerContract, amountForRoots)); 194 | } 195 | 196 | /** allow to send fundTokens back to project starter only if project is closed unsuccessfully */ 197 | function sendTokensBack() external onlyValidator atStage(Stages.UnsuccessfullyClosed) returns (uint amount) { 198 | assert(fundTokens.transfer(starter, fundTokens.balanceOf(this))); 199 | } 200 | 201 | /** allow validators change worker balance */ 202 | function changeWorkerBalance(address worker, uint amount) external onlyValidator returns (bool success) { 203 | require(amount >= 0); 204 | uint pureBalance = amount * workerRatio / 3; 205 | amountForRoots += (amount - pureBalance); 206 | workersBalances[worker] = pureBalance; 207 | } 208 | 209 | } 210 | -------------------------------------------------------------------------------- /contracts/reservation/IMintableToken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.11; 2 | 3 | 4 | contract IMintableToken { 5 | function mint(address _to, uint256 _amount) returns (bool); 6 | function finishMinting() returns (bool); 7 | } 8 | -------------------------------------------------------------------------------- /contracts/reservation/IouRootsReservationToken.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.11; 2 | 3 | import 'zeppelin-solidity/contracts/token/MintableToken.sol'; 4 | 5 | 6 | contract IouRootsReservationToken is MintableToken { 7 | 8 | string public name; 9 | 10 | string public symbol; 11 | 12 | uint8 public decimals; 13 | 14 | // This is not a ROOT token. 15 | // This token is used for the preallocation of the ROOT token, that will be issued later. 16 | // Only Owner can transfer balances and mint ROOTS without payment. 17 | // Owner can finalize the contract by `finishMinting` transaction 18 | function IouRootsReservationToken(string _name, string _symbol, uint8 _decimals) { 19 | name = _name; 20 | symbol = _symbol; 21 | decimals = _decimals; 22 | } 23 | 24 | function transfer(address _to, uint _value) onlyOwner returns (bool) { 25 | return super.transfer(_to, _value); 26 | } 27 | 28 | function transferFrom(address _from, address _to, uint _value) onlyOwner returns (bool) { 29 | return super.transferFrom(_from, _to, _value); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /contracts/reservation/PricingStrategy.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.11; 2 | 3 | import "zeppelin-solidity/contracts/math/SafeMath.sol"; 4 | 5 | 6 | contract PricingStrategy { 7 | 8 | using SafeMath for uint; 9 | 10 | uint public newRateTime; 11 | uint public rate1; 12 | uint public rate2; 13 | uint public minimumWeiAmount; 14 | 15 | function PricingStrategy( 16 | uint _newRateTime, 17 | uint _rate1, 18 | uint _rate2, 19 | uint _minimumWeiAmount 20 | ) { 21 | require(_newRateTime > 0); 22 | require(_rate1 > 0); 23 | require(_rate2 > 0); 24 | require(_minimumWeiAmount > 0); 25 | 26 | newRateTime = _newRateTime; 27 | rate1 = _rate1; 28 | rate2 = _rate2; 29 | minimumWeiAmount = _minimumWeiAmount; 30 | } 31 | 32 | /** Interface declaration. */ 33 | function isPricingStrategy() public constant returns (bool) { 34 | return true; 35 | } 36 | 37 | /** Calculate the current price for buy in amount. */ 38 | function calculateTokenAmount(uint weiAmount) public constant returns (uint tokenAmount) { 39 | uint bonusRate = 0; 40 | 41 | if (weiAmount >= minimumWeiAmount) { 42 | if (now < newRateTime) { 43 | bonusRate = rate1; 44 | } else { 45 | bonusRate = rate2; 46 | } 47 | } 48 | 49 | return weiAmount.mul(bonusRate); 50 | } 51 | } -------------------------------------------------------------------------------- /contracts/reservation/Reservation.sol: -------------------------------------------------------------------------------- 1 | /** 2 | * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net 3 | * 4 | * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt 5 | */ 6 | 7 | pragma solidity ^0.4.11; 8 | 9 | import "zeppelin-solidity/contracts/math/SafeMath.sol"; 10 | import "zeppelin-solidity/contracts/lifecycle/Pausable.sol"; 11 | import "./IMintableToken.sol"; 12 | import "./PricingStrategy.sol"; 13 | 14 | 15 | /** 16 | * Abstract base contract for token sales. 17 | * 18 | * Handle 19 | * - start and end dates 20 | * - accepting investments 21 | * - minimum funding goal and refund 22 | * - various statistics during the crowdfund 23 | * - different pricing strategies 24 | * - different investment policies (allow only whitelisted addresses) 25 | * 26 | */ 27 | 28 | 29 | contract Reservation is Pausable { 30 | 31 | using SafeMath for uint; 32 | 33 | /* Max investment count when we are still allowed to change the multisig address */ 34 | uint public MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE = 500; 35 | 36 | /* The token we are selling */ 37 | IMintableToken public token; 38 | 39 | /* How we are going to price our offering */ 40 | PricingStrategy public pricingStrategy; 41 | 42 | /* tokens will be transfered from this address */ 43 | address public multisigWallet; 44 | 45 | /* if the funding goal is not reached, investors may withdraw their funds */ 46 | uint public minimumFundingGoal; 47 | 48 | /* the UNIX timestamp start date of the reservation */ 49 | uint public startsAt; 50 | 51 | /* the UNIX timestamp end date of the reservation */ 52 | uint public endsAt; 53 | 54 | /* Maximum amount of tokens this reservation can sell. */ 55 | uint public tokensHardCap; 56 | 57 | /* the number of tokens already sold through this contract*/ 58 | uint public tokensSold = 0; 59 | 60 | /* How many wei of funding we have raised */ 61 | uint public weiRaised = 0; 62 | 63 | /* How many distinct addresses have invested */ 64 | uint public investorCount = 0; 65 | 66 | /* How much wei we have returned back to the contract after a failed crowdfund. */ 67 | uint public loadedRefund = 0; 68 | 69 | /* How much wei we have given back to investors.*/ 70 | uint public weiRefunded = 0; 71 | 72 | /** How much ETH each address has invested to this reservation */ 73 | mapping (address => uint256) public investedAmountOf; 74 | 75 | /** How much tokens this reservation has credited for each investor address */ 76 | mapping (address => uint256) public tokenAmountOf; 77 | 78 | /** Addresses that are allowed to invest even before ICO offical opens. Only for testing purpuses. */ 79 | mapping (address => bool) public earlyParticipantWhitelist; 80 | 81 | /** State machine 82 | * 83 | * - Preparing: All contract initialization calls and variables have not been set yet 84 | * - Prefunding: We have not passed start time yet 85 | * - Funding: Active reservation 86 | * - Success: Minimum funding goal reached 87 | * - Failure: Minimum funding goal not reached before ending time 88 | * - Refunding: Refunds are loaded on the contract for reclaim. 89 | */ 90 | enum State{Unknown, Preparing, PreFunding, Funding, Success, Failure, Refunding} 91 | 92 | // A new investment was made 93 | event Invested(address investor, uint weiAmount, uint tokenAmount); 94 | 95 | // Refund was processed for a contributor 96 | event Refund(address investor, uint weiAmount); 97 | 98 | // Address early participation whitelist status changed 99 | event Whitelisted(address addr, bool status); 100 | 101 | // Reservation end time has been changed 102 | event EndsAtChanged(uint endsAt); 103 | 104 | function Reservation( 105 | address _token, 106 | address _pricingStrategy, 107 | address _multisigWallet, 108 | uint _start, 109 | uint _end, 110 | uint _tokensHardCap, 111 | uint _minimumFundingGoal 112 | ) { 113 | require(_token != 0); 114 | require(_pricingStrategy != 0); 115 | require(_multisigWallet != 0); 116 | require(_start != 0); 117 | require(_end != 0); 118 | require(_start < _end); 119 | require(_tokensHardCap != 0); 120 | 121 | token = IMintableToken(_token); 122 | setPricingStrategy(_pricingStrategy); 123 | multisigWallet = _multisigWallet; 124 | startsAt = _start; 125 | endsAt = _end; 126 | tokensHardCap = _tokensHardCap; 127 | minimumFundingGoal = _minimumFundingGoal; 128 | } 129 | 130 | /** 131 | * Buy tokens 132 | */ 133 | function() payable { 134 | invest(msg.sender); 135 | } 136 | 137 | /** 138 | * Make an investment. 139 | * 140 | * Reservation must be running for one to invest. 141 | * We must have not pressed the emergency brake. 142 | * 143 | * @param receiver The Ethereum address who receives the tokens 144 | */ 145 | function invest(address receiver) whenNotPaused payable { 146 | 147 | // Determine if it's a good time to accept investment from this participant 148 | if (getState() == State.PreFunding) { 149 | // Are we whitelisted for early deposit 150 | require(earlyParticipantWhitelist[receiver]); 151 | } else { 152 | require(getState() == State.Funding); 153 | } 154 | 155 | uint weiAmount = msg.value; 156 | 157 | // Account reservation sales separately, so that they do not count against pricing tranches 158 | uint tokenAmount = pricingStrategy.calculateTokenAmount(weiAmount); 159 | 160 | // Dust transaction 161 | require(tokenAmount > 0); 162 | 163 | if (investedAmountOf[receiver] == 0) { 164 | // A new investor 165 | investorCount++; 166 | } 167 | 168 | // Update investor 169 | investedAmountOf[receiver] = investedAmountOf[receiver].add(weiAmount); 170 | tokenAmountOf[receiver] = tokenAmountOf[receiver].add(tokenAmount); 171 | 172 | // Update totals 173 | weiRaised = weiRaised.add(weiAmount); 174 | tokensSold = tokensSold.add(tokenAmount); 175 | 176 | // Check that we did not bust the cap 177 | require(!isBreakingCap(tokensSold)); 178 | 179 | token.mint(receiver, tokenAmount); 180 | 181 | // Pocket the money 182 | multisigWallet.transfer(weiAmount); 183 | 184 | // Tell us invest was success 185 | Invested(receiver, weiAmount, tokenAmount); 186 | } 187 | 188 | /** 189 | * Allow addresses to do early participation. 190 | * 191 | */ 192 | function setEarlyParicipantWhitelist(address addr, bool status) onlyOwner { 193 | earlyParticipantWhitelist[addr] = status; 194 | Whitelisted(addr, status); 195 | } 196 | 197 | /** 198 | * Allow reservation owner to close early or extend the reservation. 199 | * 200 | * This is useful e.g. for a manual soft cap implementation: 201 | * - after X amount is reached determine manual closing 202 | * 203 | * This may put the reservation to an invalid state, 204 | * but we trust owners know what they are doing. 205 | * 206 | */ 207 | function setEndsAt(uint time) onlyOwner { 208 | 209 | require(now <= time); 210 | 211 | endsAt = time; 212 | EndsAtChanged(endsAt); 213 | } 214 | 215 | /** 216 | * Allow to (re)set pricing strategy. 217 | * 218 | * Design choice: no state restrictions on the set, so that we can fix fat finger mistakes. 219 | */ 220 | function setPricingStrategy(address _pricingStrategy) onlyOwner { 221 | pricingStrategy = PricingStrategy(_pricingStrategy); 222 | 223 | // Don't allow setting bad agent 224 | require(pricingStrategy.isPricingStrategy()); 225 | } 226 | 227 | /** 228 | * Allow to change the team multisig address in the case of emergency. 229 | * 230 | * This allows to save a deployed reservation wallet in the case the reservation has not yet begun 231 | * (we have done only few test transactions). After the reservation is going 232 | * then multisig address stays locked for the safety reasons. 233 | */ 234 | function setMultisig(address addr) public onlyOwner { 235 | 236 | require(investorCount <= MAX_INVESTMENTS_BEFORE_MULTISIG_CHANGE); 237 | 238 | multisigWallet = addr; 239 | } 240 | 241 | /** 242 | * Allow load refunds back on the contract for the refunding. 243 | * 244 | * The team can transfer the funds back on the smart contract in the case the minimum goal was not reached.. 245 | */ 246 | function loadRefund() public payable inState(State.Failure) { 247 | require(msg.value > 0); 248 | 249 | loadedRefund = loadedRefund.add(msg.value); 250 | } 251 | 252 | /** 253 | * Investors can claim refund. 254 | * 255 | * Note that any refunds from proxy buyers should be handled separately, 256 | * and not through this contract. 257 | */ 258 | function refund() public inState(State.Refunding) { 259 | uint256 weiValue = investedAmountOf[msg.sender]; 260 | require(weiValue > 0); 261 | 262 | investedAmountOf[msg.sender] = 0; 263 | weiRefunded = weiRefunded.add(weiValue); 264 | Refund(msg.sender, weiValue); 265 | 266 | msg.sender.transfer(weiValue); 267 | } 268 | 269 | /** 270 | * Crowdfund state machine management. 271 | * 272 | * We make it a function and do not assign the result to a variable, so there is no chance of the variable being stale. 273 | */ 274 | function getState() public constant returns (State) { 275 | if (address(pricingStrategy) == 0) 276 | return State.Preparing; 277 | else if (block.timestamp < startsAt) 278 | return State.PreFunding; 279 | else if (block.timestamp <= endsAt && !isReservationFull()) 280 | return State.Funding; 281 | else if (isMinimumGoalReached()) 282 | return State.Success; 283 | else if (!isMinimumGoalReached() && weiRaised > 0 && loadedRefund >= weiRaised) 284 | return State.Refunding; 285 | else 286 | return State.Failure; 287 | } 288 | 289 | /** 290 | * @return true if the reservation has raised enough money to be a successful. 291 | */ 292 | function isMinimumGoalReached() public constant returns (bool reached) { 293 | return weiRaised >= minimumFundingGoal; 294 | } 295 | 296 | /** 297 | * Called from invest() to confirm if the curret investment does not break our cap rule. 298 | */ 299 | function isBreakingCap(uint tokensSoldTotal) constant returns (bool) { 300 | return tokensSoldTotal > tokensHardCap; 301 | } 302 | 303 | function isReservationFull() public constant returns (bool) { 304 | return tokensSold >= tokensHardCap; 305 | } 306 | 307 | // 308 | // Modifiers 309 | // 310 | 311 | /** Modified allowing execution only if the reservation is currently running. */ 312 | modifier inState(State state) { 313 | require(getState() == state); 314 | _; 315 | } 316 | } -------------------------------------------------------------------------------- /ethpm.json: -------------------------------------------------------------------------------- 1 | { 2 | "package_name": "rootproject-backend", 3 | "version": "0.0.1", 4 | "description": "Ethereum contracts for RootProject, a crowdfunding platform for social projects powered by a crypto currency.", 5 | "authors": [ 6 | "Alex Bazhanau " 7 | ], 8 | "keywords": [ 9 | ], 10 | "dependencies": { 11 | 12 | }, 13 | "license": "GPL-3.0" 14 | } 15 | -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | let Migrations = artifacts.require("./Migrations.sol") 2 | 3 | module.exports = (deployer) => deployer.deploy(Migrations) 4 | -------------------------------------------------------------------------------- /migrations/2_deploy_IouRootsToken.js: -------------------------------------------------------------------------------- 1 | //IOU ROOTS tokens will be exchanged into ROOTS tokens during the ICO 2 | 3 | let IouRootsToken = artifacts.require("./IouRootsToken.sol") 4 | 5 | module.exports = (deployer, network) => { 6 | if (network == 'live') { 7 | deployer.deploy( 8 | IouRootsToken, 9 | 15000, 10 | '0x6fE56527Be2AAf18347dd772fc333504B83c4447', 11 | 'ROOTS IOU', 12 | 'IOR', 13 | 18 14 | ) 15 | } 16 | else { 17 | deployer.deploy( 18 | IouRootsToken, 19 | 15000, 20 | '0xA0279AF590d94405e20Fa9127646034D8d67D827', 21 | 'ROOTS IOU', 22 | 'IOR', 23 | 18 24 | ) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /migrations/3_deploy_Reservation.js: -------------------------------------------------------------------------------- 1 | let BigNumber = require('bignumber.js'); 2 | 3 | let IouRootsReservationToken = artifacts.require("reservation/IouRootsReservationToken.sol") 4 | let PricingStrategy = artifacts.require("reservation/PricingStrategy.sol") 5 | let Reservation = artifacts.require("reservation/Reservation.sol") 6 | 7 | module.exports = (deployer, network) => { 8 | if (network == 'live') { 9 | const NEW_RATE_TIME = 1508025600 10 | const RATE1 = 12500 11 | const RATE2 = 11500 12 | const MINIMUM_WEI_AMOUNT = 1 // 1 wei 13 | const HARD_CAP = new BigNumber(10).pow(8 + 18).mul(15) // + decimals 14 | const MINIMUM_FUNDING_GOAL = 1 15 | const WALLET = '0x6fE56527Be2AAf18347dd772fc333504B83c4447' 16 | const NOW = web3.eth.getBlock(web3.eth.blockNumber).timestamp 17 | const START = NOW 18 | const STOP = 1510617600 // Monday, November 14, 2017 00:00:00 UTC 19 | 20 | deployer.deploy( 21 | PricingStrategy, 22 | NEW_RATE_TIME, 23 | RATE1, 24 | RATE2, 25 | MINIMUM_WEI_AMOUNT, 26 | ) 27 | .then(() => deployer.deploy(IouRootsReservationToken, 'ROOTS Reservation', 'RR', 18)) 28 | .then(deployer.deploy( 29 | Reservation, 30 | IouRootsReservationToken.address, 31 | PricingStrategy.address, 32 | WALLET, 33 | START, 34 | STOP, 35 | HARD_CAP, 36 | MINIMUM_FUNDING_GOAL 37 | )) 38 | 39 | } 40 | else { 41 | const NEW_RATE_TIME = 1508025600 42 | const RATE1 = 12500 43 | const RATE2 = 11500 44 | const MINIMUM_WEI_AMOUNT = new BigNumber(web3.toWei(0.001, 'ether')) 45 | const HARD_CAP = new BigNumber(1).pow(9 + 18) // + decimals 46 | const MINIMUM_FUNDING_GOAL = 100 47 | const WALLET = '0x001D51cDC8f4B378e136642DdB95Dfc4fF6a4B72' 48 | let now = web3.eth.getBlock(web3.eth.blockNumber).timestamp 49 | 50 | 51 | deployer.deploy( 52 | PricingStrategy, 53 | NEW_RATE_TIME, 54 | RATE1, 55 | RATE2, 56 | MINIMUM_WEI_AMOUNT, 57 | ) 58 | .then(() => deployer.deploy(IouRootsReservationToken, 'PRESALE ROOTS IOU', 'IOR', 18)) 59 | .then(() => deployer.deploy( 60 | Reservation, 61 | IouRootsReservationToken.address, 62 | PricingStrategy.address, 63 | WALLET, 64 | now, 65 | now + 60 * 15, 66 | HARD_CAP, 67 | MINIMUM_FUNDING_GOAL 68 | )) 69 | } 70 | } 71 | 72 | -------------------------------------------------------------------------------- /migrations/4_change_PricingStrategy.js: -------------------------------------------------------------------------------- 1 | let BigNumber = require('bignumber.js'); 2 | 3 | let PricingStrategy = artifacts.require("reservation/PricingStrategy.sol") 4 | let Reservation = artifacts.require("reservation/Reservation.sol") 5 | 6 | module.exports = (deployer, network) => { 7 | 8 | let NEW_RATE_TIME, RATE1, RATE2, MINIMUM_WEI_AMOUNT 9 | 10 | NEW_RATE_TIME = 1508025600 // Sunday, October 15, 2017: 00:00:00 UTC 11 | RATE1 = 12500 12 | RATE2 = 11500 13 | 14 | if (network == 'live') { 15 | MINIMUM_WEI_AMOUNT = 1 // 1 wei 16 | } 17 | else { 18 | MINIMUM_WEI_AMOUNT = new BigNumber(web3.toWei(0.001, 'ether')) 19 | } 20 | 21 | deployer.deploy( 22 | PricingStrategy, 23 | NEW_RATE_TIME, 24 | RATE1, 25 | RATE2, 26 | MINIMUM_WEI_AMOUNT 27 | ) 28 | .then(() => Reservation.deployed()) 29 | .then((instance) => instance.setPricingStrategy(PricingStrategy.address)) 30 | 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /migrations/5_deploy_PensionFundRelease.js: -------------------------------------------------------------------------------- 1 | let Token = artifacts.require("zeppelin-solidity/contracts/token/SimpleToken.sol") 2 | let PensionFundRelease = artifacts.require("./PensionFundRelease.sol") 3 | 4 | module.exports = (deployer, network, accounts) => 5 | deployer.deploy(Token) 6 | .then(() => deployer.deploy( 7 | PensionFundRelease, 8 | [accounts[0], accounts[1]], 9 | accounts[2], 10 | accounts[4], 11 | 100, 12 | 1500243470, 13 | 604800, 14 | 100, 15 | Token.address) 16 | ) 17 | -------------------------------------------------------------------------------- /migrations/5_deploy_ProjectValidation.js: -------------------------------------------------------------------------------- 1 | let Token = artifacts.require("zeppelin-solidity/contracts/token/SimpleToken.sol") 2 | let ProjectValidation = artifacts.require("./ProjectValidation.sol") 3 | 4 | module.exports = (deployer, network, accounts) => { 5 | const MANAGER = accounts[1] 6 | const CHECKER = accounts[2] 7 | const WORKERS = [accounts[3], accounts[4]] 8 | const EXCHANGER = accounts[5] 9 | 10 | deployer.deploy(Token).then(() => { 11 | deployer.deploy( 12 | ProjectValidation, 13 | MANAGER, 14 | CHECKER, 15 | EXCHANGER, 16 | WORKERS, 17 | Token.address 18 | ) 19 | }); 20 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rootproject-backend", 3 | "version": "0.0.1", 4 | "description": "Ethereum contracts for rootproject, a crowdfunding platform for social projects powered by a crypto currency.", 5 | "main": "truffle.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "truffle test", 11 | "lint": "./node_modules/.bin/eslint **/*.js && solium --dir ." 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/rootprojectco/backend.git" 16 | }, 17 | "author": "Alex Bazhanau ", 18 | "license": "GPL-3.0", 19 | "bugs": { 20 | "url": "https://github.com/rootprojectco/backend/issues" 21 | }, 22 | "homepage": "https://github.com/rootprojectco/backend#readme", 23 | "dependencies": { 24 | "ethereumjs-testrpc": "~4.0.1", 25 | "zeppelin-solidity": "~1.2.0" 26 | }, 27 | "devDependencies": { 28 | "bignumber.js": "~4.0.2", 29 | "chai": "~4.1.0", 30 | "chai-as-promised": "~7.1.1", 31 | "eslint": "~4.0.0-rc.0", 32 | "solium": "~0.5.5" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/IouRootsTokenTest.js: -------------------------------------------------------------------------------- 1 | let chai = require("chai") 2 | let chaiAsPromised = require("chai-as-promised") 3 | chai.use(chaiAsPromised) 4 | chai.should() 5 | 6 | //let Token = artifacts.require("zeppelin-solidity/contracts/token/SimpleToken.sol") 7 | let IouRootsToken = artifacts.require("./IouRootsToken.sol") 8 | 9 | 10 | contract('IouRootsToken', (accounts) => { 11 | let wallet = accounts[1] 12 | let beneficiary = accounts[2] 13 | let sender = accounts[3] 14 | 15 | const VALUE_TO_SEND = 10000 16 | const RATE = 15000 17 | const DECIMAL = 18 18 | 19 | 20 | let deployParams = [ 21 | RATE, 22 | wallet, 23 | 'IOU ROOTS', 24 | 'IOR', 25 | DECIMAL 26 | ] 27 | 28 | it("should return firstPaymentPercent(fallback)", async () => { 29 | let instance = await IouRootsToken.new.apply(this, deployParams) 30 | await instance.sendTransaction({ from: sender, value: VALUE_TO_SEND }) 31 | let value = await instance.balanceOf(sender) 32 | value.toNumber().should.be.equal(VALUE_TO_SEND * RATE) 33 | }) 34 | 35 | it("should return firstPaymentPercent(non-fallback)", async () => { 36 | let instance = await IouRootsToken.new.apply(this, deployParams) 37 | await instance.buyTokens(beneficiary, { from: sender, value: VALUE_TO_SEND }) 38 | let value = await instance.balanceOf(beneficiary) 39 | value.toNumber().should.be.equal(VALUE_TO_SEND * RATE) 40 | }) 41 | 42 | }) -------------------------------------------------------------------------------- /test/PensionFundReleaseTest.js: -------------------------------------------------------------------------------- 1 | let chai = require("chai") 2 | let chaiAsPromised = require("chai-as-promised") 3 | chai.use(chaiAsPromised) 4 | chai.should() 5 | 6 | let Token = artifacts.require("zeppelin-solidity/contracts/token/SimpleToken.sol") 7 | let PensionFundRelease = artifacts.require("./PensionFundRelease.sol") 8 | 9 | 10 | contract('PensionFundRelease', (accounts) => { 11 | const TIME_INCREMENT = 604800 12 | const FIRST_PAYMENT_PERCENT = 20 13 | let firstPaymentTime = web3.eth.getBlock(web3.eth.blockNumber).timestamp 14 | const VALIDATORS = [accounts[0], accounts[1]] 15 | const WORKER = accounts[2] 16 | const MASTER = accounts[4] 17 | const UNAUTHORIZED = accounts[3] 18 | const INITIAL_BALANCE = 100 19 | const PERCENT_DENOMINATOR = 100 20 | const PAYOUT_PERCENT = 40 21 | 22 | let deployParams = (_firstPaymentTime, _firstPaymentPercent, _token, _payoutPercent) => 23 | [ 24 | VALIDATORS, 25 | WORKER, 26 | MASTER, 27 | _firstPaymentPercent, 28 | _firstPaymentTime, 29 | TIME_INCREMENT, 30 | _payoutPercent, 31 | _token 32 | ] 33 | 34 | let token, fund 35 | 36 | beforeEach(async() => { 37 | token = await Token.deployed() 38 | fund = await PensionFundRelease.new.apply( 39 | this, 40 | deployParams( 41 | firstPaymentTime, 42 | FIRST_PAYMENT_PERCENT, 43 | token.address, 44 | PAYOUT_PERCENT 45 | ) 46 | ) 47 | }) 48 | 49 | it("#1 should return firstPaymentPercent", async () => { 50 | let percent = await fund.firstPaymentPercent.call() 51 | let number = await percent.toNumber() 52 | number.should.equal(FIRST_PAYMENT_PERCENT) 53 | }) 54 | 55 | it("#2 should return VALIDATORS", async () => { 56 | let validator = await fund.validators.call(0) 57 | validator.should.equal(VALIDATORS[0]) 58 | }) 59 | 60 | it("#3 should allow VALIDATORS to vote", async () => { 61 | await fund.vote(true, "justification", { from: VALIDATORS[0] }) 62 | let index = await fund.voteIndex.call(VALIDATORS[0]) 63 | let vote = await fund.votes.call(index) 64 | vote[2].should.be.equal("justification") 65 | }) 66 | 67 | it("#4 should not allow non-VALIDATORS to vote", async () => { 68 | fund.vote(true, "justification", { from: UNAUTHORIZED }).should.be.rejected 69 | }) 70 | 71 | it("#5 should allow release after all VALIDATORS approval", async () => { 72 | await fund.vote(true, "justification", { from: VALIDATORS[0] }) 73 | await fund.vote(true, "justification", { from: VALIDATORS[1] }) 74 | let approval = await fund.isReleaseApproved.call() 75 | approval.should.be.equal(true) 76 | }) 77 | 78 | it("#6 should not allow release if not all VALIDATORS approved release", async () => { 79 | await fund.vote(true, "justification", { from: VALIDATORS[0] }) 80 | let vote = await fund.isReleaseApproved.call() 81 | vote.should.be.equal(false) 82 | }) 83 | 84 | it("#7 should allow burn after all VALIDATORS rejection", async () => { 85 | await fund.vote(false, "justification", { from: VALIDATORS[0] }) 86 | await fund.vote(false, "justification", { from: VALIDATORS[1] }) 87 | let approval = await fund.isBurnApproved.call() 88 | approval.should.be.equal(true) 89 | }) 90 | 91 | it("#8 should not allow burn if not all VALIDATORS rejected release", async () => { 92 | await fund.vote(false, "justification", { from: VALIDATORS[0] }) 93 | let approval = await fund.isBurnApproved.call() 94 | approval.should.be.equal(false) 95 | }) 96 | 97 | it("#9 should release roots if all conditions met", async () => { 98 | let workerBalance 99 | let balance = INITIAL_BALANCE 100 | await token.transfer(fund.address, balance) 101 | await fund.vote(true, "justification", { from: VALIDATORS[0] }) 102 | await fund.vote(true, "justification", { from: VALIDATORS[1] }) 103 | let release = await fund.releaseRoots({ from: WORKER }) 104 | release.logs[0].args.amount.toNumber() 105 | .should.be.equal(balance * FIRST_PAYMENT_PERCENT / PERCENT_DENOMINATOR) 106 | workerBalance = await token.balanceOf(WORKER) 107 | workerBalance.toNumber().should.be.equal(balance * FIRST_PAYMENT_PERCENT / PERCENT_DENOMINATOR) 108 | }) 109 | 110 | it("#10 should attempt to release roots before freeze period ends and fail", async () => { 111 | let balance = INITIAL_BALANCE 112 | let error 113 | fund = await PensionFundRelease.new.apply( 114 | this, 115 | deployParams( 116 | firstPaymentTime + TIME_INCREMENT, 117 | FIRST_PAYMENT_PERCENT, 118 | token.address, 119 | PAYOUT_PERCENT 120 | ) 121 | ) 122 | await token.transfer(fund.address, balance) 123 | await fund.vote(true, "justification", { from: VALIDATORS[0] }) 124 | await fund.vote(true, "justification", { from: VALIDATORS[1] }) 125 | try { 126 | await fund.releaseRoots({ from: WORKER }) 127 | } catch (err) { 128 | error = err 129 | } 130 | error.should.be.a("Error") 131 | }) 132 | 133 | it("#11 should release all roots over time", async () => { 134 | let workerBalance 135 | let balance = INITIAL_BALANCE 136 | // Transfer previous balance away 137 | await token.transfer(UNAUTHORIZED, FIRST_PAYMENT_PERCENT, { from: WORKER }) 138 | await token.transfer(fund.address, balance) 139 | await fund.vote(true, "justification", { from: VALIDATORS[0] }) 140 | await fund.vote(true, "justification", { from: VALIDATORS[1] }) 141 | let release = await fund.releaseRoots({ from: WORKER }) 142 | while (await fund.balance() > 0) { 143 | web3.currentProvider.send({ 144 | jsonrpc: '2.0', 145 | method: 'evm_increaseTime', 146 | params: [TIME_INCREMENT], 147 | id: new Date().getTime() 148 | }) 149 | release = await fund.releaseRoots({ from: WORKER }) 150 | release.logs[0].args.amount.toNumber().should.be.equal(PAYOUT_PERCENT) 151 | } 152 | workerBalance = await token.balanceOf(WORKER) 153 | workerBalance.toNumber().should.be.equal(INITIAL_BALANCE) 154 | }) 155 | 156 | it("#12 should release all roots and then release balance of 0", async () => { 157 | let workerBalance 158 | let firstPaymentPercent = PERCENT_DENOMINATOR 159 | let balance = INITIAL_BALANCE 160 | fund = await PensionFundRelease.new.apply( 161 | this, 162 | deployParams( 163 | firstPaymentTime, 164 | firstPaymentPercent, 165 | token.address, 166 | PAYOUT_PERCENT 167 | ) 168 | ) 169 | // Transfer previous balance away 170 | await token.transfer(UNAUTHORIZED, INITIAL_BALANCE, { from: WORKER }) 171 | await token.transfer(fund.address, balance) 172 | await fund.vote(true, "justification", { from: VALIDATORS[0] }) 173 | await fund.vote(true, "justification", { from: VALIDATORS[1] }) 174 | let release = await fund.releaseRoots({ from: WORKER }) 175 | workerBalance = await token.balanceOf(WORKER) 176 | workerBalance.toNumber().should.be.equal(INITIAL_BALANCE) 177 | release = await fund.releaseRoots({ from: WORKER }) 178 | release.logs[0].args.amount.toNumber().should.be.equal(0) 179 | }) 180 | 181 | it("#13 should fail refund all roots", async() => { 182 | let masterBalance = await token.balanceOf(MASTER) 183 | let fundBalance = await token.balanceOf(fund.address) 184 | await fund.vote(true, "justification", {from: VALIDATORS[0]}) 185 | await fund.vote(true, "justification", {from: VALIDATORS[1]}) 186 | try{ 187 | let refund = await fund.refundRoots({from: MASTER}) 188 | throw new Error('Unexpect refund: ', refund) 189 | }catch (error){ 190 | let balance = await token.balanceOf(fund.address) 191 | assert.equal(balance.toNumber(), fundBalance.toNumber()) 192 | let mBalance = await token.balanceOf(MASTER) 193 | assert.equal(mBalance.toNumber(), masterBalance.toNumber()) 194 | } 195 | }) 196 | 197 | it("#14 should refund all roots and then refund balance of 0", async() => { 198 | let masterBalance = await token.balanceOf(MASTER) 199 | let firstPaymentPercent = PERCENT_DENOMINATOR 200 | let balance = INITIAL_BALANCE 201 | fund = await PensionFundRelease.new.apply( 202 | this, 203 | deployParams( 204 | firstPaymentTime, 205 | firstPaymentPercent, 206 | token.address, 207 | PAYOUT_PERCENT 208 | ) 209 | ) 210 | await token.transfer(fund.address, balance) 211 | await fund.vote(false, "justification", {from: VALIDATORS[0]}) 212 | await fund.vote(false, "justification", {from: VALIDATORS[1]}) 213 | await fund.refundRoots({from: MASTER}) 214 | let mBalance = await token.balanceOf(MASTER) 215 | assert.equal(mBalance.toNumber(), masterBalance.toNumber() + balance) 216 | let fundBalance = await token.balanceOf(fund.address) 217 | fundBalance.toNumber().should.be.equal(0) 218 | }) 219 | }); 220 | -------------------------------------------------------------------------------- /test/ProjectValidationTest.js: -------------------------------------------------------------------------------- 1 | let chai = require("chai") 2 | let chaiAsPromised = require("chai-as-promised") 3 | chai.use(chaiAsPromised) 4 | chai.should() 5 | 6 | let Token = artifacts.require("zeppelin-solidity/contracts/token/SimpleToken.sol") 7 | let ProjectValidation = artifacts.require("./ProjectValidation.sol") 8 | 9 | let fundToken 10 | let project 11 | 12 | contract('ProjectValidation', (accounts) => { 13 | 14 | const STAGES = { 15 | CollectingSignatures: 0, 16 | TryToCompleteProjectStage: 1, 17 | CheckerWork: 2, 18 | ProjectCompleted: 3, 19 | ProjectNonCompleted: 4, 20 | SuccessfullyClosed: 5, 21 | UnsuccessfullyClosed: 6 22 | } 23 | 24 | const STARTER = accounts[0] 25 | const MANAGER = accounts[1] 26 | const CHECKER = accounts[2] 27 | const WORKERS = [accounts[3], accounts[4]] 28 | const EXCHANGER = accounts[5] 29 | const RATIO = 2 / 3 30 | 31 | function deployParams() { 32 | return [ 33 | MANAGER, 34 | CHECKER, 35 | EXCHANGER, 36 | WORKERS, 37 | fundToken.address 38 | ] 39 | } 40 | 41 | beforeEach(async() => { 42 | fundToken = await Token.new() 43 | project = await ProjectValidation.new.apply(this, deployParams()) 44 | }) 45 | 46 | it("#1 should be equal to constructor params", async() => { 47 | let starter = await project.starter(); 48 | starter.should.be.equal(accounts[0]) 49 | let manager = await project.manager(); 50 | manager.should.be.equal(MANAGER) 51 | let checker = await project.checker(); 52 | checker[0].should.be.equal(CHECKER) 53 | let exchangerAddress = await project.exchangerContract() 54 | exchangerAddress.should.be.equal(EXCHANGER) 55 | let firstWorker = await project.workers.call(0) 56 | firstWorker.should.be.equal(WORKERS[0]) 57 | let secondWorker = await project.workers.call(1) 58 | secondWorker.should.be.equal(WORKERS[1]) 59 | }) 60 | 61 | it("#2 should transfer tokens to project address", async() => { 62 | fundToken.transfer(project.address, 100) 63 | let projectBalance = await fundToken.balanceOf(project.address) 64 | projectBalance.toNumber().should.be.equal(100) 65 | }) 66 | 67 | it("#3 should fail to set balance to worker", async() => { 68 | const AMOUNT = 60 69 | await project.changeWorkerBalance(WORKERS[0], AMOUNT, {from: WORKERS[0]}).should.be.rejected 70 | let workerBalance = await project.workersBalances.call(WORKERS[0]) 71 | workerBalance.toNumber().should.be.equal(0) 72 | }) 73 | 74 | it("#4 should set balance to first worker and increase balance for roots", async() => { 75 | const AMOUNT = 60 76 | let expectedRootBalance = Math.floor(AMOUNT - (AMOUNT * RATIO)) 77 | await project.changeWorkerBalance(WORKERS[0], AMOUNT) 78 | let workerBalance = await project.workersBalances.call(WORKERS[0]) 79 | workerBalance.toNumber().should.be.equal(AMOUNT * RATIO) 80 | let rootBalance = await project.amountForRoots() 81 | rootBalance.toNumber().should.be.equal(expectedRootBalance) 82 | }) 83 | 84 | it("#5 should set balance to workers and increase balance for roots", async() => { 85 | const FIRST_WORKER_AMOUNT = 40 86 | const SECOND_WORKER_AMOUNT = 60 87 | await project.changeWorkerBalance(WORKERS[0], FIRST_WORKER_AMOUNT) 88 | await project.changeWorkerBalance(WORKERS[1], SECOND_WORKER_AMOUNT) 89 | let firstWorkerBalance = await project.workersBalances.call(WORKERS[0]) 90 | let secondWorkerBalance = await project.workersBalances.call(WORKERS[1]) 91 | firstWorkerBalance.toNumber().should.be.equal(Math.floor(FIRST_WORKER_AMOUNT * RATIO)) 92 | secondWorkerBalance.toNumber().should.be.equal(Math.floor(SECOND_WORKER_AMOUNT * RATIO)) 93 | let rootBalance = await project.amountForRoots() 94 | assert.equal(rootBalance.toNumber() + firstWorkerBalance.toNumber() + secondWorkerBalance.toNumber(), 100) 95 | }) 96 | 97 | it("#6 should reject to sign project from non-validator address", async() => { 98 | await project.sign({from: WORKERS[0]}).should.be.rejected 99 | }) 100 | 101 | it("#7 should sign the project", async() => { 102 | await project.sign({from: STARTER}) 103 | let signature = await project.signatures(STARTER) 104 | signature.should.be.equal(true) 105 | }) 106 | 107 | it("#8 should reject to complete project if no necessary signatures", async() => { 108 | await project.sign({from: STARTER}) 109 | await project.stopCollectSignatures() 110 | await project.tryToCompleteProject() 111 | let stage = await project.stage() 112 | stage.c[0].should.not.be.equal(STAGES.ProjectCompleted) 113 | }) 114 | 115 | it("#9 should complete project", async() => { 116 | await project.sign({from: STARTER}) 117 | await project.sign({from: MANAGER}) 118 | await project.stopCollectSignatures() 119 | await project.tryToCompleteProject({from: STARTER}) 120 | let stage = await project.stage() 121 | stage.c[0].should.be.equal(STAGES.ProjectCompleted) 122 | }) 123 | 124 | it("#10 should try to close project without necessary signatures and call the checker", async() => { 125 | let checker = await project.checker() 126 | checker[3].should.be.equal(false) 127 | await project.sign({from: STARTER}) 128 | await project.stopCollectSignatures() 129 | await project.tryToCompleteProject() 130 | let checkerInfo = await project.checker() 131 | checkerInfo[3].should.be.equal(true) 132 | let stage = await project.stage() 133 | stage.c[0].should.be.equal(STAGES.CheckerWork) 134 | }) 135 | 136 | it("#11 should be right stages", async() => { 137 | let stage1 = await project.stage.call() 138 | stage1.c[0].should.be.equal(STAGES.CollectingSignatures) 139 | await project.stopCollectSignatures() 140 | await project.tryToCompleteProject({from: STARTER}) 141 | let stage2 = await project.stage.call() 142 | stage2.c[0].should.be.equal(STAGES.CheckerWork) 143 | await project.checkerSign(true, {from: CHECKER}) 144 | let stage3 = await project.stage.call() 145 | stage3.c[0].should.be.equal(STAGES.TryToCompleteProjectStage) 146 | await project.tryToCompleteProject() 147 | let stage4 = await project.stage.call() 148 | stage4.c[0].should.be.equal(STAGES.ProjectCompleted) 149 | await project.tryToCloseProject() 150 | let stage5 = await project.stage.call() 151 | stage5.c[0].should.be.equal(STAGES.SuccessfullyClosed) 152 | }) 153 | 154 | it("#12 should success to complete project and distribute tokens", async() => { 155 | const FIRST_WORKER_AMOUNT = 40 156 | const SECOND_WORKER_AMOUNT = 60 157 | let expectedBalance1 = Math.floor(FIRST_WORKER_AMOUNT * RATIO) 158 | let expectedBalance2 = Math.floor(SECOND_WORKER_AMOUNT * RATIO) 159 | await fundToken.transfer(project.address, 100) 160 | await project.changeWorkerBalance(WORKERS[0], FIRST_WORKER_AMOUNT) 161 | await project.changeWorkerBalance(WORKERS[1], SECOND_WORKER_AMOUNT) 162 | await project.sign({from: STARTER}) 163 | await project.sign({from: MANAGER}) 164 | await project.stopCollectSignatures() 165 | await project.tryToCompleteProject({from: STARTER}) 166 | await project.tryToCloseProject({from: STARTER}) 167 | let stage = await project.stage.call() 168 | stage.c[0].should.be.equal(STAGES.SuccessfullyClosed) 169 | let expectedRootsBalance = await project.amountForRoots.call() 170 | await project.sendTokensToWorkers(0, WORKERS.length, {from: STARTER}) 171 | let workerBalance1 = await fundToken.balanceOf(WORKERS[0]) 172 | let workerBalance2 = await fundToken.balanceOf(WORKERS[1]) 173 | let rootsBalance = await fundToken.balanceOf(EXCHANGER) 174 | let projectBalance = await fundToken.balanceOf(project.address) 175 | workerBalance1.toNumber().should.be.equal(expectedBalance1) 176 | workerBalance2.toNumber().should.be.equal(expectedBalance2) 177 | rootsBalance.toNumber().should.be.equal(expectedRootsBalance.toNumber()) 178 | projectBalance.toNumber().should.be.equal(0) 179 | }) 180 | 181 | it("#13 should unsuccessful to complete project and distribute tokens", async() => { 182 | const AMOUNT = 10000 183 | let starterBalance = await fundToken.balanceOf(STARTER) 184 | await fundToken.transfer(project.address, starterBalance.toNumber(), {from: STARTER}) 185 | let projectBalance = await fundToken.balanceOf(project.address) 186 | projectBalance.toNumber().should.be.equal(AMOUNT) 187 | await project.sign({from: MANAGER}) 188 | await project.stopCollectSignatures() 189 | await project.tryToCompleteProject({from: STARTER}) 190 | await project.checkerSign(false, {from: CHECKER}) 191 | await project.tryToCompleteProject({from: CHECKER}) 192 | await project.tryToCloseProject({from: CHECKER}) 193 | let stage = await project.stage.call() 194 | stage.c[0].should.be.equal(STAGES.UnsuccessfullyClosed) 195 | await project.sendTokensBack({from: CHECKER}) 196 | starterBalance = await fundToken.balanceOf(STARTER) 197 | projectBalance = await fundToken.balanceOf(project.address) 198 | starterBalance.toNumber().should.be.equal(AMOUNT) 199 | projectBalance.toNumber().should.be.equal(0) 200 | }) 201 | 202 | }); 203 | -------------------------------------------------------------------------------- /test/reservation/PricingStrategyTest.js: -------------------------------------------------------------------------------- 1 | //RR tokens used during October 2017 presale 2 | 3 | let BigNumber = require('bignumber.js'); 4 | 5 | let PricingStrategy = artifacts.require("reservation/PricingStrategy.sol") 6 | 7 | contract('PricingStrategy', () => { 8 | const RATE1 = 11000 9 | const RATE2 = 12000 10 | const MINIMUM_WEI_AMOUNT = new BigNumber(web3.toWei(20, 'ether')) 11 | 12 | let deployParams = (newRateTime) => [ 13 | newRateTime, 14 | RATE1, 15 | RATE2, 16 | MINIMUM_WEI_AMOUNT, 17 | ] 18 | 19 | it("should return 0 if amount < MINIMUM_WEI_AMOUNT", async () => { 20 | let now = web3.eth.getBlock(web3.eth.blockNumber).timestamp 21 | let instance = await PricingStrategy.new.apply(this, deployParams(now + 10000)) 22 | let amount = MINIMUM_WEI_AMOUNT.sub(1) 23 | let result = await instance.calculateTokenAmount(amount) 24 | assert(result.equals(0)) 25 | }) 26 | 27 | it("should return tokens by RATE1 if now < NEW_RATE_TIME", async () => { 28 | let now = web3.eth.getBlock(web3.eth.blockNumber).timestamp 29 | let instance = await PricingStrategy.new.apply(this, deployParams(now + 10000)) 30 | let amount = MINIMUM_WEI_AMOUNT 31 | let result = await instance.calculateTokenAmount(amount) 32 | assert(result.equals(amount.mul(RATE1))) 33 | }) 34 | 35 | it("should return tokens by RATE2 if now >= NEW_RATE_TIME", async () => { 36 | let now = web3.eth.getBlock(web3.eth.blockNumber).timestamp 37 | let newRateTime = now + 10000 38 | let delta = newRateTime - now + 100 39 | web3.currentProvider.send({ 40 | jsonrpc: '2.0', 41 | method: 'evm_increaseTime', 42 | params: [delta], 43 | id: new Date().getTime() 44 | }) 45 | 46 | let instance = await PricingStrategy.new.apply(this, deployParams(newRateTime)) 47 | let amount = MINIMUM_WEI_AMOUNT 48 | let result = await instance.calculateTokenAmount(amount) 49 | assert(result.equals(amount.mul(RATE2))) 50 | }) 51 | 52 | }) 53 | -------------------------------------------------------------------------------- /test/reservation/ReservationTest.js: -------------------------------------------------------------------------------- 1 | let BigNumber = require('bignumber.js'); 2 | let chai = require('chai'); 3 | chai.use(require("chai-as-promised")) 4 | chai.should() 5 | 6 | let Reservation = artifacts.require("reservation/Reservation.sol") 7 | let PricingStrategy = artifacts.require("reservation/PricingStrategy.sol") 8 | let Token = artifacts.require("reservation/IouRootsReservationToken.sol") 9 | 10 | contract('Reservation', (accounts) => { 11 | const NEW_RATE_TIME = 1 12 | const RATE1 = 11000 13 | const RATE2 = 12000 14 | const MINIMUM_WEI_AMOUNT = new BigNumber(web3.toWei(1, 'ether')) 15 | const HARD_CAP = new BigNumber(web3.toWei(5, 'ether')).mul(RATE2) 16 | const MINIMUM_FUNDING_GOAL = 100 17 | 18 | const WALLET = accounts[0] 19 | const OWNER = accounts[1] 20 | const INVESTOR = accounts[2] 21 | 22 | 23 | async function getContracts(relativeStart, relativeEnd) { 24 | let token = await Token.new('PRESALE ROOTS IOU', 'IOR', 18, {from : OWNER}) 25 | let now = web3.eth.getBlock(web3.eth.blockNumber).timestamp 26 | 27 | let pricingStrategy = await PricingStrategy.new( 28 | NEW_RATE_TIME, 29 | RATE1, 30 | RATE2, 31 | MINIMUM_WEI_AMOUNT, 32 | ) 33 | 34 | let reservation = await Reservation.new( 35 | token.address, 36 | pricingStrategy.address, 37 | WALLET, 38 | now + relativeStart, 39 | now + relativeEnd, 40 | HARD_CAP, 41 | MINIMUM_FUNDING_GOAL, 42 | {from : OWNER} 43 | ) 44 | 45 | await token.transferOwnership(reservation.address, {from : OWNER}) 46 | 47 | return {reservation, pricingStrategy, token}; 48 | } 49 | 50 | function getWalletBalance(){ 51 | return web3.eth.getBalance(WALLET); 52 | } 53 | 54 | it("should change endsAt with setEndsAt", async () => { 55 | let reservation = (await getContracts(10, 100)).reservation 56 | let endsAt1 = await reservation.endsAt() 57 | await reservation.setEndsAt(endsAt1.plus(5), {from: OWNER}) 58 | let endsAt2 = await reservation.endsAt() 59 | assert(endsAt2.equals(endsAt1.plus(5))) 60 | }) 61 | 62 | it("should allow investors to invest in Funding state", async () => { 63 | let contracts = await getContracts(-10, 100) 64 | let startBalance = getWalletBalance() 65 | await contracts.reservation.sendTransaction({from: INVESTOR, value: MINIMUM_WEI_AMOUNT}) 66 | let tokenBalance = await contracts.token.balanceOf(INVESTOR) 67 | let calculatedTokens = await contracts.pricingStrategy.calculateTokenAmount(MINIMUM_WEI_AMOUNT) 68 | assert(tokenBalance.equals(calculatedTokens)) 69 | assert(getWalletBalance().minus(startBalance).equals(MINIMUM_WEI_AMOUNT)) 70 | }) 71 | 72 | it("should allow earlyParticipantWhitelist to invest in PreFunding state", async () => { 73 | let contracts = await getContracts(10, 100) 74 | let startBalance = getWalletBalance() 75 | await contracts.reservation.setEarlyParicipantWhitelist(INVESTOR, true, {from : OWNER}) 76 | await contracts.reservation.sendTransaction({from: INVESTOR, value: MINIMUM_WEI_AMOUNT}) 77 | let tokenBalance = await contracts.token.balanceOf(INVESTOR) 78 | let calculatedTokens = await contracts.pricingStrategy.calculateTokenAmount(MINIMUM_WEI_AMOUNT) 79 | assert(tokenBalance.equals(calculatedTokens)) 80 | assert(getWalletBalance().minus(startBalance).equals(MINIMUM_WEI_AMOUNT)) 81 | }) 82 | 83 | it("should not allow to buy more tokens than hardcap", async () => { 84 | let contracts = await getContracts(-10, 100) 85 | await contracts.reservation.sendTransaction({from: INVESTOR, value: HARD_CAP.div(RATE2)}) 86 | let promise = contracts.reservation.sendTransaction({from: INVESTOR, value: MINIMUM_WEI_AMOUNT}) 87 | promise.should.be.rejected 88 | }) 89 | 90 | }) -------------------------------------------------------------------------------- /truffle.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | networks: { 3 | development: { 4 | host: "localhost", 5 | port: 8545, 6 | network_id: "*" // Match any network id 7 | }, 8 | live: { 9 | host: "localhost", 10 | port: 8545, 11 | network_id: 1, 12 | gasPrice: 6000000000, 13 | from: "0x54AD2933A06ac669642441F84048Ac49fa8f9498" 14 | } 15 | } 16 | }; 17 | --------------------------------------------------------------------------------