UNPKG

@josojo/tokenized-events

Version:
977 lines 484 kB
{ "contractName": "ForkonomicSystem", "abi": [ { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "branchTimestamp", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x0236b817" }, { "constant": true, "inputs": [], "name": "genesisBranchHash", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x176b6f01" }, { "constant": true, "inputs": [ { "name": "", "type": "uint256" }, { "name": "", "type": "uint256" } ], "name": "windowBranches", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x1f932d7e" }, { "constant": true, "inputs": [], "name": "WINDOWTIMESPAN", "outputs": [ { "name": "", "type": "uint32" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x53023071" }, { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "branchWindow", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x6ceccf73" }, { "constant": true, "inputs": [ { "name": "", "type": "bytes32" }, { "name": "", "type": "address" } ], "name": "arbitratorWhitelists", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x8043e771" }, { "constant": true, "inputs": [], "name": "genesisWindowTimestamp", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xc506d504" }, { "constant": true, "inputs": [], "name": "NULL_HASH", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xd6dc4edc" }, { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "branchParentHash", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xf36b43cb" }, { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "branchArbitratorsID", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xfda41221" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor", "signature": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "hash", "type": "bytes32" }, { "indexed": false, "name": "whiteList_id", "type": "bytes32" } ], "name": "BranchCreated", "type": "event", "signature": "0x51bdc8a48ac6261405a7a60c923b1fae00465f13a9477a6278e851646a349621" }, { "constant": false, "inputs": [ { "name": "parentBranchHash", "type": "bytes32" }, { "name": "whitelist_id", "type": "bytes32" } ], "name": "createBranch", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "nonpayable", "type": "function", "signature": "0x6a6d7965" }, { "constant": false, "inputs": [ { "name": "arbitrators", "type": "address[]" } ], "name": "createArbitratorWhitelist", "outputs": [ { "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "nonpayable", "type": "function", "signature": "0x0614edef" }, { "constant": true, "inputs": [ { "name": "arb", "type": "address" }, { "name": "branch", "type": "bytes32" } ], "name": "isArbitratorWhitelisted", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x49469146" }, { "constant": true, "inputs": [ { "name": "investigationHash", "type": "bytes32" }, { "name": "closerToRootHash", "type": "bytes32" }, { "name": "fartherToRootHash", "type": "bytes32" } ], "name": "isBranchInBetweenBranches", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xdc4803d1" }, { "constant": true, "inputs": [ { "name": "ts", "type": "uint256" }, { "name": "branch", "type": "bytes32" } ], "name": "isBranchCreatedAfterTS", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x2667404b" }, { "constant": true, "inputs": [ { "name": "branch", "type": "bytes32" } ], "name": "doesBranchExist", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x4dd8aa05" }, { "constant": true, "inputs": [ { "name": "father", "type": "bytes32" }, { "name": "son", "type": "bytes32" } ], "name": "isFatherOfBranch", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x406edd36" } ], "bytecode": "0x608060405260008080556001805463ffffffff19166201518017905560095534801561002a57600080fd5b5060015460009063ffffffff164281151561004157fe5b06420360085550604080517f49206c6561766520746f207365766572616c206675747572657320286e6f742081527f746f20616c6c29206d792067617264656e206f6620666f726b696e67207061746020808301919091527f68730000000000000000000000000000000000000000000000000000000000008284015282519182900360420182206000548383018290528385015283518084038501815260609093019384905282519093918291908401908083835b602083106101165780518252601f1990920191602091820191016100f7565b51815160209384036101000a600019018019909216911617905260408051929094018290039091206009818155600080549281526003845285812083905590548152600690925292902091909155505060015463ffffffff1690504281151561017b57fe5b6009805460009081526004602090815260408083209590940642039094558154815260058452918220829055600790925290547f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df805460018101825592527fd9e659536a2f603b20938d4b8c1783b32b56367744f7b53b49ad35612a31e7ca9091015550610a1c8061020e6000396000f3006080604052600436106100f05763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630236b81781146100f55780630614edef1461011f578063176b6f01146101745780631f932d7e146101895780632667404b146101a4578063406edd36146101d357806349469146146101ee5780634dd8aa0514610212578063530230711461022a5780636a6d7965146102585780636ceccf73146102735780638043e7711461028b578063c506d504146102af578063d6dc4edc146102c4578063dc4803d1146102d9578063f36b43cb146102f7578063fda412211461030f575b600080fd5b34801561010157600080fd5b5061010d600435610327565b60408051918252519081900360200190f35b34801561012b57600080fd5b506040805160206004803580820135838102808601850190965280855261010d953695939460249493850192918291850190849080828437509497506103399650505050505050565b34801561018057600080fd5b5061010d61052f565b34801561019557600080fd5b5061010d600435602435610535565b3480156101b057600080fd5b506101bf600435602435610565565b604080519115158252519081900360200190f35b3480156101df57600080fd5b506101bf6004356024356105a1565b3480156101fa57600080fd5b506101bf600160a060020a03600435166024356105e8565b34801561021e57600080fd5b506101bf60043561061c565b34801561023657600080fd5b5061023f61063e565b6040805163ffffffff9092168252519081900360200190f35b34801561026457600080fd5b5061010d60043560243561064a565b34801561027f57600080fd5b5061010d600435610951565b34801561029757600080fd5b506101bf600435600160a060020a0360243516610963565b3480156102bb57600080fd5b5061010d610983565b3480156102d057600080fd5b5061010d610989565b3480156102e557600080fd5b506101bf60043560243560443561098f565b34801561030357600080fd5b5061010d6004356109cc565b34801561031b57600080fd5b5061010d6004356109de565b60046020526000908152604090205481565b600080600083600081518110151561034d57fe5b906020019060200201516040516020018082600160a060020a0316600160a060020a03166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b602083106103c65780518252601f1990920191602091820191016103a7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209150600190505b83518110156104c15781848281518110151561041257fe5b6020908102919091018101516040805180840194909452600160a060020a039091166c01000000000000000000000000028382015280518084036034018152605490930190819052825190918291908401908083835b602083106104875780518252601f199092019160209182019101610468565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209450505060019190910190506103fa565b5060005b83518110156105285760008281526002602052604081208551600192908790859081106104ee57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff19169115159190911790556001016104c5565b5092915050565b60095481565b60076020528160005260406000208181548110151561055057fe5b90600052602060002001600091509150505481565b600154600854600083815260056020526040812054909263ffffffff168086039102909101106105975750600161059b565b5060005b92915050565b60005b8183146105df57600091825260036020526040909120546009549091908214156105da576009548314156105975750600161059b565b6105a4565b50600192915050565b600090815260066020908152604080832054835260028252808320600160a060020a03949094168352929052205460ff1690565b60095460009082148061059b5750506000908152600560205260408120541190565b60015463ffffffff1681565b604080516020808201859052818301849052825180830384018152606090920192839052815160009384938493909282918401908083835b602083106106a15780518252601f199092019160209182019101610682565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206000549095508514159250610752915050576040805160e560020a62461bcd02815260206004820152602760248201527f6272616e636820686173682073686f756c64206e6f7420626520746865204e5560448201527f4c4c5f4841534800000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600082815260056020526040902054156107b6576040805160e560020a62461bcd02815260206004820152601560248201527f6272616e6368206d757374206e6f742065786973740000000000000000000000604482015290519081900360640190fd5b6009548514806107d25750600085815260056020526040812054115b1515610828576040805160e560020a62461bcd02815260206004820152601860248201527f706172656e74206272616e6368206d7573742065786973740000000000000000604482015290519081900360640190fd5b5060008481526005602052604090205460018054600854919092019163ffffffff168202014210156108ca576040805160e560020a62461bcd02815260206004820152603a60248201527f7468657265206d757374206265206f6e65207765656b2064656c61792062657460448201527f7765656e20706172656e7420616e6420736f6e206272616e6368000000000000606482015290519081900360840190fd5b6000828152600360209081526040808320889055600682528083208790556005825280832084905583835260078252808320805460018101825590845292829020909201849055815184815290810186905281517f51bdc8a48ac6261405a7a60c923b1fae00465f13a9477a6278e851646a349621929181900390910190a1509392505050565b60056020526000908152604090205481565b600260209081526000928352604080842090915290825290205460ff1681565b60085481565b60005481565b6000825b8083146109bf57848114156109ab57600191506109c4565b600090815260036020526040902054610993565b600091505b509392505050565b60036020526000908152604090205481565b600660205260009081526040902054815600a165627a7a7230582063d273aa78bfd2078a4bee3fd16630872df881e9fb2ba2bb61f5890f11e6a1940029", "deployedBytecode": "0x6080604052600436106100f05763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630236b81781146100f55780630614edef1461011f578063176b6f01146101745780631f932d7e146101895780632667404b146101a4578063406edd36146101d357806349469146146101ee5780634dd8aa0514610212578063530230711461022a5780636a6d7965146102585780636ceccf73146102735780638043e7711461028b578063c506d504146102af578063d6dc4edc146102c4578063dc4803d1146102d9578063f36b43cb146102f7578063fda412211461030f575b600080fd5b34801561010157600080fd5b5061010d600435610327565b60408051918252519081900360200190f35b34801561012b57600080fd5b506040805160206004803580820135838102808601850190965280855261010d953695939460249493850192918291850190849080828437509497506103399650505050505050565b34801561018057600080fd5b5061010d61052f565b34801561019557600080fd5b5061010d600435602435610535565b3480156101b057600080fd5b506101bf600435602435610565565b604080519115158252519081900360200190f35b3480156101df57600080fd5b506101bf6004356024356105a1565b3480156101fa57600080fd5b506101bf600160a060020a03600435166024356105e8565b34801561021e57600080fd5b506101bf60043561061c565b34801561023657600080fd5b5061023f61063e565b6040805163ffffffff9092168252519081900360200190f35b34801561026457600080fd5b5061010d60043560243561064a565b34801561027f57600080fd5b5061010d600435610951565b34801561029757600080fd5b506101bf600435600160a060020a0360243516610963565b3480156102bb57600080fd5b5061010d610983565b3480156102d057600080fd5b5061010d610989565b3480156102e557600080fd5b506101bf60043560243560443561098f565b34801561030357600080fd5b5061010d6004356109cc565b34801561031b57600080fd5b5061010d6004356109de565b60046020526000908152604090205481565b600080600083600081518110151561034d57fe5b906020019060200201516040516020018082600160a060020a0316600160a060020a03166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b602083106103c65780518252601f1990920191602091820191016103a7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209150600190505b83518110156104c15781848281518110151561041257fe5b6020908102919091018101516040805180840194909452600160a060020a039091166c01000000000000000000000000028382015280518084036034018152605490930190819052825190918291908401908083835b602083106104875780518252601f199092019160209182019101610468565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209450505060019190910190506103fa565b5060005b83518110156105285760008281526002602052604081208551600192908790859081106104ee57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff19169115159190911790556001016104c5565b5092915050565b60095481565b60076020528160005260406000208181548110151561055057fe5b90600052602060002001600091509150505481565b600154600854600083815260056020526040812054909263ffffffff168086039102909101106105975750600161059b565b5060005b92915050565b60005b8183146105df57600091825260036020526040909120546009549091908214156105da576009548314156105975750600161059b565b6105a4565b50600192915050565b600090815260066020908152604080832054835260028252808320600160a060020a03949094168352929052205460ff1690565b60095460009082148061059b5750506000908152600560205260408120541190565b60015463ffffffff1681565b604080516020808201859052818301849052825180830384018152606090920192839052815160009384938493909282918401908083835b602083106106a15780518252601f199092019160209182019101610682565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206000549095508514159250610752915050576040805160e560020a62461bcd02815260206004820152602760248201527f6272616e636820686173682073686f756c64206e6f7420626520746865204e5560448201527f4c4c5f4841534800000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600082815260056020526040902054156107b6576040805160e560020a62461bcd02815260206004820152601560248201527f6272616e6368206d757374206e6f742065786973740000000000000000000000604482015290519081900360640190fd5b6009548514806107d25750600085815260056020526040812054115b1515610828576040805160e560020a62461bcd02815260206004820152601860248201527f706172656e74206272616e6368206d7573742065786973740000000000000000604482015290519081900360640190fd5b5060008481526005602052604090205460018054600854919092019163ffffffff168202014210156108ca576040805160e560020a62461bcd02815260206004820152603a60248201527f7468657265206d757374206265206f6e65207765656b2064656c61792062657460448201527f7765656e20706172656e7420616e6420736f6e206272616e6368000000000000606482015290519081900360840190fd5b6000828152600360209081526040808320889055600682528083208790556005825280832084905583835260078252808320805460018101825590845292829020909201849055815184815290810186905281517f51bdc8a48ac6261405a7a60c923b1fae00465f13a9477a6278e851646a349621929181900390910190a1509392505050565b60056020526000908152604090205481565b600260209081526000928352604080842090915290825290205460ff1681565b60085481565b60005481565b6000825b8083146109bf57848114156109ab57600191506109c4565b600090815260036020526040902054610993565b600091505b509392505050565b60036020526000908152604090205481565b600660205260009081526040902054815600a165627a7a7230582063d273aa78bfd2078a4bee3fd16630872df881e9fb2ba2bb61f5890f11e6a1940029", "sourceMap": "27:4860:14:-;;;122:29;;;;157:36;;;-1:-1:-1;;157:36:14;188:5;157:36;;;892:42;;941:588;5:2:-1;;;;30:1;27;20:12;5:2;-1:-1;1014:14:14;;1039:25;;1014:14;;1008:3;:20;;;;;;;;1001:3;:28;976:22;:53;-1:-1:-1;1067:79:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1222:9:14;1186:46;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;1186:46:14;;;;;;;;1176:57;;1067:79;;1186:46;;;1176:57;;;;;1186:46;1176:57;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1176:57:14;;;;;;;;;;;;;1156:17;:77;;;-1:-1:-1;1282:9:14;;1244:35;;;:16;:35;;;;;:47;;;1321:17;;1301:38;;:19;:38;;;;;;:50;;;;-1:-1:-1;;274:1;1411:14:14;;;;-1:-1:-1;1405:3:14;:20;;;;;;;1377:17;;;1361:34;;;;:15;:34;;;;;;;;1405:20;;;;1398:3;:28;1361:65;;;1449:17;;1436:31;;:12;:31;;;;;:35;;;1481:14;:17;;;1504;;1481;27:10:-1;;39:1;23:18;;45:23;;1481:41:14;;;;;;;-1:-1:-1;27:4860:14;;;;;;", "deployedSourceMap": "27:4860:14:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;444:49;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;444:49:14;;;;;;;;;;;;;;;;;;;;;2875:542;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2875:542:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2875:542:14;;-1:-1:-1;2875:542:14;;-1:-1:-1;;;;;;;2875:542:14;892:42;;8:9:-1;5:2;;;30:1;27;20:12;5:2;892:42:14;;;;683:51;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;683:51:14;;;;;;;4087:257;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4087:257:14;;;;;;;;;;;;;;;;;;;;;;;;;4504:381;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4504:381:14;;;;;;;3423:176;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3423:176:14;-1:-1:-1;;;;;3423:176:14;;;;;;;4350:148;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4350:148:14;;;;;157:36;;8:9:-1;5:2;;;30:1;27;20:12;5:2;157:36:14;;;;;;;;;;;;;;;;;;;;;;;1535:1334;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1535:1334:14;;;;;;;523:46;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;523:46:14;;;;;254:68;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;254:68:14;;;-1:-1:-1;;;;;254:68:14;;;;;799:37;;8:9:-1;5:2;;;30:1;27;20:12;5:2;799:37:14;;;;122:29;;8:9:-1;5:2;;;30:1;27;20:12;5:2;122:29:14;;;;3606:475;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3606:475:14;;;;;;;;;359:52;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;359:52:14;;;;;595:54;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;595:54:14;;;;;444:49;;;;;;;;;;;;;:::o;2875:542::-;2953:7;3003:17;3081:6;3050:11;3062:1;3050:14;;;;;;;;;;;;;;;;;;3033:32;;;;;;-1:-1:-1;;;;;3033:32:14;-1:-1:-1;;;;;3033:32:14;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3033:32:14;;;3023:43;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3023:43:14;;;;;;;;;;;;;;;;3003:63;;3088:1;3081:8;;3076:135;3095:11;:18;3091:1;:22;3076:135;;;3173:9;3184:11;3196:1;3184:14;;;;;;;;;;;;;;;;;;;;;3156:43;;;;;;;;;;-1:-1:-1;;;;;3156:43:14;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3156:43:14;;;;;;;;3146:54;;3156:43;;;;3146:54;;;;;3156:43;3146:54;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;;;;365:33;;3146:54:14;;;;;;;;;;;-1:-1:-1;;;274:1;3115:3:14;;;;;-1:-1:-1;3076:135:14;;;-1:-1:-1;3274:1:14;3265:120;3281:11;:18;3277:1;:22;3265:120;;;3320:31;;;;:20;:31;;;;;3352:14;;3370:4;;3320:31;3352:11;;3364:1;;3352:14;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3320:47:14;;;;;;;;;;;-1:-1:-1;3320:47:14;:54;;-1:-1:-1;;3320:54:14;;;;;;;;;;-1:-1:-1;3301:3:14;3265:120;;;-1:-1:-1;3401:9:14;2875:542;-1:-1:-1;;2875:542:14:o;892:42::-;;;;:::o;683:51::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;4087:257::-;4258:14;;4227:22;;4167:4;4187:20;;;:12;:20;;;;;;4167:4;;4258:14;;4253:19;;;4187:37;;:62;;;:85;4183:154;;-1:-1:-1;4293:4:14;4286:11;;4183:154;-1:-1:-1;4332:5:14;4183:154;4087:257;;;;:::o;4504:381::-;4588:4;4605:253;4612:13;;;4605:253;;4647:21;;;;:16;:21;;;;;;;4693:17;;4647:21;;-1:-1:-1;4686:24:14;;4682:165;;;4742:17;;4732:27;;4728:119;;;-1:-1:-1;4788:4:14;4781:11;;4728:119;4605:253;;;-1:-1:-1;4874:4:14;4504:381;;;;:::o;3423:176::-;3515:4;3559:27;;;:19;:27;;;;;;;;;3538:49;;:20;:49;;;;;-1:-1:-1;;;;;3538:54:14;;;;;;;;;;;;;;3423:176::o;4350:148::-;4445:17;;4411:4;;4435:27;;;:55;;-1:-1:-1;;4489:1:14;4466:20;;;:12;:20;;;;;;:24;;4350:148::o;157:36::-;;;;;;:::o;1535:1334::-;1676:48;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;1676:48:14;;;;;;;;1666:59;;1625:7;;;;;;1676:48;;;;1666:59;;;;1676:48;1666:59;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;;;;365:33;;1666:59:14;;;;;;;;;;-1:-1:-1;1757:9:14;1666:59;;-1:-1:-1;1743:23:14;;;;-1:-1:-1;1735:75:14;;-1:-1:-1;;1735:75:14;;;;-1:-1:-1;;;;;1735:75:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1966:24;;;;:12;:24;;;;;;:29;1958:63;;;;;-1:-1:-1;;;;;1958:63:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;2059:17;;2039:37;;;:75;;-1:-1:-1;2113:1:14;2080:30;;;:12;:30;;;;;;:34;2039:75;2031:112;;;;;;;-1:-1:-1;;;;;2031:112:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2242:30:14;;;;:12;:30;;;;;;2275:1;2326:14;;2301:22;;2242:34;;;;;2326:14;;:23;;2301:48;2294:3;:55;;2286:126;;;;;-1:-1:-1;;;;;2286:126:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2423:28;;;;:16;:28;;;;;;;;:47;;;2480:19;:31;;;;;:46;;;2698:12;:24;;;;;:33;;;2741:22;;;:14;:22;;;;;27:10:-1;;39:1;23:18;;45:23;;2741:39:14;;;;;;;;;;;;;2796;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2852:10:14;1535:1334;-1:-1:-1;;;1535:1334:14:o;523:46::-;;;;;;;;;;;;;:::o;254:68::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;799:37::-;;;;:::o;122:29::-;;;;:::o;3606:475::-;3750:4;3790:16;3816:237;3823:34;;;3816:237;;3877:34;;;3873:170;;;3938:4;3931:11;;;;3873:170;3997:31;;;;:16;:31;;;;;;3816:237;;;4069:5;4062:12;;3606:475;;;;;;;:::o;359:52::-;;;;;;;;;;;;;:::o;595:54::-;;;;;;;;;;;;;:::o", "source": "pragma solidity ^0.4.22;\n\n\ncontract ForkonomicSystem {\n\n event BranchCreated(bytes32 hash, bytes32 whiteList_id);\n\n bytes32 public NULL_HASH = \"\";\n uint32 public WINDOWTIMESPAN = 86400; \n\n // index_arbitrators => arbitrator => isSelected\n mapping(bytes32=>mapping(address=>bool)) public arbitratorWhitelists;\n // branch => parent_branch\n mapping(bytes32 => bytes32) public branchParentHash;\n // branch => timestamp\n mapping(bytes32 => uint ) public branchTimestamp;\n // branch => window\n mapping(bytes32 => uint ) public branchWindow;\n // branch => id\n mapping(bytes32 => bytes32) public branchArbitratorsID;\n // window => branches[]\n mapping(uint256 => bytes32[]) public windowBranches; // index to easily get all branch hashes for a window\n \n uint256 public genesisWindowTimestamp; // 00:00:00 UTC on the day the contract was mined\n bytes32 public genesisBranchHash=NULL_HASH;\n\n constructor()\n public {\n genesisWindowTimestamp = now - (now % WINDOWTIMESPAN);\n bytes32 genesisMerkleRoot = keccak256(\"I leave to several futures (not to all) my garden of forking paths\");\n genesisBranchHash = keccak256(abi.encodePacked(genesisMerkleRoot, NULL_HASH));\n\n branchParentHash[genesisBranchHash] = NULL_HASH;\n branchArbitratorsID[genesisBranchHash] = NULL_HASH;\n branchTimestamp[genesisBranchHash] = now - (now % WINDOWTIMESPAN);\n branchWindow[genesisBranchHash] = 0;\n windowBranches[0].push(genesisBranchHash);\n }\n\n function createBranch(bytes32 parentBranchHash, bytes32 whitelist_id)\n public returns (bytes32) {\n\n bytes32 branchHash = keccak256(abi.encodePacked(parentBranchHash, whitelist_id));\n require(branchHash != NULL_HASH, \"branch hash should not be the 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(branchWindow[branchHash] == 0, \"branch must not exist\");\n require(parentBranchHash == genesisBranchHash || branchWindow[parentBranchHash] > 0, \"parent branch must exist\");\n\n // The window should be the window after the previous branch.\n uint256 window = branchWindow[parentBranchHash] + 1;\n require(now >= genesisWindowTimestamp + WINDOWTIMESPAN * window, \"there must be one week delay between parent and son branch\");\n\n branchParentHash[branchHash] = parentBranchHash;\n branchArbitratorsID[branchHash] = whitelist_id;\n //Either timestamp or window is not needed in this construction\n //branchTimestamp[branchHash] = genesisWindowTimestamp + WINDOWTIMESPAN * window;\n branchWindow[branchHash] = window;\n windowBranches[window].push(branchHash);\n\n emit BranchCreated(branchHash, whitelist_id);\n return branchHash;\n }\n\n function createArbitratorWhitelist(address[] arbitrators)\n public returns (bytes32) {\n // generate unique id;\n bytes32 prev_hash = keccak256(abi.encodePacked(arbitrators[0]));\n for (uint i=1; i < arbitrators.length; i++) {\n prev_hash = keccak256(abi.encodePacked(prev_hash, arbitrators[i]));\n }\n //set abirtrator address as true \n for (i = 0; i < arbitrators.length; i++) {\n arbitratorWhitelists[prev_hash][arbitrators[i]] = true;\n }\n return prev_hash;\n }\n\n function isArbitratorWhitelisted(address arb, bytes32 branch) \n public constant returns (bool) {\n return arbitratorWhitelists[branchArbitratorsID[branch]][arb];\n }\n \n function isBranchInBetweenBranches(bytes32 investigationHash, bytes32 closerToRootHash, bytes32 fartherToRootHash)\n public constant returns (bool) {\n bytes32 iterationHash = closerToRootHash;\n while (iterationHash != fartherToRootHash) {\n if (investigationHash == iterationHash) {\n return true;\n } else {\n iterationHash = branchParentHash[iterationHash];\n }\n }\n return false;\n }\n\n function isBranchCreatedAfterTS(uint256 ts, bytes32 branch) public view returns(bool) {\n if (branchWindow[branch] * WINDOWTIMESPAN + genesisWindowTimestamp >= ts - WINDOWTIMESPAN)\n return true;\n else \n return false;\n }\n\n function doesBranchExist(bytes32 branch) public view returns(bool) {\n return (branch == genesisBranchHash || branchWindow[branch] > 0);\n }\n\n function isFatherOfBranch(bytes32 father, bytes32 son)\n public constant returns (bool) {\n\n while (son != father) {\n son = branchParentHash[son];\n if (son == genesisBranchHash)\n if (father == genesisBranchHash)\n return true;\n else\n return false;\n }\n return true;\n }\n}\n", "sourcePath": "@josojo/forkonomics-contracts/contracts/ForkonomicSystem.sol", "ast": { "absolutePath": "@josojo/forkonomics-contracts/contracts/ForkonomicSystem.sol", "exportedSymbols": { "ForkonomicSystem": [ 5270 ] }, "id": 5271, "nodeType": "SourceUnit", "nodes": [ { "id": 4855, "literals": [ "solidity", "^", "0.4", ".22" ], "nodeType": "PragmaDirective", "src": "0:24:14" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 5270, "linearizedBaseContracts": [ 5270 ], "name": "ForkonomicSystem", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 4861, "name": "BranchCreated", "nodeType": "EventDefinition", "parameters": { "id": 4860, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4857, "indexed": false, "name": "hash", "nodeType": "VariableDeclaration", "scope": 4861, "src": "80:12:14", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 4856, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "80:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 4859, "indexed": false, "name": "whiteList_id", "nodeType": "VariableDeclaration", "scope": 4861, "src": "94:20:14", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 4858, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "94:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "79:36:14" }, "src": "60:56:14" }, { "constant": false, "id": 4864, "name": "NULL_HASH", "nodeType": "VariableDeclaration", "scope": 5270, "src": "122:29:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 4862, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "122:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "hexValue": "", "id": 4863, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "149:2:14", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "typeString": "literal_string \"\"" }, "value": "" }, "visibility": "public" }, { "constant": false, "id": 4867, "name": "WINDOWTIMESPAN", "nodeType": "VariableDeclaration", "scope": 5270, "src": "157:36:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 4865, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "157:6:14", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": { "argumentTypes": null, "hexValue": "3836343030", "id": 4866, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "188:5:14", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_86400_by_1", "typeString": "int_const 86400" }, "value": "86400" }, "visibility": "public" }, { "constant": false, "id": 4873, "name": "arbitratorWhitelists", "nodeType": "VariableDeclaration", "scope": 5270, "src": "254:68:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_mapping$_t_address_$_t_bool_$_$", "typeString": "mapping(bytes32 => mapping(address => bool))" }, "typeName": { "id": 4872, "keyType": { "id": 4868, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "262:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "254:40:14", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_mapping$_t_address_$_t_bool_$_$", "typeString": "mapping(bytes32 => mapping(address => bool))" }, "valueType": { "id": 4871, "keyType": { "id": 4869, "name": "address", "nodeType": "ElementaryTypeName", "src": "279:7:14", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "271:22:14", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", "typeString": "mapping(address => bool)" }, "valueType": { "id": 4870, "name": "bool", "nodeType": "ElementaryTypeName", "src": "288:4:14", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 4877, "name": "branchParentHash", "nodeType": "VariableDeclaration", "scope": 5270, "src": "359:52:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" }, "typeName": { "id": 4876, "keyType": { "id": 4874, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "367:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "359:28:14", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" }, "valueType": { "id": 4875, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "379:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 4881, "name": "branchTimestamp", "nodeType": "VariableDeclaration", "scope": 5270, "src": "444:49:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "typeName": { "id": 4880, "keyType": { "id": 4878, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "452:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "444:26:14", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "valueType": { "id": 4879, "name": "uint", "nodeType": "ElementaryTypeName", "src": "464:4:14", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 4885, "name": "branchWindow", "nodeType": "VariableDeclaration", "scope": 5270, "src": "523:46:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "typeName": { "id": 4884, "keyType": { "id": 4882, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "531:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "523:26:14", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$", "typeString": "mapping(bytes32 => uint256)" }, "valueType": { "id": 4883, "name": "uint", "nodeType": "ElementaryTypeName", "src": "543:4:14", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 4889, "name": "branchArbitratorsID", "nodeType": "VariableDeclaration", "scope": 5270, "src": "595:54:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" }, "typeName": { "id": 4888, "keyType": { "id": 4886, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "603:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "595:27:14", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$", "typeString": "mapping(bytes32 => bytes32)" }, "valueType": { "id": 4887, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "614:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 4894, "name": "windowBranches", "nodeType": "VariableDeclaration", "scope": 5270, "src": "683:51:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_array$_t_bytes32_$dyn_storage_$", "typeString": "mapping(uint256 => bytes32[])" }, "typeName": { "id": 4893, "keyType": { "id": 4890, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "691:7:14", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Mapping", "src": "683:29:14", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_array$_t_bytes32_$dyn_storage_$", "typeString": "mapping(uint256 => bytes32[])" }, "valueType": { "baseType": { "id": 4891, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "702:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 4892, "length": null, "nodeType": "ArrayTypeName", "src": "702:9:14", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" } } }, "value": null, "visibility": "public" }, { "constant": false, "id": 4896, "name": "genesisWindowTimestamp", "nodeType": "VariableDeclaration", "scope": 5270, "src": "799:37:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4895, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "799:7:14", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 4899, "name": "genesisBranchHash", "nodeType": "VariableDeclaration", "scope": 5270, "src": "892:42:14", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 4897, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "892:7:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "id": 4898, "name": "NULL_HASH", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4864, "src": "925:9:14", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "public" }, { "body": { "id": 4963, "nodeType": "Block", "src": "966:563:14", "statements": [ { "expression": { "argumentTypes": null, "id": 4909, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 4902, "name": "genesisWindowTimestamp", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4896, "src": "976:22:14", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 4908, "isConstant": false, "isLValu