UNPKG

secretstore-contracts

Version:

Secret Store permissioning and service contracts collection and toolkit.

431 lines 454 kB
{ "contractName": "SecretStoreDocumentKeyStoreService", "abi": [ { "constant": true, "inputs": [ { "name": "keyServer", "type": "address" } ], "name": "requireKeyServer", "outputs": [ { "name": "", "type": "uint8" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "maxDocumentKeyStoreRequests", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "keyServersCount", "outputs": [ { "name": "", "type": "uint8" } ], "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": false, "inputs": [], "name": "drain", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "documentKeyStoreFee", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "name": "keyServerSetAddressInit", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "payable": true, "stateMutability": "payable", "type": "fallback" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "serverKeyId", "type": "bytes32" }, { "indexed": false, "name": "author", "type": "address" }, { "indexed": false, "name": "commonPoint", "type": "bytes" }, { "indexed": false, "name": "encryptedPoint", "type": "bytes" } ], "name": "DocumentKeyStoreRequested", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "serverKeyId", "type": "bytes32" } ], "name": "DocumentKeyStored", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "serverKeyId", "type": "bytes32" } ], "name": "DocumentKeyStoreError", "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": "serverKeyId", "type": "bytes32" }, { "name": "commonPoint", "type": "bytes" }, { "name": "encryptedPoint", "type": "bytes" } ], "name": "storeDocumentKey", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "serverKeyId", "type": "bytes32" } ], "name": "documentKeyStored", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "serverKeyId", "type": "bytes32" } ], "name": "documentKeyStoreError", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "documentKeyStoreRequestsCount", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "index", "type": "uint256" } ], "name": "getDocumentKeyStoreRequest", "outputs": [ { "name": "", "type": "bytes32" }, { "name": "", "type": "address" }, { "name": "", "type": "bytes" }, { "name": "", "type": "bytes" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "serverKeyId", "type": "bytes32" }, { "name": "keyServer", "type": "address" } ], "name": "isDocumentKeyStoreResponseRequired", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "newFee", "type": "uint256" } ], "name": "setDocumentKeyStoreFee", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "newLimit", "type": "uint256" } ], "name": "setMaxDocumentKeyStoreRequests", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "serverKeyId", "type": "bytes32" } ], "name": "deleteDocumentKeyStoreRequest", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b506040516020806115e9833981016040819052905160008054600160a060020a031916331780825591928392600160a060020a031691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a360018054600160a060020a031916600160a060020a03929092169190911790555067016345785d8a0000600455600860055561153c806100ad6000396000f3006080604052600436106100e25763ffffffff60e060020a6000350416630fe7db4a81146101585780632b4f030a1461017d5780634bcdff5e146101b45780635aa8404c146101db578063663c87cd146101f0578063715018a61461020557806387f76b1a1461021a5780638a9a9a0f146102325780638b9749671461024a5780638ba9e398146102625780638da5cb5b1461029a5780638f32d59b146102cb5780639890220b146102e0578063a020846a146102f5578063c0332ca11461030a578063d413995b14610322578063f2fde38b1461033a578063fb2f439b1461035b575b6040805160e560020a62461bcd02815260206004820152602260248201527f446972656374207061796d656e747320617265206e6f7420737570706f72746560448201527f642e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61017b600480359060248035808201929081013591604435908101910135610479565b005b34801561018957600080fd5b5061019e600160a060020a03600435166107e7565b6040805160ff9092168252519081900360200190f35b3480156101c057600080fd5b506101c9610884565b60408051918252519081900360200190f35b3480156101e757600080fd5b5061019e61088a565b3480156101fc57600080fd5b506101c961091b565b34801561021157600080fd5b5061017b610921565b34801561022657600080fd5b5061017b60043561098b565b34801561023e57600080fd5b5061017b6004356109f3565b34801561025657600080fd5b5061017b600435610a9e565b34801561026e57600080fd5b50610286600435600160a060020a0360243516610ab6565b604080519115158252519081900360200190f35b3480156102a657600080fd5b506102af610aef565b60408051600160a060020a039092168252519081900360200190f35b3480156102d757600080fd5b50610286610afe565b3480156102ec57600080fd5b5061017b610b0f565b34801561030157600080fd5b506101c9610bb1565b34801561031657600080fd5b5061017b600435610bb7565b34801561032e57600080fd5b5061017b600435610be5565b34801561034657600080fd5b5061017b600160a060020a0360043516610bfd565b34801561036757600080fd5b50610373600435610c1c565b60405180856000191660001916815260200184600160a060020a0316600160a060020a031681526020018060200180602001838103835285818151815260200191508051906020019080838360005b838110156103da5781810151838201526020016103c2565b50505050905090810190601f1680156104075780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b8381101561043a578181015183820152602001610422565b50505050905090810190601f1680156104675780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b60006004548034101515156104d8576040805160e560020a62461bcd02815260206004820181905260248201527f5472616e73616374696f6e2076616c7565206973206e6f7420656e6f7567682e604482015290519081900360640190fd5b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843750508451604014935061056392505050576040805160e560020a62461bcd02815260206004820152601860248201527f5075626c6963206b6579206973206e6f742076616c69642e0000000000000000604482015290519081900360640190fd5b84848080601f0160208091040260200160405190810160405280939291908181526020018383808284375050845160401493506105ee92505050576040805160e560020a62461bcd02815260206004820152601860248201527f5075626c6963206b6579206973206e6f742076616c69642e0000000000000000604482015290519081900360640190fd5b6005546007541061066f576040805160e560020a62461bcd02815260206004820152602360248201527f4d6178696d756d206e756d626572206f6620726571756573747320726561636860448201527f65642e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008981526006602052604090208054909450600160a060020a0316156106e0576040805160e560020a62461bcd02815260206004820152601e60248201527f5265717565737420617574686f722061646472657373206973203078302e0000604482015290519081900360640190fd5b6106e8610d96565b835473ffffffffffffffffffffffffffffffffffffffff1916331784556107136001850189896113f6565b506107226002850187876113f6565b50600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68801899055604080518a8152336020820181905260809282018381529282018a90527fadc87e5ceadda3a573403a1ad2d7e815d4482b89ea2034e49d188de6843ee43d928c928c918c918c918c91906060820160a083018787808284379091018481038352858152602001905085858082843760405192018290039a509098505050505050505050a1505050505050505050565b600154604080517f287fb40c000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151600093929092169163287fb40c9160248082019260209290919082900301818787803b15801561085257600080fd5b505af1158015610866573d6000803e3d6000fd5b505050506040513d602081101561087c57600080fd5b505192915050565b60055481565b600154604080517f5560c9650000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691635560c96591600480830192602092919082900301818787803b1580156108e957600080fd5b505af11580156108fd573d6000803e3d6000fd5b505050506040513d602081101561091357600080fd5b505190505b90565b60075490565b610929610afe565b151561093457600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60008181526006602052604090208054600160a060020a031615156109af576109ef565b6109b8336107e7565b506109c38282610f58565b60405182907f1accba7cc95d8cf1f4f927b53957972a0d92aa6f96636f1fd988dad93d263e9790600090a25b5050565b6000818152600660205260408120805490919081908190600160a060020a03161515610a1e57610a97565b610a27336107e7565b925060009150610a4660038501846001610a3f61088a565b0385610ff0565b90506001816002811115610a5657fe5b1415610a6157610a97565b610a6b8585610f58565b60405185907ff97081917a769be6d07eefdd63666c32b011f9dba0bb0eed6cf1b9c9b987461c90600090a25b5050505050565b610aa6610afe565b1515610ab157600080fd5b600455565b6000806000610ac4846107e7565b60008681526006602052604090209092509050610ae460038201836111b5565b92505b505092915050565b600054600160a060020a031690565b600054600160a060020a0316331490565b33600090815260026020526040902054801515610b76576040805160e560020a62461bcd02815260206004820152600d60248201527f42616c616e636520697320302e00000000000000000000000000000000000000604482015290519081900360640190fd5b336000818152600260205260408082208290555183156108fc0291849190818181858888f193505050501580156109ef573d6000803e3d6000fd5b60045481565b6000610bc1610afe565b1515610bcc57600080fd5b5060008181526006602052604090206109c38282610f58565b610bed610afe565b1515610bf857600080fd5b600555565b610c05610afe565b1515610c1057600080fd5b610c1981611264565b50565b600080606080600080600787815481101515610c3457fe5b6000918252602080832090910154808352600682526040928390208054600180830180548751601f60029483161561010002600019019092168490049182018890048802810188019098528088529498509296508795600160a060020a0390921694929390870192849190830182828015610cf05780601f10610cc557610100808354040283529160200191610cf0565b820191906000526020600020905b815481529060010190602001808311610cd357829003601f168201915b5050845460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815295975086945092508401905082828015610d7e5780601f10610d5357610100808354040283529160200191610d7e565b820191906000526020600020905b815481529060010190602001808311610d6157829003601f168201915b50505050509050955095509550955050509193509193565b600080600080600080610da761088a565b95503494508560ff1685811515610dba57fe5b049350600092505b6001860360ff168360ff161015610e9957600154604080517fc66198dc00000000000000000000000000000000000000000000000000000000815260ff861660048201529051600160a060020a039092169163c66198dc916024808201926020929091908290030181600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050506040513d6020811015610e6657600080fd5b5051600160a060020a03811660009081526002602052604090208054860190559484900394600193909301929150610dc2565b600154604080517fc66198dc00000000000000000000000000000000000000000000000000000000815260ff6000198a011660048201529051600160a060020a039092169163c66198dc916024808201926020929091908290030181600087803b158015610f0657600080fd5b505af1158015610f1a573d6000803e3d6000fd5b505050506040513d6020811015610f3057600080fd5b5051600160a060020a0316600090815260026020526040902080549095019094555050505050565b610f64816003016112e1565b6000828152600660205260408120805473ffffffffffffffffffffffffffffffffffffffff1916815590610f9b6001830182611474565b610fa9600283016000611474565b6000600383018181556004840182905560058401805460ff19908116909155600785018054909116905590610fe160088501826114b8565b505050506109ef600783611332565b6000806000806000600160009054906101000a9004600160a060020a0316600160a060020a0316636452e8216040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561104b57600080fd5b505af115801561105f573d6000803e3d6000fd5b505050506040513d602081101561107557600080fd5b505160028a015490945060ff161515611090578389556110a2565b885484146110a2576110a289856113ba565b600189015460ff891660020a93508316156110c057600194506111a9565b600086815260038a016020526040902080546001808c0180548717905560028c01805460ff8181168401811660ff19928316179092558454938216830191821693168317909355919350141561112b5760058901805460018101825560009182526020909120018690555b600489015460ff9081169083161061116b5760048901805460ff191660ff84811691909117909155600019830181169088161161116b57600094506111a9565b600289015460ff1661117b61088a565b60048b0154919003915060001960ff918216830101811690881611156111a457600294506111a9565b600194505b50505050949350505050565b6000806000600160009054906101000a9004600160a060020a0316600160a060020a0316636452e8216040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561120d57600080fd5b505af1158015611221573d6000803e3d6000fd5b505050506040513d602081101561123757600080fd5b50518554909250821461124d5760019250610ae7565b5050506001919091015460ff90911660020a161590565b600160a060020a038116151561127957600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005b60058201548110156109ef57816003016000836005018381548110151561130757fe5b600091825260208083209091015483528201929092526040019020805460ff191690556001016112e4565b60005b82548110156113b5578254829084908390811061134e57fe5b60009182526020909120015414156113ad5782548390600019810190811061137257fe5b9060005260206000200154838281548110151561138b57fe5b6000918252602090912001558254600019016113a784826114d6565b506113b5565b600101611335565b505050565b6113c3826112e1565b80825560006001830181905560028301805460ff1990811690915560048401805490911690556113b560058401826114d6565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114375782800160ff19823516178555611464565b82800160010185558215611464579182015b82811115611464578235825591602001919060010190611449565b506114709291506114f6565b5090565b50805460018160011615610100020316600290046000825580601f1061149a5750610c19565b601f016020900490600052602060002090810190610c1991906114f6565b5080546000825590600052602060002090810190610c1991906114f6565b8154818355818111156113b5576000838152602090206113b59181019083015b61091891905b8082111561147057600081556001016114fc5600a165627a7a7230582039522cef30b53295f8e51d2fd0b97a9707f880590ffb1be8a13bee5078378ba40029", "deployedBytecode": "0x6080604052600436106100e25763ffffffff60e060020a6000350416630fe7db4a81146101585780632b4f030a1461017d5780634bcdff5e146101b45780635aa8404c146101db578063663c87cd146101f0578063715018a61461020557806387f76b1a1461021a5780638a9a9a0f146102325780638b9749671461024a5780638ba9e398146102625780638da5cb5b1461029a5780638f32d59b146102cb5780639890220b146102e0578063a020846a146102f5578063c0332ca11461030a578063d413995b14610322578063f2fde38b1461033a578063fb2f439b1461035b575b6040805160e560020a62461bcd02815260206004820152602260248201527f446972656374207061796d656e747320617265206e6f7420737570706f72746560448201527f642e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61017b600480359060248035808201929081013591604435908101910135610479565b005b34801561018957600080fd5b5061019e600160a060020a03600435166107e7565b6040805160ff9092168252519081900360200190f35b3480156101c057600080fd5b506101c9610884565b60408051918252519081900360200190f35b3480156101e757600080fd5b5061019e61088a565b3480156101fc57600080fd5b506101c961091b565b34801561021157600080fd5b5061017b610921565b34801561022657600080fd5b5061017b60043561098b565b34801561023e57600080fd5b5061017b6004356109f3565b34801561025657600080fd5b5061017b600435610a9e565b34801561026e57600080fd5b50610286600435600160a060020a0360243516610ab6565b604080519115158252519081900360200190f35b3480156102a657600080fd5b506102af610aef565b60408051600160a060020a039092168252519081900360200190f35b3480156102d757600080fd5b50610286610afe565b3480156102ec57600080fd5b5061017b610b0f565b34801561030157600080fd5b506101c9610bb1565b34801561031657600080fd5b5061017b600435610bb7565b34801561032e57600080fd5b5061017b600435610be5565b34801561034657600080fd5b5061017b600160a060020a0360043516610bfd565b34801561036757600080fd5b50610373600435610c1c565b60405180856000191660001916815260200184600160a060020a0316600160a060020a031681526020018060200180602001838103835285818151815260200191508051906020019080838360005b838110156103da5781810151838201526020016103c2565b50505050905090810190601f1680156104075780820380516001836020036101000a031916815260200191505b50838103825284518152845160209182019186019080838360005b8381101561043a578181015183820152602001610422565b50505050905090810190601f1680156104675780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b60006004548034101515156104d8576040805160e560020a62461bcd02815260206004820181905260248201527f5472616e73616374696f6e2076616c7565206973206e6f7420656e6f7567682e604482015290519081900360640190fd5b85858080601f01602080910402602001604051908101604052809392919081815260200183838082843750508451604014935061056392505050576040805160e560020a62461bcd02815260206004820152601860248201527f5075626c6963206b6579206973206e6f742076616c69642e0000000000000000604482015290519081900360640190fd5b84848080601f0160208091040260200160405190810160405280939291908181526020018383808284375050845160401493506105ee92505050576040805160e560020a62461bcd02815260206004820152601860248201527f5075626c6963206b6579206973206e6f742076616c69642e0000000000000000604482015290519081900360640190fd5b6005546007541061066f576040805160e560020a62461bcd02815260206004820152602360248201527f4d6178696d756d206e756d626572206f6620726571756573747320726561636860448201527f65642e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008981526006602052604090208054909450600160a060020a0316156106e0576040805160e560020a62461bcd02815260206004820152601e60248201527f5265717565737420617574686f722061646472657373206973203078302e0000604482015290519081900360640190fd5b6106e8610d96565b835473ffffffffffffffffffffffffffffffffffffffff1916331784556107136001850189896113f6565b506107226002850187876113f6565b50600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68801899055604080518a8152336020820181905260809282018381529282018a90527fadc87e5ceadda3a573403a1ad2d7e815d4482b89ea2034e49d188de6843ee43d928c928c918c918c918c91906060820160a083018787808284379091018481038352858152602001905085858082843760405192018290039a509098505050505050505050a1505050505050505050565b600154604080517f287fb40c000000000000000000000000000000000000000000000000000000008152600160a060020a0384811660048301529151600093929092169163287fb40c9160248082019260209290919082900301818787803b15801561085257600080fd5b505af1158015610866573d6000803e3d6000fd5b505050506040513d602081101561087c57600080fd5b505192915050565b60055481565b600154604080517f5560c9650000000000000000000000000000000000000000000000000000000081529051600092600160a060020a031691635560c96591600480830192602092919082900301818787803b1580156108e957600080fd5b505af11580156108fd573d6000803e3d6000fd5b505050506040513d602081101561091357600080fd5b505190505b90565b60075490565b610929610afe565b151561093457600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60008181526006602052604090208054600160a060020a031615156109af576109ef565b6109b8336107e7565b506109c38282610f58565b60405182907f1accba7cc95d8cf1f4f927b53957972a0d92aa6f96636f1fd988dad93d263e9790600090a25b5050565b6000818152600660205260408120805490919081908190600160a060020a03161515610a1e57610a97565b610a27336107e7565b925060009150610a4660038501846001610a3f61088a565b0385610ff0565b90506001816002811115610a5657fe5b1415610a6157610a97565b610a6b8585610f58565b60405185907ff97081917a769be6d07eefdd63666c32b011f9dba0bb0eed6cf1b9c9b987461c90600090a25b5050505050565b610aa6610afe565b1515610ab157600080fd5b600455565b6000806000610ac4846107e7565b60008681526006602052604090209092509050610ae460038201836111b5565b92505b505092915050565b600054600160a060020a031690565b600054600160a060020a0316331490565b33600090815260026020526040902054801515610b76576040805160e560020a62461bcd02815260206004820152600d60248201527f42616c616e636520697320302e00000000000000000000000000000000000000604482015290519081900360640190fd5b336000818152600260205260408082208290555183156108fc0291849190818181858888f193505050501580156109ef573d6000803e3d6000fd5b60045481565b6000610bc1610afe565b1515610bcc57600080fd5b5060008181526006602052604090206109c38282610f58565b610bed610afe565b1515610bf857600080fd5b600555565b610c05610afe565b1515610c1057600080fd5b610c1981611264565b50565b600080606080600080600787815481101515610c3457fe5b6000918252602080832090910154808352600682526040928390208054600180830180548751601f60029483161561010002600019019092168490049182018890048802810188019098528088529498509296508795600160a060020a0390921694929390870192849190830182828015610cf05780601f10610cc557610100808354040283529160200191610cf0565b820191906000526020600020905b815481529060010190602001808311610cd357829003601f168201915b5050845460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815295975086945092508401905082828015610d7e5780601f10610d5357610100808354040283529160200191610d7e565b820191906000526020600020905b815481529060010190602001808311610d6157829003601f168201915b50505050509050955095509550955050509193509193565b600080600080600080610da761088a565b95503494508560ff1685811515610dba57fe5b049350600092505b6001860360ff168360ff161015610e9957600154604080517fc66198dc00000000000000000000000000000000000000000000000000000000815260ff861660048201529051600160a060020a039092169163c66198dc916024808201926020929091908290030181600087803b158015610e3c57600080fd5b505af1158015610e50573d6000803e3d6000fd5b505050506040513d6020811015610e6657600080fd5b5051600160a060020a03811660009081526002602052604090208054860190559484900394600193909301929150610dc2565b600154604080517fc66198dc00000000000000000000000000000000000000000000000000000000815260ff6000198a011660048201529051600160a060020a039092169163c66198dc916024808201926020929091908290030181600087803b158015610f0657600080fd5b505af1158015610f1a573d6000803e3d6000fd5b505050506040513d6020811015610f3057600080fd5b5051600160a060020a0316600090815260026020526040902080549095019094555050505050565b610f64816003016112e1565b6000828152600660205260408120805473ffffffffffffffffffffffffffffffffffffffff1916815590610f9b6001830182611474565b610fa9600283016000611474565b6000600383018181556004840182905560058401805460ff19908116909155600785018054909116905590610fe160088501826114b8565b505050506109ef600783611332565b6000806000806000600160009054906101000a9004600160a060020a0316600160a060020a0316636452e8216040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561104b57600080fd5b505af115801561105f573d6000803e3d6000fd5b505050506040513d602081101561107557600080fd5b505160028a015490945060ff161515611090578389556110a2565b885484146110a2576110a289856113ba565b600189015460ff891660020a93508316156110c057600194506111a9565b600086815260038a016020526040902080546001808c0180548717905560028c01805460ff8181168401811660ff19928316179092558454938216830191821693168317909355919350141561112b5760058901805460018101825560009182526020909120018690555b600489015460ff9081169083161061116b5760048901805460ff191660ff84811691909117909155600019830181169088161161116b57600094506111a9565b600289015460ff1661117b61088a565b60048b0154919003915060001960ff918216830101811690881611156111a457600294506111a9565b600194505b50505050949350505050565b6000806000600160009054906101000a9004600160a060020a0316600160a060020a0316636452e8216040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561120d57600080fd5b505af1158015611221573d6000803e3d6000fd5b505050506040513d602081101561123757600080fd5b50518554909250821461124d5760019250610ae7565b5050506001919091015460ff90911660020a161590565b600160a060020a038116151561127957600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005b60058201548110156109ef57816003016000836005018381548110151561130757fe5b600091825260208083209091015483528201929092526040019020805460ff191690556001016112e4565b60005b82548110156113b5578254829084908390811061134e57fe5b60009182526020909120015414156113ad5782548390600019810190811061137257fe5b9060005260206000200154838281548110151561138b57fe5b6000918252602090912001558254600019016113a784826114d6565b506113b5565b600101611335565b505050565b6113c3826112e1565b80825560006001830181905560028301805460ff1990811690915560048401805490911690556113b560058401826114d6565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114375782800160ff19823516178555611464565b82800160010185558215611464579182015b82811115611464578235825591602001919060010190611449565b506114709291506114f6565b5090565b50805460018160011615610100020316600290046000825580601f1061149a5750610c19565b601f016020900490600052602060002090810190610c1991906114f6565b5080546000825590600052602060002090810190610c1991906114f6565b8154818355818111156113b5576000838152602090206113b59181019083015b61091891905b8082111561147057600081556001016114fc5600a165627a7a7230582039522cef30b53295f8e51d2fd0b97a9707f880590ffb1be8a13bee5078378ba40029", "sourceMap": "853:6720:5:-;;;1597:190;8:9:-1;5:2;;;30:1;27;20:12;5:2;1597:190:5;;;;;;;;;;;;;;;;509:6:12;:19;;-1:-1:-1;;;;;;509:19:12;518:10;509:19;;;;1597:190:5;;;;-1:-1:-1;;;;;572:6:12;;509;539:40;;509:6;;539:40;2548:19:8;:45;;-1:-1:-1;;;;;;2548:45:8;-1:-1:-1;;;;;2548:45:8;;;;;;;;;;-1:-1:-1;1729:10:5;1707:19;:32;1779:1;1749:27;:31;853:6720;;;-1:-1:-1;853:6720:5;;", "deployedSourceMap": "853:6720:5:-;;;;;;;;;-1:-1:-1;;;853:6720:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1906:44;;;-1:-1:-1;;;;;1906:44:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2102:913;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2843:166:8;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2843:166:8;-1:-1:-1;;;;;2843:166:8;;;;;;;;;;;;;;;;;;;;;;;;7323:42:5;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7323:42:5;;;;;;;;;;;;;;;;;;;;2644:140:8;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2644:140:8;;;;4873:132:5;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4873:132:5;;;;1273:127:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1273:127:12;;;;4195:614:5;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4195:614:5;;;;;3074:1055;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3074:1055:5;;;;;6046:130;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6046:130:5;;;;;5626:339;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5626:339:5;;;-1:-1:-1;;;;;5626:339:5;;;;;;;;;;;;;;;;;;;;;;;639:70:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;639:70:12;;;;;;;;-1:-1:-1;;;;;639:70:12;;;;;;;;;;;;;;926:83;;8:9:-1;5:2;;;30:1;27;20:12;5:2;926:83:12;;;;3059:199:8;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3059:199:8;;;;7139:34:5;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7139:34:5;;;;6428:303;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6428:303:5;;;;;6229:150;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6229:150:5;;;;;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;;;;;5136:418:5;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5136:418:5;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5136:418:5;-1:-1:-1;;;;;5136:418:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;5136:418:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5136:418:5;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;5136:418:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2102:913;2499:39;2227:19;;2216:6:8;2203:9;:19;;2195:64;;;;;;;-1:-1:-1;;;;;2195:64:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2268:11:5;;2332:125:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;2388:16:8;;2408:2;2388:22;;-1:-1:-1;2380:59:8;;-1:-1:-1;;;2380:59:8;;;;-1:-1:-1;;;;;2380:59:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;2301:14:5;;2332:125:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;2388:16:8;;2408:2;2388:22;;-1:-1:-1;2380:59:8;;-1:-1:-1;;;2380:59:8;;;;-1:-1:-1;;;;;2380:59:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;2421:27:5;;2383:28;:35;:65;2375:113;;;;;-1:-1:-1;;;;;2375:113:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2541:37;;;;:24;:37;;;;;2596:14;;2541:37;;-1:-1:-1;;;;;;2596:14:5;:28;2588:71;;;;;-1:-1:-1;;;;;2588:71:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;2669:9;:7;:9::i;:::-;2689:27;;-1:-1:-1;;2689:27:5;2706:10;2689:27;;;2726:33;2689:27;2726:19;;2748:11;;2726:33;:::i;:::-;-1:-1:-1;2769:39:5;:22;;;2794:14;;2769:39;:::i;:::-;-1:-1:-1;2818:28:5;27:10:-1;;39:1;23:18;;45:23;;-1:-1;2818:46:5;;;;;;;;;2880:128;;;;;;2944:10;2818:46;2880:128;;;;;;;;;;;;;;;;;;;;2852:11;;2968;;;;2993:14;;;;2880:128;;;;;;;2968:11;;;;2880:128;;;;;;;;;;;;;;;;-1:-1:-1;2880:128:5;;;;;;;;;;;;;;-1:-1:-1;2880:128:5;;-1:-1:-1;;;;;;;;;2880:128:5;2449:1:8;2269;2102:913:5;;;;;;;:::o;2843:166:8:-;2946:19;;2933:69;;;;;;-1:-1:-1;;;;;2933:69:8;;;;;;;;;2909:5;;2946:19;;;;;2933:58;;:69;;;;;;;;;;;;;;;2909:5;2946:19;2933:69;;;5:2:-1;;;;30:1;27;20:12;5:2;2933:69:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2933:69:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2933:69:8;;2843:166;-1:-1:-1;;2843:166:8:o;7323:42:5:-;;;;:::o;2644:140:8:-;2729:19;;2716:61;;;;;;;;2692:5;;-1:-1:-1;;;;;2729:19:8;;2716:59;;:61;;;;;;;;;;;;;;2692:5;2729:19;2716:61;;;5:2:-1;;;;30:1;27;20:12;5:2;2716:61:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2716:61:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2716:61:8;;-1:-1:-1;2644:140:8;;:::o;4873:132:5:-;4963:28;:35;4873:132;:::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;4195:614:5:-;4307:39;4349:37;;;:24;:37;;;;;4400:14;;-1:-1:-1;;;;;4400:14:5;:28;4396:65;;;4444:7;;4396:65;4520:28;4537:10;4520:16;:28::i;:::-;;4703:50;4732:11;4745:7;4703:28;:50::i;:::-;4768:34;;4790:11;;4768:34;;;;;4195:614;;;:::o;3074:1055::-;3182:39;3224:37;;;:24;:37;;;;;3275:14;;3224:37;;3182:39;;;;;-1:-1:-1;;;;;3275:14:5;:28;3271:65;;;3319:7;;3271:65;3452:28;3469:10;3452:16;:28::i;:::-;3429:51;-1:-1:-1;3517:1:5;;-1:-1:-1;3563:131:5;3591:17;;;3429:51;3509:10;3650:17;:15;:17::i;:::-;:21;3685:8;3563:14;:131::i;:::-;3529:165;-1:-1:-1;3780:27:5;3761:15;:46;;;;;;;;;3757:106;;;3846:7;;3757:106;4027:50;4056:11;4069:7;4027:28;:50::i;:::-;4092:30;;4110:11;;4092:30;;;;;3074:1055;;;;;;:::o;6046:130::-;824:9:12;:7;:9::i;:::-;816:18;;;;;;;;6141:19:5;:28;6046:130::o;5626:339::-;5733:4;5749:20;5809:39;5772:27;5789:9;5772:16;:27::i;:::-;5851:37;;;;:24;:37;;;;;5749:50;;-1:-1:-1;5851:37:5;-1:-1:-1;5905:53:5;5924:17;;;5749:50;5905:18;:53::i;:::-;5898:60;;5626:339;;;;;;;:::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;3059:199:8:-;3120:10;3093:15;3111:20;;;:8;:20;;;;;;3149:12;;;3141:38;;;;;-1:-1:-1;;;;;3141:38:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;3198:10;3212:1;3189:20;;;:8;:20;;;;;;:24;;;3223:28;;;;;;3243:7;;3223:28;;3212:1;3223:28;3243:7;3198:10;3223:28;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;7139:34:5;;;;:::o;6428:303::-;6535:39;824:9:12;:7;:9::i;:::-;816:18;;;;;;;;-1:-1:-1;6577:37:5;;;;:24;:37;;;;;6624:50;6602:11;6577:37;6624:28;:50::i;6229:150::-;824:9:12;:7;:9::i;:::-;816:18;;;;;;;;6334:27:5;:38;6229:150::o;1561:101:12:-;824:9;:7;:9::i;:::-;816:18;;;;;;;;1629:28;1648:8;1629:18;:28::i;:::-;1561:101;:::o;5136:418:5:-;5210:7;5219;5228:5;5235;5252:19;5319:39;5274:28;5303:5;5274:35;;;;;;;;;;;;;;;;;;;;;;5361:37;;;:24;:37;;;;;;;5454:14;;;5482:19;;;5408:139;;;;;5515:22;5408:139;;;;5454:14;5408:139;-1:-1:-1;;5408:139:5;;;;;;;;;;;;;;;;;;;;;;;;;5274:35;;-1:-1:-1;5361:37:5;;-1:-1:-1;5274:35:5;;-1:-1:-1;;;;;5454:14:5;;;;5482:19;;5515:22;;;;5482:19;;5408:139;;;5482:19;5408:139;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;5408:139:5;;;;;;;;;;;;;-1:-1:-1;;5408:139:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5408:139:5;;-1:-1:-1;5408:139:5;-1:-1:-1;5408:139:5;;;-1:-1:-1;5408:139:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5136:418;;;;;;;:::o;3326:521:8:-;3364:11;3405:14;3441:13;3486:7;3533:17;3709:21;3378:17;:15;:17::i;:::-;3364:31;;3422:9;3405:26;;3466:5;3457:14;;:6;:14;;;;;;;;3441:30;;3496:1;3486:11;;3481:218;3511:1;3503:5;:9;3499:13;;:1;:13;;;3481:218;;;3566:19;;3553:56;;;;;;;;;;;;;;;-1:-1:-1;;;;;3566:19:8;;;;3553:53;;:56;;;;;;;;;;;;;;;3566:19;;3553:56;;;5:2:-1;;;;30:1;27;20:12;5:2;3553:56:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3553:56:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3553:56:8;-1:-1:-1;;;;;3623:19:8;;;;;;:8;3553:56;3623:19;;;;:28;;;;;;3674:14;;;;;-1:-1:-1;3514:3:8;;;;;3553:56;-1:-1:-1;3481:218:8;;;3746:19;;3733:64;;;;;;;-1:-1:-1;;3787:9:8;;3733:64;;;;;;;-1:-1:-1;;;;;3746:19:8;;;;3733:53;;:64;;;;;;;;;;;;;;;3746:19;;3733:64;;;5:2:-1;;;;30:1;27;20:12;5:2;3733:64:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3733:64:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3733:64:8;-1:-1:-1;;;;;3807:23:8;;;;;:8;3733:64;3807:23;;;;:33;;;;;;;;-1:-1:-1;;;;;3326:521:8:o;6819:282:5:-;6937:33;6952:7;:17;;6937:14;:33::i;:::-;6987:37;;;;:24;:37;;;;;6980:44;;-1:-1:-1;;6980:44:5;;;6987:37;6980:44;;;;6987:37;6980:44;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6980:44:5;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;7035:59;7052:28;7082:11;7035:16;:59::i;4584:1938:8:-;4752:15;4874:31;5313:21;5535;6259:20;4921:19;;;;;;;;;-1:-1:-1;;;;;4921:19:8;-1:-1:-1;;;;;4908:54:8;;:56;;;;;-1:-1:-1;;;4908:56:8;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4908:56:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4908:56:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4908:56:8;4978:34;;;;4908:56;;-1:-1:-1;4978:34:8;;:39;4974:276;;;5033:59;;;4974:276;;;5113:33;;:60;;5109:141;;5189:50;5204:9;5215:23;5189:14;:50::i;:::-;5346:1;5382:33;;;5338:28;;;;;;-1:-1:-1;5382:49:8;;5381:56;5377:121;;5460:27;5453:34;;;;5377:121;5559:36;;;;:26;;;:36;;;;;;;;5609:33;;;:50;;;;;;5669:34;;;:39;;5559:36;5669:39;;;;;;;-1:-1:-1;;5669:39:8;;;;;;;5718:54;;5559:36;;;:40;;5718:54;;;;;;;;;;5559:40;;-1:-1:-1;5786:20:8;5782:85;;;5822:19;;;27:10:-1;;39:1;23:18;;45:23;;-1:-1;5822:34:8;;;;;;;;;;;5782:85;5899:28;;;;;;;;5880:47;;;;5876:309;;5943:28;;;:46;;-1:-1:-1;;5943:46:8;;;;;;;;;;;;-1:-1:-1;;6089:19:8;;6076:32;;;;;;6072:103;;6135:25;6128:32;;;;6072:103;6302:34;;;;;;6282:17;:15;:17::i;:::-;6362:28;;;;6282:54;;;;-1:-1:-1;;;6362:28:8;;;;:45;;:49;6350:61;;;;;;6346:125;;;6434:26;6427:33;;;;6346:125;6488:27;6481:34;;4584:1938;;;;;;;;;;;:::o;3920:618::-;4029:4;4120:31;4402:21;4167:19;;;;;;;;;-1:-1:-1;;;;;4167:19:8;-1:-1:-1;;;;;4154:54:8;;:56;;;;;-1:-1:-1;;;4154:56:8;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4154:56:8;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4154:56:8;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4154:56:8;4251:33;;4154:56;;-1:-1:-1;4224:60:8;;4220:102;;4307:4;4300:11;;;;4220:102;-1:-1:-1;;;4435:1:8;4475:33;;;;;4427:28;;;;;;4475:49;4474:56;;3920:618::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;6568:224:8:-;6652:9;6647:139;6671:19;;;:26;6667:30;;6647:139;;;6725:9;:26;;:50;6752:9;:19;;6772:1;6752:22;;;;;;;;;;;;;;;;;;;;;;6725:50;;;;;;;;;;;;6718:57;;-1:-1:-1;;6718:57:8;;;;6699:3;6647:139;;6836:345;6931:6;6926:249;6947:15;;6943:19;;6926:249;;;6987:11;;7002:7;;6987:8;;6996:1;;6987:11;;;;;;;;;;;;;;;;:22;6983:182;;;7052:15;;7043:8;;-1:-1:-1;;7052:19:8;;;7043:29;;;;;;;;;;;;;;7029:8;7038:1;7029:11;;;;;;;;;;;;;;;;;;;:43;7108:15;;-1:-1:-1;;7108:19:8;7090:37;7108:8;:19;7090:37;:::i;:::-;;7145:5;;6983:182;6964:3;;6926:249;;;6836:345;;;:::o;7212:389::-;7323:25;7338:9;7323:14;:25::i;:::-;7358:59;;;:33;7427;;;:37;;;7474:34;;;:38;;-1:-1:-1;;7474:38:8;;;;;;7522:28;;;:32;;;;;;;7564:30;:19;;;7358:33;7564:30;:::i;853:6720:5:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;853:6720:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;853:6720:5;;;-1:-1:-1;853:6720:5;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "source": "//! The Secret Store document key store service contract.\n//!\n//! Copyright 2017 Svyatoslav Nikolsky, Parity Technologies Ltd.\n//!\n//! Licensed under the Apache License, Version 2.0 (the \"License\");\n//! you may not use this file except in compliance with the License.\n//! You may obtain a copy of the License at\n//!\n//! http://www.apache.org/licenses/LICENSE-2.0\n//!\n//! Unless required by applicable law or agreed to in writing, software\n//! distributed under the License is distributed on an \"AS IS\" BASIS,\n//! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//! See the License for the specific language governing permissions and\n//! limitations under the License.\n\npragma solidity ^0.4.24;\n\nimport \"../interfaces/SecretStoreService.sol\";\nimport \"./SecretStoreServiceBase.sol\";\n\n\n/// Document Key store service contract.\ncontract SecretStoreDocumentKeyStoreService is SecretStoreServiceBase, DocumentKeyStoreServiceClientApi, DocumentKeyStoreServiceKeyServerApi {\n /// Document key store request.\n struct DocumentKeyStoreRequest {\n address author;\n bytes commonPoint;\n bytes encryptedPoint;\n RequestResponses responses;\n }\n\n /// When document key store request is received.\n event DocumentKeyStoreRequested(bytes32 serverKeyId, address author, bytes commonPoint, bytes encryptedPoint);\n /// When document key is stored.\n event DocumentKeyStored(bytes32 indexed serverKeyId);\n /// When error occurs during document key store.\n event DocumentKeyStoreError(bytes32 indexed serverKeyId);\n\n /// Constructor.\n constructor(address keyServerSetAddressInit) SecretStoreServiceBase(keyServerSetAddressInit) public {\n documentKeyStoreFee = 100 finney;\n maxDocumentKeyStoreRequests = 8;\n }\n\n // === Interface methods ===\n\n /// We do not support direct payments.\n function() public payable {\n revert(\"Direct payments are not supported.\");\n }\n\n /// Request document key store. Use `secretstore_generateDocumentKey` RPC to generate both\n /// `commonPoint` and `encryptedPoint`.\n function storeDocumentKey(bytes32 serverKeyId, bytes commonPoint, bytes encryptedPoint) external payable\n whenFeePaid(documentKeyStoreFee)\n validPublic(commonPoint)\n validPublic(encryptedPoint)\n {\n // check maximum number of requests\n require(documentKeyStoreRequestsKeys.length < maxDocumentKeyStoreRequests, \"Maximum number of requests reached.\");\n\n DocumentKeyStoreRequest storage request = documentKeyStoreRequests[serverKeyId];\n require(request.author == address(0), \"Request author address is 0x0.\");\n deposit();\n\n request.author = msg.sender;\n request.commonPoint = commonPoint;\n request.encryptedPoint = encryptedPoint;\n documentKeyStoreRequestsKeys.push(serverKeyId);\n\n emit DocumentKeyStoreRequested(\n serverKeyId,\n msg.sender,\n commonPoint,\n encryptedPoint);\n }\n\n /// Called when store is reported by key server.\n function documentKeyStored(bytes32 serverKeyId) external {\n // check if request still active\n DocumentKeyStoreRequest storage request = documentKeyStoreRequests[serverKeyId];\n if (request.author == address(0)) {\n return;\n }\n\n // insert response (we're waiting for responses from all authorities here)\n uint8 keyServerIndex = requireKeyServer(msg.sender);\n bytes32 response = bytes32(0);\n ResponseSupport responseSupport = insertResponse(\n request.responses,\n keyServerIndex,\n keyServersCount() - 1,\n response);\n\n // ...and check if there are enough support\n if (responseSupport == ResponseSupport.Unconfirmed) { // not confirmed (yet)\n return;\n }\n\n // delete request and fire event\n // there's always consensus, because key servers are only reporting the fact that they've stored the key\n clearDocumentKeyStoreRequest(serverKeyId, request);\n emit DocumentKeyStored(serverKeyId);\n }\n\n /// Called when error occurs during document key store.\n function documentKeyStoreError(bytes32 serverKeyId) external {\n // check if request still active\n DocumentKeyStoreRequest storage request = documentKeyStoreRequests[serverKeyId];\n if (request.author == address(0)) {\n return;\n }\n\n // check that it is called by key server\n requireKeyServer(msg.sender);\n\n // any error in key store is fatal, because we need all key servers to participate in store\n // => delete request and fire event\n clearDocumentKeyStoreRequest(serverKeyId, request);\n emit DocumentKeyStoreError(serverKeyId);\n }\n\n /// Get count of pending document key store requests.\n function documentKeyStoreRequestsCount() external view returns (uint256) {\n return documentKeyStoreRequestsKeys.length;\n }\n\n /// Get document key store request with given index.\n /// Returns: (serverKeyId, author, commonPoint, encryptedPoint)\n function getDocumentKeyStoreRequest(uint256 index) external view returns (bytes32, address, bytes, bytes) {\n bytes32 serverKeyId = documentKeyStoreRequestsKeys[index];\n DocumentKeyStoreRequest storage request = documentKeyStoreRequests[serverKeyId];\n return (\n serverKeyId,\n request.author,\n request.commonPoint,\n request.encryptedPoint\n );\n }\n\n /// Returs true if response from given keyServer is required.\n function isDocumentKeyStoreResponseRequired(bytes32 serverKeyId, address keyServer) external view returns (bool) {\n uint8 keyServerIndex = requireKeyServer(keyServer);\n DocumentKeyStoreRequest storage request = documentKeyStoreRequests[serverKeyId];\n return isResponseRequired(request.responses, keyServerIndex);\n }\n\n // === Administrative methods ===\n\n /// Set document key store fee.\n function setDocumentKeyStoreFee(uint256 newFee)\n public\n onlyOwner\n {\n documentKeyStoreFee = newFee;\n }\n\n /// Set document key store requests limit.\n function setMaxDocumentKeyStoreRequests(uint256 newLimit)\n public\n onlyOwner\n {\n maxDocumentKeyStoreRequests = newLimit;\n }\n\n /// Delete document key store request.\n function deleteDocumentKeyStoreRequest(bytes32 serverKeyId)\n public\n onlyOwner\n {\n DocumentKeyStoreRequest storage request = documentKeyStoreRequests[serverKeyId];\n clearDocumentKeyStoreRequest(serverKeyId, request);\n\n emit DocumentKeyStoreError(serverKeyId);\n }\n\n // === Internal methods ===\n\n /// Clear document key store request traces.\n function clearDocumentKeyStoreRequest(bytes32 serverKeyId, DocumentKeyStoreRequest storage request) private {\n clearResponses(request.responses);\n delete documentKeyStoreRequests[serverKeyId];\n\n removeRequestKey(documentKeyStoreRequestsKeys, serverKeyId);\n }\n\n /// Document key store fee.\n uint256 public documentKeyStoreFee;\n /// Maximal number of active document key store requests. We're limiting this number to avoid\n /// infinite gas costs of some functions.\n uint256 public maxDocumentKeyStoreRequests;\n\n /// Pending store requests.\n mapping (bytes32 => DocumentKeyStoreRequest) private documentKeyStoreRequests;\n /// Pending store requests keys.\n bytes32[] private documentKeyStoreRequestsKeys;\n}\n", "sourcePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/service/SecretStoreDocumentKeyStoreService.sol", "ast": { "absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/service/SecretStoreDocumentKeyStoreService.sol", "exportedSymbols": { "SecretStoreDocumentKeyStoreService": [ 2078 ] }, "id": 2079, "nodeType": "SourceUnit", "nodes": [ { "id": 1687, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "698:24:5" }, { "absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/interfaces/SecretStoreService.sol", "file": "../interfaces/SecretStoreService.sol", "id": 1688, "nodeType": "ImportDirective", "scope": 2079, "sourceUnit": 872, "src": "724:46:5", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/service/SecretStoreServiceBase.sol", "file": "./SecretStoreServiceBase.sol", "id": 1689, "nodeType": "ImportDirective", "scope": 2079, "sourceUnit": 3513, "src": "771:38:5", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 1690, "name": "SecretStoreServiceBase", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3512, "src": "900:22:5", "typeDescriptions": { "typeIdentifier": "t_