UNPKG

secretstore-contracts

Version:

Secret Store permissioning and service contracts collection and toolkit.

896 lines 434 kB
{ "contractName": "PermissioningRegistry", "abi": [ { "constant": true, "inputs": [ { "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "renounceOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "bytes32" } ], "name": "permissions", "outputs": [ { "name": "admin", "type": "address" }, { "name": "exposed", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "document", "type": "bytes32" } ], "name": "NewAdmin", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "document", "type": "bytes32" } ], "name": "Permission", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "previousOwner", "type": "address" }, { "indexed": true, "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "constant": false, "inputs": [ { "name": "document", "type": "bytes32" }, { "name": "newAdmin", "type": "address" } ], "name": "setAdmin", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "document", "type": "bytes32" }, { "name": "_users", "type": "address[]" } ], "name": "setUsers", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "document", "type": "bytes32" }, { "name": "_exposed", "type": "bool" } ], "name": "setExposed", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "document", "type": "bytes32" }, { "name": "newUser", "type": "address" } ], "name": "addUser", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "document", "type": "bytes32" } ], "name": "removePermission", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "document", "type": "bytes32" }, { "name": "_users", "type": "address[]" } ], "name": "permission", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "user", "type": "address" }, { "name": "document", "type": "bytes32" } ], "name": "checkPermissions", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "document", "type": "bytes32" } ], "name": "getAdmin", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "document", "type": "bytes32" } ], "name": "getUsers", "outputs": [ { "name": "", "type": "address[]" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "document", "type": "bytes32" } ], "name": "isExposed", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b5060008054600160a060020a0319163317808255604051600160a060020a039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a361008c7f01ffc9a7000000000000000000000000000000000000000000000000000000006401000000006100f5810204565b6100be7fb36a9a7c000000000000000000000000000000000000000000000000000000006401000000006100f5810204565b6100f07f813ae5ed000000000000000000000000000000000000000000000000000000006401000000006100f5810204565b610164565b7fffffffff00000000000000000000000000000000000000000000000000000000808216141561012457600080fd5b7fffffffff00000000000000000000000000000000000000000000000000000000166000908152600160208190526040909120805460ff19169091179055565b610d05806101736000396000f3006080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301ffc9a781146100ea5780630f039de8146101355780634ccea5261461015957806365923cd1146101c1578063715018a6146101d95780637ffb5473146101f057806380c6e70a146102085780638170d8391461023c5780638da5cb5b146102605780638f32d59b14610275578063aa9c54261461028a578063b36a9a7c146102ae578063b4d2388f146102d2578063c29297471461030d578063ee4024db1461032a578063f2fde38b1461034e575b600080fd5b3480156100f657600080fd5b506101217bffffffffffffffffffffffffffffffffffffffffffffffffffffffff196004351661036f565b604080519115158252519081900360200190f35b34801561014157600080fd5b506101216004803590602480359081019101356103a3565b34801561016557600080fd5b5061017160043561049b565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101ad578181015183820152602001610195565b505050509050019250505060405180910390f35b3480156101cd57600080fd5b50610121600435610507565b3480156101e557600080fd5b506101ee6105c6565b005b3480156101fc57600080fd5b50610121600435610623565b34801561021457600080fd5b50610220600435610653565b60408051600160a060020a039092168252519081900360200190f35b34801561024857600080fd5b50610121600480359060248035908101910135610671565b34801561026c57600080fd5b50610220610713565b34801561028157600080fd5b50610121610723565b34801561029657600080fd5b50610121600435600160a060020a0360243516610734565b3480156102ba57600080fd5b50610121600160a060020a03600435166024356107f1565b3480156102de57600080fd5b506102ea6004356108b5565b60408051600160a060020a03909316835290151560208301528051918290030190f35b34801561031957600080fd5b5061012160043560243515156108f0565b34801561033657600080fd5b50610121600435600160a060020a03602435166109bb565b34801561035a57600080fd5b506101ee600160a060020a0360043516610ada565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660009081526001602052604090205460ff1690565b600083815260026020526040812060010154600160a060020a031615806103ce57506103ce84610af9565b151561044a576040805160e560020a62461bcd02815260206004820152603460248201527f596f75206861766520746f2062652061646d696e206f72206f776e657220746f60448201527f206368616e6765207065726d697373696f6e732e000000000000000000000000606482015290519081900360840190fd5b6000848152600260205260409020600181018054600160a060020a03191633179055610477908484610bba565b506040518490600080516020610c9a83398151915290600090a25060019392505050565b6000818152600260209081526040918290208054835181840281018401909452808452606093928301828280156104fb57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116104dd575b50505050509050919050565b60008161051381610af9565b151561056b576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b6000838152600260205260408120906105848282610c1d565b50600101805474ffffffffffffffffffffffffffffffffffffffffff191690556040518390600080516020610c9a83398151915290600090a250600192915050565b6105ce610723565b15156105d957600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360008054600160a060020a0319169055565b60009081526002602052604090206001015474010000000000000000000000000000000000000000900460ff1690565b600090815260026020526040902060010154600160a060020a031690565b60008361067d81610af9565b15156106d5576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b60008581526002602052604090206106ee908585610bba565b506040518590600080516020610c9a83398151915290600090a2506001949350505050565b600054600160a060020a03165b90565b600054600160a060020a0316331490565b60008261074081610af9565b1515610798576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b600084815260026020908152604080832080546001810182559084529183209091018054600160a060020a031916600160a060020a038716179055518591600080516020610c9a83398151915291a25060019392505050565b60008060006107ff84610b2a565b151561080e57600092506108ad565b60008481526002602052604090206001015474010000000000000000000000000000000000000000900460ff161561084957600192506108ad565b50506000828152600260205260408120905b81548110156108a85784600160a060020a0316828281548110151561087c57fe5b600091825260209091200154600160a060020a031614156108a057600192506108ad565b60010161085b565b600092505b505092915050565b600260205260009081526040902060010154600160a060020a0381169074010000000000000000000000000000000000000000900460ff1682565b6000826108fc81610af9565b1515610954576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b600084815260026020526040808220600101805474ff000000000000000000000000000000000000000019167401000000000000000000000000000000000000000087151502179055518591600080516020610c9a83398151915291a25060019392505050565b6000826109c781610af9565b1515610a1f576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b600160a060020a0383161515610a7f576040805160e560020a62461bcd02815260206004820181905260248201527f4e65772061646d696e20616464726573732063616e6e6f74206265203078302e604482015290519081900360640190fd5b6000848152600260205260408082206001018054600160a060020a031916600160a060020a0387161790555185917f9c38d9bf66f47815dd90b1c5c80b0138365b0f232c260374041f97909b70146591a25060019392505050565b610ae2610723565b1515610aed57600080fd5b610af681610b4a565b50565b600081815260026020526040812060010154600160a060020a0316331480610b245750610b24610723565b92915050565b600090815260026020526040902060010154600160a060020a0316151590565b600160a060020a0381161515610b5f57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b828054828255906000526020600020908101928215610c0d579160200282015b82811115610c0d578154600160a060020a031916600160a060020a03843516178255602090920191600190910190610bda565b50610c19929150610c3b565b5090565b5080546000825590600052602060002090810190610af69190610c5f565b61072091905b80821115610c19578054600160a060020a0319168155600101610c41565b61072091905b80821115610c195760008155600101610c655600696e206f72206f776e65722e00000000000000000000000000000000000000001cc9fc44b401f3c62bc063fa96b96115b72c6c810c4cb13745eeb6e173d5ffe543616c6c65722068617320746f206265207468652063757272656e742061646da165627a7a72305820563cf8e41019a244502757d3edf51b14c66a238620d3e26d36787fb0cab94d2e0029", "deployedBytecode": "0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301ffc9a781146100ea5780630f039de8146101355780634ccea5261461015957806365923cd1146101c1578063715018a6146101d95780637ffb5473146101f057806380c6e70a146102085780638170d8391461023c5780638da5cb5b146102605780638f32d59b14610275578063aa9c54261461028a578063b36a9a7c146102ae578063b4d2388f146102d2578063c29297471461030d578063ee4024db1461032a578063f2fde38b1461034e575b600080fd5b3480156100f657600080fd5b506101217bffffffffffffffffffffffffffffffffffffffffffffffffffffffff196004351661036f565b604080519115158252519081900360200190f35b34801561014157600080fd5b506101216004803590602480359081019101356103a3565b34801561016557600080fd5b5061017160043561049b565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101ad578181015183820152602001610195565b505050509050019250505060405180910390f35b3480156101cd57600080fd5b50610121600435610507565b3480156101e557600080fd5b506101ee6105c6565b005b3480156101fc57600080fd5b50610121600435610623565b34801561021457600080fd5b50610220600435610653565b60408051600160a060020a039092168252519081900360200190f35b34801561024857600080fd5b50610121600480359060248035908101910135610671565b34801561026c57600080fd5b50610220610713565b34801561028157600080fd5b50610121610723565b34801561029657600080fd5b50610121600435600160a060020a0360243516610734565b3480156102ba57600080fd5b50610121600160a060020a03600435166024356107f1565b3480156102de57600080fd5b506102ea6004356108b5565b60408051600160a060020a03909316835290151560208301528051918290030190f35b34801561031957600080fd5b5061012160043560243515156108f0565b34801561033657600080fd5b50610121600435600160a060020a03602435166109bb565b34801561035a57600080fd5b506101ee600160a060020a0360043516610ada565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660009081526001602052604090205460ff1690565b600083815260026020526040812060010154600160a060020a031615806103ce57506103ce84610af9565b151561044a576040805160e560020a62461bcd02815260206004820152603460248201527f596f75206861766520746f2062652061646d696e206f72206f776e657220746f60448201527f206368616e6765207065726d697373696f6e732e000000000000000000000000606482015290519081900360840190fd5b6000848152600260205260409020600181018054600160a060020a03191633179055610477908484610bba565b506040518490600080516020610c9a83398151915290600090a25060019392505050565b6000818152600260209081526040918290208054835181840281018401909452808452606093928301828280156104fb57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116104dd575b50505050509050919050565b60008161051381610af9565b151561056b576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b6000838152600260205260408120906105848282610c1d565b50600101805474ffffffffffffffffffffffffffffffffffffffffff191690556040518390600080516020610c9a83398151915290600090a250600192915050565b6105ce610723565b15156105d957600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360008054600160a060020a0319169055565b60009081526002602052604090206001015474010000000000000000000000000000000000000000900460ff1690565b600090815260026020526040902060010154600160a060020a031690565b60008361067d81610af9565b15156106d5576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b60008581526002602052604090206106ee908585610bba565b506040518590600080516020610c9a83398151915290600090a2506001949350505050565b600054600160a060020a03165b90565b600054600160a060020a0316331490565b60008261074081610af9565b1515610798576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b600084815260026020908152604080832080546001810182559084529183209091018054600160a060020a031916600160a060020a038716179055518591600080516020610c9a83398151915291a25060019392505050565b60008060006107ff84610b2a565b151561080e57600092506108ad565b60008481526002602052604090206001015474010000000000000000000000000000000000000000900460ff161561084957600192506108ad565b50506000828152600260205260408120905b81548110156108a85784600160a060020a0316828281548110151561087c57fe5b600091825260209091200154600160a060020a031614156108a057600192506108ad565b60010161085b565b600092505b505092915050565b600260205260009081526040902060010154600160a060020a0381169074010000000000000000000000000000000000000000900460ff1682565b6000826108fc81610af9565b1515610954576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b600084815260026020526040808220600101805474ff000000000000000000000000000000000000000019167401000000000000000000000000000000000000000087151502179055518591600080516020610c9a83398151915291a25060019392505050565b6000826109c781610af9565b1515610a1f576040805160e560020a62461bcd02815260206004820152602c6024820152600080516020610cba8339815191526044820152600080516020610c7a833981519152606482015290519081900360840190fd5b600160a060020a0383161515610a7f576040805160e560020a62461bcd02815260206004820181905260248201527f4e65772061646d696e20616464726573732063616e6e6f74206265203078302e604482015290519081900360640190fd5b6000848152600260205260408082206001018054600160a060020a031916600160a060020a0387161790555185917f9c38d9bf66f47815dd90b1c5c80b0138365b0f232c260374041f97909b70146591a25060019392505050565b610ae2610723565b1515610aed57600080fd5b610af681610b4a565b50565b600081815260026020526040812060010154600160a060020a0316331480610b245750610b24610723565b92915050565b600090815260026020526040902060010154600160a060020a0316151590565b600160a060020a0381161515610b5f57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b828054828255906000526020600020908101928215610c0d579160200282015b82811115610c0d578154600160a060020a031916600160a060020a03843516178255602090920191600190910190610bda565b50610c19929150610c3b565b5090565b5080546000825590600052602060002090810190610af69190610c5f565b61072091905b80821115610c19578054600160a060020a0319168155600101610c41565b61072091905b80821115610c195760008155600101610c655600696e206f72206f776e65722e00000000000000000000000000000000000000001cc9fc44b401f3c62bc063fa96b96115b72c6c810c4cb13745eeb6e173d5ffe543616c6c65722068617320746f206265207468652063757272656e742061646da165627a7a72305820563cf8e41019a244502757d3edf51b14c66a238620d3e26d36787fb0cab94d2e0029", "sourceMap": "212:3504:0:-;;;709:314;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;509:6:12;:19;;-1:-1:-1;;;;;;509:19:12;518:10;509:19;;;;539:40;;-1:-1:-1;;;;;572:6:12;;;;;509;539:40;;509:6;;539:40;612:39:10;631:19;612:18;;;;:39;:::i;:::-;767:50:0;786:30;767:18;;;;:50;:::i;:::-;827:189;859:147;827:18;;;;:189;:::i;:::-;212:3504;;951:154:10;1028:25;;;;;;1020:34;;;;;;1060:33;;;;;;1096:4;1060:33;;;;;;;;:40;;-1:-1:-1;;1060:40:10;;;;;;951:154::o;212:3504:0:-;;;;;;;", "deployedSourceMap": "212:3504:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;739:141:10;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;739:141:10;-1:-1:-1;;739:141:10;;;;;;;;;;;;;;;;;;;;;;;2164:411:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2164:411:0;;;;;;;;;;;;;;;;3177:119;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3177:119:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3177:119:0;;;;;;;;;;;;;;;;;1968:190;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1968:190:0;;;;;1273:127:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1273:127:12;;;;;;3302:117:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3302:117:0;;;;;3054;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3054:117:0;;;;;;;;;-1:-1:-1;;;;;3054:117:0;;;;;;;;;;;;;;1320:208;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1320:208:0;;;;;;;;;;;;;;;;639:70:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;639:70:12;;;;926:83;;8:9:-1;5:2;;;30:1;27;20:12;5:2;926:83:12;;;;1751:211:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1751:211:0;;;-1:-1:-1;;;;;1751:211:0;;;;;2581:467;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2581:467:0;-1:-1:-1;;;;;2581:467:0;;;;;;;406:54;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;406:54:0;;;;;;;;;-1:-1:-1;;;;;406:54:0;;;;;;;;;;;;;;;;;;;;;1534:211;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1534:211:0;;;;;;;;;1029:285;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1029:285:0;;;-1:-1:-1;;;;;1029:285:0;;;;;1561:101:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1561:101:12;-1:-1:-1;;;;;1561:101:12;;;;;739:141:10;-1:-1:-1;;842:33:10;821:4;842:33;;;:20;:33;;;;;;;;;739:141::o;2164:411:0:-;2238:4;2275:21;;;:11;:21;;;;;:27;;;-1:-1:-1;;;;;2275:27:0;:41;;:63;;;2320:18;2329:8;2320;:18::i;:::-;2254:162;;;;;;;-1:-1:-1;;;;;2254:162:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2426:21;;;;:11;:21;;;;;:27;;;:40;;-1:-1:-1;;;;;;2426:40:0;2456:10;2426:40;;;2476:36;;2506:6;;2476:36;:::i;:::-;-1:-1:-1;2527:20:0;;2538:8;;-1:-1:-1;;;;;;;;;;;2527:20:0;;;;-1:-1:-1;2564:4:0;2164:411;;;;;:::o;3177:119::-;3262:21;;;;:11;:21;;;;;;;;;3255:34;;;;;;;;;;;;;;;;;3234:9;;3255:34;;;3262:21;3255:34;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3255:34:0;;;;;;;;;;;;;;;;;;;;;;;3177:119;;;:::o;1968:190::-;2051:4;2032:8;618:18;627:8;618;:18::i;:::-;610:75;;;;;;;-1:-1:-1;;;;;610:75:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;;;;;;;;;;;;2074:21;;;;:11;:21;;;;;;2067:28;2074:21;;2067:28;:::i;:::-;-1:-1:-1;2067:28:0;;;;-1:-1:-1;;2067:28:0;;;2110:20;;2121:8;;-1:-1:-1;;;;;;;;;;;2110:20:0;2067:28;;2110:20;-1:-1:-1;2147:4:0;;1968:190;-1:-1:-1;;1968:190:0:o;1273:127:12:-;824:9;:7;:9::i;:::-;816:18;;;;;;;;1367:1;1351:6;;1330:40;;-1:-1:-1;;;;;1351:6:12;;;;1330:40;;1367:1;;1330:40;1393:1;1376:19;;-1:-1:-1;;;;;;1376:19:12;;;1273:127::o;3302:117:0:-;3360:4;3383:21;;;:11;:21;;;;;:29;;;;;;;;;3302:117::o;3054:::-;3111:7;3137:21;;;:11;:21;;;;;:27;;;-1:-1:-1;;;;;3137:27:0;;3054:117::o;1320:208::-;1413:4;1394:8;618:18;627:8;618;:18::i;:::-;610:75;;;;;;;-1:-1:-1;;;;;610:75:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;;;;;;;;;;;;1429:21;;;;:11;:21;;;;;:36;;1459:6;;1429:36;:::i;:::-;-1:-1:-1;1480:20:0;;1491:8;;-1:-1:-1;;;;;;;;;;;1480:20:0;;;;-1:-1:-1;1517:4:0;;1320:208;-1:-1:-1;;;;1320:208:0:o;639:70:12:-;676:7;698:6;-1:-1:-1;;;;;698:6:12;639:70;;:::o;926:83::-;965:4;998:6;-1:-1:-1;;;;;998:6:12;984:10;:20;;926:83::o;1751:211:0:-;1842:4;1823:8;618:18;627:8;618;:18::i;:::-;610:75;;;;;;;-1:-1:-1;;;;;610:75:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;;;;;;;;;;;;1858:21;;;;:11;:21;;;;;;;;27:10:-1;;39:1;23:18;;45:23;;1858:41:0;;;;;;;;;;;-1:-1:-1;;;;;;1858:41:0;-1:-1:-1;;;;;1858:41:0;;;;;1914:20;1858:21;;-1:-1:-1;;;;;;;;;;;1914:20:0;;-1:-1:-1;1951:4:0;;1751:211;-1:-1:-1;;;1751:211:0:o;2581:467::-;2660:4;2843:23;2911:6;2681:24;2696:8;2681:14;:24::i;:::-;2680:25;2676:68;;;2728:5;2721:12;;;;2676:68;2766:21;;;;:11;:21;;;;;:29;;;;;;;;2762:71;;;2818:4;2811:11;;;;2762:71;-1:-1:-1;;2869:21:0;;;;:11;:21;;;;;;2906:114;2927:12;;2923:16;;2906:114;;;2976:4;-1:-1:-1;;;;;2964:16:0;:5;2970:1;2964:8;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2964:8:0;:16;2960:49;;;3005:4;2998:11;;;;2960:49;2941:3;;2906:114;;;3036:5;3029:12;;2581:467;;;;;;;:::o;406:54::-;;;;;;;;;;;;;;-1:-1:-1;;;;;406:54:0;;;;;;;;;:::o;1534:211::-;1626:4;1607:8;618:18;627:8;618;:18::i;:::-;610:75;;;;;;;-1:-1:-1;;;;;610:75:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;;;;;;;;;;;;1642:21;;;;:11;:21;;;;;;:29;;:40;;-1:-1:-1;;1642:40:0;;;;;;;;;1697:20;1642:21;;-1:-1:-1;;;;;;;;;;;1697:20:0;;-1:-1:-1;1734:4:0;;1534:211;-1:-1:-1;;;1534:211:0:o;1029:285::-;1122:4;1103:8;618:18;627:8;618;:18::i;:::-;610:75;;;;;;;-1:-1:-1;;;;;610:75:0;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;-1:-1:-1;;;;;;;;;;;610:75:0;;;;;;;;;;;;;;;-1:-1:-1;;;;;1146:22:0;;;;1138:67;;;;;-1:-1:-1;;;;;1138:67:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1215:21;;;;:11;:21;;;;;;:27;;:38;;-1:-1:-1;;;;;;1215:38:0;-1:-1:-1;;;;;1215:38:0;;;;;1268:18;1215:21;;1268:18;;;-1:-1:-1;1303:4:0;;1029:285;-1:-1:-1;;;1029:285:0:o;1561:101:12:-;824:9;:7;:9::i;:::-;816:18;;;;;;;;1629:28;1648:8;1629:18;:28::i;:::-;1561:101;:::o;3425:145:0:-;3484:4;3508:21;;;:11;:21;;;;;:27;;;-1:-1:-1;;;;;3508:27:0;3539:10;3508:41;;:54;;;3553:9;:7;:9::i;:::-;3500:63;3425:145;-1:-1:-1;;3425:145:0:o;3576:138::-;3641:4;3665:21;;;:11;:21;;;;;:27;;;-1:-1:-1;;;;;3665:27:0;:41;;;3576:138::o;1796:169:12:-;-1:-1:-1;;;;;1865:22:12;;;;1857:31;;;;;;1920:6;;;1899:38;;-1:-1:-1;;;;;1899:38:12;;;;1920:6;;;1899:38;;;1943:6;:17;;-1:-1:-1;;;;;;1943:17:12;-1:-1:-1;;;;;1943:17:12;;;;;;;;;;1796:169::o;212:3504:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;212:3504:0;-1:-1:-1;;;;;212:3504:0;;;;;;;;;;;;;;;;;;;-1:-1:-1;212:3504:0;;;-1:-1:-1;212:3504:0;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;;212:3504:0;;;;;;;;;;;;;;;;;;;;;;;;", "source": "pragma solidity ^0.4.24;\n\nimport \"./interfaces/ISecretStorePermissioning.sol\";\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport \"openzeppelin-solidity/contracts/introspection/ERC165.sol\";\n\n\ncontract PermissioningRegistry is ISecretStorePermissioning, Ownable, ERC165 {\n\n struct PermissionEntry {\n address[] users;\n address admin;\n bool exposed;\n }\n \n mapping(bytes32 => PermissionEntry) public permissions;\n\n event NewAdmin(bytes32 indexed document);\n event Permission(bytes32 indexed document);\n\n modifier onlyAdmins(bytes32 document) {\n require(_isAdmin(document), \"Caller has to be the current admin or owner.\");\n _;\n }\n\n constructor() public {\n // ERC 165 support\n _registerInterface(this.checkPermissions.selector);\n _registerInterface(\n this.owner.selector\n ^ this.isOwner.selector\n ^ this.renounceOwnership.selector\n ^ this.transferOwnership.selector\n );\n }\n\n function setAdmin(bytes32 document, address newAdmin) external onlyAdmins(document) returns (bool) {\n require(newAdmin != address(0), \"New admin address cannot be 0x0.\");\n permissions[document].admin = newAdmin;\n emit NewAdmin(document);\n return true;\n }\n\n function setUsers(bytes32 document, address[] _users) external onlyAdmins(document) returns (bool) {\n permissions[document].users = _users;\n emit Permission(document);\n return true;\n }\n\n function setExposed(bytes32 document, bool _exposed) external onlyAdmins(document) returns (bool) {\n permissions[document].exposed = _exposed;\n emit Permission(document);\n return true;\n }\n\n function addUser(bytes32 document, address newUser) external onlyAdmins(document) returns (bool) {\n permissions[document].users.push(newUser);\n emit Permission(document);\n return true;\n }\n\n function removePermission(bytes32 document) external onlyAdmins(document) returns (bool) {\n delete permissions[document];\n emit Permission(document);\n return true;\n }\n\n function permission(bytes32 document, address[] _users) external returns (bool) {\n require(\n permissions[document].admin == address(0) || _isAdmin(document),\n \"You have to be admin or owner to change permissions.\"\n );\n permissions[document].admin = msg.sender;\n permissions[document].users = _users;\n emit Permission(document);\n return true;\n }\n\n function checkPermissions(address user, bytes32 document) public view returns (bool) {\n if (!_isInitialized(document)) {\n return false;\n }\n \n if (permissions[document].exposed) {\n return true;\n }\n\n address[] storage users = permissions[document].users;\n for (uint i = 0; i < users.length; i++) {\n if (users[i] == user)\n return true;\n }\n return false;\n }\n\n function getAdmin(bytes32 document) public view returns (address) {\n return permissions[document].admin;\n }\n\n function getUsers(bytes32 document) public view returns (address[]) {\n return permissions[document].users;\n }\n\n function isExposed(bytes32 document) public view returns (bool) {\n return permissions[document].exposed;\n }\n\n function _isAdmin(bytes32 document) internal view returns (bool) {\n return (permissions[document].admin == msg.sender || isOwner());\n }\n\n function _isInitialized(bytes32 document) internal view returns (bool) {\n return (permissions[document].admin != address(0));\n }\n}", "sourcePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/PermissioningRegistry.sol", "ast": { "absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/PermissioningRegistry.sol", "exportedSymbols": { "PermissioningRegistry": [ 393 ] }, "id": 394, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:24:0" }, { "absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/interfaces/ISecretStorePermissioning.sol", "file": "./interfaces/ISecretStorePermissioning.sol", "id": 2, "nodeType": "ImportDirective", "scope": 394, "sourceUnit": 406, "src": "26:52:0", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol", "file": "openzeppelin-solidity/contracts/ownership/Ownable.sol", "id": 3, "nodeType": "ImportDirective", "scope": 394, "sourceUnit": 4824, "src": "79:63:0", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "openzeppelin-solidity/contracts/introspection/ERC165.sol", "file": "openzeppelin-solidity/contracts/introspection/ERC165.sol", "id": 4, "nodeType": "ImportDirective", "scope": 394, "sourceUnit": 4705, "src": "143:66:0", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 5, "name": "ISecretStorePermissioning", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 405, "src": "246:25:0", "typeDescriptions": { "typeIdentifier": "t_contract$_ISecretStorePermissioning_$405", "typeString": "contract ISecretStorePermissioning" } }, "id": 6, "nodeType": "InheritanceSpecifier", "src": "246:25:0" }, { "arguments": null, "baseName": { "contractScope": null, "id": 7, "name": "Ownable", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4823, "src": "273:7:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Ownable_$4823", "typeString": "contract Ownable" } }, "id": 8, "nodeType": "InheritanceSpecifier", "src": "273:7:0" }, { "arguments": null, "baseName": { "contractScope": null, "id": 9, "name": "ERC165", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4704, "src": "282:6:0", "typeDescriptions": { "typeIdentifier": "t_contract$_ERC165_$4704", "typeString": "contract ERC165" } }, "id": 10, "nodeType": "InheritanceSpecifier", "src": "282:6:0" } ], "contractDependencies": [ 405, 4704, 4714, 4823 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 393, "linearizedBaseContracts": [ 393, 4704, 4714, 4823, 405 ], "name": "PermissioningRegistry", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "PermissioningRegistry.PermissionEntry", "id": 18, "members": [ { "constant": false, "id": 13, "name": "users", "nodeType": "VariableDeclaration", "scope": 18, "src": "329:15:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", "typeString": "address[]" }, "typeName": { "baseType": { "id": 11, "name": "address", "nodeType": "ElementaryTypeName", "src": "329:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 12, "length": null, "nodeType": "ArrayTypeName", "src": "329:9:0", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", "typeString": "address[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 15, "name": "admin", "nodeType": "VariableDeclaration", "scope": 18, "src": "354:13:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 14, "name": "address", "nodeType": "ElementaryTypeName", "src": "354:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 17, "name": "exposed", "nodeType": "VariableDeclaration", "scope": 18, "src": "377:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 16, "name": "bool", "nodeType": "ElementaryTypeName", "src": "377:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "name": "PermissionEntry", "nodeType": "StructDefinition", "scope": 393, "src": "296:100:0", "visibility": "public" }, { "constant": false, "id": 22, "name": "permissions", "nodeType": "VariableDeclaration", "scope": 393, "src": "406:54:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_PermissionEntry_$18_storage_$", "typeString": "mapping(bytes32 => struct PermissioningRegistry.PermissionEntry)" }, "typeName": { "id": 21, "keyType": { "id": 19, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "414:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "406:35:0", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_PermissionEntry_$18_storage_$", "typeString": "mapping(bytes32 => struct PermissioningRegistry.PermissionEntry)" }, "valueType": { "contractScope": null, "id": 20, "name": "PermissionEntry", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 18, "src": "425:15:0", "typeDescriptions": { "typeIdentifier": "t_struct$_PermissionEntry_$18_storage_ptr", "typeString": "struct PermissioningRegistry.PermissionEntry" } } }, "value": null, "visibility": "public" }, { "anonymous": false, "documentation": null, "id": 26, "name": "NewAdmin", "nodeType": "EventDefinition", "parameters": { "id": 25, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24, "indexed": true, "name": "document", "nodeType": "VariableDeclaration", "scope": 26, "src": "482:24:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 23, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "482:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "481:26:0" }, "src": "467:41:0" }, { "anonymous": false, "documentation": null, "id": 30, "name": "Permission", "nodeType": "EventDefinition", "parameters": { "id": 29, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 28, "indexed": true, "name": "document", "nodeType": "VariableDeclaration", "scope": 30, "src": "530:24:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 27, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "530:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "529:26:0" }, "src": "513:43:0" }, { "body": { "id": 42, "nodeType": "Block", "src": "600:103:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 36, "name": "document", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 32, "src": "627:8:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 35, "name": "_isAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 374, "src": "618:8:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_bool_$", "typeString": "function (bytes32) view returns (bool)" } }, "id": 37, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "618:18:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "43616c6c65722068617320746f206265207468652063757272656e742061646d696e206f72206f776e65722e", "id": 38, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "638:46:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_88f66d4c4a74c0d3376762e13427122e988fd9032bcc2a2a735c43a0ff7c3107", "typeString": "literal_string \"Caller has to be the current admin or owner.\"" }, "value": "Caller has to be the current admin or owner." } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_88f66d4c4a74c0d3376762e13427122e988fd9032bcc2a2a735c43a0ff7c3107", "typeString": "literal_string \"Caller has to be the current admin or owner.\"" } ], "id": 34, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4841, 4842 ], "referencedDeclaration": 4842, "src": "610:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 39, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "610:75:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 40, "nodeType": "ExpressionStatement", "src": "610:75:0" }, { "id": 41, "nodeType": "PlaceholderStatement", "src": "695:1:0" } ] }, "documentation": null, "id": 43, "name": "onlyAdmins", "nodeType": "ModifierDefinition", "parameters": { "id": 33, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 32, "name": "document", "nodeType": "VariableDeclaration", "scope": 43, "src": "582:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 31, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "582:7:0", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "src": "581:18:0" }, "src": "562:141:0", "visibility": "internal" }, { "body": { "