├── .gitignore ├── .gitmodules ├── README.md ├── build └── contracts │ ├── DSAuth.json │ ├── DSAuthEvents.json │ ├── DSAuthority.json │ ├── DSExec.json │ ├── DSGuard.json │ ├── DSGuardEvents.json │ ├── DSGuardFactory.json │ ├── DSMath.json │ ├── DSMultiVault.json │ ├── DSNote.json │ ├── DSRoles.json │ ├── DSStop.json │ ├── DSThing.json │ ├── DSToken.json │ ├── DSTokenBase.json │ ├── DSVault.json │ ├── ERC20.json │ ├── ERC20Events.json │ ├── Migrations.json │ ├── VideoPublisher.json │ ├── ViewTokenMintage.json │ └── VotingPowerDelegator.json ├── contracts ├── Migrations.sol ├── VideoPublisher.sol └── VotingPowerDelegator.sol ├── helpers └── expectRevert.js ├── migrations ├── 1_deploy_migration.js ├── 2_deploy_erc20_token.js ├── 3_deploy_video_publisher.js └── 4_deploy_voting_power_delegator.js ├── test ├── Deployment.js ├── VideoPublisher.js └── VotingPowerDelegator.js └── truffle.js /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Viewly/platform-contracts/9605f27de048575b370428cf998b149e9d7d6988/.gitignore -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "contracts/dappsys"] 2 | path = contracts/dappsys 3 | url = git://github.com/dapphub/dappsys-monolithic 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://i.imgur.com/ekvJd60.png) 2 | 3 | # Platform Contracts 4 | A collection of Ethereum smart contracts to be used on the Viewly platform. 5 | 6 | ## VideoPublisher 7 | VideoPublisher acts as a gatekeeper to making videos public on Viewly. 8 | Users need to pay a small fee in VIEW Tokens to have their videos published. 9 | The fee can be changed at any time by changing `VideoPublisher.price`, however the fee change does 10 | not impact already published videos. 11 | 12 | **Published videos receive the following perks:** 13 | - Backup, storage and retreival of original video files on the IPFS network 14 | - Future re-transcoding for higher visual fidelity when new encoders become available (VP9, AV1) 15 | - Unlimited streaming from Viewly's CDN 16 | - Public Listing on Viewly (Alpha) 17 | 18 | ## NameRegistrar 19 | NameRegistrar is the contract for registering *(brand)* names on Viewly. The brand names proxy *(point to)* an arbitrary channel on Viewly, as set by the *transient owner*. 20 | 21 | eg: 22 | ``` 23 | view.ly/ 24 | view.ly/apple 25 | view.ly/pewdiepie 26 | ``` 27 | 28 | #### Transient Ownership 29 | In an effort to prevent *[name-squatting](https://en.wikipedia.org/wiki/Cybersquatting)*, the names on Viewly cannot be permanently owned. Rather, names have transient owners, where a **user who stakes the most tokens behind a name, has control over said name**. If another user stakes more tokens than the current transient owner, he/she will become a new transient owner after the *challenge period*. 30 | 31 | Users can withdraw their stake from a name at any-time, and can withdraw all of the staked tokens after a *withdraw period* is over. 32 | 33 | The *withdraw period* has to be longer than the *challenge period*, such that the users cannot hijack the names by repeated stake/unstake behavior. Further, the *challenge period* only resets when the staking action has potential transient ownership consequences. 34 | 35 | **Exhibit A** 36 | 37 | 1.) A name-squatter or an impostor stakes 10 VIEW behind `view.ly/pewdiepie`. 38 | 2.) The real *pewdiepie* joins Viewly. His brand name is worth more to him, so he stakes 1,000 VIEW behind `view.ly/pewdiepie`. During the challenge period, the impostor can engage in a bidding war. However the brand is more valuable to the legitimate brand owner, and as such, he is more likely to stake more. 39 | 40 | 3.) After the challenge period, the highest stakeholder (assuming *pewdiepie*) wins the control of the name, and sets `view.ly/pewdiepie` to point to `view.ly/c/`. 41 | 42 | **Exhibit B** 43 | 44 | Sometimes names have long term interests from multiple users, or groups of users. Sometimes the interests of said users/groups shift with passing of time. An example of such name would be `bitcoin` or `view.ly/bitcoin`. In the traditional domain name registration system, an early stakeholder (initial buyer of the domain) could acquire the name for cheap, and remain in control despite the value and interest in such name increasing in orders of magnitude. 45 | 46 | The flexibility of the *Transient Ownership* system allows for the ownership (control) over a name to change over time, based on free market forces. No capital is destroyed in the process, since tokens are merely locked up (not spent or destroyed), and can be withdrawn at any time in full. 47 | 48 | **Edge Case Limitations** 49 | 50 | a.) A sufficiently wealthy user stakes a large amount of tokens behind a name X. Assuming a condition where user dies, and/or if his keys are permanently lost, the name might remain locked forever, if the amount of tokens staked surpasses name's practical utility value. Adding an *expiry* or *TTL* to active stakes would remedy this inefficiency, at the expense of some inconvenience to all users. 51 | 52 | b.) A malicious and sufficiently wealthy user could acquire control of valuable brand names, and demand a ransom or a "fee" for unstaking, and releasing control to the brand owner, assuming that the ransom is sufficient to offset the negative effects of such behavior on the value of the locked stake. If this edge case materializes as a systemic problem, this contract could be improved by adding *identity oracles* and offsetting the amplitude of locked stake on the transient ownership. 53 | 54 | 55 | 56 | ## VotingStakeDelegator 57 | 58 | VotingStakeDelegator allows VIEW Token holders to _delegate_ the voting power belonging to their tokens to another Ethereum account, while keeping the tokens in their wallet. This is useful for two purposes: 59 | 60 | a.) **Security**. Allowing users to delegate their voting power to a convenient hot wallet - such as Metamask running in the browser - while keeping the tokens safe in cold storage. 61 | 62 | b.) **Liquid Democracy**. Stakeholders whom chose to abstain from participation in governance or distribution game voting may delegate their voting power to others, and enable a form of _liquid democracy_. Ideally, individuals posessing good intent, skill and effort would be the beneficiaries of the delegation. 63 | 64 | 65 | # Governance 66 | All contracts in this repository have an option of setting an authority, such that the authority would have the ability of changing *some* contract parameters. 67 | 68 | Once an appropriate governance model is found, the ownership of the contracts owners should be revoked, and the governance contract should become the new authority. 69 | 70 | This would enable the community and/or stakeholders to propose parameter changes and apply/reject those changes based on some - currently undefined - governance process. 71 | 72 | ## Mainnet contracts 73 | - [ViewToken](https://etherscan.io/address/0xf03f8d65bafa598611c3495124093c56e8f638f0) 74 | - [VideoPublisher](https://etherscan.io/address/0x9048A059c4beF8775ecF6E24197Fd987B387edc1) _(deprecated)_ 75 | - [VideoPublisher 2.0](https://etherscan.io/address/0x54df6e2D8f0E9a015Bf804b64ed8e9BAd6ccbaca) 76 | - [VotingStakeDelegator](https://etherscan.io/address/0x7fC7F71da6d2d9deFF5100C8F3D8e54C97697Ad2) 77 | -------------------------------------------------------------------------------- /build/contracts/DSNote.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "DSNote", 3 | "abi": [ 4 | { 5 | "anonymous": true, 6 | "inputs": [ 7 | { 8 | "indexed": true, 9 | "name": "sig", 10 | "type": "bytes4" 11 | }, 12 | { 13 | "indexed": true, 14 | "name": "guy", 15 | "type": "address" 16 | }, 17 | { 18 | "indexed": true, 19 | "name": "foo", 20 | "type": "bytes32" 21 | }, 22 | { 23 | "indexed": true, 24 | "name": "bar", 25 | "type": "bytes32" 26 | }, 27 | { 28 | "indexed": false, 29 | "name": "wad", 30 | "type": "uint256" 31 | }, 32 | { 33 | "indexed": false, 34 | "name": "fax", 35 | "type": "bytes" 36 | } 37 | ], 38 | "name": "LogNote", 39 | "type": "event" 40 | } 41 | ], 42 | "bytecode": "0x6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00a165627a7a7230582098cafb17d4a446b169fc3481616b51542a8dbb99774b48f5d1caa97f44e785700029", 43 | "deployedBytecode": "0x6080604052600080fd00a165627a7a7230582098cafb17d4a446b169fc3481616b51542a8dbb99774b48f5d1caa97f44e785700029", 44 | "sourceMap": "735:497:6:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;735:497:6;;;;;;;", 45 | "deployedSourceMap": "735:497:6:-;;;;;", 46 | "source": "/// note.sol -- the `note' modifier, for logging calls as events\n\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\npragma solidity ^0.4.23;\n\ncontract DSNote {\n event LogNote(\n bytes4 indexed sig,\n address indexed guy,\n bytes32 indexed foo,\n bytes32 indexed bar,\n uint wad,\n bytes fax\n ) anonymous;\n\n modifier note {\n bytes32 foo;\n bytes32 bar;\n\n assembly {\n foo := calldataload(4)\n bar := calldataload(36)\n }\n\n emit LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data);\n\n _;\n }\n}\n", 47 | "sourcePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/note.sol", 48 | "ast": { 49 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/note.sol", 50 | "exportedSymbols": { 51 | "DSNote": [ 52 | 1031 53 | ] 54 | }, 55 | "id": 1032, 56 | "nodeType": "SourceUnit", 57 | "nodes": [ 58 | { 59 | "id": 992, 60 | "literals": [ 61 | "solidity", 62 | "^", 63 | "0.4", 64 | ".23" 65 | ], 66 | "nodeType": "PragmaDirective", 67 | "src": "709:24:6" 68 | }, 69 | { 70 | "baseContracts": [], 71 | "contractDependencies": [], 72 | "contractKind": "contract", 73 | "documentation": null, 74 | "fullyImplemented": true, 75 | "id": 1031, 76 | "linearizedBaseContracts": [ 77 | 1031 78 | ], 79 | "name": "DSNote", 80 | "nodeType": "ContractDefinition", 81 | "nodes": [ 82 | { 83 | "anonymous": true, 84 | "documentation": null, 85 | "id": 1006, 86 | "name": "LogNote", 87 | "nodeType": "EventDefinition", 88 | "parameters": { 89 | "id": 1005, 90 | "nodeType": "ParameterList", 91 | "parameters": [ 92 | { 93 | "constant": false, 94 | "id": 994, 95 | "indexed": true, 96 | "name": "sig", 97 | "nodeType": "VariableDeclaration", 98 | "scope": 1006, 99 | "src": "780:21:6", 100 | "stateVariable": false, 101 | "storageLocation": "default", 102 | "typeDescriptions": { 103 | "typeIdentifier": "t_bytes4", 104 | "typeString": "bytes4" 105 | }, 106 | "typeName": { 107 | "id": 993, 108 | "name": "bytes4", 109 | "nodeType": "ElementaryTypeName", 110 | "src": "780:6:6", 111 | "typeDescriptions": { 112 | "typeIdentifier": "t_bytes4", 113 | "typeString": "bytes4" 114 | } 115 | }, 116 | "value": null, 117 | "visibility": "internal" 118 | }, 119 | { 120 | "constant": false, 121 | "id": 996, 122 | "indexed": true, 123 | "name": "guy", 124 | "nodeType": "VariableDeclaration", 125 | "scope": 1006, 126 | "src": "811:21:6", 127 | "stateVariable": false, 128 | "storageLocation": "default", 129 | "typeDescriptions": { 130 | "typeIdentifier": "t_address", 131 | "typeString": "address" 132 | }, 133 | "typeName": { 134 | "id": 995, 135 | "name": "address", 136 | "nodeType": "ElementaryTypeName", 137 | "src": "811:7:6", 138 | "typeDescriptions": { 139 | "typeIdentifier": "t_address", 140 | "typeString": "address" 141 | } 142 | }, 143 | "value": null, 144 | "visibility": "internal" 145 | }, 146 | { 147 | "constant": false, 148 | "id": 998, 149 | "indexed": true, 150 | "name": "foo", 151 | "nodeType": "VariableDeclaration", 152 | "scope": 1006, 153 | "src": "842:21:6", 154 | "stateVariable": false, 155 | "storageLocation": "default", 156 | "typeDescriptions": { 157 | "typeIdentifier": "t_bytes32", 158 | "typeString": "bytes32" 159 | }, 160 | "typeName": { 161 | "id": 997, 162 | "name": "bytes32", 163 | "nodeType": "ElementaryTypeName", 164 | "src": "842:7:6", 165 | "typeDescriptions": { 166 | "typeIdentifier": "t_bytes32", 167 | "typeString": "bytes32" 168 | } 169 | }, 170 | "value": null, 171 | "visibility": "internal" 172 | }, 173 | { 174 | "constant": false, 175 | "id": 1000, 176 | "indexed": true, 177 | "name": "bar", 178 | "nodeType": "VariableDeclaration", 179 | "scope": 1006, 180 | "src": "873:21:6", 181 | "stateVariable": false, 182 | "storageLocation": "default", 183 | "typeDescriptions": { 184 | "typeIdentifier": "t_bytes32", 185 | "typeString": "bytes32" 186 | }, 187 | "typeName": { 188 | "id": 999, 189 | "name": "bytes32", 190 | "nodeType": "ElementaryTypeName", 191 | "src": "873:7:6", 192 | "typeDescriptions": { 193 | "typeIdentifier": "t_bytes32", 194 | "typeString": "bytes32" 195 | } 196 | }, 197 | "value": null, 198 | "visibility": "internal" 199 | }, 200 | { 201 | "constant": false, 202 | "id": 1002, 203 | "indexed": false, 204 | "name": "wad", 205 | "nodeType": "VariableDeclaration", 206 | "scope": 1006, 207 | "src": "904:21:6", 208 | "stateVariable": false, 209 | "storageLocation": "default", 210 | "typeDescriptions": { 211 | "typeIdentifier": "t_uint256", 212 | "typeString": "uint256" 213 | }, 214 | "typeName": { 215 | "id": 1001, 216 | "name": "uint", 217 | "nodeType": "ElementaryTypeName", 218 | "src": "904:4:6", 219 | "typeDescriptions": { 220 | "typeIdentifier": "t_uint256", 221 | "typeString": "uint256" 222 | } 223 | }, 224 | "value": null, 225 | "visibility": "internal" 226 | }, 227 | { 228 | "constant": false, 229 | "id": 1004, 230 | "indexed": false, 231 | "name": "fax", 232 | "nodeType": "VariableDeclaration", 233 | "scope": 1006, 234 | "src": "935:21:6", 235 | "stateVariable": false, 236 | "storageLocation": "default", 237 | "typeDescriptions": { 238 | "typeIdentifier": "t_bytes_memory_ptr", 239 | "typeString": "bytes" 240 | }, 241 | "typeName": { 242 | "id": 1003, 243 | "name": "bytes", 244 | "nodeType": "ElementaryTypeName", 245 | "src": "935:5:6", 246 | "typeDescriptions": { 247 | "typeIdentifier": "t_bytes_storage_ptr", 248 | "typeString": "bytes" 249 | } 250 | }, 251 | "value": null, 252 | "visibility": "internal" 253 | } 254 | ], 255 | "src": "770:192:6" 256 | }, 257 | "src": "757:216:6" 258 | }, 259 | { 260 | "body": { 261 | "id": 1029, 262 | "nodeType": "Block", 263 | "src": "993:237:6", 264 | "statements": [ 265 | { 266 | "assignments": [], 267 | "declarations": [ 268 | { 269 | "constant": false, 270 | "id": 1009, 271 | "name": "foo", 272 | "nodeType": "VariableDeclaration", 273 | "scope": 1030, 274 | "src": "1003:11:6", 275 | "stateVariable": false, 276 | "storageLocation": "default", 277 | "typeDescriptions": { 278 | "typeIdentifier": "t_bytes32", 279 | "typeString": "bytes32" 280 | }, 281 | "typeName": { 282 | "id": 1008, 283 | "name": "bytes32", 284 | "nodeType": "ElementaryTypeName", 285 | "src": "1003:7:6", 286 | "typeDescriptions": { 287 | "typeIdentifier": "t_bytes32", 288 | "typeString": "bytes32" 289 | } 290 | }, 291 | "value": null, 292 | "visibility": "internal" 293 | } 294 | ], 295 | "id": 1010, 296 | "initialValue": null, 297 | "nodeType": "VariableDeclarationStatement", 298 | "src": "1003:11:6" 299 | }, 300 | { 301 | "assignments": [], 302 | "declarations": [ 303 | { 304 | "constant": false, 305 | "id": 1012, 306 | "name": "bar", 307 | "nodeType": "VariableDeclaration", 308 | "scope": 1030, 309 | "src": "1024:11:6", 310 | "stateVariable": false, 311 | "storageLocation": "default", 312 | "typeDescriptions": { 313 | "typeIdentifier": "t_bytes32", 314 | "typeString": "bytes32" 315 | }, 316 | "typeName": { 317 | "id": 1011, 318 | "name": "bytes32", 319 | "nodeType": "ElementaryTypeName", 320 | "src": "1024:7:6", 321 | "typeDescriptions": { 322 | "typeIdentifier": "t_bytes32", 323 | "typeString": "bytes32" 324 | } 325 | }, 326 | "value": null, 327 | "visibility": "internal" 328 | } 329 | ], 330 | "id": 1013, 331 | "initialValue": null, 332 | "nodeType": "VariableDeclarationStatement", 333 | "src": "1024:11:6" 334 | }, 335 | { 336 | "externalReferences": [ 337 | { 338 | "foo": { 339 | "declaration": 1009, 340 | "isOffset": false, 341 | "isSlot": false, 342 | "src": "1069:3:6", 343 | "valueSize": 1 344 | } 345 | }, 346 | { 347 | "bar": { 348 | "declaration": 1012, 349 | "isOffset": false, 350 | "isSlot": false, 351 | "src": "1104:3:6", 352 | "valueSize": 1 353 | } 354 | } 355 | ], 356 | "id": 1014, 357 | "nodeType": "InlineAssembly", 358 | "operations": "{\n foo := calldataload(4)\n bar := calldataload(36)\n}", 359 | "src": "1046:105:6" 360 | }, 361 | { 362 | "eventCall": { 363 | "argumentTypes": null, 364 | "arguments": [ 365 | { 366 | "argumentTypes": null, 367 | "expression": { 368 | "argumentTypes": null, 369 | "id": 1016, 370 | "name": "msg", 371 | "nodeType": "Identifier", 372 | "overloadedDeclarations": [], 373 | "referencedDeclaration": 1433, 374 | "src": "1160:3:6", 375 | "typeDescriptions": { 376 | "typeIdentifier": "t_magic_message", 377 | "typeString": "msg" 378 | } 379 | }, 380 | "id": 1017, 381 | "isConstant": false, 382 | "isLValue": false, 383 | "isPure": false, 384 | "lValueRequested": false, 385 | "memberName": "sig", 386 | "nodeType": "MemberAccess", 387 | "referencedDeclaration": null, 388 | "src": "1160:7:6", 389 | "typeDescriptions": { 390 | "typeIdentifier": "t_bytes4", 391 | "typeString": "bytes4" 392 | } 393 | }, 394 | { 395 | "argumentTypes": null, 396 | "expression": { 397 | "argumentTypes": null, 398 | "id": 1018, 399 | "name": "msg", 400 | "nodeType": "Identifier", 401 | "overloadedDeclarations": [], 402 | "referencedDeclaration": 1433, 403 | "src": "1169:3:6", 404 | "typeDescriptions": { 405 | "typeIdentifier": "t_magic_message", 406 | "typeString": "msg" 407 | } 408 | }, 409 | "id": 1019, 410 | "isConstant": false, 411 | "isLValue": false, 412 | "isPure": false, 413 | "lValueRequested": false, 414 | "memberName": "sender", 415 | "nodeType": "MemberAccess", 416 | "referencedDeclaration": null, 417 | "src": "1169:10:6", 418 | "typeDescriptions": { 419 | "typeIdentifier": "t_address", 420 | "typeString": "address" 421 | } 422 | }, 423 | { 424 | "argumentTypes": null, 425 | "id": 1020, 426 | "name": "foo", 427 | "nodeType": "Identifier", 428 | "overloadedDeclarations": [], 429 | "referencedDeclaration": 1009, 430 | "src": "1181:3:6", 431 | "typeDescriptions": { 432 | "typeIdentifier": "t_bytes32", 433 | "typeString": "bytes32" 434 | } 435 | }, 436 | { 437 | "argumentTypes": null, 438 | "id": 1021, 439 | "name": "bar", 440 | "nodeType": "Identifier", 441 | "overloadedDeclarations": [], 442 | "referencedDeclaration": 1012, 443 | "src": "1186:3:6", 444 | "typeDescriptions": { 445 | "typeIdentifier": "t_bytes32", 446 | "typeString": "bytes32" 447 | } 448 | }, 449 | { 450 | "argumentTypes": null, 451 | "expression": { 452 | "argumentTypes": null, 453 | "id": 1022, 454 | "name": "msg", 455 | "nodeType": "Identifier", 456 | "overloadedDeclarations": [], 457 | "referencedDeclaration": 1433, 458 | "src": "1191:3:6", 459 | "typeDescriptions": { 460 | "typeIdentifier": "t_magic_message", 461 | "typeString": "msg" 462 | } 463 | }, 464 | "id": 1023, 465 | "isConstant": false, 466 | "isLValue": false, 467 | "isPure": false, 468 | "lValueRequested": false, 469 | "memberName": "value", 470 | "nodeType": "MemberAccess", 471 | "referencedDeclaration": null, 472 | "src": "1191:9:6", 473 | "typeDescriptions": { 474 | "typeIdentifier": "t_uint256", 475 | "typeString": "uint256" 476 | } 477 | }, 478 | { 479 | "argumentTypes": null, 480 | "expression": { 481 | "argumentTypes": null, 482 | "id": 1024, 483 | "name": "msg", 484 | "nodeType": "Identifier", 485 | "overloadedDeclarations": [], 486 | "referencedDeclaration": 1433, 487 | "src": "1202:3:6", 488 | "typeDescriptions": { 489 | "typeIdentifier": "t_magic_message", 490 | "typeString": "msg" 491 | } 492 | }, 493 | "id": 1025, 494 | "isConstant": false, 495 | "isLValue": false, 496 | "isPure": false, 497 | "lValueRequested": false, 498 | "memberName": "data", 499 | "nodeType": "MemberAccess", 500 | "referencedDeclaration": null, 501 | "src": "1202:8:6", 502 | "typeDescriptions": { 503 | "typeIdentifier": "t_bytes_calldata_ptr", 504 | "typeString": "bytes calldata" 505 | } 506 | } 507 | ], 508 | "expression": { 509 | "argumentTypes": [ 510 | { 511 | "typeIdentifier": "t_bytes4", 512 | "typeString": "bytes4" 513 | }, 514 | { 515 | "typeIdentifier": "t_address", 516 | "typeString": "address" 517 | }, 518 | { 519 | "typeIdentifier": "t_bytes32", 520 | "typeString": "bytes32" 521 | }, 522 | { 523 | "typeIdentifier": "t_bytes32", 524 | "typeString": "bytes32" 525 | }, 526 | { 527 | "typeIdentifier": "t_uint256", 528 | "typeString": "uint256" 529 | }, 530 | { 531 | "typeIdentifier": "t_bytes_calldata_ptr", 532 | "typeString": "bytes calldata" 533 | } 534 | ], 535 | "id": 1015, 536 | "name": "LogNote", 537 | "nodeType": "Identifier", 538 | "overloadedDeclarations": [], 539 | "referencedDeclaration": 1006, 540 | "src": "1152:7:6", 541 | "typeDescriptions": { 542 | "typeIdentifier": "t_function_event_nonpayable$_t_bytes4_$_t_address_$_t_bytes32_$_t_bytes32_$_t_uint256_$_t_bytes_memory_ptr_$returns$__$", 543 | "typeString": "function (bytes4,address,bytes32,bytes32,uint256,bytes memory)" 544 | } 545 | }, 546 | "id": 1026, 547 | "isConstant": false, 548 | "isLValue": false, 549 | "isPure": false, 550 | "kind": "functionCall", 551 | "lValueRequested": false, 552 | "names": [], 553 | "nodeType": "FunctionCall", 554 | "src": "1152:59:6", 555 | "typeDescriptions": { 556 | "typeIdentifier": "t_tuple$__$", 557 | "typeString": "tuple()" 558 | } 559 | }, 560 | "id": 1027, 561 | "nodeType": "EmitStatement", 562 | "src": "1147:64:6" 563 | }, 564 | { 565 | "id": 1028, 566 | "nodeType": "PlaceholderStatement", 567 | "src": "1222:1:6" 568 | } 569 | ] 570 | }, 571 | "documentation": null, 572 | "id": 1030, 573 | "name": "note", 574 | "nodeType": "ModifierDefinition", 575 | "parameters": { 576 | "id": 1007, 577 | "nodeType": "ParameterList", 578 | "parameters": [], 579 | "src": "993:0:6" 580 | }, 581 | "src": "979:251:6", 582 | "visibility": "internal" 583 | } 584 | ], 585 | "scope": 1032, 586 | "src": "735:497:6" 587 | } 588 | ], 589 | "src": "709:524:6" 590 | }, 591 | "legacyAST": { 592 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/note.sol", 593 | "exportedSymbols": { 594 | "DSNote": [ 595 | 1031 596 | ] 597 | }, 598 | "id": 1032, 599 | "nodeType": "SourceUnit", 600 | "nodes": [ 601 | { 602 | "id": 992, 603 | "literals": [ 604 | "solidity", 605 | "^", 606 | "0.4", 607 | ".23" 608 | ], 609 | "nodeType": "PragmaDirective", 610 | "src": "709:24:6" 611 | }, 612 | { 613 | "baseContracts": [], 614 | "contractDependencies": [], 615 | "contractKind": "contract", 616 | "documentation": null, 617 | "fullyImplemented": true, 618 | "id": 1031, 619 | "linearizedBaseContracts": [ 620 | 1031 621 | ], 622 | "name": "DSNote", 623 | "nodeType": "ContractDefinition", 624 | "nodes": [ 625 | { 626 | "anonymous": true, 627 | "documentation": null, 628 | "id": 1006, 629 | "name": "LogNote", 630 | "nodeType": "EventDefinition", 631 | "parameters": { 632 | "id": 1005, 633 | "nodeType": "ParameterList", 634 | "parameters": [ 635 | { 636 | "constant": false, 637 | "id": 994, 638 | "indexed": true, 639 | "name": "sig", 640 | "nodeType": "VariableDeclaration", 641 | "scope": 1006, 642 | "src": "780:21:6", 643 | "stateVariable": false, 644 | "storageLocation": "default", 645 | "typeDescriptions": { 646 | "typeIdentifier": "t_bytes4", 647 | "typeString": "bytes4" 648 | }, 649 | "typeName": { 650 | "id": 993, 651 | "name": "bytes4", 652 | "nodeType": "ElementaryTypeName", 653 | "src": "780:6:6", 654 | "typeDescriptions": { 655 | "typeIdentifier": "t_bytes4", 656 | "typeString": "bytes4" 657 | } 658 | }, 659 | "value": null, 660 | "visibility": "internal" 661 | }, 662 | { 663 | "constant": false, 664 | "id": 996, 665 | "indexed": true, 666 | "name": "guy", 667 | "nodeType": "VariableDeclaration", 668 | "scope": 1006, 669 | "src": "811:21:6", 670 | "stateVariable": false, 671 | "storageLocation": "default", 672 | "typeDescriptions": { 673 | "typeIdentifier": "t_address", 674 | "typeString": "address" 675 | }, 676 | "typeName": { 677 | "id": 995, 678 | "name": "address", 679 | "nodeType": "ElementaryTypeName", 680 | "src": "811:7:6", 681 | "typeDescriptions": { 682 | "typeIdentifier": "t_address", 683 | "typeString": "address" 684 | } 685 | }, 686 | "value": null, 687 | "visibility": "internal" 688 | }, 689 | { 690 | "constant": false, 691 | "id": 998, 692 | "indexed": true, 693 | "name": "foo", 694 | "nodeType": "VariableDeclaration", 695 | "scope": 1006, 696 | "src": "842:21:6", 697 | "stateVariable": false, 698 | "storageLocation": "default", 699 | "typeDescriptions": { 700 | "typeIdentifier": "t_bytes32", 701 | "typeString": "bytes32" 702 | }, 703 | "typeName": { 704 | "id": 997, 705 | "name": "bytes32", 706 | "nodeType": "ElementaryTypeName", 707 | "src": "842:7:6", 708 | "typeDescriptions": { 709 | "typeIdentifier": "t_bytes32", 710 | "typeString": "bytes32" 711 | } 712 | }, 713 | "value": null, 714 | "visibility": "internal" 715 | }, 716 | { 717 | "constant": false, 718 | "id": 1000, 719 | "indexed": true, 720 | "name": "bar", 721 | "nodeType": "VariableDeclaration", 722 | "scope": 1006, 723 | "src": "873:21:6", 724 | "stateVariable": false, 725 | "storageLocation": "default", 726 | "typeDescriptions": { 727 | "typeIdentifier": "t_bytes32", 728 | "typeString": "bytes32" 729 | }, 730 | "typeName": { 731 | "id": 999, 732 | "name": "bytes32", 733 | "nodeType": "ElementaryTypeName", 734 | "src": "873:7:6", 735 | "typeDescriptions": { 736 | "typeIdentifier": "t_bytes32", 737 | "typeString": "bytes32" 738 | } 739 | }, 740 | "value": null, 741 | "visibility": "internal" 742 | }, 743 | { 744 | "constant": false, 745 | "id": 1002, 746 | "indexed": false, 747 | "name": "wad", 748 | "nodeType": "VariableDeclaration", 749 | "scope": 1006, 750 | "src": "904:21:6", 751 | "stateVariable": false, 752 | "storageLocation": "default", 753 | "typeDescriptions": { 754 | "typeIdentifier": "t_uint256", 755 | "typeString": "uint256" 756 | }, 757 | "typeName": { 758 | "id": 1001, 759 | "name": "uint", 760 | "nodeType": "ElementaryTypeName", 761 | "src": "904:4:6", 762 | "typeDescriptions": { 763 | "typeIdentifier": "t_uint256", 764 | "typeString": "uint256" 765 | } 766 | }, 767 | "value": null, 768 | "visibility": "internal" 769 | }, 770 | { 771 | "constant": false, 772 | "id": 1004, 773 | "indexed": false, 774 | "name": "fax", 775 | "nodeType": "VariableDeclaration", 776 | "scope": 1006, 777 | "src": "935:21:6", 778 | "stateVariable": false, 779 | "storageLocation": "default", 780 | "typeDescriptions": { 781 | "typeIdentifier": "t_bytes_memory_ptr", 782 | "typeString": "bytes" 783 | }, 784 | "typeName": { 785 | "id": 1003, 786 | "name": "bytes", 787 | "nodeType": "ElementaryTypeName", 788 | "src": "935:5:6", 789 | "typeDescriptions": { 790 | "typeIdentifier": "t_bytes_storage_ptr", 791 | "typeString": "bytes" 792 | } 793 | }, 794 | "value": null, 795 | "visibility": "internal" 796 | } 797 | ], 798 | "src": "770:192:6" 799 | }, 800 | "src": "757:216:6" 801 | }, 802 | { 803 | "body": { 804 | "id": 1029, 805 | "nodeType": "Block", 806 | "src": "993:237:6", 807 | "statements": [ 808 | { 809 | "assignments": [], 810 | "declarations": [ 811 | { 812 | "constant": false, 813 | "id": 1009, 814 | "name": "foo", 815 | "nodeType": "VariableDeclaration", 816 | "scope": 1030, 817 | "src": "1003:11:6", 818 | "stateVariable": false, 819 | "storageLocation": "default", 820 | "typeDescriptions": { 821 | "typeIdentifier": "t_bytes32", 822 | "typeString": "bytes32" 823 | }, 824 | "typeName": { 825 | "id": 1008, 826 | "name": "bytes32", 827 | "nodeType": "ElementaryTypeName", 828 | "src": "1003:7:6", 829 | "typeDescriptions": { 830 | "typeIdentifier": "t_bytes32", 831 | "typeString": "bytes32" 832 | } 833 | }, 834 | "value": null, 835 | "visibility": "internal" 836 | } 837 | ], 838 | "id": 1010, 839 | "initialValue": null, 840 | "nodeType": "VariableDeclarationStatement", 841 | "src": "1003:11:6" 842 | }, 843 | { 844 | "assignments": [], 845 | "declarations": [ 846 | { 847 | "constant": false, 848 | "id": 1012, 849 | "name": "bar", 850 | "nodeType": "VariableDeclaration", 851 | "scope": 1030, 852 | "src": "1024:11:6", 853 | "stateVariable": false, 854 | "storageLocation": "default", 855 | "typeDescriptions": { 856 | "typeIdentifier": "t_bytes32", 857 | "typeString": "bytes32" 858 | }, 859 | "typeName": { 860 | "id": 1011, 861 | "name": "bytes32", 862 | "nodeType": "ElementaryTypeName", 863 | "src": "1024:7:6", 864 | "typeDescriptions": { 865 | "typeIdentifier": "t_bytes32", 866 | "typeString": "bytes32" 867 | } 868 | }, 869 | "value": null, 870 | "visibility": "internal" 871 | } 872 | ], 873 | "id": 1013, 874 | "initialValue": null, 875 | "nodeType": "VariableDeclarationStatement", 876 | "src": "1024:11:6" 877 | }, 878 | { 879 | "externalReferences": [ 880 | { 881 | "foo": { 882 | "declaration": 1009, 883 | "isOffset": false, 884 | "isSlot": false, 885 | "src": "1069:3:6", 886 | "valueSize": 1 887 | } 888 | }, 889 | { 890 | "bar": { 891 | "declaration": 1012, 892 | "isOffset": false, 893 | "isSlot": false, 894 | "src": "1104:3:6", 895 | "valueSize": 1 896 | } 897 | } 898 | ], 899 | "id": 1014, 900 | "nodeType": "InlineAssembly", 901 | "operations": "{\n foo := calldataload(4)\n bar := calldataload(36)\n}", 902 | "src": "1046:105:6" 903 | }, 904 | { 905 | "eventCall": { 906 | "argumentTypes": null, 907 | "arguments": [ 908 | { 909 | "argumentTypes": null, 910 | "expression": { 911 | "argumentTypes": null, 912 | "id": 1016, 913 | "name": "msg", 914 | "nodeType": "Identifier", 915 | "overloadedDeclarations": [], 916 | "referencedDeclaration": 1433, 917 | "src": "1160:3:6", 918 | "typeDescriptions": { 919 | "typeIdentifier": "t_magic_message", 920 | "typeString": "msg" 921 | } 922 | }, 923 | "id": 1017, 924 | "isConstant": false, 925 | "isLValue": false, 926 | "isPure": false, 927 | "lValueRequested": false, 928 | "memberName": "sig", 929 | "nodeType": "MemberAccess", 930 | "referencedDeclaration": null, 931 | "src": "1160:7:6", 932 | "typeDescriptions": { 933 | "typeIdentifier": "t_bytes4", 934 | "typeString": "bytes4" 935 | } 936 | }, 937 | { 938 | "argumentTypes": null, 939 | "expression": { 940 | "argumentTypes": null, 941 | "id": 1018, 942 | "name": "msg", 943 | "nodeType": "Identifier", 944 | "overloadedDeclarations": [], 945 | "referencedDeclaration": 1433, 946 | "src": "1169:3:6", 947 | "typeDescriptions": { 948 | "typeIdentifier": "t_magic_message", 949 | "typeString": "msg" 950 | } 951 | }, 952 | "id": 1019, 953 | "isConstant": false, 954 | "isLValue": false, 955 | "isPure": false, 956 | "lValueRequested": false, 957 | "memberName": "sender", 958 | "nodeType": "MemberAccess", 959 | "referencedDeclaration": null, 960 | "src": "1169:10:6", 961 | "typeDescriptions": { 962 | "typeIdentifier": "t_address", 963 | "typeString": "address" 964 | } 965 | }, 966 | { 967 | "argumentTypes": null, 968 | "id": 1020, 969 | "name": "foo", 970 | "nodeType": "Identifier", 971 | "overloadedDeclarations": [], 972 | "referencedDeclaration": 1009, 973 | "src": "1181:3:6", 974 | "typeDescriptions": { 975 | "typeIdentifier": "t_bytes32", 976 | "typeString": "bytes32" 977 | } 978 | }, 979 | { 980 | "argumentTypes": null, 981 | "id": 1021, 982 | "name": "bar", 983 | "nodeType": "Identifier", 984 | "overloadedDeclarations": [], 985 | "referencedDeclaration": 1012, 986 | "src": "1186:3:6", 987 | "typeDescriptions": { 988 | "typeIdentifier": "t_bytes32", 989 | "typeString": "bytes32" 990 | } 991 | }, 992 | { 993 | "argumentTypes": null, 994 | "expression": { 995 | "argumentTypes": null, 996 | "id": 1022, 997 | "name": "msg", 998 | "nodeType": "Identifier", 999 | "overloadedDeclarations": [], 1000 | "referencedDeclaration": 1433, 1001 | "src": "1191:3:6", 1002 | "typeDescriptions": { 1003 | "typeIdentifier": "t_magic_message", 1004 | "typeString": "msg" 1005 | } 1006 | }, 1007 | "id": 1023, 1008 | "isConstant": false, 1009 | "isLValue": false, 1010 | "isPure": false, 1011 | "lValueRequested": false, 1012 | "memberName": "value", 1013 | "nodeType": "MemberAccess", 1014 | "referencedDeclaration": null, 1015 | "src": "1191:9:6", 1016 | "typeDescriptions": { 1017 | "typeIdentifier": "t_uint256", 1018 | "typeString": "uint256" 1019 | } 1020 | }, 1021 | { 1022 | "argumentTypes": null, 1023 | "expression": { 1024 | "argumentTypes": null, 1025 | "id": 1024, 1026 | "name": "msg", 1027 | "nodeType": "Identifier", 1028 | "overloadedDeclarations": [], 1029 | "referencedDeclaration": 1433, 1030 | "src": "1202:3:6", 1031 | "typeDescriptions": { 1032 | "typeIdentifier": "t_magic_message", 1033 | "typeString": "msg" 1034 | } 1035 | }, 1036 | "id": 1025, 1037 | "isConstant": false, 1038 | "isLValue": false, 1039 | "isPure": false, 1040 | "lValueRequested": false, 1041 | "memberName": "data", 1042 | "nodeType": "MemberAccess", 1043 | "referencedDeclaration": null, 1044 | "src": "1202:8:6", 1045 | "typeDescriptions": { 1046 | "typeIdentifier": "t_bytes_calldata_ptr", 1047 | "typeString": "bytes calldata" 1048 | } 1049 | } 1050 | ], 1051 | "expression": { 1052 | "argumentTypes": [ 1053 | { 1054 | "typeIdentifier": "t_bytes4", 1055 | "typeString": "bytes4" 1056 | }, 1057 | { 1058 | "typeIdentifier": "t_address", 1059 | "typeString": "address" 1060 | }, 1061 | { 1062 | "typeIdentifier": "t_bytes32", 1063 | "typeString": "bytes32" 1064 | }, 1065 | { 1066 | "typeIdentifier": "t_bytes32", 1067 | "typeString": "bytes32" 1068 | }, 1069 | { 1070 | "typeIdentifier": "t_uint256", 1071 | "typeString": "uint256" 1072 | }, 1073 | { 1074 | "typeIdentifier": "t_bytes_calldata_ptr", 1075 | "typeString": "bytes calldata" 1076 | } 1077 | ], 1078 | "id": 1015, 1079 | "name": "LogNote", 1080 | "nodeType": "Identifier", 1081 | "overloadedDeclarations": [], 1082 | "referencedDeclaration": 1006, 1083 | "src": "1152:7:6", 1084 | "typeDescriptions": { 1085 | "typeIdentifier": "t_function_event_nonpayable$_t_bytes4_$_t_address_$_t_bytes32_$_t_bytes32_$_t_uint256_$_t_bytes_memory_ptr_$returns$__$", 1086 | "typeString": "function (bytes4,address,bytes32,bytes32,uint256,bytes memory)" 1087 | } 1088 | }, 1089 | "id": 1026, 1090 | "isConstant": false, 1091 | "isLValue": false, 1092 | "isPure": false, 1093 | "kind": "functionCall", 1094 | "lValueRequested": false, 1095 | "names": [], 1096 | "nodeType": "FunctionCall", 1097 | "src": "1152:59:6", 1098 | "typeDescriptions": { 1099 | "typeIdentifier": "t_tuple$__$", 1100 | "typeString": "tuple()" 1101 | } 1102 | }, 1103 | "id": 1027, 1104 | "nodeType": "EmitStatement", 1105 | "src": "1147:64:6" 1106 | }, 1107 | { 1108 | "id": 1028, 1109 | "nodeType": "PlaceholderStatement", 1110 | "src": "1222:1:6" 1111 | } 1112 | ] 1113 | }, 1114 | "documentation": null, 1115 | "id": 1030, 1116 | "name": "note", 1117 | "nodeType": "ModifierDefinition", 1118 | "parameters": { 1119 | "id": 1007, 1120 | "nodeType": "ParameterList", 1121 | "parameters": [], 1122 | "src": "993:0:6" 1123 | }, 1124 | "src": "979:251:6", 1125 | "visibility": "internal" 1126 | } 1127 | ], 1128 | "scope": 1032, 1129 | "src": "735:497:6" 1130 | } 1131 | ], 1132 | "src": "709:524:6" 1133 | }, 1134 | "compiler": { 1135 | "name": "solc", 1136 | "version": "0.4.24+commit.e67f0147.Emscripten.clang" 1137 | }, 1138 | "networks": {}, 1139 | "schemaVersion": "2.0.1", 1140 | "updatedAt": "2018-07-15T16:38:14.728Z" 1141 | } -------------------------------------------------------------------------------- /build/contracts/DSStop.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "DSStop", 3 | "abi": [ 4 | { 5 | "constant": false, 6 | "inputs": [ 7 | { 8 | "name": "owner_", 9 | "type": "address" 10 | } 11 | ], 12 | "name": "setOwner", 13 | "outputs": [], 14 | "payable": false, 15 | "stateMutability": "nonpayable", 16 | "type": "function" 17 | }, 18 | { 19 | "constant": true, 20 | "inputs": [], 21 | "name": "stopped", 22 | "outputs": [ 23 | { 24 | "name": "", 25 | "type": "bool" 26 | } 27 | ], 28 | "payable": false, 29 | "stateMutability": "view", 30 | "type": "function" 31 | }, 32 | { 33 | "constant": false, 34 | "inputs": [ 35 | { 36 | "name": "authority_", 37 | "type": "address" 38 | } 39 | ], 40 | "name": "setAuthority", 41 | "outputs": [], 42 | "payable": false, 43 | "stateMutability": "nonpayable", 44 | "type": "function" 45 | }, 46 | { 47 | "constant": true, 48 | "inputs": [], 49 | "name": "owner", 50 | "outputs": [ 51 | { 52 | "name": "", 53 | "type": "address" 54 | } 55 | ], 56 | "payable": false, 57 | "stateMutability": "view", 58 | "type": "function" 59 | }, 60 | { 61 | "constant": true, 62 | "inputs": [], 63 | "name": "authority", 64 | "outputs": [ 65 | { 66 | "name": "", 67 | "type": "address" 68 | } 69 | ], 70 | "payable": false, 71 | "stateMutability": "view", 72 | "type": "function" 73 | }, 74 | { 75 | "anonymous": false, 76 | "inputs": [ 77 | { 78 | "indexed": true, 79 | "name": "authority", 80 | "type": "address" 81 | } 82 | ], 83 | "name": "LogSetAuthority", 84 | "type": "event" 85 | }, 86 | { 87 | "anonymous": false, 88 | "inputs": [ 89 | { 90 | "indexed": true, 91 | "name": "owner", 92 | "type": "address" 93 | } 94 | ], 95 | "name": "LogSetOwner", 96 | "type": "event" 97 | }, 98 | { 99 | "anonymous": true, 100 | "inputs": [ 101 | { 102 | "indexed": true, 103 | "name": "sig", 104 | "type": "bytes4" 105 | }, 106 | { 107 | "indexed": true, 108 | "name": "guy", 109 | "type": "address" 110 | }, 111 | { 112 | "indexed": true, 113 | "name": "foo", 114 | "type": "bytes32" 115 | }, 116 | { 117 | "indexed": true, 118 | "name": "bar", 119 | "type": "bytes32" 120 | }, 121 | { 122 | "indexed": false, 123 | "name": "wad", 124 | "type": "uint256" 125 | }, 126 | { 127 | "indexed": false, 128 | "name": "fax", 129 | "type": "bytes" 130 | } 131 | ], 132 | "name": "LogNote", 133 | "type": "event" 134 | }, 135 | { 136 | "constant": false, 137 | "inputs": [], 138 | "name": "stop", 139 | "outputs": [], 140 | "payable": false, 141 | "stateMutability": "nonpayable", 142 | "type": "function" 143 | }, 144 | { 145 | "constant": false, 146 | "inputs": [], 147 | "name": "start", 148 | "outputs": [], 149 | "payable": false, 150 | "stateMutability": "nonpayable", 151 | "type": "function" 152 | } 153 | ], 154 | "bytecode": "0x608060405233600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a26108e1806100976000396000f300608060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307da68f51461008857806313af40351461009f57806375f12b21146100e25780637a9e5e4b146101115780638da5cb5b14610154578063be9a6555146101ab578063bf7e214f146101c2575b600080fd5b34801561009457600080fd5b5061009d610219565b005b3480156100ab57600080fd5b506100e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061031b565b005b3480156100ee57600080fd5b506100f76103fd565b604051808215151515815260200191505060405180910390f35b34801561011d57600080fd5b50610152600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610410565b005b34801561016057600080fd5b506101696104f0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101b757600080fd5b506101c0610516565b005b3480156101ce57600080fd5b506101d7610619565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610247336000357fffffffff000000000000000000000000000000000000000000000000000000001661063e565b151561025257600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a460018060146101000a81548160ff0219169083151502179055505050565b610349336000357fffffffff000000000000000000000000000000000000000000000000000000001661063e565b151561035457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b600160149054906101000a900460ff1681565b61043e336000357fffffffff000000000000000000000000000000000000000000000000000000001661063e565b151561044957600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610544336000357fffffffff000000000000000000000000000000000000000000000000000000001661063e565b151561054f57600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600160146101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561067d57600190506108af565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156106dc57600190506108af565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561073b57600090506108af565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15801561087157600080fd5b505af1158015610885573d6000803e3d6000fd5b505050506040513d602081101561089b57600080fd5b810190808051906020019092919050505090505b929150505600a165627a7a7230582062f9e2b8c7176c66a5071a2f246aedd8bb0eadc4fbd52803c864baeeb5b5aca00029", 155 | "deployedBytecode": "0x608060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307da68f51461008857806313af40351461009f57806375f12b21146100e25780637a9e5e4b146101115780638da5cb5b14610154578063be9a6555146101ab578063bf7e214f146101c2575b600080fd5b34801561009457600080fd5b5061009d610219565b005b3480156100ab57600080fd5b506100e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061031b565b005b3480156100ee57600080fd5b506100f76103fd565b604051808215151515815260200191505060405180910390f35b34801561011d57600080fd5b50610152600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610410565b005b34801561016057600080fd5b506101696104f0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101b757600080fd5b506101c0610516565b005b3480156101ce57600080fd5b506101d7610619565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610247336000357fffffffff000000000000000000000000000000000000000000000000000000001661063e565b151561025257600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a460018060146101000a81548160ff0219169083151502179055505050565b610349336000357fffffffff000000000000000000000000000000000000000000000000000000001661063e565b151561035457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b600160149054906101000a900460ff1681565b61043e336000357fffffffff000000000000000000000000000000000000000000000000000000001661063e565b151561044957600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610544336000357fffffffff000000000000000000000000000000000000000000000000000000001661063e565b151561054f57600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600160146101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561067d57600190506108af565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156106dc57600190506108af565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561073b57600090506108af565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15801561087157600080fd5b505af1158015610885573d6000803e3d6000fd5b505050506040513d602081101561089b57600080fd5b810190808051906020019092919050505090505b929150505600a165627a7a7230582062f9e2b8c7176c66a5071a2f246aedd8bb0eadc4fbd52803c864baeeb5b5aca00029", 156 | "sourceMap": "805:274:7:-;;;1075:10:2;1067:5;;:18;;;;;;;;;;;;;;;;;;1112:10;1100:23;;;;;;;;;;;;805:274:7;;;;;;", 157 | "deployedSourceMap": "805:274:7:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;941:64;;8:9:-1;5:2;;;30:1;27;20:12;5:2;941:64:7;;;;;;1136:130:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1136:130:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;846:19:7;;8:9:-1;5:2;;;30:1;27;20:12;5:2;846:19:7;;;;;;;;;;;;;;;;;;;;;;;;;;;1272:158:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1272:158:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;1003:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1003:26:2;;;;;;;;;;;;;;;;;;;;;;;;;;;1010:66:7;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1010:66:7;;;;;;967:30:2;;8:9:-1;5:2;;;30:1;27;20:12;5:2;967:30:2;;;;;;;;;;;;;;;;;;;;;;;;;;;941:64:7;1468:33:2;1481:10;1493:7;;;;1468:12;:33::i;:::-;1460:42;;;;;;;;1003:11:6;1024;1089:1;1076:15;1069:22;;1124:2;1111:16;1104:23;;1186:3;1152:59;;;1181:3;1152:59;;;1169:10;1152:59;;1160:7;;;;1152:59;;;1191:9;1202:8;;1152:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;994:4:7;984:7;;:14;;;;;;;;;;;;;;;;;;1512:1:2;;941:64:7:o;1136:130:2:-;1468:33;1481:10;1493:7;;;;1468:12;:33::i;:::-;1460:42;;;;;;;;1220:6;1212:5;;:14;;;;;;;;;;;;;;;;;;1253:5;;;;;;;;;;;1241:18;;;;;;;;;;;;1136:130;:::o;846:19:7:-;;;;;;;;;;;;;:::o;1272:158:2:-;1468:33;1481:10;1493:7;;;;1468:12;:33::i;:::-;1460:42;;;;;;;;1372:10;1360:9;;:22;;;;;;;;;;;;;;;;;;1413:9;;;;;;;;;;;1397:26;;;;;;;;;;;;1272:158;:::o;1003:26::-;;;;;;;;;;;;;:::o;1010:66:7:-;1468:33:2;1481:10;1493:7;;;;1468:12;:33::i;:::-;1460:42;;;;;;;;1003:11:6;1024;1089:1;1076:15;1069:22;;1124:2;1111:16;1104:23;;1186:3;1152:59;;;1181:3;1152:59;;;1169:10;1152:59;;1160:7;;;;1152:59;;;1191:9;1202:8;;1152:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1064:5:7;1054:7;;:15;;;;;;;;;;;;;;;;;;1512:1:2;;1010:66:7:o;967:30:2:-;;;;;;;;;;;;;:::o;1526:361::-;1596:4;1631;1616:20;;:3;:20;;;1612:269;;;1659:4;1652:11;;;;1612:269;1691:5;;;;;;;;;;;1684:12;;:3;:12;;;1680:201;;;1719:4;1712:11;;;;1680:201;1769:1;1744:27;;:9;;;;;;;;;;;:27;;;1740:141;;;1794:5;1787:12;;;;1740:141;1837:9;;;;;;;;;;;:17;;;1855:3;1860:4;1866:3;1837:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1837:33:2;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1837:33:2;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1837:33:2;;;;;;;;;;;;;;;;1830:40;;1526:361;;;;;:::o", 158 | "source": "/// stop.sol -- mixin for enable/disable functionality\n\n// Copyright (C) 2017 DappHub, LLC\n\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\npragma solidity ^0.4.23;\n\nimport \"./auth.sol\";\nimport \"./note.sol\";\n\ncontract DSStop is DSNote, DSAuth {\n\n bool public stopped;\n\n modifier stoppable {\n require(!stopped);\n _;\n }\n function stop() public auth note {\n stopped = true;\n }\n function start() public auth note {\n stopped = false;\n }\n\n}\n", 159 | "sourcePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/stop.sol", 160 | "ast": { 161 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/stop.sol", 162 | "exportedSymbols": { 163 | "DSStop": [ 164 | 1075 165 | ] 166 | }, 167 | "id": 1076, 168 | "nodeType": "SourceUnit", 169 | "nodes": [ 170 | { 171 | "id": 1033, 172 | "literals": [ 173 | "solidity", 174 | "^", 175 | "0.4", 176 | ".23" 177 | ], 178 | "nodeType": "PragmaDirective", 179 | "src": "736:24:7" 180 | }, 181 | { 182 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/auth.sol", 183 | "file": "./auth.sol", 184 | "id": 1034, 185 | "nodeType": "ImportDirective", 186 | "scope": 1076, 187 | "sourceUnit": 434, 188 | "src": "762:20:7", 189 | "symbolAliases": [], 190 | "unitAlias": "" 191 | }, 192 | { 193 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/note.sol", 194 | "file": "./note.sol", 195 | "id": 1035, 196 | "nodeType": "ImportDirective", 197 | "scope": 1076, 198 | "sourceUnit": 1032, 199 | "src": "783:20:7", 200 | "symbolAliases": [], 201 | "unitAlias": "" 202 | }, 203 | { 204 | "baseContracts": [ 205 | { 206 | "arguments": null, 207 | "baseName": { 208 | "contractScope": null, 209 | "id": 1036, 210 | "name": "DSNote", 211 | "nodeType": "UserDefinedTypeName", 212 | "referencedDeclaration": 1031, 213 | "src": "824:6:7", 214 | "typeDescriptions": { 215 | "typeIdentifier": "t_contract$_DSNote_$1031", 216 | "typeString": "contract DSNote" 217 | } 218 | }, 219 | "id": 1037, 220 | "nodeType": "InheritanceSpecifier", 221 | "src": "824:6:7" 222 | }, 223 | { 224 | "arguments": null, 225 | "baseName": { 226 | "contractScope": null, 227 | "id": 1038, 228 | "name": "DSAuth", 229 | "nodeType": "UserDefinedTypeName", 230 | "referencedDeclaration": 433, 231 | "src": "832:6:7", 232 | "typeDescriptions": { 233 | "typeIdentifier": "t_contract$_DSAuth_$433", 234 | "typeString": "contract DSAuth" 235 | } 236 | }, 237 | "id": 1039, 238 | "nodeType": "InheritanceSpecifier", 239 | "src": "832:6:7" 240 | } 241 | ], 242 | "contractDependencies": [ 243 | 324, 244 | 433, 245 | 1031 246 | ], 247 | "contractKind": "contract", 248 | "documentation": null, 249 | "fullyImplemented": true, 250 | "id": 1075, 251 | "linearizedBaseContracts": [ 252 | 1075, 253 | 433, 254 | 324, 255 | 1031 256 | ], 257 | "name": "DSStop", 258 | "nodeType": "ContractDefinition", 259 | "nodes": [ 260 | { 261 | "constant": false, 262 | "id": 1041, 263 | "name": "stopped", 264 | "nodeType": "VariableDeclaration", 265 | "scope": 1075, 266 | "src": "846:19:7", 267 | "stateVariable": true, 268 | "storageLocation": "default", 269 | "typeDescriptions": { 270 | "typeIdentifier": "t_bool", 271 | "typeString": "bool" 272 | }, 273 | "typeName": { 274 | "id": 1040, 275 | "name": "bool", 276 | "nodeType": "ElementaryTypeName", 277 | "src": "846:4:7", 278 | "typeDescriptions": { 279 | "typeIdentifier": "t_bool", 280 | "typeString": "bool" 281 | } 282 | }, 283 | "value": null, 284 | "visibility": "public" 285 | }, 286 | { 287 | "body": { 288 | "id": 1049, 289 | "nodeType": "Block", 290 | "src": "891:45:7", 291 | "statements": [ 292 | { 293 | "expression": { 294 | "argumentTypes": null, 295 | "arguments": [ 296 | { 297 | "argumentTypes": null, 298 | "id": 1045, 299 | "isConstant": false, 300 | "isLValue": false, 301 | "isPure": false, 302 | "lValueRequested": false, 303 | "nodeType": "UnaryOperation", 304 | "operator": "!", 305 | "prefix": true, 306 | "src": "909:8:7", 307 | "subExpression": { 308 | "argumentTypes": null, 309 | "id": 1044, 310 | "name": "stopped", 311 | "nodeType": "Identifier", 312 | "overloadedDeclarations": [], 313 | "referencedDeclaration": 1041, 314 | "src": "910:7:7", 315 | "typeDescriptions": { 316 | "typeIdentifier": "t_bool", 317 | "typeString": "bool" 318 | } 319 | }, 320 | "typeDescriptions": { 321 | "typeIdentifier": "t_bool", 322 | "typeString": "bool" 323 | } 324 | } 325 | ], 326 | "expression": { 327 | "argumentTypes": [ 328 | { 329 | "typeIdentifier": "t_bool", 330 | "typeString": "bool" 331 | } 332 | ], 333 | "id": 1043, 334 | "name": "require", 335 | "nodeType": "Identifier", 336 | "overloadedDeclarations": [ 337 | 1436, 338 | 1437 339 | ], 340 | "referencedDeclaration": 1436, 341 | "src": "901:7:7", 342 | "typeDescriptions": { 343 | "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", 344 | "typeString": "function (bool) pure" 345 | } 346 | }, 347 | "id": 1046, 348 | "isConstant": false, 349 | "isLValue": false, 350 | "isPure": false, 351 | "kind": "functionCall", 352 | "lValueRequested": false, 353 | "names": [], 354 | "nodeType": "FunctionCall", 355 | "src": "901:17:7", 356 | "typeDescriptions": { 357 | "typeIdentifier": "t_tuple$__$", 358 | "typeString": "tuple()" 359 | } 360 | }, 361 | "id": 1047, 362 | "nodeType": "ExpressionStatement", 363 | "src": "901:17:7" 364 | }, 365 | { 366 | "id": 1048, 367 | "nodeType": "PlaceholderStatement", 368 | "src": "928:1:7" 369 | } 370 | ] 371 | }, 372 | "documentation": null, 373 | "id": 1050, 374 | "name": "stoppable", 375 | "nodeType": "ModifierDefinition", 376 | "parameters": { 377 | "id": 1042, 378 | "nodeType": "ParameterList", 379 | "parameters": [], 380 | "src": "891:0:7" 381 | }, 382 | "src": "872:64:7", 383 | "visibility": "internal" 384 | }, 385 | { 386 | "body": { 387 | "id": 1061, 388 | "nodeType": "Block", 389 | "src": "974:31:7", 390 | "statements": [ 391 | { 392 | "expression": { 393 | "argumentTypes": null, 394 | "id": 1059, 395 | "isConstant": false, 396 | "isLValue": false, 397 | "isPure": false, 398 | "lValueRequested": false, 399 | "leftHandSide": { 400 | "argumentTypes": null, 401 | "id": 1057, 402 | "name": "stopped", 403 | "nodeType": "Identifier", 404 | "overloadedDeclarations": [], 405 | "referencedDeclaration": 1041, 406 | "src": "984:7:7", 407 | "typeDescriptions": { 408 | "typeIdentifier": "t_bool", 409 | "typeString": "bool" 410 | } 411 | }, 412 | "nodeType": "Assignment", 413 | "operator": "=", 414 | "rightHandSide": { 415 | "argumentTypes": null, 416 | "hexValue": "74727565", 417 | "id": 1058, 418 | "isConstant": false, 419 | "isLValue": false, 420 | "isPure": true, 421 | "kind": "bool", 422 | "lValueRequested": false, 423 | "nodeType": "Literal", 424 | "src": "994:4:7", 425 | "subdenomination": null, 426 | "typeDescriptions": { 427 | "typeIdentifier": "t_bool", 428 | "typeString": "bool" 429 | }, 430 | "value": "true" 431 | }, 432 | "src": "984:14:7", 433 | "typeDescriptions": { 434 | "typeIdentifier": "t_bool", 435 | "typeString": "bool" 436 | } 437 | }, 438 | "id": 1060, 439 | "nodeType": "ExpressionStatement", 440 | "src": "984:14:7" 441 | } 442 | ] 443 | }, 444 | "documentation": null, 445 | "id": 1062, 446 | "implemented": true, 447 | "isConstructor": false, 448 | "isDeclaredConst": false, 449 | "modifiers": [ 450 | { 451 | "arguments": null, 452 | "id": 1053, 453 | "modifierName": { 454 | "argumentTypes": null, 455 | "id": 1052, 456 | "name": "auth", 457 | "nodeType": "Identifier", 458 | "overloadedDeclarations": [], 459 | "referencedDeclaration": 389, 460 | "src": "964:4:7", 461 | "typeDescriptions": { 462 | "typeIdentifier": "t_modifier$__$", 463 | "typeString": "modifier ()" 464 | } 465 | }, 466 | "nodeType": "ModifierInvocation", 467 | "src": "964:4:7" 468 | }, 469 | { 470 | "arguments": null, 471 | "id": 1055, 472 | "modifierName": { 473 | "argumentTypes": null, 474 | "id": 1054, 475 | "name": "note", 476 | "nodeType": "Identifier", 477 | "overloadedDeclarations": [], 478 | "referencedDeclaration": 1030, 479 | "src": "969:4:7", 480 | "typeDescriptions": { 481 | "typeIdentifier": "t_modifier$__$", 482 | "typeString": "modifier ()" 483 | } 484 | }, 485 | "nodeType": "ModifierInvocation", 486 | "src": "969:4:7" 487 | } 488 | ], 489 | "name": "stop", 490 | "nodeType": "FunctionDefinition", 491 | "parameters": { 492 | "id": 1051, 493 | "nodeType": "ParameterList", 494 | "parameters": [], 495 | "src": "954:2:7" 496 | }, 497 | "payable": false, 498 | "returnParameters": { 499 | "id": 1056, 500 | "nodeType": "ParameterList", 501 | "parameters": [], 502 | "src": "974:0:7" 503 | }, 504 | "scope": 1075, 505 | "src": "941:64:7", 506 | "stateMutability": "nonpayable", 507 | "superFunction": null, 508 | "visibility": "public" 509 | }, 510 | { 511 | "body": { 512 | "id": 1073, 513 | "nodeType": "Block", 514 | "src": "1044:32:7", 515 | "statements": [ 516 | { 517 | "expression": { 518 | "argumentTypes": null, 519 | "id": 1071, 520 | "isConstant": false, 521 | "isLValue": false, 522 | "isPure": false, 523 | "lValueRequested": false, 524 | "leftHandSide": { 525 | "argumentTypes": null, 526 | "id": 1069, 527 | "name": "stopped", 528 | "nodeType": "Identifier", 529 | "overloadedDeclarations": [], 530 | "referencedDeclaration": 1041, 531 | "src": "1054:7:7", 532 | "typeDescriptions": { 533 | "typeIdentifier": "t_bool", 534 | "typeString": "bool" 535 | } 536 | }, 537 | "nodeType": "Assignment", 538 | "operator": "=", 539 | "rightHandSide": { 540 | "argumentTypes": null, 541 | "hexValue": "66616c7365", 542 | "id": 1070, 543 | "isConstant": false, 544 | "isLValue": false, 545 | "isPure": true, 546 | "kind": "bool", 547 | "lValueRequested": false, 548 | "nodeType": "Literal", 549 | "src": "1064:5:7", 550 | "subdenomination": null, 551 | "typeDescriptions": { 552 | "typeIdentifier": "t_bool", 553 | "typeString": "bool" 554 | }, 555 | "value": "false" 556 | }, 557 | "src": "1054:15:7", 558 | "typeDescriptions": { 559 | "typeIdentifier": "t_bool", 560 | "typeString": "bool" 561 | } 562 | }, 563 | "id": 1072, 564 | "nodeType": "ExpressionStatement", 565 | "src": "1054:15:7" 566 | } 567 | ] 568 | }, 569 | "documentation": null, 570 | "id": 1074, 571 | "implemented": true, 572 | "isConstructor": false, 573 | "isDeclaredConst": false, 574 | "modifiers": [ 575 | { 576 | "arguments": null, 577 | "id": 1065, 578 | "modifierName": { 579 | "argumentTypes": null, 580 | "id": 1064, 581 | "name": "auth", 582 | "nodeType": "Identifier", 583 | "overloadedDeclarations": [], 584 | "referencedDeclaration": 389, 585 | "src": "1034:4:7", 586 | "typeDescriptions": { 587 | "typeIdentifier": "t_modifier$__$", 588 | "typeString": "modifier ()" 589 | } 590 | }, 591 | "nodeType": "ModifierInvocation", 592 | "src": "1034:4:7" 593 | }, 594 | { 595 | "arguments": null, 596 | "id": 1067, 597 | "modifierName": { 598 | "argumentTypes": null, 599 | "id": 1066, 600 | "name": "note", 601 | "nodeType": "Identifier", 602 | "overloadedDeclarations": [], 603 | "referencedDeclaration": 1030, 604 | "src": "1039:4:7", 605 | "typeDescriptions": { 606 | "typeIdentifier": "t_modifier$__$", 607 | "typeString": "modifier ()" 608 | } 609 | }, 610 | "nodeType": "ModifierInvocation", 611 | "src": "1039:4:7" 612 | } 613 | ], 614 | "name": "start", 615 | "nodeType": "FunctionDefinition", 616 | "parameters": { 617 | "id": 1063, 618 | "nodeType": "ParameterList", 619 | "parameters": [], 620 | "src": "1024:2:7" 621 | }, 622 | "payable": false, 623 | "returnParameters": { 624 | "id": 1068, 625 | "nodeType": "ParameterList", 626 | "parameters": [], 627 | "src": "1044:0:7" 628 | }, 629 | "scope": 1075, 630 | "src": "1010:66:7", 631 | "stateMutability": "nonpayable", 632 | "superFunction": null, 633 | "visibility": "public" 634 | } 635 | ], 636 | "scope": 1076, 637 | "src": "805:274:7" 638 | } 639 | ], 640 | "src": "736:344:7" 641 | }, 642 | "legacyAST": { 643 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/stop.sol", 644 | "exportedSymbols": { 645 | "DSStop": [ 646 | 1075 647 | ] 648 | }, 649 | "id": 1076, 650 | "nodeType": "SourceUnit", 651 | "nodes": [ 652 | { 653 | "id": 1033, 654 | "literals": [ 655 | "solidity", 656 | "^", 657 | "0.4", 658 | ".23" 659 | ], 660 | "nodeType": "PragmaDirective", 661 | "src": "736:24:7" 662 | }, 663 | { 664 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/auth.sol", 665 | "file": "./auth.sol", 666 | "id": 1034, 667 | "nodeType": "ImportDirective", 668 | "scope": 1076, 669 | "sourceUnit": 434, 670 | "src": "762:20:7", 671 | "symbolAliases": [], 672 | "unitAlias": "" 673 | }, 674 | { 675 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/note.sol", 676 | "file": "./note.sol", 677 | "id": 1035, 678 | "nodeType": "ImportDirective", 679 | "scope": 1076, 680 | "sourceUnit": 1032, 681 | "src": "783:20:7", 682 | "symbolAliases": [], 683 | "unitAlias": "" 684 | }, 685 | { 686 | "baseContracts": [ 687 | { 688 | "arguments": null, 689 | "baseName": { 690 | "contractScope": null, 691 | "id": 1036, 692 | "name": "DSNote", 693 | "nodeType": "UserDefinedTypeName", 694 | "referencedDeclaration": 1031, 695 | "src": "824:6:7", 696 | "typeDescriptions": { 697 | "typeIdentifier": "t_contract$_DSNote_$1031", 698 | "typeString": "contract DSNote" 699 | } 700 | }, 701 | "id": 1037, 702 | "nodeType": "InheritanceSpecifier", 703 | "src": "824:6:7" 704 | }, 705 | { 706 | "arguments": null, 707 | "baseName": { 708 | "contractScope": null, 709 | "id": 1038, 710 | "name": "DSAuth", 711 | "nodeType": "UserDefinedTypeName", 712 | "referencedDeclaration": 433, 713 | "src": "832:6:7", 714 | "typeDescriptions": { 715 | "typeIdentifier": "t_contract$_DSAuth_$433", 716 | "typeString": "contract DSAuth" 717 | } 718 | }, 719 | "id": 1039, 720 | "nodeType": "InheritanceSpecifier", 721 | "src": "832:6:7" 722 | } 723 | ], 724 | "contractDependencies": [ 725 | 324, 726 | 433, 727 | 1031 728 | ], 729 | "contractKind": "contract", 730 | "documentation": null, 731 | "fullyImplemented": true, 732 | "id": 1075, 733 | "linearizedBaseContracts": [ 734 | 1075, 735 | 433, 736 | 324, 737 | 1031 738 | ], 739 | "name": "DSStop", 740 | "nodeType": "ContractDefinition", 741 | "nodes": [ 742 | { 743 | "constant": false, 744 | "id": 1041, 745 | "name": "stopped", 746 | "nodeType": "VariableDeclaration", 747 | "scope": 1075, 748 | "src": "846:19:7", 749 | "stateVariable": true, 750 | "storageLocation": "default", 751 | "typeDescriptions": { 752 | "typeIdentifier": "t_bool", 753 | "typeString": "bool" 754 | }, 755 | "typeName": { 756 | "id": 1040, 757 | "name": "bool", 758 | "nodeType": "ElementaryTypeName", 759 | "src": "846:4:7", 760 | "typeDescriptions": { 761 | "typeIdentifier": "t_bool", 762 | "typeString": "bool" 763 | } 764 | }, 765 | "value": null, 766 | "visibility": "public" 767 | }, 768 | { 769 | "body": { 770 | "id": 1049, 771 | "nodeType": "Block", 772 | "src": "891:45:7", 773 | "statements": [ 774 | { 775 | "expression": { 776 | "argumentTypes": null, 777 | "arguments": [ 778 | { 779 | "argumentTypes": null, 780 | "id": 1045, 781 | "isConstant": false, 782 | "isLValue": false, 783 | "isPure": false, 784 | "lValueRequested": false, 785 | "nodeType": "UnaryOperation", 786 | "operator": "!", 787 | "prefix": true, 788 | "src": "909:8:7", 789 | "subExpression": { 790 | "argumentTypes": null, 791 | "id": 1044, 792 | "name": "stopped", 793 | "nodeType": "Identifier", 794 | "overloadedDeclarations": [], 795 | "referencedDeclaration": 1041, 796 | "src": "910:7:7", 797 | "typeDescriptions": { 798 | "typeIdentifier": "t_bool", 799 | "typeString": "bool" 800 | } 801 | }, 802 | "typeDescriptions": { 803 | "typeIdentifier": "t_bool", 804 | "typeString": "bool" 805 | } 806 | } 807 | ], 808 | "expression": { 809 | "argumentTypes": [ 810 | { 811 | "typeIdentifier": "t_bool", 812 | "typeString": "bool" 813 | } 814 | ], 815 | "id": 1043, 816 | "name": "require", 817 | "nodeType": "Identifier", 818 | "overloadedDeclarations": [ 819 | 1436, 820 | 1437 821 | ], 822 | "referencedDeclaration": 1436, 823 | "src": "901:7:7", 824 | "typeDescriptions": { 825 | "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", 826 | "typeString": "function (bool) pure" 827 | } 828 | }, 829 | "id": 1046, 830 | "isConstant": false, 831 | "isLValue": false, 832 | "isPure": false, 833 | "kind": "functionCall", 834 | "lValueRequested": false, 835 | "names": [], 836 | "nodeType": "FunctionCall", 837 | "src": "901:17:7", 838 | "typeDescriptions": { 839 | "typeIdentifier": "t_tuple$__$", 840 | "typeString": "tuple()" 841 | } 842 | }, 843 | "id": 1047, 844 | "nodeType": "ExpressionStatement", 845 | "src": "901:17:7" 846 | }, 847 | { 848 | "id": 1048, 849 | "nodeType": "PlaceholderStatement", 850 | "src": "928:1:7" 851 | } 852 | ] 853 | }, 854 | "documentation": null, 855 | "id": 1050, 856 | "name": "stoppable", 857 | "nodeType": "ModifierDefinition", 858 | "parameters": { 859 | "id": 1042, 860 | "nodeType": "ParameterList", 861 | "parameters": [], 862 | "src": "891:0:7" 863 | }, 864 | "src": "872:64:7", 865 | "visibility": "internal" 866 | }, 867 | { 868 | "body": { 869 | "id": 1061, 870 | "nodeType": "Block", 871 | "src": "974:31:7", 872 | "statements": [ 873 | { 874 | "expression": { 875 | "argumentTypes": null, 876 | "id": 1059, 877 | "isConstant": false, 878 | "isLValue": false, 879 | "isPure": false, 880 | "lValueRequested": false, 881 | "leftHandSide": { 882 | "argumentTypes": null, 883 | "id": 1057, 884 | "name": "stopped", 885 | "nodeType": "Identifier", 886 | "overloadedDeclarations": [], 887 | "referencedDeclaration": 1041, 888 | "src": "984:7:7", 889 | "typeDescriptions": { 890 | "typeIdentifier": "t_bool", 891 | "typeString": "bool" 892 | } 893 | }, 894 | "nodeType": "Assignment", 895 | "operator": "=", 896 | "rightHandSide": { 897 | "argumentTypes": null, 898 | "hexValue": "74727565", 899 | "id": 1058, 900 | "isConstant": false, 901 | "isLValue": false, 902 | "isPure": true, 903 | "kind": "bool", 904 | "lValueRequested": false, 905 | "nodeType": "Literal", 906 | "src": "994:4:7", 907 | "subdenomination": null, 908 | "typeDescriptions": { 909 | "typeIdentifier": "t_bool", 910 | "typeString": "bool" 911 | }, 912 | "value": "true" 913 | }, 914 | "src": "984:14:7", 915 | "typeDescriptions": { 916 | "typeIdentifier": "t_bool", 917 | "typeString": "bool" 918 | } 919 | }, 920 | "id": 1060, 921 | "nodeType": "ExpressionStatement", 922 | "src": "984:14:7" 923 | } 924 | ] 925 | }, 926 | "documentation": null, 927 | "id": 1062, 928 | "implemented": true, 929 | "isConstructor": false, 930 | "isDeclaredConst": false, 931 | "modifiers": [ 932 | { 933 | "arguments": null, 934 | "id": 1053, 935 | "modifierName": { 936 | "argumentTypes": null, 937 | "id": 1052, 938 | "name": "auth", 939 | "nodeType": "Identifier", 940 | "overloadedDeclarations": [], 941 | "referencedDeclaration": 389, 942 | "src": "964:4:7", 943 | "typeDescriptions": { 944 | "typeIdentifier": "t_modifier$__$", 945 | "typeString": "modifier ()" 946 | } 947 | }, 948 | "nodeType": "ModifierInvocation", 949 | "src": "964:4:7" 950 | }, 951 | { 952 | "arguments": null, 953 | "id": 1055, 954 | "modifierName": { 955 | "argumentTypes": null, 956 | "id": 1054, 957 | "name": "note", 958 | "nodeType": "Identifier", 959 | "overloadedDeclarations": [], 960 | "referencedDeclaration": 1030, 961 | "src": "969:4:7", 962 | "typeDescriptions": { 963 | "typeIdentifier": "t_modifier$__$", 964 | "typeString": "modifier ()" 965 | } 966 | }, 967 | "nodeType": "ModifierInvocation", 968 | "src": "969:4:7" 969 | } 970 | ], 971 | "name": "stop", 972 | "nodeType": "FunctionDefinition", 973 | "parameters": { 974 | "id": 1051, 975 | "nodeType": "ParameterList", 976 | "parameters": [], 977 | "src": "954:2:7" 978 | }, 979 | "payable": false, 980 | "returnParameters": { 981 | "id": 1056, 982 | "nodeType": "ParameterList", 983 | "parameters": [], 984 | "src": "974:0:7" 985 | }, 986 | "scope": 1075, 987 | "src": "941:64:7", 988 | "stateMutability": "nonpayable", 989 | "superFunction": null, 990 | "visibility": "public" 991 | }, 992 | { 993 | "body": { 994 | "id": 1073, 995 | "nodeType": "Block", 996 | "src": "1044:32:7", 997 | "statements": [ 998 | { 999 | "expression": { 1000 | "argumentTypes": null, 1001 | "id": 1071, 1002 | "isConstant": false, 1003 | "isLValue": false, 1004 | "isPure": false, 1005 | "lValueRequested": false, 1006 | "leftHandSide": { 1007 | "argumentTypes": null, 1008 | "id": 1069, 1009 | "name": "stopped", 1010 | "nodeType": "Identifier", 1011 | "overloadedDeclarations": [], 1012 | "referencedDeclaration": 1041, 1013 | "src": "1054:7:7", 1014 | "typeDescriptions": { 1015 | "typeIdentifier": "t_bool", 1016 | "typeString": "bool" 1017 | } 1018 | }, 1019 | "nodeType": "Assignment", 1020 | "operator": "=", 1021 | "rightHandSide": { 1022 | "argumentTypes": null, 1023 | "hexValue": "66616c7365", 1024 | "id": 1070, 1025 | "isConstant": false, 1026 | "isLValue": false, 1027 | "isPure": true, 1028 | "kind": "bool", 1029 | "lValueRequested": false, 1030 | "nodeType": "Literal", 1031 | "src": "1064:5:7", 1032 | "subdenomination": null, 1033 | "typeDescriptions": { 1034 | "typeIdentifier": "t_bool", 1035 | "typeString": "bool" 1036 | }, 1037 | "value": "false" 1038 | }, 1039 | "src": "1054:15:7", 1040 | "typeDescriptions": { 1041 | "typeIdentifier": "t_bool", 1042 | "typeString": "bool" 1043 | } 1044 | }, 1045 | "id": 1072, 1046 | "nodeType": "ExpressionStatement", 1047 | "src": "1054:15:7" 1048 | } 1049 | ] 1050 | }, 1051 | "documentation": null, 1052 | "id": 1074, 1053 | "implemented": true, 1054 | "isConstructor": false, 1055 | "isDeclaredConst": false, 1056 | "modifiers": [ 1057 | { 1058 | "arguments": null, 1059 | "id": 1065, 1060 | "modifierName": { 1061 | "argumentTypes": null, 1062 | "id": 1064, 1063 | "name": "auth", 1064 | "nodeType": "Identifier", 1065 | "overloadedDeclarations": [], 1066 | "referencedDeclaration": 389, 1067 | "src": "1034:4:7", 1068 | "typeDescriptions": { 1069 | "typeIdentifier": "t_modifier$__$", 1070 | "typeString": "modifier ()" 1071 | } 1072 | }, 1073 | "nodeType": "ModifierInvocation", 1074 | "src": "1034:4:7" 1075 | }, 1076 | { 1077 | "arguments": null, 1078 | "id": 1067, 1079 | "modifierName": { 1080 | "argumentTypes": null, 1081 | "id": 1066, 1082 | "name": "note", 1083 | "nodeType": "Identifier", 1084 | "overloadedDeclarations": [], 1085 | "referencedDeclaration": 1030, 1086 | "src": "1039:4:7", 1087 | "typeDescriptions": { 1088 | "typeIdentifier": "t_modifier$__$", 1089 | "typeString": "modifier ()" 1090 | } 1091 | }, 1092 | "nodeType": "ModifierInvocation", 1093 | "src": "1039:4:7" 1094 | } 1095 | ], 1096 | "name": "start", 1097 | "nodeType": "FunctionDefinition", 1098 | "parameters": { 1099 | "id": 1063, 1100 | "nodeType": "ParameterList", 1101 | "parameters": [], 1102 | "src": "1024:2:7" 1103 | }, 1104 | "payable": false, 1105 | "returnParameters": { 1106 | "id": 1068, 1107 | "nodeType": "ParameterList", 1108 | "parameters": [], 1109 | "src": "1044:0:7" 1110 | }, 1111 | "scope": 1075, 1112 | "src": "1010:66:7", 1113 | "stateMutability": "nonpayable", 1114 | "superFunction": null, 1115 | "visibility": "public" 1116 | } 1117 | ], 1118 | "scope": 1076, 1119 | "src": "805:274:7" 1120 | } 1121 | ], 1122 | "src": "736:344:7" 1123 | }, 1124 | "compiler": { 1125 | "name": "solc", 1126 | "version": "0.4.24+commit.e67f0147.Emscripten.clang" 1127 | }, 1128 | "networks": {}, 1129 | "schemaVersion": "2.0.1", 1130 | "updatedAt": "2018-07-15T16:38:14.729Z" 1131 | } -------------------------------------------------------------------------------- /build/contracts/DSThing.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "DSThing", 3 | "abi": [ 4 | { 5 | "constant": false, 6 | "inputs": [ 7 | { 8 | "name": "owner_", 9 | "type": "address" 10 | } 11 | ], 12 | "name": "setOwner", 13 | "outputs": [], 14 | "payable": false, 15 | "stateMutability": "nonpayable", 16 | "type": "function" 17 | }, 18 | { 19 | "constant": false, 20 | "inputs": [ 21 | { 22 | "name": "authority_", 23 | "type": "address" 24 | } 25 | ], 26 | "name": "setAuthority", 27 | "outputs": [], 28 | "payable": false, 29 | "stateMutability": "nonpayable", 30 | "type": "function" 31 | }, 32 | { 33 | "constant": true, 34 | "inputs": [], 35 | "name": "owner", 36 | "outputs": [ 37 | { 38 | "name": "", 39 | "type": "address" 40 | } 41 | ], 42 | "payable": false, 43 | "stateMutability": "view", 44 | "type": "function" 45 | }, 46 | { 47 | "constant": true, 48 | "inputs": [], 49 | "name": "authority", 50 | "outputs": [ 51 | { 52 | "name": "", 53 | "type": "address" 54 | } 55 | ], 56 | "payable": false, 57 | "stateMutability": "view", 58 | "type": "function" 59 | }, 60 | { 61 | "anonymous": true, 62 | "inputs": [ 63 | { 64 | "indexed": true, 65 | "name": "sig", 66 | "type": "bytes4" 67 | }, 68 | { 69 | "indexed": true, 70 | "name": "guy", 71 | "type": "address" 72 | }, 73 | { 74 | "indexed": true, 75 | "name": "foo", 76 | "type": "bytes32" 77 | }, 78 | { 79 | "indexed": true, 80 | "name": "bar", 81 | "type": "bytes32" 82 | }, 83 | { 84 | "indexed": false, 85 | "name": "wad", 86 | "type": "uint256" 87 | }, 88 | { 89 | "indexed": false, 90 | "name": "fax", 91 | "type": "bytes" 92 | } 93 | ], 94 | "name": "LogNote", 95 | "type": "event" 96 | }, 97 | { 98 | "anonymous": false, 99 | "inputs": [ 100 | { 101 | "indexed": true, 102 | "name": "authority", 103 | "type": "address" 104 | } 105 | ], 106 | "name": "LogSetAuthority", 107 | "type": "event" 108 | }, 109 | { 110 | "anonymous": false, 111 | "inputs": [ 112 | { 113 | "indexed": true, 114 | "name": "owner", 115 | "type": "address" 116 | } 117 | ], 118 | "name": "LogSetOwner", 119 | "type": "event" 120 | } 121 | ], 122 | "bytecode": "0x608060405233600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a261064b806100976000396000f300608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313af4035146100675780637a9e5e4b146100aa5780638da5cb5b146100ed578063bf7e214f14610144575b600080fd5b34801561007357600080fd5b506100a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061019b565b005b3480156100b657600080fd5b506100eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061027d565b005b3480156100f957600080fd5b5061010261035d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561015057600080fd5b50610159610383565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c9336000357fffffffff00000000000000000000000000000000000000000000000000000000166103a8565b15156101d457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b6102ab336000357fffffffff00000000000000000000000000000000000000000000000000000000166103a8565b15156102b657600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103e75760019050610619565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156104465760019050610619565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156104a55760009050610619565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b1580156105db57600080fd5b505af11580156105ef573d6000803e3d6000fd5b505050506040513d602081101561060557600080fd5b810190808051906020019092919050505090505b929150505600a165627a7a72305820c4dbbfe729e834903ab9337b540d22caed124e90f25885e4c44f42ccf43479dd0029", 123 | "deployedBytecode": "0x608060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313af4035146100675780637a9e5e4b146100aa5780638da5cb5b146100ed578063bf7e214f14610144575b600080fd5b34801561007357600080fd5b506100a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061019b565b005b3480156100b657600080fd5b506100eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061027d565b005b3480156100f957600080fd5b5061010261035d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561015057600080fd5b50610159610383565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c9336000357fffffffff00000000000000000000000000000000000000000000000000000000166103a8565b15156101d457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b6102ab336000357fffffffff00000000000000000000000000000000000000000000000000000000166103a8565b15156102b657600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156103e75760019050610619565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156104465760019050610619565b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156104a55760009050610619565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b1580156105db57600080fd5b505af11580156105ef573d6000803e3d6000fd5b505050506040513d602081101561060557600080fd5b810190808051906020019092919050505090505b929150505600a165627a7a72305820c4dbbfe729e834903ab9337b540d22caed124e90f25885e4c44f42ccf43479dd0029", 124 | "sourceMap": "843:149:11:-;;;1075:10:1;1067:5;;:18;;;;;;;;;;;;;;;;;;1112:10;1100:23;;;;;;;;;;;;843:149:11;;;;;;", 125 | "deployedSourceMap": "843:149:11:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1136:130:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1136:130:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;1272:158;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1272:158:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;1003:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1003:26:1;;;;;;;;;;;;;;;;;;;;;;;;;;;967:30;;8:9:-1;5:2;;;30:1;27;20:12;5:2;967:30:1;;;;;;;;;;;;;;;;;;;;;;;;;;;1136:130;1468:33;1481:10;1493:7;;;;1468:12;:33::i;:::-;1460:42;;;;;;;;1220:6;1212:5;;:14;;;;;;;;;;;;;;;;;;1253:5;;;;;;;;;;;1241:18;;;;;;;;;;;;1136:130;:::o;1272:158::-;1468:33;1481:10;1493:7;;;;1468:12;:33::i;:::-;1460:42;;;;;;;;1372:10;1360:9;;:22;;;;;;;;;;;;;;;;;;1413:9;;;;;;;;;;;1397:26;;;;;;;;;;;;1272:158;:::o;1003:26::-;;;;;;;;;;;;;:::o;967:30::-;;;;;;;;;;;;;:::o;1526:361::-;1596:4;1631;1616:20;;:3;:20;;;1612:269;;;1659:4;1652:11;;;;1612:269;1691:5;;;;;;;;;;;1684:12;;:3;:12;;;1680:201;;;1719:4;1712:11;;;;1680:201;1769:1;1744:27;;:9;;;;;;;;;;;:27;;;1740:141;;;1794:5;1787:12;;;;1740:141;1837:9;;;;;;;;;;;:17;;;1855:3;1860:4;1866:3;1837:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1837:33:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1837:33:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1837:33:1;;;;;;;;;;;;;;;;1830:40;;1526:361;;;;;:::o", 126 | "source": "// thing.sol - `auth` with handy mixins. your things should be DSThings\n\n// Copyright (C) 2017 DappHub, LLC\n\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\npragma solidity ^0.4.13;\n\nimport \"./auth.sol\";\nimport \"./note.sol\";\nimport \"./math.sol\";\n\ncontract DSThing is DSAuth, DSNote, DSMath {\n\n function S(string s) internal pure returns (bytes4) {\n return bytes4(keccak256(s));\n }\n\n}\n", 127 | "sourcePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/thing.sol", 128 | "ast": { 129 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/thing.sol", 130 | "exportedSymbols": { 131 | "DSThing": [ 132 | 1917 133 | ] 134 | }, 135 | "id": 1918, 136 | "nodeType": "SourceUnit", 137 | "nodes": [ 138 | { 139 | "id": 1893, 140 | "literals": [ 141 | "solidity", 142 | "^", 143 | "0.4", 144 | ".13" 145 | ], 146 | "nodeType": "PragmaDirective", 147 | "src": "753:24:11" 148 | }, 149 | { 150 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/auth.sol", 151 | "file": "./auth.sol", 152 | "id": 1894, 153 | "nodeType": "ImportDirective", 154 | "scope": 1918, 155 | "sourceUnit": 376, 156 | "src": "779:20:11", 157 | "symbolAliases": [], 158 | "unitAlias": "" 159 | }, 160 | { 161 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/note.sol", 162 | "file": "./note.sol", 163 | "id": 1895, 164 | "nodeType": "ImportDirective", 165 | "scope": 1918, 166 | "sourceUnit": 1510, 167 | "src": "800:20:11", 168 | "symbolAliases": [], 169 | "unitAlias": "" 170 | }, 171 | { 172 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/math.sol", 173 | "file": "./math.sol", 174 | "id": 1896, 175 | "nodeType": "ImportDirective", 176 | "scope": 1918, 177 | "sourceUnit": 1300, 178 | "src": "821:20:11", 179 | "symbolAliases": [], 180 | "unitAlias": "" 181 | }, 182 | { 183 | "baseContracts": [ 184 | { 185 | "arguments": null, 186 | "baseName": { 187 | "contractScope": null, 188 | "id": 1897, 189 | "name": "DSAuth", 190 | "nodeType": "UserDefinedTypeName", 191 | "referencedDeclaration": 375, 192 | "src": "863:6:11", 193 | "typeDescriptions": { 194 | "typeIdentifier": "t_contract$_DSAuth_$375", 195 | "typeString": "contract DSAuth" 196 | } 197 | }, 198 | "id": 1898, 199 | "nodeType": "InheritanceSpecifier", 200 | "src": "863:6:11" 201 | }, 202 | { 203 | "arguments": null, 204 | "baseName": { 205 | "contractScope": null, 206 | "id": 1899, 207 | "name": "DSNote", 208 | "nodeType": "UserDefinedTypeName", 209 | "referencedDeclaration": 1509, 210 | "src": "871:6:11", 211 | "typeDescriptions": { 212 | "typeIdentifier": "t_contract$_DSNote_$1509", 213 | "typeString": "contract DSNote" 214 | } 215 | }, 216 | "id": 1900, 217 | "nodeType": "InheritanceSpecifier", 218 | "src": "871:6:11" 219 | }, 220 | { 221 | "arguments": null, 222 | "baseName": { 223 | "contractScope": null, 224 | "id": 1901, 225 | "name": "DSMath", 226 | "nodeType": "UserDefinedTypeName", 227 | "referencedDeclaration": 1299, 228 | "src": "879:6:11", 229 | "typeDescriptions": { 230 | "typeIdentifier": "t_contract$_DSMath_$1299", 231 | "typeString": "contract DSMath" 232 | } 233 | }, 234 | "id": 1902, 235 | "nodeType": "InheritanceSpecifier", 236 | "src": "879:6:11" 237 | } 238 | ], 239 | "contractDependencies": [ 240 | 266, 241 | 375, 242 | 1299, 243 | 1509 244 | ], 245 | "contractKind": "contract", 246 | "documentation": null, 247 | "fullyImplemented": true, 248 | "id": 1917, 249 | "linearizedBaseContracts": [ 250 | 1917, 251 | 1299, 252 | 1509, 253 | 375, 254 | 266 255 | ], 256 | "name": "DSThing", 257 | "nodeType": "ContractDefinition", 258 | "nodes": [ 259 | { 260 | "body": { 261 | "id": 1915, 262 | "nodeType": "Block", 263 | "src": "945:44:11", 264 | "statements": [ 265 | { 266 | "expression": { 267 | "argumentTypes": null, 268 | "arguments": [ 269 | { 270 | "argumentTypes": null, 271 | "arguments": [ 272 | { 273 | "argumentTypes": null, 274 | "id": 1911, 275 | "name": "s", 276 | "nodeType": "Identifier", 277 | "overloadedDeclarations": [], 278 | "referencedDeclaration": 1904, 279 | "src": "979:1:11", 280 | "typeDescriptions": { 281 | "typeIdentifier": "t_string_memory_ptr", 282 | "typeString": "string memory" 283 | } 284 | } 285 | ], 286 | "expression": { 287 | "argumentTypes": [ 288 | { 289 | "typeIdentifier": "t_string_memory_ptr", 290 | "typeString": "string memory" 291 | } 292 | ], 293 | "id": 1910, 294 | "name": "keccak256", 295 | "nodeType": "Identifier", 296 | "overloadedDeclarations": [], 297 | "referencedDeclaration": 2379, 298 | "src": "969:9:11", 299 | "typeDescriptions": { 300 | "typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$", 301 | "typeString": "function () pure returns (bytes32)" 302 | } 303 | }, 304 | "id": 1912, 305 | "isConstant": false, 306 | "isLValue": false, 307 | "isPure": false, 308 | "kind": "functionCall", 309 | "lValueRequested": false, 310 | "names": [], 311 | "nodeType": "FunctionCall", 312 | "src": "969:12:11", 313 | "typeDescriptions": { 314 | "typeIdentifier": "t_bytes32", 315 | "typeString": "bytes32" 316 | } 317 | } 318 | ], 319 | "expression": { 320 | "argumentTypes": [ 321 | { 322 | "typeIdentifier": "t_bytes32", 323 | "typeString": "bytes32" 324 | } 325 | ], 326 | "id": 1909, 327 | "isConstant": false, 328 | "isLValue": false, 329 | "isPure": true, 330 | "lValueRequested": false, 331 | "nodeType": "ElementaryTypeNameExpression", 332 | "src": "962:6:11", 333 | "typeDescriptions": { 334 | "typeIdentifier": "t_type$_t_bytes4_$", 335 | "typeString": "type(bytes4)" 336 | }, 337 | "typeName": "bytes4" 338 | }, 339 | "id": 1913, 340 | "isConstant": false, 341 | "isLValue": false, 342 | "isPure": false, 343 | "kind": "typeConversion", 344 | "lValueRequested": false, 345 | "names": [], 346 | "nodeType": "FunctionCall", 347 | "src": "962:20:11", 348 | "typeDescriptions": { 349 | "typeIdentifier": "t_bytes4", 350 | "typeString": "bytes4" 351 | } 352 | }, 353 | "functionReturnParameters": 1908, 354 | "id": 1914, 355 | "nodeType": "Return", 356 | "src": "955:27:11" 357 | } 358 | ] 359 | }, 360 | "documentation": null, 361 | "id": 1916, 362 | "implemented": true, 363 | "isConstructor": false, 364 | "isDeclaredConst": true, 365 | "modifiers": [], 366 | "name": "S", 367 | "nodeType": "FunctionDefinition", 368 | "parameters": { 369 | "id": 1905, 370 | "nodeType": "ParameterList", 371 | "parameters": [ 372 | { 373 | "constant": false, 374 | "id": 1904, 375 | "name": "s", 376 | "nodeType": "VariableDeclaration", 377 | "scope": 1916, 378 | "src": "904:8:11", 379 | "stateVariable": false, 380 | "storageLocation": "default", 381 | "typeDescriptions": { 382 | "typeIdentifier": "t_string_memory_ptr", 383 | "typeString": "string" 384 | }, 385 | "typeName": { 386 | "id": 1903, 387 | "name": "string", 388 | "nodeType": "ElementaryTypeName", 389 | "src": "904:6:11", 390 | "typeDescriptions": { 391 | "typeIdentifier": "t_string_storage_ptr", 392 | "typeString": "string" 393 | } 394 | }, 395 | "value": null, 396 | "visibility": "internal" 397 | } 398 | ], 399 | "src": "903:10:11" 400 | }, 401 | "payable": false, 402 | "returnParameters": { 403 | "id": 1908, 404 | "nodeType": "ParameterList", 405 | "parameters": [ 406 | { 407 | "constant": false, 408 | "id": 1907, 409 | "name": "", 410 | "nodeType": "VariableDeclaration", 411 | "scope": 1916, 412 | "src": "937:6:11", 413 | "stateVariable": false, 414 | "storageLocation": "default", 415 | "typeDescriptions": { 416 | "typeIdentifier": "t_bytes4", 417 | "typeString": "bytes4" 418 | }, 419 | "typeName": { 420 | "id": 1906, 421 | "name": "bytes4", 422 | "nodeType": "ElementaryTypeName", 423 | "src": "937:6:11", 424 | "typeDescriptions": { 425 | "typeIdentifier": "t_bytes4", 426 | "typeString": "bytes4" 427 | } 428 | }, 429 | "value": null, 430 | "visibility": "internal" 431 | } 432 | ], 433 | "src": "936:8:11" 434 | }, 435 | "scope": 1917, 436 | "src": "893:96:11", 437 | "stateMutability": "pure", 438 | "superFunction": null, 439 | "visibility": "internal" 440 | } 441 | ], 442 | "scope": 1918, 443 | "src": "843:149:11" 444 | } 445 | ], 446 | "src": "753:240:11" 447 | }, 448 | "legacyAST": { 449 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/thing.sol", 450 | "exportedSymbols": { 451 | "DSThing": [ 452 | 1917 453 | ] 454 | }, 455 | "id": 1918, 456 | "nodeType": "SourceUnit", 457 | "nodes": [ 458 | { 459 | "id": 1893, 460 | "literals": [ 461 | "solidity", 462 | "^", 463 | "0.4", 464 | ".13" 465 | ], 466 | "nodeType": "PragmaDirective", 467 | "src": "753:24:11" 468 | }, 469 | { 470 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/auth.sol", 471 | "file": "./auth.sol", 472 | "id": 1894, 473 | "nodeType": "ImportDirective", 474 | "scope": 1918, 475 | "sourceUnit": 376, 476 | "src": "779:20:11", 477 | "symbolAliases": [], 478 | "unitAlias": "" 479 | }, 480 | { 481 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/note.sol", 482 | "file": "./note.sol", 483 | "id": 1895, 484 | "nodeType": "ImportDirective", 485 | "scope": 1918, 486 | "sourceUnit": 1510, 487 | "src": "800:20:11", 488 | "symbolAliases": [], 489 | "unitAlias": "" 490 | }, 491 | { 492 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/dappsys/math.sol", 493 | "file": "./math.sol", 494 | "id": 1896, 495 | "nodeType": "ImportDirective", 496 | "scope": 1918, 497 | "sourceUnit": 1300, 498 | "src": "821:20:11", 499 | "symbolAliases": [], 500 | "unitAlias": "" 501 | }, 502 | { 503 | "baseContracts": [ 504 | { 505 | "arguments": null, 506 | "baseName": { 507 | "contractScope": null, 508 | "id": 1897, 509 | "name": "DSAuth", 510 | "nodeType": "UserDefinedTypeName", 511 | "referencedDeclaration": 375, 512 | "src": "863:6:11", 513 | "typeDescriptions": { 514 | "typeIdentifier": "t_contract$_DSAuth_$375", 515 | "typeString": "contract DSAuth" 516 | } 517 | }, 518 | "id": 1898, 519 | "nodeType": "InheritanceSpecifier", 520 | "src": "863:6:11" 521 | }, 522 | { 523 | "arguments": null, 524 | "baseName": { 525 | "contractScope": null, 526 | "id": 1899, 527 | "name": "DSNote", 528 | "nodeType": "UserDefinedTypeName", 529 | "referencedDeclaration": 1509, 530 | "src": "871:6:11", 531 | "typeDescriptions": { 532 | "typeIdentifier": "t_contract$_DSNote_$1509", 533 | "typeString": "contract DSNote" 534 | } 535 | }, 536 | "id": 1900, 537 | "nodeType": "InheritanceSpecifier", 538 | "src": "871:6:11" 539 | }, 540 | { 541 | "arguments": null, 542 | "baseName": { 543 | "contractScope": null, 544 | "id": 1901, 545 | "name": "DSMath", 546 | "nodeType": "UserDefinedTypeName", 547 | "referencedDeclaration": 1299, 548 | "src": "879:6:11", 549 | "typeDescriptions": { 550 | "typeIdentifier": "t_contract$_DSMath_$1299", 551 | "typeString": "contract DSMath" 552 | } 553 | }, 554 | "id": 1902, 555 | "nodeType": "InheritanceSpecifier", 556 | "src": "879:6:11" 557 | } 558 | ], 559 | "contractDependencies": [ 560 | 266, 561 | 375, 562 | 1299, 563 | 1509 564 | ], 565 | "contractKind": "contract", 566 | "documentation": null, 567 | "fullyImplemented": true, 568 | "id": 1917, 569 | "linearizedBaseContracts": [ 570 | 1917, 571 | 1299, 572 | 1509, 573 | 375, 574 | 266 575 | ], 576 | "name": "DSThing", 577 | "nodeType": "ContractDefinition", 578 | "nodes": [ 579 | { 580 | "body": { 581 | "id": 1915, 582 | "nodeType": "Block", 583 | "src": "945:44:11", 584 | "statements": [ 585 | { 586 | "expression": { 587 | "argumentTypes": null, 588 | "arguments": [ 589 | { 590 | "argumentTypes": null, 591 | "arguments": [ 592 | { 593 | "argumentTypes": null, 594 | "id": 1911, 595 | "name": "s", 596 | "nodeType": "Identifier", 597 | "overloadedDeclarations": [], 598 | "referencedDeclaration": 1904, 599 | "src": "979:1:11", 600 | "typeDescriptions": { 601 | "typeIdentifier": "t_string_memory_ptr", 602 | "typeString": "string memory" 603 | } 604 | } 605 | ], 606 | "expression": { 607 | "argumentTypes": [ 608 | { 609 | "typeIdentifier": "t_string_memory_ptr", 610 | "typeString": "string memory" 611 | } 612 | ], 613 | "id": 1910, 614 | "name": "keccak256", 615 | "nodeType": "Identifier", 616 | "overloadedDeclarations": [], 617 | "referencedDeclaration": 2379, 618 | "src": "969:9:11", 619 | "typeDescriptions": { 620 | "typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$", 621 | "typeString": "function () pure returns (bytes32)" 622 | } 623 | }, 624 | "id": 1912, 625 | "isConstant": false, 626 | "isLValue": false, 627 | "isPure": false, 628 | "kind": "functionCall", 629 | "lValueRequested": false, 630 | "names": [], 631 | "nodeType": "FunctionCall", 632 | "src": "969:12:11", 633 | "typeDescriptions": { 634 | "typeIdentifier": "t_bytes32", 635 | "typeString": "bytes32" 636 | } 637 | } 638 | ], 639 | "expression": { 640 | "argumentTypes": [ 641 | { 642 | "typeIdentifier": "t_bytes32", 643 | "typeString": "bytes32" 644 | } 645 | ], 646 | "id": 1909, 647 | "isConstant": false, 648 | "isLValue": false, 649 | "isPure": true, 650 | "lValueRequested": false, 651 | "nodeType": "ElementaryTypeNameExpression", 652 | "src": "962:6:11", 653 | "typeDescriptions": { 654 | "typeIdentifier": "t_type$_t_bytes4_$", 655 | "typeString": "type(bytes4)" 656 | }, 657 | "typeName": "bytes4" 658 | }, 659 | "id": 1913, 660 | "isConstant": false, 661 | "isLValue": false, 662 | "isPure": false, 663 | "kind": "typeConversion", 664 | "lValueRequested": false, 665 | "names": [], 666 | "nodeType": "FunctionCall", 667 | "src": "962:20:11", 668 | "typeDescriptions": { 669 | "typeIdentifier": "t_bytes4", 670 | "typeString": "bytes4" 671 | } 672 | }, 673 | "functionReturnParameters": 1908, 674 | "id": 1914, 675 | "nodeType": "Return", 676 | "src": "955:27:11" 677 | } 678 | ] 679 | }, 680 | "documentation": null, 681 | "id": 1916, 682 | "implemented": true, 683 | "isConstructor": false, 684 | "isDeclaredConst": true, 685 | "modifiers": [], 686 | "name": "S", 687 | "nodeType": "FunctionDefinition", 688 | "parameters": { 689 | "id": 1905, 690 | "nodeType": "ParameterList", 691 | "parameters": [ 692 | { 693 | "constant": false, 694 | "id": 1904, 695 | "name": "s", 696 | "nodeType": "VariableDeclaration", 697 | "scope": 1916, 698 | "src": "904:8:11", 699 | "stateVariable": false, 700 | "storageLocation": "default", 701 | "typeDescriptions": { 702 | "typeIdentifier": "t_string_memory_ptr", 703 | "typeString": "string" 704 | }, 705 | "typeName": { 706 | "id": 1903, 707 | "name": "string", 708 | "nodeType": "ElementaryTypeName", 709 | "src": "904:6:11", 710 | "typeDescriptions": { 711 | "typeIdentifier": "t_string_storage_ptr", 712 | "typeString": "string" 713 | } 714 | }, 715 | "value": null, 716 | "visibility": "internal" 717 | } 718 | ], 719 | "src": "903:10:11" 720 | }, 721 | "payable": false, 722 | "returnParameters": { 723 | "id": 1908, 724 | "nodeType": "ParameterList", 725 | "parameters": [ 726 | { 727 | "constant": false, 728 | "id": 1907, 729 | "name": "", 730 | "nodeType": "VariableDeclaration", 731 | "scope": 1916, 732 | "src": "937:6:11", 733 | "stateVariable": false, 734 | "storageLocation": "default", 735 | "typeDescriptions": { 736 | "typeIdentifier": "t_bytes4", 737 | "typeString": "bytes4" 738 | }, 739 | "typeName": { 740 | "id": 1906, 741 | "name": "bytes4", 742 | "nodeType": "ElementaryTypeName", 743 | "src": "937:6:11", 744 | "typeDescriptions": { 745 | "typeIdentifier": "t_bytes4", 746 | "typeString": "bytes4" 747 | } 748 | }, 749 | "value": null, 750 | "visibility": "internal" 751 | } 752 | ], 753 | "src": "936:8:11" 754 | }, 755 | "scope": 1917, 756 | "src": "893:96:11", 757 | "stateMutability": "pure", 758 | "superFunction": null, 759 | "visibility": "internal" 760 | } 761 | ], 762 | "scope": 1918, 763 | "src": "843:149:11" 764 | } 765 | ], 766 | "src": "753:240:11" 767 | }, 768 | "compiler": { 769 | "name": "solc", 770 | "version": "0.4.24+commit.e67f0147.Emscripten.clang" 771 | }, 772 | "networks": {}, 773 | "schemaVersion": "2.0.1", 774 | "updatedAt": "2018-06-24T20:38:07.195Z" 775 | } -------------------------------------------------------------------------------- /build/contracts/Migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "contractName": "Migrations", 3 | "abi": [ 4 | { 5 | "constant": true, 6 | "inputs": [], 7 | "name": "last_completed_migration", 8 | "outputs": [ 9 | { 10 | "name": "", 11 | "type": "uint256" 12 | } 13 | ], 14 | "payable": false, 15 | "stateMutability": "view", 16 | "type": "function" 17 | }, 18 | { 19 | "constant": true, 20 | "inputs": [], 21 | "name": "owner", 22 | "outputs": [ 23 | { 24 | "name": "", 25 | "type": "address" 26 | } 27 | ], 28 | "payable": false, 29 | "stateMutability": "view", 30 | "type": "function" 31 | }, 32 | { 33 | "inputs": [], 34 | "payable": false, 35 | "stateMutability": "nonpayable", 36 | "type": "constructor" 37 | }, 38 | { 39 | "constant": false, 40 | "inputs": [ 41 | { 42 | "name": "completed", 43 | "type": "uint256" 44 | } 45 | ], 46 | "name": "setCompleted", 47 | "outputs": [], 48 | "payable": false, 49 | "stateMutability": "nonpayable", 50 | "type": "function" 51 | }, 52 | { 53 | "constant": false, 54 | "inputs": [ 55 | { 56 | "name": "new_address", 57 | "type": "address" 58 | } 59 | ], 60 | "name": "upgrade", 61 | "outputs": [], 62 | "payable": false, 63 | "stateMutability": "nonpayable", 64 | "type": "function" 65 | } 66 | ], 67 | "bytecode": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102db8061005e6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a723058208625364cafc5eea2343623854107354d275d504ad8409d7e6e9c42e306c93a640029", 68 | "deployedBytecode": "0x606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a723058208625364cafc5eea2343623854107354d275d504ad8409d7e6e9c42e306c93a640029", 69 | "sourceMap": "25:488:0:-;;;177:58;;;;;;;;220:10;212:5;;:18;;;;;;;;;;;;;;;;;;25:488;;;;;;", 70 | "deployedSourceMap": "25:488:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;346:165;;;;;;;;;;;;;;;;;;;;;;;;;;;;73:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;239:103;;;;;;;;;;;;;;;;;;;;;;;;;;346:165;408:19;160:5;;;;;;;;;;;146:19;;:10;:19;;;142:26;;;441:11;408:45;;459:8;:21;;;481:24;;459:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;142:26;346:165;;:::o;73:36::-;;;;:::o;49:20::-;;;;;;;;;;;;;:::o;239:103::-;160:5;;;;;;;;;;;146:19;;:10;:19;;;142:26;;;328:9;301:24;:36;;;;142:26;239:103;:::o", 71 | "source": "pragma solidity ^0.4.2;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n function Migrations() public {\n owner = msg.sender;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) public restricted {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n", 72 | "sourcePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/Migrations.sol", 73 | "ast": { 74 | "attributes": { 75 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/Migrations.sol", 76 | "exportedSymbols": { 77 | "Migrations": [ 78 | 56 79 | ] 80 | } 81 | }, 82 | "children": [ 83 | { 84 | "attributes": { 85 | "literals": [ 86 | "solidity", 87 | "^", 88 | "0.4", 89 | ".2" 90 | ] 91 | }, 92 | "id": 1, 93 | "name": "PragmaDirective", 94 | "src": "0:23:0" 95 | }, 96 | { 97 | "attributes": { 98 | "baseContracts": [ 99 | null 100 | ], 101 | "contractDependencies": [ 102 | null 103 | ], 104 | "contractKind": "contract", 105 | "documentation": null, 106 | "fullyImplemented": true, 107 | "linearizedBaseContracts": [ 108 | 56 109 | ], 110 | "name": "Migrations", 111 | "scope": 57 112 | }, 113 | "children": [ 114 | { 115 | "attributes": { 116 | "constant": false, 117 | "name": "owner", 118 | "scope": 56, 119 | "stateVariable": true, 120 | "storageLocation": "default", 121 | "type": "address", 122 | "value": null, 123 | "visibility": "public" 124 | }, 125 | "children": [ 126 | { 127 | "attributes": { 128 | "name": "address", 129 | "type": "address" 130 | }, 131 | "id": 2, 132 | "name": "ElementaryTypeName", 133 | "src": "49:7:0" 134 | } 135 | ], 136 | "id": 3, 137 | "name": "VariableDeclaration", 138 | "src": "49:20:0" 139 | }, 140 | { 141 | "attributes": { 142 | "constant": false, 143 | "name": "last_completed_migration", 144 | "scope": 56, 145 | "stateVariable": true, 146 | "storageLocation": "default", 147 | "type": "uint256", 148 | "value": null, 149 | "visibility": "public" 150 | }, 151 | "children": [ 152 | { 153 | "attributes": { 154 | "name": "uint", 155 | "type": "uint256" 156 | }, 157 | "id": 4, 158 | "name": "ElementaryTypeName", 159 | "src": "73:4:0" 160 | } 161 | ], 162 | "id": 5, 163 | "name": "VariableDeclaration", 164 | "src": "73:36:0" 165 | }, 166 | { 167 | "attributes": { 168 | "name": "restricted", 169 | "visibility": "internal" 170 | }, 171 | "children": [ 172 | { 173 | "attributes": { 174 | "parameters": [ 175 | null 176 | ] 177 | }, 178 | "children": [], 179 | "id": 6, 180 | "name": "ParameterList", 181 | "src": "133:2:0" 182 | }, 183 | { 184 | "children": [ 185 | { 186 | "attributes": { 187 | "falseBody": null 188 | }, 189 | "children": [ 190 | { 191 | "attributes": { 192 | "argumentTypes": null, 193 | "commonType": { 194 | "typeIdentifier": "t_address", 195 | "typeString": "address" 196 | }, 197 | "isConstant": false, 198 | "isLValue": false, 199 | "isPure": false, 200 | "lValueRequested": false, 201 | "operator": "==", 202 | "type": "bool" 203 | }, 204 | "children": [ 205 | { 206 | "attributes": { 207 | "argumentTypes": null, 208 | "isConstant": false, 209 | "isLValue": false, 210 | "isPure": false, 211 | "lValueRequested": false, 212 | "member_name": "sender", 213 | "referencedDeclaration": null, 214 | "type": "address" 215 | }, 216 | "children": [ 217 | { 218 | "attributes": { 219 | "argumentTypes": null, 220 | "overloadedDeclarations": [ 221 | null 222 | ], 223 | "referencedDeclaration": 2321, 224 | "type": "msg", 225 | "value": "msg" 226 | }, 227 | "id": 7, 228 | "name": "Identifier", 229 | "src": "146:3:0" 230 | } 231 | ], 232 | "id": 8, 233 | "name": "MemberAccess", 234 | "src": "146:10:0" 235 | }, 236 | { 237 | "attributes": { 238 | "argumentTypes": null, 239 | "overloadedDeclarations": [ 240 | null 241 | ], 242 | "referencedDeclaration": 3, 243 | "type": "address", 244 | "value": "owner" 245 | }, 246 | "id": 9, 247 | "name": "Identifier", 248 | "src": "160:5:0" 249 | } 250 | ], 251 | "id": 10, 252 | "name": "BinaryOperation", 253 | "src": "146:19:0" 254 | }, 255 | { 256 | "id": 11, 257 | "name": "PlaceholderStatement", 258 | "src": "167:1:0" 259 | } 260 | ], 261 | "id": 12, 262 | "name": "IfStatement", 263 | "src": "142:26:0" 264 | } 265 | ], 266 | "id": 13, 267 | "name": "Block", 268 | "src": "136:37:0" 269 | } 270 | ], 271 | "id": 14, 272 | "name": "ModifierDefinition", 273 | "src": "114:59:0" 274 | }, 275 | { 276 | "attributes": { 277 | "constant": false, 278 | "implemented": true, 279 | "isConstructor": true, 280 | "modifiers": [ 281 | null 282 | ], 283 | "name": "Migrations", 284 | "payable": false, 285 | "scope": 56, 286 | "stateMutability": "nonpayable", 287 | "superFunction": null, 288 | "visibility": "public" 289 | }, 290 | "children": [ 291 | { 292 | "attributes": { 293 | "parameters": [ 294 | null 295 | ] 296 | }, 297 | "children": [], 298 | "id": 15, 299 | "name": "ParameterList", 300 | "src": "196:2:0" 301 | }, 302 | { 303 | "attributes": { 304 | "parameters": [ 305 | null 306 | ] 307 | }, 308 | "children": [], 309 | "id": 16, 310 | "name": "ParameterList", 311 | "src": "206:0:0" 312 | }, 313 | { 314 | "children": [ 315 | { 316 | "children": [ 317 | { 318 | "attributes": { 319 | "argumentTypes": null, 320 | "isConstant": false, 321 | "isLValue": false, 322 | "isPure": false, 323 | "lValueRequested": false, 324 | "operator": "=", 325 | "type": "address" 326 | }, 327 | "children": [ 328 | { 329 | "attributes": { 330 | "argumentTypes": null, 331 | "overloadedDeclarations": [ 332 | null 333 | ], 334 | "referencedDeclaration": 3, 335 | "type": "address", 336 | "value": "owner" 337 | }, 338 | "id": 17, 339 | "name": "Identifier", 340 | "src": "212:5:0" 341 | }, 342 | { 343 | "attributes": { 344 | "argumentTypes": null, 345 | "isConstant": false, 346 | "isLValue": false, 347 | "isPure": false, 348 | "lValueRequested": false, 349 | "member_name": "sender", 350 | "referencedDeclaration": null, 351 | "type": "address" 352 | }, 353 | "children": [ 354 | { 355 | "attributes": { 356 | "argumentTypes": null, 357 | "overloadedDeclarations": [ 358 | null 359 | ], 360 | "referencedDeclaration": 2321, 361 | "type": "msg", 362 | "value": "msg" 363 | }, 364 | "id": 18, 365 | "name": "Identifier", 366 | "src": "220:3:0" 367 | } 368 | ], 369 | "id": 19, 370 | "name": "MemberAccess", 371 | "src": "220:10:0" 372 | } 373 | ], 374 | "id": 20, 375 | "name": "Assignment", 376 | "src": "212:18:0" 377 | } 378 | ], 379 | "id": 21, 380 | "name": "ExpressionStatement", 381 | "src": "212:18:0" 382 | } 383 | ], 384 | "id": 22, 385 | "name": "Block", 386 | "src": "206:29:0" 387 | } 388 | ], 389 | "id": 23, 390 | "name": "FunctionDefinition", 391 | "src": "177:58:0" 392 | }, 393 | { 394 | "attributes": { 395 | "constant": false, 396 | "implemented": true, 397 | "isConstructor": false, 398 | "name": "setCompleted", 399 | "payable": false, 400 | "scope": 56, 401 | "stateMutability": "nonpayable", 402 | "superFunction": null, 403 | "visibility": "public" 404 | }, 405 | "children": [ 406 | { 407 | "children": [ 408 | { 409 | "attributes": { 410 | "constant": false, 411 | "name": "completed", 412 | "scope": 35, 413 | "stateVariable": false, 414 | "storageLocation": "default", 415 | "type": "uint256", 416 | "value": null, 417 | "visibility": "internal" 418 | }, 419 | "children": [ 420 | { 421 | "attributes": { 422 | "name": "uint", 423 | "type": "uint256" 424 | }, 425 | "id": 24, 426 | "name": "ElementaryTypeName", 427 | "src": "261:4:0" 428 | } 429 | ], 430 | "id": 25, 431 | "name": "VariableDeclaration", 432 | "src": "261:14:0" 433 | } 434 | ], 435 | "id": 26, 436 | "name": "ParameterList", 437 | "src": "260:16:0" 438 | }, 439 | { 440 | "attributes": { 441 | "parameters": [ 442 | null 443 | ] 444 | }, 445 | "children": [], 446 | "id": 29, 447 | "name": "ParameterList", 448 | "src": "295:0:0" 449 | }, 450 | { 451 | "attributes": { 452 | "arguments": [ 453 | null 454 | ] 455 | }, 456 | "children": [ 457 | { 458 | "attributes": { 459 | "argumentTypes": null, 460 | "overloadedDeclarations": [ 461 | null 462 | ], 463 | "referencedDeclaration": 14, 464 | "type": "modifier ()", 465 | "value": "restricted" 466 | }, 467 | "id": 27, 468 | "name": "Identifier", 469 | "src": "284:10:0" 470 | } 471 | ], 472 | "id": 28, 473 | "name": "ModifierInvocation", 474 | "src": "284:10:0" 475 | }, 476 | { 477 | "children": [ 478 | { 479 | "children": [ 480 | { 481 | "attributes": { 482 | "argumentTypes": null, 483 | "isConstant": false, 484 | "isLValue": false, 485 | "isPure": false, 486 | "lValueRequested": false, 487 | "operator": "=", 488 | "type": "uint256" 489 | }, 490 | "children": [ 491 | { 492 | "attributes": { 493 | "argumentTypes": null, 494 | "overloadedDeclarations": [ 495 | null 496 | ], 497 | "referencedDeclaration": 5, 498 | "type": "uint256", 499 | "value": "last_completed_migration" 500 | }, 501 | "id": 30, 502 | "name": "Identifier", 503 | "src": "301:24:0" 504 | }, 505 | { 506 | "attributes": { 507 | "argumentTypes": null, 508 | "overloadedDeclarations": [ 509 | null 510 | ], 511 | "referencedDeclaration": 25, 512 | "type": "uint256", 513 | "value": "completed" 514 | }, 515 | "id": 31, 516 | "name": "Identifier", 517 | "src": "328:9:0" 518 | } 519 | ], 520 | "id": 32, 521 | "name": "Assignment", 522 | "src": "301:36:0" 523 | } 524 | ], 525 | "id": 33, 526 | "name": "ExpressionStatement", 527 | "src": "301:36:0" 528 | } 529 | ], 530 | "id": 34, 531 | "name": "Block", 532 | "src": "295:47:0" 533 | } 534 | ], 535 | "id": 35, 536 | "name": "FunctionDefinition", 537 | "src": "239:103:0" 538 | }, 539 | { 540 | "attributes": { 541 | "constant": false, 542 | "implemented": true, 543 | "isConstructor": false, 544 | "name": "upgrade", 545 | "payable": false, 546 | "scope": 56, 547 | "stateMutability": "nonpayable", 548 | "superFunction": null, 549 | "visibility": "public" 550 | }, 551 | "children": [ 552 | { 553 | "children": [ 554 | { 555 | "attributes": { 556 | "constant": false, 557 | "name": "new_address", 558 | "scope": 55, 559 | "stateVariable": false, 560 | "storageLocation": "default", 561 | "type": "address", 562 | "value": null, 563 | "visibility": "internal" 564 | }, 565 | "children": [ 566 | { 567 | "attributes": { 568 | "name": "address", 569 | "type": "address" 570 | }, 571 | "id": 36, 572 | "name": "ElementaryTypeName", 573 | "src": "363:7:0" 574 | } 575 | ], 576 | "id": 37, 577 | "name": "VariableDeclaration", 578 | "src": "363:19:0" 579 | } 580 | ], 581 | "id": 38, 582 | "name": "ParameterList", 583 | "src": "362:21:0" 584 | }, 585 | { 586 | "attributes": { 587 | "parameters": [ 588 | null 589 | ] 590 | }, 591 | "children": [], 592 | "id": 41, 593 | "name": "ParameterList", 594 | "src": "402:0:0" 595 | }, 596 | { 597 | "attributes": { 598 | "arguments": [ 599 | null 600 | ] 601 | }, 602 | "children": [ 603 | { 604 | "attributes": { 605 | "argumentTypes": null, 606 | "overloadedDeclarations": [ 607 | null 608 | ], 609 | "referencedDeclaration": 14, 610 | "type": "modifier ()", 611 | "value": "restricted" 612 | }, 613 | "id": 39, 614 | "name": "Identifier", 615 | "src": "391:10:0" 616 | } 617 | ], 618 | "id": 40, 619 | "name": "ModifierInvocation", 620 | "src": "391:10:0" 621 | }, 622 | { 623 | "children": [ 624 | { 625 | "attributes": { 626 | "assignments": [ 627 | 43 628 | ] 629 | }, 630 | "children": [ 631 | { 632 | "attributes": { 633 | "constant": false, 634 | "name": "upgraded", 635 | "scope": 55, 636 | "stateVariable": false, 637 | "storageLocation": "default", 638 | "type": "contract Migrations", 639 | "value": null, 640 | "visibility": "internal" 641 | }, 642 | "children": [ 643 | { 644 | "attributes": { 645 | "contractScope": null, 646 | "name": "Migrations", 647 | "referencedDeclaration": 56, 648 | "type": "contract Migrations" 649 | }, 650 | "id": 42, 651 | "name": "UserDefinedTypeName", 652 | "src": "408:10:0" 653 | } 654 | ], 655 | "id": 43, 656 | "name": "VariableDeclaration", 657 | "src": "408:19:0" 658 | }, 659 | { 660 | "attributes": { 661 | "argumentTypes": null, 662 | "isConstant": false, 663 | "isLValue": false, 664 | "isPure": false, 665 | "isStructConstructorCall": false, 666 | "lValueRequested": false, 667 | "names": [ 668 | null 669 | ], 670 | "type": "contract Migrations", 671 | "type_conversion": true 672 | }, 673 | "children": [ 674 | { 675 | "attributes": { 676 | "argumentTypes": [ 677 | { 678 | "typeIdentifier": "t_address", 679 | "typeString": "address" 680 | } 681 | ], 682 | "overloadedDeclarations": [ 683 | null 684 | ], 685 | "referencedDeclaration": 56, 686 | "type": "type(contract Migrations)", 687 | "value": "Migrations" 688 | }, 689 | "id": 44, 690 | "name": "Identifier", 691 | "src": "430:10:0" 692 | }, 693 | { 694 | "attributes": { 695 | "argumentTypes": null, 696 | "overloadedDeclarations": [ 697 | null 698 | ], 699 | "referencedDeclaration": 37, 700 | "type": "address", 701 | "value": "new_address" 702 | }, 703 | "id": 45, 704 | "name": "Identifier", 705 | "src": "441:11:0" 706 | } 707 | ], 708 | "id": 46, 709 | "name": "FunctionCall", 710 | "src": "430:23:0" 711 | } 712 | ], 713 | "id": 47, 714 | "name": "VariableDeclarationStatement", 715 | "src": "408:45:0" 716 | }, 717 | { 718 | "children": [ 719 | { 720 | "attributes": { 721 | "argumentTypes": null, 722 | "isConstant": false, 723 | "isLValue": false, 724 | "isPure": false, 725 | "isStructConstructorCall": false, 726 | "lValueRequested": false, 727 | "names": [ 728 | null 729 | ], 730 | "type": "tuple()", 731 | "type_conversion": false 732 | }, 733 | "children": [ 734 | { 735 | "attributes": { 736 | "argumentTypes": [ 737 | { 738 | "typeIdentifier": "t_uint256", 739 | "typeString": "uint256" 740 | } 741 | ], 742 | "isConstant": false, 743 | "isLValue": false, 744 | "isPure": false, 745 | "lValueRequested": false, 746 | "member_name": "setCompleted", 747 | "referencedDeclaration": 35, 748 | "type": "function (uint256) external" 749 | }, 750 | "children": [ 751 | { 752 | "attributes": { 753 | "argumentTypes": null, 754 | "overloadedDeclarations": [ 755 | null 756 | ], 757 | "referencedDeclaration": 43, 758 | "type": "contract Migrations", 759 | "value": "upgraded" 760 | }, 761 | "id": 48, 762 | "name": "Identifier", 763 | "src": "459:8:0" 764 | } 765 | ], 766 | "id": 50, 767 | "name": "MemberAccess", 768 | "src": "459:21:0" 769 | }, 770 | { 771 | "attributes": { 772 | "argumentTypes": null, 773 | "overloadedDeclarations": [ 774 | null 775 | ], 776 | "referencedDeclaration": 5, 777 | "type": "uint256", 778 | "value": "last_completed_migration" 779 | }, 780 | "id": 51, 781 | "name": "Identifier", 782 | "src": "481:24:0" 783 | } 784 | ], 785 | "id": 52, 786 | "name": "FunctionCall", 787 | "src": "459:47:0" 788 | } 789 | ], 790 | "id": 53, 791 | "name": "ExpressionStatement", 792 | "src": "459:47:0" 793 | } 794 | ], 795 | "id": 54, 796 | "name": "Block", 797 | "src": "402:109:0" 798 | } 799 | ], 800 | "id": 55, 801 | "name": "FunctionDefinition", 802 | "src": "346:165:0" 803 | } 804 | ], 805 | "id": 56, 806 | "name": "ContractDefinition", 807 | "src": "25:488:0" 808 | } 809 | ], 810 | "id": 57, 811 | "name": "SourceUnit", 812 | "src": "0:514:0" 813 | }, 814 | "legacyAST": { 815 | "attributes": { 816 | "absolutePath": "/home/user/GitHub/Viewly/platform-contracts/contracts/Migrations.sol", 817 | "exportedSymbols": { 818 | "Migrations": [ 819 | 56 820 | ] 821 | } 822 | }, 823 | "children": [ 824 | { 825 | "attributes": { 826 | "literals": [ 827 | "solidity", 828 | "^", 829 | "0.4", 830 | ".2" 831 | ] 832 | }, 833 | "id": 1, 834 | "name": "PragmaDirective", 835 | "src": "0:23:0" 836 | }, 837 | { 838 | "attributes": { 839 | "baseContracts": [ 840 | null 841 | ], 842 | "contractDependencies": [ 843 | null 844 | ], 845 | "contractKind": "contract", 846 | "documentation": null, 847 | "fullyImplemented": true, 848 | "linearizedBaseContracts": [ 849 | 56 850 | ], 851 | "name": "Migrations", 852 | "scope": 57 853 | }, 854 | "children": [ 855 | { 856 | "attributes": { 857 | "constant": false, 858 | "name": "owner", 859 | "scope": 56, 860 | "stateVariable": true, 861 | "storageLocation": "default", 862 | "type": "address", 863 | "value": null, 864 | "visibility": "public" 865 | }, 866 | "children": [ 867 | { 868 | "attributes": { 869 | "name": "address", 870 | "type": "address" 871 | }, 872 | "id": 2, 873 | "name": "ElementaryTypeName", 874 | "src": "49:7:0" 875 | } 876 | ], 877 | "id": 3, 878 | "name": "VariableDeclaration", 879 | "src": "49:20:0" 880 | }, 881 | { 882 | "attributes": { 883 | "constant": false, 884 | "name": "last_completed_migration", 885 | "scope": 56, 886 | "stateVariable": true, 887 | "storageLocation": "default", 888 | "type": "uint256", 889 | "value": null, 890 | "visibility": "public" 891 | }, 892 | "children": [ 893 | { 894 | "attributes": { 895 | "name": "uint", 896 | "type": "uint256" 897 | }, 898 | "id": 4, 899 | "name": "ElementaryTypeName", 900 | "src": "73:4:0" 901 | } 902 | ], 903 | "id": 5, 904 | "name": "VariableDeclaration", 905 | "src": "73:36:0" 906 | }, 907 | { 908 | "attributes": { 909 | "name": "restricted", 910 | "visibility": "internal" 911 | }, 912 | "children": [ 913 | { 914 | "attributes": { 915 | "parameters": [ 916 | null 917 | ] 918 | }, 919 | "children": [], 920 | "id": 6, 921 | "name": "ParameterList", 922 | "src": "133:2:0" 923 | }, 924 | { 925 | "children": [ 926 | { 927 | "attributes": { 928 | "falseBody": null 929 | }, 930 | "children": [ 931 | { 932 | "attributes": { 933 | "argumentTypes": null, 934 | "commonType": { 935 | "typeIdentifier": "t_address", 936 | "typeString": "address" 937 | }, 938 | "isConstant": false, 939 | "isLValue": false, 940 | "isPure": false, 941 | "lValueRequested": false, 942 | "operator": "==", 943 | "type": "bool" 944 | }, 945 | "children": [ 946 | { 947 | "attributes": { 948 | "argumentTypes": null, 949 | "isConstant": false, 950 | "isLValue": false, 951 | "isPure": false, 952 | "lValueRequested": false, 953 | "member_name": "sender", 954 | "referencedDeclaration": null, 955 | "type": "address" 956 | }, 957 | "children": [ 958 | { 959 | "attributes": { 960 | "argumentTypes": null, 961 | "overloadedDeclarations": [ 962 | null 963 | ], 964 | "referencedDeclaration": 2321, 965 | "type": "msg", 966 | "value": "msg" 967 | }, 968 | "id": 7, 969 | "name": "Identifier", 970 | "src": "146:3:0" 971 | } 972 | ], 973 | "id": 8, 974 | "name": "MemberAccess", 975 | "src": "146:10:0" 976 | }, 977 | { 978 | "attributes": { 979 | "argumentTypes": null, 980 | "overloadedDeclarations": [ 981 | null 982 | ], 983 | "referencedDeclaration": 3, 984 | "type": "address", 985 | "value": "owner" 986 | }, 987 | "id": 9, 988 | "name": "Identifier", 989 | "src": "160:5:0" 990 | } 991 | ], 992 | "id": 10, 993 | "name": "BinaryOperation", 994 | "src": "146:19:0" 995 | }, 996 | { 997 | "id": 11, 998 | "name": "PlaceholderStatement", 999 | "src": "167:1:0" 1000 | } 1001 | ], 1002 | "id": 12, 1003 | "name": "IfStatement", 1004 | "src": "142:26:0" 1005 | } 1006 | ], 1007 | "id": 13, 1008 | "name": "Block", 1009 | "src": "136:37:0" 1010 | } 1011 | ], 1012 | "id": 14, 1013 | "name": "ModifierDefinition", 1014 | "src": "114:59:0" 1015 | }, 1016 | { 1017 | "attributes": { 1018 | "constant": false, 1019 | "implemented": true, 1020 | "isConstructor": true, 1021 | "modifiers": [ 1022 | null 1023 | ], 1024 | "name": "Migrations", 1025 | "payable": false, 1026 | "scope": 56, 1027 | "stateMutability": "nonpayable", 1028 | "superFunction": null, 1029 | "visibility": "public" 1030 | }, 1031 | "children": [ 1032 | { 1033 | "attributes": { 1034 | "parameters": [ 1035 | null 1036 | ] 1037 | }, 1038 | "children": [], 1039 | "id": 15, 1040 | "name": "ParameterList", 1041 | "src": "196:2:0" 1042 | }, 1043 | { 1044 | "attributes": { 1045 | "parameters": [ 1046 | null 1047 | ] 1048 | }, 1049 | "children": [], 1050 | "id": 16, 1051 | "name": "ParameterList", 1052 | "src": "206:0:0" 1053 | }, 1054 | { 1055 | "children": [ 1056 | { 1057 | "children": [ 1058 | { 1059 | "attributes": { 1060 | "argumentTypes": null, 1061 | "isConstant": false, 1062 | "isLValue": false, 1063 | "isPure": false, 1064 | "lValueRequested": false, 1065 | "operator": "=", 1066 | "type": "address" 1067 | }, 1068 | "children": [ 1069 | { 1070 | "attributes": { 1071 | "argumentTypes": null, 1072 | "overloadedDeclarations": [ 1073 | null 1074 | ], 1075 | "referencedDeclaration": 3, 1076 | "type": "address", 1077 | "value": "owner" 1078 | }, 1079 | "id": 17, 1080 | "name": "Identifier", 1081 | "src": "212:5:0" 1082 | }, 1083 | { 1084 | "attributes": { 1085 | "argumentTypes": null, 1086 | "isConstant": false, 1087 | "isLValue": false, 1088 | "isPure": false, 1089 | "lValueRequested": false, 1090 | "member_name": "sender", 1091 | "referencedDeclaration": null, 1092 | "type": "address" 1093 | }, 1094 | "children": [ 1095 | { 1096 | "attributes": { 1097 | "argumentTypes": null, 1098 | "overloadedDeclarations": [ 1099 | null 1100 | ], 1101 | "referencedDeclaration": 2321, 1102 | "type": "msg", 1103 | "value": "msg" 1104 | }, 1105 | "id": 18, 1106 | "name": "Identifier", 1107 | "src": "220:3:0" 1108 | } 1109 | ], 1110 | "id": 19, 1111 | "name": "MemberAccess", 1112 | "src": "220:10:0" 1113 | } 1114 | ], 1115 | "id": 20, 1116 | "name": "Assignment", 1117 | "src": "212:18:0" 1118 | } 1119 | ], 1120 | "id": 21, 1121 | "name": "ExpressionStatement", 1122 | "src": "212:18:0" 1123 | } 1124 | ], 1125 | "id": 22, 1126 | "name": "Block", 1127 | "src": "206:29:0" 1128 | } 1129 | ], 1130 | "id": 23, 1131 | "name": "FunctionDefinition", 1132 | "src": "177:58:0" 1133 | }, 1134 | { 1135 | "attributes": { 1136 | "constant": false, 1137 | "implemented": true, 1138 | "isConstructor": false, 1139 | "name": "setCompleted", 1140 | "payable": false, 1141 | "scope": 56, 1142 | "stateMutability": "nonpayable", 1143 | "superFunction": null, 1144 | "visibility": "public" 1145 | }, 1146 | "children": [ 1147 | { 1148 | "children": [ 1149 | { 1150 | "attributes": { 1151 | "constant": false, 1152 | "name": "completed", 1153 | "scope": 35, 1154 | "stateVariable": false, 1155 | "storageLocation": "default", 1156 | "type": "uint256", 1157 | "value": null, 1158 | "visibility": "internal" 1159 | }, 1160 | "children": [ 1161 | { 1162 | "attributes": { 1163 | "name": "uint", 1164 | "type": "uint256" 1165 | }, 1166 | "id": 24, 1167 | "name": "ElementaryTypeName", 1168 | "src": "261:4:0" 1169 | } 1170 | ], 1171 | "id": 25, 1172 | "name": "VariableDeclaration", 1173 | "src": "261:14:0" 1174 | } 1175 | ], 1176 | "id": 26, 1177 | "name": "ParameterList", 1178 | "src": "260:16:0" 1179 | }, 1180 | { 1181 | "attributes": { 1182 | "parameters": [ 1183 | null 1184 | ] 1185 | }, 1186 | "children": [], 1187 | "id": 29, 1188 | "name": "ParameterList", 1189 | "src": "295:0:0" 1190 | }, 1191 | { 1192 | "attributes": { 1193 | "arguments": [ 1194 | null 1195 | ] 1196 | }, 1197 | "children": [ 1198 | { 1199 | "attributes": { 1200 | "argumentTypes": null, 1201 | "overloadedDeclarations": [ 1202 | null 1203 | ], 1204 | "referencedDeclaration": 14, 1205 | "type": "modifier ()", 1206 | "value": "restricted" 1207 | }, 1208 | "id": 27, 1209 | "name": "Identifier", 1210 | "src": "284:10:0" 1211 | } 1212 | ], 1213 | "id": 28, 1214 | "name": "ModifierInvocation", 1215 | "src": "284:10:0" 1216 | }, 1217 | { 1218 | "children": [ 1219 | { 1220 | "children": [ 1221 | { 1222 | "attributes": { 1223 | "argumentTypes": null, 1224 | "isConstant": false, 1225 | "isLValue": false, 1226 | "isPure": false, 1227 | "lValueRequested": false, 1228 | "operator": "=", 1229 | "type": "uint256" 1230 | }, 1231 | "children": [ 1232 | { 1233 | "attributes": { 1234 | "argumentTypes": null, 1235 | "overloadedDeclarations": [ 1236 | null 1237 | ], 1238 | "referencedDeclaration": 5, 1239 | "type": "uint256", 1240 | "value": "last_completed_migration" 1241 | }, 1242 | "id": 30, 1243 | "name": "Identifier", 1244 | "src": "301:24:0" 1245 | }, 1246 | { 1247 | "attributes": { 1248 | "argumentTypes": null, 1249 | "overloadedDeclarations": [ 1250 | null 1251 | ], 1252 | "referencedDeclaration": 25, 1253 | "type": "uint256", 1254 | "value": "completed" 1255 | }, 1256 | "id": 31, 1257 | "name": "Identifier", 1258 | "src": "328:9:0" 1259 | } 1260 | ], 1261 | "id": 32, 1262 | "name": "Assignment", 1263 | "src": "301:36:0" 1264 | } 1265 | ], 1266 | "id": 33, 1267 | "name": "ExpressionStatement", 1268 | "src": "301:36:0" 1269 | } 1270 | ], 1271 | "id": 34, 1272 | "name": "Block", 1273 | "src": "295:47:0" 1274 | } 1275 | ], 1276 | "id": 35, 1277 | "name": "FunctionDefinition", 1278 | "src": "239:103:0" 1279 | }, 1280 | { 1281 | "attributes": { 1282 | "constant": false, 1283 | "implemented": true, 1284 | "isConstructor": false, 1285 | "name": "upgrade", 1286 | "payable": false, 1287 | "scope": 56, 1288 | "stateMutability": "nonpayable", 1289 | "superFunction": null, 1290 | "visibility": "public" 1291 | }, 1292 | "children": [ 1293 | { 1294 | "children": [ 1295 | { 1296 | "attributes": { 1297 | "constant": false, 1298 | "name": "new_address", 1299 | "scope": 55, 1300 | "stateVariable": false, 1301 | "storageLocation": "default", 1302 | "type": "address", 1303 | "value": null, 1304 | "visibility": "internal" 1305 | }, 1306 | "children": [ 1307 | { 1308 | "attributes": { 1309 | "name": "address", 1310 | "type": "address" 1311 | }, 1312 | "id": 36, 1313 | "name": "ElementaryTypeName", 1314 | "src": "363:7:0" 1315 | } 1316 | ], 1317 | "id": 37, 1318 | "name": "VariableDeclaration", 1319 | "src": "363:19:0" 1320 | } 1321 | ], 1322 | "id": 38, 1323 | "name": "ParameterList", 1324 | "src": "362:21:0" 1325 | }, 1326 | { 1327 | "attributes": { 1328 | "parameters": [ 1329 | null 1330 | ] 1331 | }, 1332 | "children": [], 1333 | "id": 41, 1334 | "name": "ParameterList", 1335 | "src": "402:0:0" 1336 | }, 1337 | { 1338 | "attributes": { 1339 | "arguments": [ 1340 | null 1341 | ] 1342 | }, 1343 | "children": [ 1344 | { 1345 | "attributes": { 1346 | "argumentTypes": null, 1347 | "overloadedDeclarations": [ 1348 | null 1349 | ], 1350 | "referencedDeclaration": 14, 1351 | "type": "modifier ()", 1352 | "value": "restricted" 1353 | }, 1354 | "id": 39, 1355 | "name": "Identifier", 1356 | "src": "391:10:0" 1357 | } 1358 | ], 1359 | "id": 40, 1360 | "name": "ModifierInvocation", 1361 | "src": "391:10:0" 1362 | }, 1363 | { 1364 | "children": [ 1365 | { 1366 | "attributes": { 1367 | "assignments": [ 1368 | 43 1369 | ] 1370 | }, 1371 | "children": [ 1372 | { 1373 | "attributes": { 1374 | "constant": false, 1375 | "name": "upgraded", 1376 | "scope": 55, 1377 | "stateVariable": false, 1378 | "storageLocation": "default", 1379 | "type": "contract Migrations", 1380 | "value": null, 1381 | "visibility": "internal" 1382 | }, 1383 | "children": [ 1384 | { 1385 | "attributes": { 1386 | "contractScope": null, 1387 | "name": "Migrations", 1388 | "referencedDeclaration": 56, 1389 | "type": "contract Migrations" 1390 | }, 1391 | "id": 42, 1392 | "name": "UserDefinedTypeName", 1393 | "src": "408:10:0" 1394 | } 1395 | ], 1396 | "id": 43, 1397 | "name": "VariableDeclaration", 1398 | "src": "408:19:0" 1399 | }, 1400 | { 1401 | "attributes": { 1402 | "argumentTypes": null, 1403 | "isConstant": false, 1404 | "isLValue": false, 1405 | "isPure": false, 1406 | "isStructConstructorCall": false, 1407 | "lValueRequested": false, 1408 | "names": [ 1409 | null 1410 | ], 1411 | "type": "contract Migrations", 1412 | "type_conversion": true 1413 | }, 1414 | "children": [ 1415 | { 1416 | "attributes": { 1417 | "argumentTypes": [ 1418 | { 1419 | "typeIdentifier": "t_address", 1420 | "typeString": "address" 1421 | } 1422 | ], 1423 | "overloadedDeclarations": [ 1424 | null 1425 | ], 1426 | "referencedDeclaration": 56, 1427 | "type": "type(contract Migrations)", 1428 | "value": "Migrations" 1429 | }, 1430 | "id": 44, 1431 | "name": "Identifier", 1432 | "src": "430:10:0" 1433 | }, 1434 | { 1435 | "attributes": { 1436 | "argumentTypes": null, 1437 | "overloadedDeclarations": [ 1438 | null 1439 | ], 1440 | "referencedDeclaration": 37, 1441 | "type": "address", 1442 | "value": "new_address" 1443 | }, 1444 | "id": 45, 1445 | "name": "Identifier", 1446 | "src": "441:11:0" 1447 | } 1448 | ], 1449 | "id": 46, 1450 | "name": "FunctionCall", 1451 | "src": "430:23:0" 1452 | } 1453 | ], 1454 | "id": 47, 1455 | "name": "VariableDeclarationStatement", 1456 | "src": "408:45:0" 1457 | }, 1458 | { 1459 | "children": [ 1460 | { 1461 | "attributes": { 1462 | "argumentTypes": null, 1463 | "isConstant": false, 1464 | "isLValue": false, 1465 | "isPure": false, 1466 | "isStructConstructorCall": false, 1467 | "lValueRequested": false, 1468 | "names": [ 1469 | null 1470 | ], 1471 | "type": "tuple()", 1472 | "type_conversion": false 1473 | }, 1474 | "children": [ 1475 | { 1476 | "attributes": { 1477 | "argumentTypes": [ 1478 | { 1479 | "typeIdentifier": "t_uint256", 1480 | "typeString": "uint256" 1481 | } 1482 | ], 1483 | "isConstant": false, 1484 | "isLValue": false, 1485 | "isPure": false, 1486 | "lValueRequested": false, 1487 | "member_name": "setCompleted", 1488 | "referencedDeclaration": 35, 1489 | "type": "function (uint256) external" 1490 | }, 1491 | "children": [ 1492 | { 1493 | "attributes": { 1494 | "argumentTypes": null, 1495 | "overloadedDeclarations": [ 1496 | null 1497 | ], 1498 | "referencedDeclaration": 43, 1499 | "type": "contract Migrations", 1500 | "value": "upgraded" 1501 | }, 1502 | "id": 48, 1503 | "name": "Identifier", 1504 | "src": "459:8:0" 1505 | } 1506 | ], 1507 | "id": 50, 1508 | "name": "MemberAccess", 1509 | "src": "459:21:0" 1510 | }, 1511 | { 1512 | "attributes": { 1513 | "argumentTypes": null, 1514 | "overloadedDeclarations": [ 1515 | null 1516 | ], 1517 | "referencedDeclaration": 5, 1518 | "type": "uint256", 1519 | "value": "last_completed_migration" 1520 | }, 1521 | "id": 51, 1522 | "name": "Identifier", 1523 | "src": "481:24:0" 1524 | } 1525 | ], 1526 | "id": 52, 1527 | "name": "FunctionCall", 1528 | "src": "459:47:0" 1529 | } 1530 | ], 1531 | "id": 53, 1532 | "name": "ExpressionStatement", 1533 | "src": "459:47:0" 1534 | } 1535 | ], 1536 | "id": 54, 1537 | "name": "Block", 1538 | "src": "402:109:0" 1539 | } 1540 | ], 1541 | "id": 55, 1542 | "name": "FunctionDefinition", 1543 | "src": "346:165:0" 1544 | } 1545 | ], 1546 | "id": 56, 1547 | "name": "ContractDefinition", 1548 | "src": "25:488:0" 1549 | } 1550 | ], 1551 | "id": 57, 1552 | "name": "SourceUnit", 1553 | "src": "0:514:0" 1554 | }, 1555 | "compiler": { 1556 | "name": "solc", 1557 | "version": "0.4.19+commit.c4cbbb05.Emscripten.clang" 1558 | }, 1559 | "networks": { 1560 | "1": { 1561 | "events": {}, 1562 | "links": {}, 1563 | "address": "0x1f92840f31cbc8fc61afb483ecfacef5197cf16d", 1564 | "transactionHash": "0xce0ac18a2e9ec7d1dea9b8ed46725259c7b1085ac1921aed0dbcbfed06c59683" 1565 | }, 1566 | "42": { 1567 | "events": {}, 1568 | "links": {}, 1569 | "address": "0x29891eddbda356a77c8e352d27352b5758aa4d8a", 1570 | "transactionHash": "0xe985b970623a9a2ac843e6c504d2f774ec6f6437fad0fcb1702760ae0e83d347" 1571 | }, 1572 | "4447": { 1573 | "events": {}, 1574 | "links": {}, 1575 | "address": "0x8cdaf0cd259887258bc13a92c0a6da92698644c0" 1576 | }, 1577 | "5777": { 1578 | "events": {}, 1579 | "links": {}, 1580 | "address": "0x1cff61b8259f05f4bbf7aa4f769321e5fa70b22d" 1581 | } 1582 | }, 1583 | "schemaVersion": "2.0.1", 1584 | "updatedAt": "2018-07-16T17:49:57.127Z" 1585 | } -------------------------------------------------------------------------------- /contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.2; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | modifier restricted() { 8 | if (msg.sender == owner) _; 9 | } 10 | 11 | function Migrations() public { 12 | owner = msg.sender; 13 | } 14 | 15 | function setCompleted(uint completed) public restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) public restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /contracts/VideoPublisher.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.24; 2 | 3 | import "./dappsys/math.sol"; 4 | import "./dappsys/token.sol"; 5 | import "./dappsys/auth.sol"; 6 | 7 | // Pay to publish videos on Viewly. 8 | contract VideoPublisher is DSAuth, DSMath { 9 | 10 | DSToken public viewToken; 11 | uint public priceView; 12 | uint public priceEth; 13 | // videoID => publisher 14 | mapping (bytes12 => address) public videos; 15 | event Published(bytes12 videoID); 16 | 17 | function VideoPublisher( 18 | DSToken viewToken_, 19 | uint priceView_, 20 | uint priceEth_) public { 21 | viewToken = viewToken_; 22 | priceView = priceView_; 23 | priceEth = priceEth_; 24 | } 25 | 26 | function publish(bytes12 videoID) payable public { 27 | require(videos[videoID] == 0); 28 | if (msg.value == 0) { 29 | require(viewToken.transferFrom(msg.sender, address(this), priceView)); 30 | } else { 31 | require(msg.value >= priceEth); 32 | } 33 | videos[videoID] = msg.sender; 34 | emit Published(videoID); 35 | } 36 | 37 | function publishFor(bytes12 videoID, address beneficiary) payable public { 38 | require(videos[videoID] == 0); 39 | if (msg.value == 0) { 40 | require(viewToken.transferFrom(msg.sender, address(this), priceView)); 41 | } else { 42 | require(msg.value >= priceEth); 43 | } 44 | videos[videoID] = beneficiary; 45 | emit Published(videoID); 46 | } 47 | 48 | function setPrices(uint priceView_, uint priceEth_) public auth { 49 | priceView = priceView_; 50 | priceEth = priceEth_; 51 | } 52 | 53 | function withdraw(address addr) public payable auth { 54 | uint tokenBalance = viewToken.balanceOf(this); 55 | if (tokenBalance > 0) { 56 | viewToken.transfer(addr, tokenBalance); 57 | } 58 | if (address(this).balance > 0) { 59 | addr.transfer(address(this).balance); 60 | } 61 | } 62 | 63 | function destruct(address addr) public payable auth { 64 | require(address(this).balance == 0); 65 | require(viewToken.balanceOf(this) == 0); 66 | selfdestruct(addr); 67 | } 68 | 69 | function () public payable { 70 | revert(); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /contracts/VotingPowerDelegator.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.24; 2 | 3 | // Delegate voting power for stake based voting and governance. 4 | // Enables safe in-app voting participation, by letting users 5 | // delegate their cold wallet VP to a convenient hot wallet. 6 | contract VotingPowerDelegator { 7 | // delegator => beneficiary 8 | mapping (address => address) public delegations; 9 | mapping (address => uint) public delegatedAt; 10 | event Delegated(address delegator, address beneficiary); 11 | 12 | constructor() public { } 13 | 14 | function delegate(address beneficiary) public { 15 | if (beneficiary == msg.sender) { 16 | beneficiary = 0; 17 | } 18 | delegations[msg.sender] = beneficiary; 19 | delegatedAt[msg.sender] = now; 20 | emit Delegated(msg.sender, beneficiary); 21 | } 22 | 23 | function () public payable { 24 | revert(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /helpers/expectRevert.js: -------------------------------------------------------------------------------- 1 | module.exports = async (promise) => { 2 | try { 3 | await promise; 4 | } catch (error) { 5 | const invalidOpcode = error.message.search('invalid opcode') > -1; 6 | const revert = error.message.search('revert') >= 0; 7 | const outOfGas = error.message.search('out of gas') > -1; 8 | assert(invalidOpcode || outOfGas || revert, 9 | `Expected throw, got ${error} instead`); 10 | return; 11 | } 12 | assert(false, "Expected throw wasn't received"); 13 | }; 14 | -------------------------------------------------------------------------------- /migrations/1_deploy_migration.js: -------------------------------------------------------------------------------- 1 | var Migrations = artifacts.require("./Migrations.sol"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /migrations/2_deploy_erc20_token.js: -------------------------------------------------------------------------------- 1 | var DSToken = artifacts.require("./dappsys/DSToken.sol"); 2 | var DSGuard = artifacts.require("./dappsys/DSGuard.sol"); 3 | 4 | module.exports = function(deployer, network) { 5 | if (network == "mainnet") 6 | return 7 | return deployer.deploy(DSGuard) 8 | .then(() => deployer.deploy(DSToken, 'VIEW')) 9 | .then(() => DSToken.deployed()) 10 | .then((instance) => instance.setAuthority(DSGuard.address)) 11 | } 12 | -------------------------------------------------------------------------------- /migrations/3_deploy_video_publisher.js: -------------------------------------------------------------------------------- 1 | var DSToken = artifacts.require("./dappsys/DSToken.sol"); 2 | var VideoPublisher = artifacts.require("./VideoPublisher.sol"); 3 | 4 | module.exports = function(deployer, network) { 5 | const viewTokenAddr = (network == "mainnet") ? 6 | "0xf03f8d65bafa598611c3495124093c56e8f638f0" : DSToken.address; 7 | console.log(viewTokenAddr) 8 | deployer.deploy(VideoPublisher, 9 | viewTokenAddr, 10 | web3.toWei('20', 'ether'), 11 | web3.toWei('0.01', 'ether')) 12 | }; 13 | -------------------------------------------------------------------------------- /migrations/4_deploy_voting_power_delegator.js: -------------------------------------------------------------------------------- 1 | var VotingPowerDelegator = artifacts.require("./VotingPowerDelegator.sol"); 2 | 3 | module.exports = function(deployer, network) { 4 | deployer.deploy(VotingPowerDelegator); 5 | } 6 | -------------------------------------------------------------------------------- /test/Deployment.js: -------------------------------------------------------------------------------- 1 | var VideoPublisher = artifacts.require("VideoPublisher"); 2 | var DSToken = artifacts.require("DSToken"); 3 | var DSGuard = artifacts.require("DSGuard"); 4 | 5 | 6 | contract('DSToken', function(accounts) { 7 | let owner = accounts[0]; 8 | let authority = DSGuard.address; 9 | 10 | it("should have initial supply of 0", function() { 11 | return DSToken.deployed().then(function(instance) { 12 | return instance.totalSupply.call(); 13 | }).then(function(supply) { 14 | assert.equal( 15 | supply.valueOf(), 16 | 0, 17 | "DSToken Supply is not 0"); 18 | }); 19 | }); 20 | it("should have the correct owner", function() { 21 | return DSToken.deployed().then(function(instance) { 22 | return instance.owner.call(); 23 | }).then(function(owner_) { 24 | assert.equal(owner_, owner, 'Invalid owner'); 25 | }); 26 | }); 27 | it("should have DSGuard authority", function() { 28 | return DSToken.deployed().then(function(instance) { 29 | return instance.authority.call(); 30 | }).then(function(authority_) { 31 | assert.equal(authority_, authority, 'Invalid authority'); 32 | }); 33 | }); 34 | }); 35 | 36 | contract('VideoPublisher', function(accounts) { 37 | let owner = accounts[0]; 38 | 39 | it("should have correct DSToken instance", function() { 40 | return VideoPublisher.deployed().then(function(instance) { 41 | return instance.viewToken.call(); 42 | }).then(function(viewToken) { 43 | assert.equal( 44 | viewToken.valueOf(), 45 | DSToken.address, 46 | 'Invalid DSToken'); 47 | }); 48 | }); 49 | it("should have correct starting price", function() { 50 | return VideoPublisher.deployed().then(function(instance) { 51 | return instance.priceView.call(); 52 | }).then(function(price) { 53 | assert.equal( 54 | price.valueOf(), 55 | web3.toWei(20, 'ether'), 56 | 'Invalid starting price'); 57 | }); 58 | }); 59 | it("should have correct owner", function() { 60 | return VideoPublisher.deployed().then(function(instance) { 61 | return instance.owner.call(); 62 | }).then(function(owner_) { 63 | assert.equal(owner_, owner, 'Invalid owner'); 64 | }); 65 | }); 66 | it("should have no authority", function() { 67 | return VideoPublisher.deployed().then(function(instance) { 68 | return instance.authority.call(); 69 | }).then(function(authority) { 70 | assert.equal( 71 | authority.toString(), 72 | '0x0000000000000000000000000000000000000000', 73 | 'Authority Set'); 74 | }); 75 | }); 76 | }); 77 | -------------------------------------------------------------------------------- /test/VideoPublisher.js: -------------------------------------------------------------------------------- 1 | let expectRevert = require('../helpers/expectRevert.js') 2 | 3 | let VideoPublisher = artifacts.require("VideoPublisher") 4 | let DSToken = artifacts.require("DSToken") 5 | let DSGuard = artifacts.require("DSGuard") 6 | 7 | 8 | contract('VideoPublisher', (accounts) => { 9 | let viewToken, instance 10 | 11 | // videoID's are 12 ASCII characters long 12 | let videoID = web3.fromAscii('YMVHa8fEPIXh') 13 | 14 | // buyerWithFunds has sufficient funds to publish 15 | // and has approved the publishing contract instance 16 | // to spend on his behalf 17 | // buywerWithoutFunds has no tokens 18 | // buyerWithoutAuth has tokens, but hasnt approved the instance 19 | let owner = accounts[0] 20 | let buyerWithFunds = accounts[1] 21 | let buyerWithoutAuth = accounts[2] 22 | let buyerWithoutFunds = accounts[3] 23 | 24 | let ownerDeposit = web3.toWei(31, 'ether') 25 | let buyerWithFundsDeposit = web3.toWei(20, 'ether') 26 | let buyerWithoutAuthDeposit = web3.toWei(10, 'ether') 27 | let buyerWithoutFundsDeposit = web3.toWei(1, 'ether') 28 | 29 | let price = web3.toWei(10, 'ether') 30 | let priceEth = web3.toWei(0.01, 'ether') 31 | 32 | beforeEach(async () => { 33 | viewToken = await DSToken.new('VIEW') 34 | instance = await VideoPublisher.new(viewToken.address, price, priceEth) 35 | 36 | // due to a bug in truffle (function overloading) 37 | // tokens can be minted to owner account only 38 | await viewToken.mint(ownerDeposit) 39 | await viewToken.transfer(buyerWithFunds, buyerWithFundsDeposit) 40 | await viewToken.transfer(buyerWithoutAuth, buyerWithoutAuthDeposit) 41 | await viewToken.transfer(buyerWithoutFunds, buyerWithoutFundsDeposit) 42 | 43 | // due to a bug in truffle (function overloading) 44 | // approval have to be done with amounts 45 | await viewToken.approve( 46 | instance.address, web3.toWei(20, 'ether'), {from: buyerWithFunds}) 47 | }) 48 | 49 | describe('publish', async() => { 50 | it('should publish with sufficient funds and approval', async () => { 51 | let result = await instance.publish(videoID, {from: buyerWithFunds}) 52 | 53 | // check if video is published 54 | assert.equal((await instance.videos.call(videoID)), buyerWithFunds) 55 | 56 | // check if event fired properly 57 | assert.lengthOf(result.logs, 1); 58 | let event = result.logs[0]; 59 | assert.equal(event.event, 'Published'); 60 | assert.equal(event.args.videoID, videoID); 61 | // assert.equal(Number(event.args.price), (await instance.price.call())); 62 | 63 | // check if funds were deducted/credited properly 64 | let remainingBlance = (await viewToken.balanceOf(buyerWithFunds)).toNumber() 65 | assert.equal( 66 | remainingBlance, 67 | buyerWithFundsDeposit - (await instance.priceView.call()).toNumber()) 68 | assert.equal( 69 | (await viewToken.balanceOf(instance.address)).toNumber(), 70 | (await instance.priceView.call()).toNumber()) 71 | }) 72 | 73 | it('should fail if same video is published twice', async () => { 74 | await instance.publish(videoID, {from: buyerWithFunds}) 75 | await expectRevert(instance.publish(videoID, {from: buyerWithFunds})) 76 | }) 77 | 78 | it('should fail if user has funds but no approval', async () => { 79 | await expectRevert(instance.publish(videoID, {from: buyerWithoutAuth})) 80 | }) 81 | 82 | it('should fail if user has insufficient funds', async () => { 83 | await expectRevert(instance.publish(videoID, {from: buyerWithoutFunds})) 84 | }) 85 | }) 86 | 87 | describe('setPrices', async() => { 88 | it('should let owner change the price', async () => { 89 | let newPrice = web3.toWei(20, 'ether') 90 | let newPriceEth = web3.toWei(0.02, 'ether') 91 | await instance.setPrices(newPrice, newPriceEth, {from: owner}) 92 | assert.equal((await instance.priceView.call()), newPrice, 'Invalid New Price') 93 | }) 94 | it('should not let unauthorized user change the price', async () => { 95 | let newPrice = web3.toWei(20, 'ether') 96 | let newPriceEth = web3.toWei(0.02, 'ether') 97 | await expectRevert(instance.setPrices(newPrice, newPriceEth, {from: buyerWithFunds})) 98 | }) 99 | }) 100 | 101 | describe('withdraw', async() => { 102 | it('should let owner withdraw tokens', async () => { 103 | await instance.publish(videoID, {from: buyerWithFunds}) 104 | await instance.withdraw(owner, {from: owner}) 105 | assert.equal( 106 | (await viewToken.balanceOf(instance.address)).toNumber(), 107 | web3.toWei(0, 'ether')) 108 | assert.equal( 109 | (await viewToken.balanceOf(owner)).toNumber(), 110 | (await instance.priceView.call()).toNumber()) 111 | }) 112 | it('should not allow unauthorized user to withdraw tokens', async () => { 113 | let newPrice = web3.toWei(20, 'ether') 114 | await expectRevert(instance.withdraw(newPrice, {from: buyerWithFunds})) 115 | }) 116 | }) 117 | 118 | describe('destruct', async() => { 119 | it('should let owner destruct an empty contract', async () => { 120 | await instance.publish(videoID, {from: buyerWithFunds}) 121 | await instance.withdraw(owner, {from: owner}) 122 | await instance.destruct(owner, {from: owner}) 123 | assert.equal((await viewToken.balanceOf(owner)).toNumber(), price) 124 | }) 125 | it('should not let owner destruct a contract with funds', async () => { 126 | await instance.publish(videoID, {from: buyerWithFunds}) 127 | await expectRevert(instance.destruct(owner)) 128 | }) 129 | it('should not let unauthorized user destruct the contract', async () => { 130 | await expectRevert(instance.destruct(owner, {from: buyerWithFunds})) 131 | }) 132 | }) 133 | 134 | }) 135 | -------------------------------------------------------------------------------- /test/VotingPowerDelegator.js: -------------------------------------------------------------------------------- 1 | // let expectRevert = require('../helpers/expectRevert.js') 2 | 3 | let VotingPowerDelegator = artifacts.require("VotingPowerDelegator") 4 | 5 | 6 | contract('VotingPowerDelegator', (accounts) => { 7 | let instance 8 | 9 | let owner = accounts[0] 10 | let delegator = accounts[1] 11 | let beneficiary = accounts[2] 12 | 13 | beforeEach(async () => { 14 | instance = await VotingPowerDelegator.new() 15 | }) 16 | 17 | describe('delegate', async() => { 18 | it('should set the delegation', async () => { 19 | let result = await instance.delegate(beneficiary, {from: delegator}) 20 | 21 | // check if delegation was set 22 | assert.equal((await instance.delegations.call(delegator)), beneficiary) 23 | 24 | // check if event fired properly 25 | assert.lengthOf(result.logs, 1); 26 | let event = result.logs[0]; 27 | assert.equal(event.event, 'Delegated'); 28 | assert.equal(event.args.delegator, delegator); 29 | assert.equal(event.args.beneficiary, beneficiary); 30 | }) 31 | 32 | it('should unset the delegation', async () => { 33 | await instance.delegate(beneficiary, {from: delegator}) 34 | await instance.delegate(0, {from: delegator}) 35 | assert.equal((await instance.delegations.call(delegator)), 0) 36 | }) 37 | 38 | it('should unset the delegation if delegating to self', async () => { 39 | await instance.delegate(delegator, {from: delegator}) 40 | assert.equal((await instance.delegations.call(delegator)), 0) 41 | }) 42 | 43 | }) 44 | 45 | }) 46 | -------------------------------------------------------------------------------- /truffle.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // See 3 | // to customize your Truffle configuration! 4 | networks: { 5 | ganache: { 6 | host: "127.0.0.1", 7 | port: 7545, 8 | network_id: "*" // Match any network id 9 | }, 10 | mainnet: { 11 | network_id: 1, 12 | host: "127.0.0.1", 13 | port: 8545, 14 | gasPrice: 20000000000, // 20 gwei 15 | from: "0x00Db81D2d33b8Ef69a62e3b31bF769a12124C5E8" // deployer 16 | }, 17 | kovan: { 18 | network_id: 42, 19 | host: "127.0.0.1", 20 | port: 8545, 21 | gasPrice: 5000000000, // 5 gwei 22 | } 23 | } 24 | }; 25 | --------------------------------------------------------------------------------