UNPKG

realitytoken-contracts

Version:
878 lines (877 loc) 808 kB
{ "contractName": "RealityToken", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "uint256" }, { "name": "", "type": "uint256" } ], "name": "window_branches", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "address" } ], "name": "last_debit_windows", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "branches", "outputs": [ { "name": "parent_hash", "type": "bytes32" }, { "name": "merkle_root", "type": "bytes32" }, { "name": "arbitrator_list", "type": "address" }, { "name": "timestamp", "type": "uint256" }, { "name": "window", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "genesis_window_timestamp", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "_owner", "type": "address" }, { "indexed": true, "name": "_spender", "type": "address" }, { "indexed": false, "name": "_value", "type": "uint256" }, { "indexed": false, "name": "branch", "type": "bytes32" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "_from", "type": "address" }, { "indexed": true, "name": "_to", "type": "address" }, { "indexed": false, "name": "_value", "type": "uint256" }, { "indexed": false, "name": "branch", "type": "bytes32" } ], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "hash", "type": "bytes32" }, { "indexed": false, "name": "data_cntrct", "type": "address" } ], "name": "BranchCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "contract_funded", "type": "address" }, { "indexed": false, "name": "funding_amount", "type": "int256" } ], "name": "FundedDistributionContract", "type": "event" }, { "constant": false, "inputs": [ { "name": "parent_branch_hash", "type": "bytes32" }, { "name": "merkle_root", "type": "bytes32" }, { "name": "arbitrator_list", "type": "address" }, { "name": "contract_funded", "type": "address" }, { "name": "funding_amount", "type": "int256" } ], "name": "createBranch", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "window", "type": "uint256" } ], "name": "getWindowBranches", "outputs": [ { "name": "", "type": "bytes32[]" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_spender", "type": "address" }, { "name": "_amount", "type": "uint256" }, { "name": "_branch", "type": "bytes32" } ], "name": "approve", "outputs": [ { "name": "success", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "_owner", "type": "address" }, { "name": "_spender", "type": "address" }, { "name": "branch", "type": "bytes32" } ], "name": "allowance", "outputs": [ { "name": "remaining", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "addr", "type": "address" }, { "name": "branch", "type": "bytes32" } ], "name": "balanceOf", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "addr", "type": "address" }, { "name": "_min_balance", "type": "uint256" }, { "name": "branch_hash", "type": "bytes32" } ], "name": "isAmountSpendable", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "from", "type": "address" }, { "name": "addr", "type": "address" }, { "name": "amount", "type": "uint256" }, { "name": "branch", "type": "bytes32" } ], "name": "transferFrom", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "addr", "type": "address" }, { "name": "amount", "type": "uint256" }, { "name": "branch", "type": "bytes32" } ], "name": "transfer", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "_branch", "type": "bytes32" } ], "name": "getArbitratorList", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "_branchHash", "type": "bytes32" } ], "name": "getWindowOfBranch", "outputs": [ { "name": "id", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "investigationHash", "type": "bytes32" }, { "name": "hashOlderBranch", "type": "bytes32" }, { "name": "hashNewerBranch", "type": "bytes32" } ], "name": "isBranchInBetweenBranches", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "branch", "type": "bytes32" } ], "name": "getTimestampOfBranch", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x6060604052341561000f57600080fd5b6000808080620151804206420360035560405180807f49206c6561766520746f207365766572616c206675747572657320286e6f742081526020017f746f20616c6c29206d792067617264656e206f6620666f726b696e672070617481526020017f68730000000000000000000000000000000000000000000000000000000000008152506042019050604051809103902091508282856040519283526020830191909152600160a060020a03166c0100000000000000000000000002604080830191909152605490910190518091039020905060a060405190810160409081528482526020808301859052600160a060020a03871682840152426060840152600060808401819052848152908190522081518155602082015160018201556040820151600282018054600160a060020a031916600160a060020a039290921691909117905560608201518160030155608082015160049091015550600081815260208181526040808320600160a060020a033316845260050182528220660775f05a0740009055908052600290527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b8054600181016101cf83826101e5565b506000918252602090912001555061022f915050565b8154818355818115116102095760008381526020902061020991810190830161020e565b505050565b61022c91905b808211156102285760008155600101610214565b5090565b90565b610c188061023e6000396000f3006060604052600436106100e55763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631c8d5d3881146100ea5780632a748535146101245780632c43c169146101565780633ba10e8b1461016f578063401e3367146101d8578063483e4b16146102175780634d30b6be1461022d57806357cfeeee1461024f578063633033ca1461027457806374618a0d146102935780638180f2fc146102e857806381a4464e1461030d578063911651ac1461033b578063c6d36a3314610360578063c7b4a62f14610373578063dc4803d114610389575b600080fd5b34156100f557600080fd5b610112600160a060020a03600435811690602435166044356103a5565b60405190815260200160405180910390f35b341561012f57600080fd5b61013a6004356103d7565b604051600160a060020a03909116815260200160405180910390f35b341561016157600080fd5b6101126004356024356103f5565b341561017a57600080fd5b610185600435610423565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156101c45780820151838201526020016101ac565b505050509050019250505060405180910390f35b34156101e357600080fd5b610203600160a060020a0360043581169060243516604435606435610495565b604051901515815260200160405180910390f35b341561022257600080fd5b610112600435610633565b341561023857600080fd5b610112600160a060020a0360043516602435610648565b341561025a57600080fd5b610203600160a060020a0360043516602435604435610693565b341561027f57600080fd5b610112600160a060020a03600435166107aa565b341561029e57600080fd5b6102a96004356107bc565b6040519485526020850193909352600160a060020a039091166040808501919091526060840191909152608083019190915260a0909101905180910390f35b34156102f357600080fd5b610203600160a060020a03600435166024356044356107f5565b341561031857600080fd5b610112600435602435600160a060020a0360443581169060643516608435610872565b341561034657600080fd5b610203600160a060020a0360043516602435604435610abc565b341561036b57600080fd5b610112610b3a565b341561037e57600080fd5b610112600435610b40565b341561039457600080fd5b610203600435602435604435610b55565b600160a060020a0392831660009081526004602090815260408083209490951682529283528381209181529152205490565b600090815260208190526040902060020154600160a060020a031690565b60026020528160005260406000208181548110151561041057fe5b6000918252602090912001549150829050565b61042b610b90565b6002600083815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561048957602002820191906000526020600020905b81548152600190910190602001808311610474575b50505050509050919050565b600160a060020a038085166000908152600460209081526040808320339094168352928152828220848352905290812054819081908190869010156104d957600080fd5b6000858152602081905260409020600401549250660775f05a07400086111561050157600080fd5b6000858152602081905260408120600301541161051d57600080fd5b600160a060020a0388166000908152600160205260409020548310156105465760009350610628565b610551888787610abc565b15156105605760009350610628565b5050600160a060020a038681166000818152600160209081526040808320869055878352828252808320848452600501825280832080548a90039055898516835280832080548a019055928252600481528282203390941682529283528181208682529092529020548481038082116105d557fe5b86600160a060020a031688600160a060020a03167f10d85eb696556cf89e382ad2be46259009e783f0060ef100faa456da4d834add888860405191825260208201526040908101905180910390a3600193505b505050949350505050565b60009081526020819052604090206004015490565b600080805b83811461068b57600084815260208181526040808320600160a060020a0389168452600581018352908320549683529190525493919091019061064d565b509392505050565b600081815260208190526040812060040154660775f05a0740008411156106b957600080fd5b600083815260208190526040812060030154116106d557600080fd5b600160a060020a0333166000908152600160205260409020548110156106fe576000915061068b565b610709338585610abc565b1515610718576000915061068b565b600160a060020a0333811660008181526001602090815260408083208690558783528282528083208484526005019091528082208054899003905592881680825290839020805488019055917f10d85eb696556cf89e382ad2be46259009e783f0060ef100faa456da4d834add90879087905191825260208201526040908101905180910390a3506001949350505050565b60016020526000908152604090205481565b6000602081905290815260409020805460018201546002830154600384015460049094015492939192600160a060020a03909116919085565b600160a060020a033381166000818152600460209081526040808320948816808452948252808320868452909152808220869055909291907f3f2942ebbe186a895b6f45ed67745d6415c10de9037c58f40671e00ee50d84a390869086905191825260208201526040908101905180910390a35060019392505050565b60008060008062015180600354420381151561088a57fe5b0491508888886040519283526020830191909152600160a060020a03166c0100000000000000000000000002604080830191909152605490910190519081900390209050828114156108db57600080fd5b600081815260208190526040902060030154156108f757600080fd5b6000898152602081905260408120600301541161091357600080fd5b60008981526020819052604090206004015482901061093157600080fd5b60008513156109ab57600081815260208181526040808320600160a060020a038a168452600501909152908190208054870190557fe94197a1fc588d321a4da881f61fd74ec301b9a6d29404bdfbd902f8e0a02845908790879051600160a060020a03909216825260208201526040908101905180910390a15b60a060405190810160409081528a825260208083018b9052600160a060020a038a168284015242606084015260808301859052600084815290819052208151815560208201516001820155604082015160028201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055606082015181600301556080820151600490910155506000828152600260205260409020805460018101610a5e8382610ba2565b5060009182526020909120018190557f1c0d77521be7a4e300c726e7b0429d932040a7e5d02a0d836769882791af7c308188604051918252600160a060020a031660208201526040908101905180910390a198975050505050505050565b6000808080660775f05a074000861115610ad557600080fd5b600092508591505b848114610b2b57600085815260208181526040808320600160a060020a038b1684526005810183529083205497835291905254949290920191818312610b265760019350610b30565b610add565b600093505b5050509392505050565b60035481565b60009081526020819052604090206003015490565b6000815b808414610b855784811415610b71576001915061068b565b600090815260208190526040902054610b59565b506000949350505050565b60206040519081016040526000815290565b815481835581811511610bc657600083815260209020610bc6918101908301610bcb565b505050565b610be991905b80821115610be55760008155600101610bd1565b5090565b905600a165627a7a72305820c19d5051e229977b5c5d145b7d117c54ae49eb43505d161bbdb8453de2ac96740029", "deployedBytecode": "0x6060604052600436106100e55763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631c8d5d3881146100ea5780632a748535146101245780632c43c169146101565780633ba10e8b1461016f578063401e3367146101d8578063483e4b16146102175780634d30b6be1461022d57806357cfeeee1461024f578063633033ca1461027457806374618a0d146102935780638180f2fc146102e857806381a4464e1461030d578063911651ac1461033b578063c6d36a3314610360578063c7b4a62f14610373578063dc4803d114610389575b600080fd5b34156100f557600080fd5b610112600160a060020a03600435811690602435166044356103a5565b60405190815260200160405180910390f35b341561012f57600080fd5b61013a6004356103d7565b604051600160a060020a03909116815260200160405180910390f35b341561016157600080fd5b6101126004356024356103f5565b341561017a57600080fd5b610185600435610423565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156101c45780820151838201526020016101ac565b505050509050019250505060405180910390f35b34156101e357600080fd5b610203600160a060020a0360043581169060243516604435606435610495565b604051901515815260200160405180910390f35b341561022257600080fd5b610112600435610633565b341561023857600080fd5b610112600160a060020a0360043516602435610648565b341561025a57600080fd5b610203600160a060020a0360043516602435604435610693565b341561027f57600080fd5b610112600160a060020a03600435166107aa565b341561029e57600080fd5b6102a96004356107bc565b6040519485526020850193909352600160a060020a039091166040808501919091526060840191909152608083019190915260a0909101905180910390f35b34156102f357600080fd5b610203600160a060020a03600435166024356044356107f5565b341561031857600080fd5b610112600435602435600160a060020a0360443581169060643516608435610872565b341561034657600080fd5b610203600160a060020a0360043516602435604435610abc565b341561036b57600080fd5b610112610b3a565b341561037e57600080fd5b610112600435610b40565b341561039457600080fd5b610203600435602435604435610b55565b600160a060020a0392831660009081526004602090815260408083209490951682529283528381209181529152205490565b600090815260208190526040902060020154600160a060020a031690565b60026020528160005260406000208181548110151561041057fe5b6000918252602090912001549150829050565b61042b610b90565b6002600083815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561048957602002820191906000526020600020905b81548152600190910190602001808311610474575b50505050509050919050565b600160a060020a038085166000908152600460209081526040808320339094168352928152828220848352905290812054819081908190869010156104d957600080fd5b6000858152602081905260409020600401549250660775f05a07400086111561050157600080fd5b6000858152602081905260408120600301541161051d57600080fd5b600160a060020a0388166000908152600160205260409020548310156105465760009350610628565b610551888787610abc565b15156105605760009350610628565b5050600160a060020a038681166000818152600160209081526040808320869055878352828252808320848452600501825280832080548a90039055898516835280832080548a019055928252600481528282203390941682529283528181208682529092529020548481038082116105d557fe5b86600160a060020a031688600160a060020a03167f10d85eb696556cf89e382ad2be46259009e783f0060ef100faa456da4d834add888860405191825260208201526040908101905180910390a3600193505b505050949350505050565b60009081526020819052604090206004015490565b600080805b83811461068b57600084815260208181526040808320600160a060020a0389168452600581018352908320549683529190525493919091019061064d565b509392505050565b600081815260208190526040812060040154660775f05a0740008411156106b957600080fd5b600083815260208190526040812060030154116106d557600080fd5b600160a060020a0333166000908152600160205260409020548110156106fe576000915061068b565b610709338585610abc565b1515610718576000915061068b565b600160a060020a0333811660008181526001602090815260408083208690558783528282528083208484526005019091528082208054899003905592881680825290839020805488019055917f10d85eb696556cf89e382ad2be46259009e783f0060ef100faa456da4d834add90879087905191825260208201526040908101905180910390a3506001949350505050565b60016020526000908152604090205481565b6000602081905290815260409020805460018201546002830154600384015460049094015492939192600160a060020a03909116919085565b600160a060020a033381166000818152600460209081526040808320948816808452948252808320868452909152808220869055909291907f3f2942ebbe186a895b6f45ed67745d6415c10de9037c58f40671e00ee50d84a390869086905191825260208201526040908101905180910390a35060019392505050565b60008060008062015180600354420381151561088a57fe5b0491508888886040519283526020830191909152600160a060020a03166c0100000000000000000000000002604080830191909152605490910190519081900390209050828114156108db57600080fd5b600081815260208190526040902060030154156108f757600080fd5b6000898152602081905260408120600301541161091357600080fd5b60008981526020819052604090206004015482901061093157600080fd5b60008513156109ab57600081815260208181526040808320600160a060020a038a168452600501909152908190208054870190557fe94197a1fc588d321a4da881f61fd74ec301b9a6d29404bdfbd902f8e0a02845908790879051600160a060020a03909216825260208201526040908101905180910390a15b60a060405190810160409081528a825260208083018b9052600160a060020a038a168284015242606084015260808301859052600084815290819052208151815560208201516001820155604082015160028201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055606082015181600301556080820151600490910155506000828152600260205260409020805460018101610a5e8382610ba2565b5060009182526020909120018190557f1c0d77521be7a4e300c726e7b0429d932040a7e5d02a0d836769882791af7c308188604051918252600160a060020a031660208201526040908101905180910390a198975050505050505050565b6000808080660775f05a074000861115610ad557600080fd5b600092508591505b848114610b2b57600085815260208181526040808320600160a060020a038b1684526005810183529083205497835291905254949290920191818312610b265760019350610b30565b610add565b600093505b5050509392505050565b60035481565b60009081526020819052604090206003015490565b6000815b808414610b855784811415610b71576001915061068b565b600090815260208190526040902054610b59565b506000949350505050565b60206040519081016040526000815290565b815481835581811511610bc657600083815260209020610bc6918101908301610bcb565b505050565b610be991905b80821115610be55760008155600101610bd1565b5090565b905600a165627a7a72305820c19d5051e229977b5c5d145b7d117c54ae49eb43505d161bbdb8453de2ac96740029", "sourceMap": "25:7819:1:-;;;1479:610;;;;;;;;1580:20;;;;1564:5;1558:3;:11;1551:3;:19;1524:24;:46;1667:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1637:109;;1796:9;1807:19;1828:12;1786:55;;;;;;;;;;;;-1:-1:-1;;;;;1786:55:1;;;;;;;;;;;;;;;;;;;;;;1756:85;;1883:60;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1883:60:1;;;;;;1936:3;1883:60;;;;;;;;;;;1851:29;;;;;;;;1883:60;1851:92;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;1851:92:1;-1:-1:-1;;;;;1851:92:1;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1953:8:1;:29;;;;;;;;;;;-1:-1:-1;;;;;1998:10:1;1953:56;;;:44;;:56;;;;2012:16;1953:75;;2038:18;;;:15;:18;;;:44;;;;;;:18;:44;;:::i;:::-;-1:-1:-1;2038:44:1;;;;;;;;;;-1:-1:-1;25:7819:1;;-1:-1:-1;;25:7819:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", "deployedSourceMap": "25:7819:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3851:171;;;;;;;;;;-1:-1:-1;;;;;3851:171:1;;;;;;;;;;;;;;;;;;;;;;;;;;;6977:139;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6977:139:1;;;;;;;;;;;;;;1189:52;;;;;;;;;;;;;;;;3457:130;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3457:130:1;;;;;;;;;;;;;;;;;5233:979;;;;;;;;;;-1:-1:-1;;;;;5233:979:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7122:138;;;;;;;;;;;;;;4028:330;;;;;;;;;;-1:-1:-1;;;;;4028:330:1;;;;;;;6218:753;;;;;;;;;;-1:-1:-1;;;;;6218:753:1;;;;;;;;;1072:53;;;;;;;;;;-1:-1:-1;;;;;1072:53:1;;;;;874:42;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;874:42:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3593:252;;;;;;;;;;-1:-1:-1;;;;;3593:252:1;;;;;;;;;2095:1356;;;;;;;;;;;;;;-1:-1:-1;;;;;2095:1356:1;;;;;;;;;;;;4668:559;;;;;;;;;;-1:-1:-1;;;;;4668:559:1;;;;;;;;;1301:39;;;;;;;;;;;;7718:124;;;;;;;;;;;;;;7266:446;;;;;;;;;;;;;;;;;;3851:171;-1:-1:-1;;;;;3982:15:1;;;3949:14;3982:15;;;:7;:15;;;;;;;;:25;;;;;;;;;;;;:33;;;;;;;;3851:171::o;6977:139::-;7050:7;7076:17;;;;;;;;;;:33;;;-1:-1:-1;;;;;7076:33:1;;6977:139::o;1189:52::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1189:52:1;;-1:-1:-1;1189:52:1:o;3457:130::-;3529:9;;:::i;:::-;3557:15;:23;3573:6;3557:23;;;;;;;;;;;3550:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3457:130;;;:::o;5233:979::-;-1:-1:-1;;;;;5360:13:1;;;5335:4;5360:13;;;:7;:13;;;;;;;;5374:10;5360:25;;;;;;;;;;;:33;;;;;;;;;5335:4;;;;;;5360:43;;;;5352:52;;;;;;5439:8;:16;;;;;;;;;;:23;;;;-1:-1:-1;5491:16:1;5481:26;;;5473:35;;;;;;5555:1;5526:16;;;;;;;;;;:26;;;:30;5518:39;;;;;;-1:-1:-1;;;;;5609:24:1;;;;;;:18;:24;;;;;;5593:40;;5589:58;;;5642:5;5635:12;;;;5589:58;5691:39;5709:4;5715:6;5723;5691:17;:39::i;:::-;5690:40;5686:58;;;5739:5;5732:12;;;;5686:58;-1:-1:-1;;;;;;;5787:24:1;;;;;;;:18;:24;;;;;;;;:40;;;5837:16;;;;;;;;;:37;;;:31;;:37;;;;;:55;;;;;;;5902:37;;;;;;;;:55;;;;;;5993:13;;;:7;:13;;;;;6007:10;5993:25;;;;;;;;;;;:33;;;;;;;;;6060:23;;;6100:30;;;6093:38;;;;6162:4;-1:-1:-1;;;;;6147:36:1;6156:4;-1:-1:-1;;;;;6147:36:1;;6168:6;6176;6147:36;;;;;;;;;;;;;;;;;;;;6201:4;6194:11;;5233:979;;;;;;;;;;:::o;7122:138::-;7199:7;7225:21;;;;;;;;;;:28;;;;7122:138::o;4028:330::-;4106:7;;;4176:147;4182:19;;;4176:147;;4224:8;:16;;;;;;;;;;;-1:-1:-1;;;;;4224:37:1;;;;:31;;;:37;;;;;;4284:16;;;;;;:28;;4217:44;;;;;4176:147;;;-1:-1:-1;4347:3:1;4028:330;-1:-1:-1;;;4028:330:1:o;6218:753::-;6302:4;6342:16;;;;;;;;;;:23;;;6394:16;6384:26;;;6376:35;;;;;;6458:1;6429:16;;;;;;;;;;:26;;;:30;6421:39;;;;;;-1:-1:-1;;;;;6531:10:1;6512:30;;;;;:18;:30;;;;;;6496:46;;6492:64;;;6551:5;6544:12;;;;6492:64;6600:45;6618:10;6630:6;6638;6600:17;:45::i;:::-;6599:46;6595:64;;;6654:5;6647:12;;;;6595:64;-1:-1:-1;;;;;6721:10:1;6702:30;;;;;;:18;:30;;;;;;;;:46;;;6758:16;;;;;;;;;:43;;;:31;;:43;;;;;;:61;;;;;;;6829:37;;;;;;;;;;:55;;;;;;:37;6900:42;;6758:61;;:16;;6900:42;;;;;;;;;;;;;;;;;;;-1:-1:-1;6960:4:1;;6218:753;-1:-1:-1;;;;6218:753:1:o;1072:53::-;;;;;;;;;;;;;:::o;874:42::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;874:42:1;;;;;;:::o;3593:252::-;-1:-1:-1;;;;;3714:10:1;3706:19;;3682:12;3706:19;;;:7;:19;;;;;;;;:29;;;;;;;;;;;;:38;;;;;;;;;:48;;;3682:12;;3706:29;:19;3769:48;;3747:7;;3736;;3769:48;;;;;;;;;;;;;;;;;;;-1:-1:-1;3834:4:1;3593:252;;;;;:::o;2095:1356::-;2259:7;2278:17;2305:14;2407:19;2357:5;2329:24;;2323:3;:30;2322:40;;;;;;;;2305:57;;2439:18;2459:11;2472:15;2429:59;;;;;;;;;;;;-1:-1:-1;;;;;2429:59:1;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2506:24:1;;;;2498:33;;;;;;2687:8;:21;;;;;;;;;;:31;;;:36;2679:45;;;;;;2783:1;2742:28;;;;;;;;;;:38;;;:42;2734:51;;;;;;2870:8;:28;;;;;;;;;;:35;;;:44;;;2862:53;;;;;;3027:1;3010:14;:18;3006:198;;;3044:8;:21;;;;;;;;;;;-1:-1:-1;;;;;3044:53:1;;;;:36;;:53;;;;;;;:71;;;;;;3134:59;;3081:15;;3101:14;;3134:59;-1:-1:-1;;;;;3134:59:1;;;;;;;;;;;;;;;;;;;;3006:198;3238:69;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3238:69:1;;;;;;3295:3;3238:69;;;;;;;;;;;3214:21;;;;;;;;3238:69;3214:93;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3214:93:1;-1:-1:-1;;;;;3214:93:1;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3317:23:1;;;;:15;:23;;;;;:41;;;;;;:23;:41;;:::i;:::-;-1:-1:-1;3317:41:1;;;;;;;;;;;;3373:43;3346:11;3400:15;3373:43;;;;;-1:-1:-1;;;;;3373:43:1;;;;;;;;;;;;;;;;3433:11;2095:1356;-1:-1:-1;;;;;;;;2095:1356:1:o;4668:559::-;4781:4;;;;4822:16;4806:32;;;4797:42;;;;;;4862:1;4849:14;;4901:12;4873:41;;4951:248;4957:24;;;4951:248;;5004:8;:21;;;;;;;;;;;-1:-1:-1;;;;;5004:42:1;;;;:36;;;:42;;;;;;5074:21;;;;;;:33;;4997:49;;;;;5125:18;;;5121:68;;5170:4;5163:11;;;;5121:68;4951:248;;;5215:5;5208:12;;4668:559;;;;;;;;;:::o;1301:39::-;;;;:::o;7718:124::-;7784:7;7809:16;;;;;;;;;;:26;;;;7718:124::o;7266:446::-;7406:4;7442:15;7465:221;7471:32;;;7465:221;;7518:34;;;7515:163;;;7573:4;7566:11;;;;7515:163;7632:8;:23;;;;;;;;;;:35;7465:221;;;-1:-1:-1;7700:5:1;;7266:446;-1:-1:-1;;;;7266:446:1:o;25:7819::-;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;:::o", "source": "pragma solidity ^0.4.6;\n\ncontract RealityToken {\n\n event Approval(address indexed _owner, address indexed _spender, uint _value, bytes32 branch);\n event Transfer(address indexed _from, address indexed _to, uint _value, bytes32 branch);\n event BranchCreated(bytes32 hash, address data_cntrct);\n event FundedDistributionContract(address contract_funded, int256 funding_amount);\n\n struct Branch {\n bytes32 parent_hash; // Hash of the parent branch.\n bytes32 merkle_root; // Merkle root of the data we commit to\n address arbitrator_list; // Optional address of a contract containing arbitrators with good values\n uint256 timestamp; // Timestamp branch was mined\n uint256 window; // Day x of the system's operation, starting at UTC 00:00:00\n mapping(address => int256) balance_change; // user debits and credits\n }\n mapping(bytes32 => Branch) public branches;\n\n // Spends, which may cause debits, can only go forwards.\n // That way when we check if you have enough to spend we only have to go backwards.\n mapping(address => uint256) public last_debit_windows; // index of last user debits to stop you going backwards\n\n mapping(uint256 => bytes32[]) public window_branches; // index to easily get all branch hashes for a window\n uint256 public genesis_window_timestamp; // 00:00:00 UTC on the day the contract was mined\n\n mapping(address => mapping(address => mapping(bytes32=> uint256))) allowed;\n\n\n function RealityToken()\n public {\n genesis_window_timestamp = now - (now % 86400);\n address NULL_ADDRESS;\n bytes32 NULL_HASH;\n bytes32 genesis_merkle_root = keccak256(\"I leave to several futures (not to all) my garden of forking paths\");\n bytes32 genesis_branch_hash = keccak256(NULL_HASH, genesis_merkle_root, NULL_ADDRESS);\n branches[genesis_branch_hash] = Branch(NULL_HASH, genesis_merkle_root, NULL_ADDRESS, now, 0);\n branches[genesis_branch_hash].balance_change[msg.sender] = 2100000000000000;\n window_branches[0].push(genesis_branch_hash);\n }\n\n function createBranch(bytes32 parent_branch_hash, bytes32 merkle_root, address arbitrator_list, address contract_funded, int256 funding_amount)\n public returns (bytes32) {\n bytes32 NULL_HASH;\n uint256 window = (now - genesis_window_timestamp) / 86400; // NB remainder gets rounded down\n\n bytes32 branch_hash = keccak256(parent_branch_hash, merkle_root, arbitrator_list);\n require(branch_hash != NULL_HASH);\n\n // Your branch must not yet exist, the parent branch must exist.\n // Check existence by timestamp, all branches have one.\n require(branches[branch_hash].timestamp == 0);\n require(branches[parent_branch_hash].timestamp > 0);\n\n // We must now be a later 24-hour window than the parent.\n require(branches[parent_branch_hash].window < window);\n\n // distribute further RealityTokens when requested via subjectiviocracy\n if (funding_amount > 0) {\n branches[branch_hash].balance_change[contract_funded] += funding_amount;\n emit FundedDistributionContract(contract_funded, funding_amount);\n }\n\n branches[branch_hash] = Branch(parent_branch_hash, merkle_root, arbitrator_list, now, window);\n window_branches[window].push(branch_hash);\n emit BranchCreated(branch_hash, arbitrator_list);\n return branch_hash;\n }\n\n function getWindowBranches(uint256 window)\n public constant returns (bytes32[]) {\n return window_branches[window];\n }\n\n function approve(address _spender, uint256 _amount, bytes32 _branch)\n public returns (bool success) {\n allowed[msg.sender][_spender][_branch] = _amount;\n emit Approval(msg.sender, _spender, _amount, _branch);\n return true;\n }\n\n function allowance(address _owner, address _spender, bytes32 branch)\n constant public returns (uint remaining) {\n return allowed[_owner][_spender][branch];\n }\n\n function balanceOf(address addr, bytes32 branch)\n public constant returns (uint256) {\n int256 bal = 0;\n bytes32 NULL_HASH;\n while(branch != NULL_HASH) {\n bal += branches[branch].balance_change[addr];\n branch = branches[branch].parent_hash;\n }\n return uint256(bal);\n }\n\n // Crawl up towards the root of the tree until we get enough, or return false if we never do.\n // You never have negative total balance above you, so if you have enough credit at any point then return.\n // This uses less gas than balanceOfAbove, which always has to go all the way to the root.\n function isAmountSpendable(address addr, uint256 _min_balance, bytes32 branch_hash)\n public constant returns (bool) {\n require (_min_balance <= 2100000000000000);\n int256 bal = 0;\n int256 min_balance = int256(_min_balance);\n bytes32 NULL_HASH;\n while(branch_hash != NULL_HASH) {\n bal += branches[branch_hash].balance_change[addr];\n branch_hash = branches[branch_hash].parent_hash;\n if (bal >= min_balance) {\n return true;\n }\n }\n return false;\n }\n\n function transferFrom(address from, address addr, uint256 amount, bytes32 branch)\n public returns (bool) {\n\n require(allowed[from][msg.sender][branch] >= amount);\n\n uint256 branch_window = branches[branch].window;\n\n require(amount <= 2100000000000000);\n require(branches[branch].timestamp > 0); // branch must exist\n\n if (branch_window < last_debit_windows[from]) return false; // debits can't go backwards\n if (!isAmountSpendable(from, amount, branch)) return false; // can only spend what you have\n\n last_debit_windows[from] = branch_window;\n branches[branch].balance_change[from] -= int256(amount);\n branches[branch].balance_change[addr] += int256(amount);\n\n uint256 allowed_before = allowed[from][msg.sender][branch];\n uint256 allowed_after = allowed_before - amount;\n assert(allowed_before > allowed_after);\n\n emit Transfer(from, addr, amount, branch);\n\n return true;\n }\n\n function transfer(address addr, uint256 amount, bytes32 branch)\n public returns (bool) {\n uint256 branch_window = branches[branch].window;\n\n require(amount <= 2100000000000000);\n require(branches[branch].timestamp > 0); // branch must exist\n\n if (branch_window < last_debit_windows[msg.sender]) return false; // debits can't go backwards\n if (!isAmountSpendable(msg.sender, amount, branch)) return false; // can only spend what you have\n\n last_debit_windows[msg.sender] = branch_window;\n branches[branch].balance_change[msg.sender] -= int256(amount);\n branches[branch].balance_change[addr] += int256(amount);\n\n emit Transfer(msg.sender, addr, amount, branch);\n\n return true;\n }\n\n function getArbitratorList(bytes32 _branch)\n public constant returns (address) {\n return branches[_branch].arbitrator_list;\n }\n\n function getWindowOfBranch(bytes32 _branchHash)\n public constant returns (uint id) {\n return branches[_branchHash].window;\n }\n\n function isBranchInBetweenBranches(bytes32 investigationHash, bytes32 hashOlderBranch, bytes32 hashNewerBranch)\n public constant returns(bool) {\n bytes32 iterationHash=hashNewerBranch;\n while(iterationHash != hashOlderBranch) {\n if(investigationHash == iterationHash) {\n return true;\n }\n else {\n iterationHash = branches[iterationHash].parent_hash;\n }\n }\n return false;\n }\n\n function getTimestampOfBranch(bytes32 branch) public view returns(uint256){\n return branches[branch].timestamp;\n }\n}\n", "sourcePath": "/home/josojo/reality/subjectivocracy/contracts/RealityToken.sol", "ast": { "absolutePath": "/home/josojo/reality/subjectivocracy/contracts/RealityToken.sol", "exportedSymbols": { "RealityToken": [ 840 ] }, "id": 841, "nodeType": "SourceUnit", "nodes": [ { "id": 128, "literals": [ "solidity", "^", "0.4", ".6" ], "nodeType": "PragmaDirective", "src": "0:23:1" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 840, "linearizedBaseContracts": [ 840 ], "name": "RealityToken", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 138, "name": "Approval", "nodeType": "EventDefinition", "parameters": { "id": 137, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 130, "indexed": true, "name": "_owner", "nodeType": "VariableDeclaration", "scope": 138, "src": "69:22:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 129, "name": "address", "nodeType": "ElementaryTypeName", "src": "69:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 132, "indexed": true, "name": "_spender", "nodeType": "VariableDeclaration", "scope": 138, "src": "93:24:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 131, "name": "address", "nodeType": "ElementaryTypeName", "src": "93:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 134, "indexed": false, "name": "_value", "nodeType": "VariableDeclaration", "scope": 138, "src": "119:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 133, "name": "uint", "nodeType": "ElementaryTypeName", "src": "119:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 136, "indexed": false, "name": "branch", "nodeType": "VariableDeclaration", "scope": 138, "src": "132:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 135, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "132:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "68:79:1" }, "src": "54:94:1" }, { "anonymous": false, "documentation": null, "id": 148, "name": "Transfer", "nodeType": "EventDefinition", "parameters": { "id": 147, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 140, "indexed": true, "name": "_from", "nodeType": "VariableDeclaration", "scope": 148, "src": "168:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 139, "name": "address", "nodeType": "ElementaryTypeName", "src": "168:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 142, "indexed": true, "name": "_to", "nodeType": "VariableDeclaration", "scope": 148, "src": "191:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 141, "name": "address", "nodeType": "ElementaryTypeName", "src": "191:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 144, "indexed": false, "name": "_value", "nodeType": "VariableDeclaration", "scope": 148, "src": "212:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 143, "name": "uint", "nodeType": "ElementaryTypeName", "src": "212:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 146, "indexed": false, "name": "branch", "nodeType": "VariableDeclaration", "scope": 148, "src": "225:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 145, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "225:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "167:73:1" }, "src": "153:88:1" }, { "anonymous": false, "documentation": null, "id": 154, "name": "BranchCreated", "nodeType": "EventDefinition", "parameters": { "id": 153, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 150, "indexed": false, "name": "hash", "nodeType": "VariableDeclaration", "scope": 154, "src": "266:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 149, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "266:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 152, "indexed": false, "name": "data_cntrct", "nodeType": "VariableDeclaration", "scope": 154, "src": "280:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 151, "name": "address", "nodeType": "ElementaryTypeName", "src": "280:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "265:35:1" }, "src": "246:55:1" }, { "anonymous": false, "documentation": null, "id": 160, "name": "FundedDistributionContract", "nodeType": "EventDefinition", "parameters": { "id": 159, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 156, "indexed": false, "name": "contract_funded", "nodeType": "VariableDeclaration", "scope": 160, "src": "339:23:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 155, "name": "address", "nodeType": "ElementaryTypeName", "src": "339:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }