secretstore-contracts
Version:
Secret Store permissioning and service contracts collection and toolkit.
901 lines (900 loc) • 272 kB
JSON
{
"contractName": "PermissioningRelay",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "permissioningContract",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "oldPermissioningContracts",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"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": "erc165Query",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_erc165Query",
"type": "address"
},
{
"name": "_permissioningContract",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "newPermissioningContract",
"type": "address"
}
],
"name": "NewPermissioningContract",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"constant": true,
"inputs": [
{
"name": "user",
"type": "address"
},
{
"name": "document",
"type": "bytes32"
}
],
"name": "checkPermissions",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_newContract",
"type": "address"
}
],
"name": "setPermissioningContract",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_newContract",
"type": "address"
}
],
"name": "setERC165Query",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50604051604080610d22833981016040819052815160209092015160008054600160a060020a03191633178082559192600160a060020a0392909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36100a47f01ffc9a7000000000000000000000000000000000000000000000000000000006401000000006102ff810204565b600160a060020a038216151561014157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4552432031363520517565727920636f6e74726163742061646472657373206360448201527f616e6e6f74206265203078302e00000000000000000000000000000000000000606482015290519081900360840190fd5b60048054600160a060020a031916600160a060020a03841617905561016e8164010000000061036e810204565b151561024d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152606260248201527f50726f766964656420636f6e747261637420646f6573206e6f7420696d706c6560448201527f6d656e74207468652027636865636b5065726d697373696f6e73272066756e6360648201527f74696f6e2c206f7220646f6573206e6f7420737570706f7274204552432d313660848201527f352e00000000000000000000000000000000000000000000000000000000000060a482015290519081900360c40190fd5b61027f7fb36a9a7c000000000000000000000000000000000000000000000000000000006401000000006102ff810204565b6102b17f813ae5ed000000000000000000000000000000000000000000000000000000006401000000006102ff810204565b60028054600160a060020a031916600160a060020a0383169081179091556040517f22e20df36014b0dba740cae4cec1ad9e418baa8a640398267ab275f9add267b790600090a25050610433565b7fffffffff00000000000000000000000000000000000000000000000000000000808216141561032e57600080fd5b7fffffffff00000000000000000000000000000000000000000000000000000000166000908152600160208190526040909120805460ff19169091179055565b60048054604080517fe9c54384000000000000000000000000000000000000000000000000000000008152600160a060020a03858116948201949094527fb36a9a7c00000000000000000000000000000000000000000000000000000000602482015290516000939092169163e9c543849160448082019260209290919082900301818787803b15801561040157600080fd5b505af1158015610415573d6000803e3d6000fd5b505050506040513d602081101561042b57600080fd5b505192915050565b6108e0806104426000396000f3006080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301ffc9a781146100b35780633b5d195a146100fe5780633e707e471461012f578063715018a61461015057806376bf6030146101675780638da5cb5b1461017f5780638f32d59b14610194578063b36a9a7c146101a9578063cc5f4320146101cd578063ea3d2d7b146101e2578063f2fde38b14610203575b600080fd5b3480156100bf57600080fd5b506100ea7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1960043516610224565b604080519115158252519081900360200190f35b34801561010a57600080fd5b50610113610258565b60408051600160a060020a039092168252519081900360200190f35b34801561013b57600080fd5b50610113600160a060020a0360043516610267565b34801561015c57600080fd5b50610165610334565b005b34801561017357600080fd5b5061011360043561039e565b34801561018b57600080fd5b506101136103c6565b3480156101a057600080fd5b506100ea6103d5565b3480156101b557600080fd5b506100ea600160a060020a03600435166024356103e6565b3480156101d957600080fd5b5061011361048b565b3480156101ee57600080fd5b50610113600160a060020a036004351661049a565b34801561020f57600080fd5b50610165600160a060020a0360043516610753565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660009081526001602052604090205460ff1690565b600254600160a060020a031681565b6000806102726103d5565b151561027d57600080fd5b600160a060020a0383161515610303576040805160e560020a62461bcd02815260206004820152602d60248201527f4552432031363520517565727920636f6e74726163742061646472657373206360448201527f616e6e6f74206265203078302e00000000000000000000000000000000000000606482015290519081900360840190fd5b50506004805473ffffffffffffffffffffffffffffffffffffffff198116600160a060020a03938416179091551690565b61033c6103d5565b151561034757600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60038054829081106103ac57fe5b600091825260209091200154600160a060020a0316905081565b600054600160a060020a031690565b600054600160a060020a0316331490565b600254604080517fb36a9a7c000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151600093929092169163b36a9a7c9160448082019260209290919082900301818787803b15801561045857600080fd5b505af115801561046c573d6000803e3d6000fd5b505050506040513d602081101561048257600080fd5b50519392505050565b600454600160a060020a031681565b60006104a46103d5565b15156104af57600080fd5b600254600160a060020a038381169116141561053b576040805160e560020a62461bcd02815260206004820152603e60248201527f4e6577207065726d697373696f6e696e6720636f6e747261637420616464726560448201527f7373206973207468652073616d6520617320746865206f6c64206f6e652e0000606482015290519081900360840190fd5b30600160a060020a03831614156105c2576040805160e560020a62461bcd02815260206004820152602e60248201527f4e6577207065726d697373696f6e696e6720636f6e74726163742063616e6e6f60448201527f742062652074686973206f6e652e000000000000000000000000000000000000606482015290519081900360840190fd5b6105cb82610772565b1515610693576040805160e560020a62461bcd02815260206004820152606260248201527f50726f766964656420636f6e747261637420646f6573206e6f7420696d706c6560448201527f6d656e74207468652027636865636b5065726d697373696f6e73272066756e6360648201527f74696f6e2c206f7220646f6573206e6f7420737570706f7274204552432d313660848201527f352e00000000000000000000000000000000000000000000000000000000000060a482015290519081900360c40190fd5b600280546003805460018101825560009182527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a039485161790915583549286169216821790925560405190917f22e20df36014b0dba740cae4cec1ad9e418baa8a640398267ab275f9add267b791a260038054600019810190811061073857fe5b600091825260209091200154600160a060020a031692915050565b61075b6103d5565b151561076657600080fd5b61076f81610837565b50565b60048054604080517fe9c54384000000000000000000000000000000000000000000000000000000008152600160a060020a03858116948201949094527fb36a9a7c00000000000000000000000000000000000000000000000000000000602482015290516000939092169163e9c543849160448082019260209290919082900301818787803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b505050506040513d602081101561082f57600080fd5b505192915050565b600160a060020a038116151561084c57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a723058209b619e4e3b04d35158ff0aaaec757a010d09cd1de105fd99a1484a420108e55a0029",
"deployedBytecode": "0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301ffc9a781146100b35780633b5d195a146100fe5780633e707e471461012f578063715018a61461015057806376bf6030146101675780638da5cb5b1461017f5780638f32d59b14610194578063b36a9a7c146101a9578063cc5f4320146101cd578063ea3d2d7b146101e2578063f2fde38b14610203575b600080fd5b3480156100bf57600080fd5b506100ea7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1960043516610224565b604080519115158252519081900360200190f35b34801561010a57600080fd5b50610113610258565b60408051600160a060020a039092168252519081900360200190f35b34801561013b57600080fd5b50610113600160a060020a0360043516610267565b34801561015c57600080fd5b50610165610334565b005b34801561017357600080fd5b5061011360043561039e565b34801561018b57600080fd5b506101136103c6565b3480156101a057600080fd5b506100ea6103d5565b3480156101b557600080fd5b506100ea600160a060020a03600435166024356103e6565b3480156101d957600080fd5b5061011361048b565b3480156101ee57600080fd5b50610113600160a060020a036004351661049a565b34801561020f57600080fd5b50610165600160a060020a0360043516610753565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660009081526001602052604090205460ff1690565b600254600160a060020a031681565b6000806102726103d5565b151561027d57600080fd5b600160a060020a0383161515610303576040805160e560020a62461bcd02815260206004820152602d60248201527f4552432031363520517565727920636f6e74726163742061646472657373206360448201527f616e6e6f74206265203078302e00000000000000000000000000000000000000606482015290519081900360840190fd5b50506004805473ffffffffffffffffffffffffffffffffffffffff198116600160a060020a03938416179091551690565b61033c6103d5565b151561034757600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60038054829081106103ac57fe5b600091825260209091200154600160a060020a0316905081565b600054600160a060020a031690565b600054600160a060020a0316331490565b600254604080517fb36a9a7c000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151600093929092169163b36a9a7c9160448082019260209290919082900301818787803b15801561045857600080fd5b505af115801561046c573d6000803e3d6000fd5b505050506040513d602081101561048257600080fd5b50519392505050565b600454600160a060020a031681565b60006104a46103d5565b15156104af57600080fd5b600254600160a060020a038381169116141561053b576040805160e560020a62461bcd02815260206004820152603e60248201527f4e6577207065726d697373696f6e696e6720636f6e747261637420616464726560448201527f7373206973207468652073616d6520617320746865206f6c64206f6e652e0000606482015290519081900360840190fd5b30600160a060020a03831614156105c2576040805160e560020a62461bcd02815260206004820152602e60248201527f4e6577207065726d697373696f6e696e6720636f6e74726163742063616e6e6f60448201527f742062652074686973206f6e652e000000000000000000000000000000000000606482015290519081900360840190fd5b6105cb82610772565b1515610693576040805160e560020a62461bcd02815260206004820152606260248201527f50726f766964656420636f6e747261637420646f6573206e6f7420696d706c6560448201527f6d656e74207468652027636865636b5065726d697373696f6e73272066756e6360648201527f74696f6e2c206f7220646f6573206e6f7420737570706f7274204552432d313660848201527f352e00000000000000000000000000000000000000000000000000000000000060a482015290519081900360c40190fd5b600280546003805460018101825560009182527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a039485161790915583549286169216821790925560405190917f22e20df36014b0dba740cae4cec1ad9e418baa8a640398267ab275f9add267b791a260038054600019810190811061073857fe5b600091825260209091200154600160a060020a031692915050565b61075b6103d5565b151561076657600080fd5b61076f81610837565b50565b60048054604080517fe9c54384000000000000000000000000000000000000000000000000000000008152600160a060020a03858116948201949094527fb36a9a7c00000000000000000000000000000000000000000000000000000000602482015290516000939092169163e9c543849160448082019260209290919082900301818787803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b505050506040513d602081101561082f57600080fd5b505192915050565b600160a060020a038116151561084c57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a723058209b619e4e3b04d35158ff0aaaec757a010d09cd1de105fd99a1484a420108e55a0029",
"sourceMap": "280:2696:3:-;;;587:876;8:9:-1;5:2;;;30:1;27;20:12;5:2;587:876:3;;;;;;;;;;;;;;;;;;;;;509:6:15;:19;;-1:-1:-1;;;;;;509:19:15;518:10;509:19;;;;587:876:3;;-1:-1:-1;;;;;572:6:15;;;;;539:40;;509:6;;539:40;612:39:12;631:19;612:18;;;;:39;:::i;:::-;-1:-1:-1;;;;;678:26:3;;;;670:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;773:11;:40;;-1:-1:-1;;;;;;773:40:3;-1:-1:-1;;;;;773:40:3;;;;;845:45;867:22;845:21;;;;:45;:::i;:::-;824:190;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1052:50;1071:30;1052:18;;;;:50;:::i;:::-;1112:189;1144:147;1112:18;;;;:189;:::i;:::-;1320:21;:73;;-1:-1:-1;;;;;;1320:73:3;-1:-1:-1;;;;;1320:73:3;;;;;;;;1408:48;;;;-1:-1:-1;;1408:48:3;587:876;;280:2696;;951:154:12;1028:25;;;;;;1020:34;;;;;;1060:33;;;;;;1096:4;1060:33;;;;;;;;:40;;-1:-1:-1;;1060:40:12;;;;;;951:154::o;2752:222:3:-;2848:11;;;:119;;;;;;-1:-1:-1;;;;;2848:119:3;;;;;;;;;;2927:30;2848:119;;;;;;2825:4;;2848:11;;;;:42;;:119;;;;;;;;;;;;;;;2825:4;2848:11;:119;;;5:2:-1;;;;30:1;27;20:12;5:2;2848:119:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2848:119:3;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2848:119:3;;2752:222;-1:-1:-1;;2752:222:3:o;280:2696::-;;;;;;;",
"deployedSourceMap": "280:2696:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;739:141:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;739:141:12;-1:-1:-1;;739:141:12;;;;;;;;;;;;;;;;;;;;;;;361:54:3;;8:9:-1;5:2;;;30:1;27;20:12;5:2;361:54:3;;;;;;;;-1:-1:-1;;;;;361:54:3;;;;;;;;;;;;;;2448:298;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2448:298:3;-1:-1:-1;;;;;2448:298:3;;;;;1273:127:15;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1273:127:15;;;;;;421:42:3;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;421:42:3;;;;;639:70:15;;8:9:-1;5:2;;;30:1;27;20:12;5:2;639:70:15;;;;926:83;;8:9:-1;5:2;;;30:1;27;20:12;5:2;926:83:15;;;;1469:163:3;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1469:163:3;-1:-1:-1;;;;;1469:163:3;;;;;;;470:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;470:31:3;;;;1638:804;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1638:804:3;-1:-1:-1;;;;;1638:804:3;;;;;1561:101:15;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1561:101:15;-1:-1:-1;;;;;1561:101:15;;;;;739:141:12;-1:-1:-1;;842:33:12;821:4;842:33;;;:20;:33;;;;;;;;;739:141::o;361:54:3:-;;;-1:-1:-1;;;;;361:54:3;;:::o;2448:298::-;2520:7;2633:12;824:9:15;:7;:9::i;:::-;816:18;;;;;;;;-1:-1:-1;;;;;2547:26:3;;;;2539:84;;;;;-1:-1:-1;;;;;2539:84:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;2656:11:3;;;-1:-1:-1;;2678:40:3;;-1:-1:-1;;;;;2678:40:3;;;;;;;2656:11;;2448:298::o;1273:127:15:-;824:9;:7;:9::i;:::-;816:18;;;;;;;;1367:1;1351:6;;1330:40;;-1:-1:-1;;;;;1351:6:15;;;;1330:40;;1367:1;;1330:40;1393:1;1376:19;;-1:-1:-1;;1376:19:15;;;1273:127::o;421:42:3:-;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;421:42:3;;-1:-1:-1;421:42:3;:::o;639:70:15:-;676:7;698:6;-1:-1:-1;;;;;698:6:15;639:70;:::o;926:83::-;965:4;998:6;-1:-1:-1;;;;;998:6:15;984:10;:20;;926:83::o;1469:163:3:-;1571:21;;:54;;;;;;-1:-1:-1;;;;;1571:54:3;;;;;;;;;;;;;;;1548:4;;1571:21;;;;;:38;;:54;;;;;;;;;;;;;;;1548:4;1571:21;:54;;;5:2:-1;;;;30:1;27;20:12;5:2;1571:54:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1571:54:3;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1571:54:3;;1469:163;-1:-1:-1;;;1469:163:3:o;470:31::-;;;-1:-1:-1;;;;;470:31:3;;:::o;1638:804::-;1720:7;824:9:15;:7;:9::i;:::-;816:18;;;;;;;;1755:21:3;;-1:-1:-1;;;;;1747:46:3;;;1755:21;;1747:46;;1739:121;;;;;-1:-1:-1;;;;;1739:121:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1886:4;-1:-1:-1;;;;;1878:29:3;;;;1870:88;;;;;-1:-1:-1;;;;;1870:88:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1989:35;2011:12;1989:21;:35::i;:::-;1968:180;;;;;;;-1:-1:-1;;;;;1968:180:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2198:21;;;2159:25;27:10:-1;;2198:21:3;23:18:-1;;45:23;;2198:21:3;2159:62;;;;;;;-1:-1:-1;;2159:62:3;;;-1:-1:-1;;;;;2198:21:3;;;2159:62;;;;2231:63;;;;;;;;;;;;2310:38;;2231:63;;2310:38;;;2374:25;2400:32;;-1:-1:-1;;2400:34:3;;;2374:61;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2374:61:3;;1638:804;-1:-1:-1;;1638:804:3:o;1561:101:15:-;824:9;:7;:9::i;:::-;816:18;;;;;;;;1629:28;1648:8;1629:18;:28::i;:::-;1561:101;:::o;2752:222:3:-;2848:11;;;:119;;;;;;-1:-1:-1;;;;;2848:119:3;;;;;;;;;;2927:30;2848:119;;;;;;2825:4;;2848:11;;;;:42;;:119;;;;;;;;;;;;;;;2825:4;2848:11;:119;;;5:2:-1;;;;30:1;27;20:12;5:2;2848:119:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2848:119:3;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2848:119:3;;2752:222;-1:-1:-1;;2752:222:3:o;1796:169:15:-;-1:-1:-1;;;;;1865:22:15;;;;1857:31;;;;;;1920:6;;;1899:38;;-1:-1:-1;;;;;1899:38:15;;;;1920:6;;;1899:38;;;1943:6;:17;;-1:-1:-1;;1943:17:15;-1:-1:-1;;;;;1943:17:15;;;;;;;;;;1796:169::o",
"source": "pragma solidity ^0.4.24;\n\nimport \"./ERC165Query.sol\";\nimport \"./interfaces/ISecretStorePermissioning.sol\";\nimport \"./interfaces/IERC165Query.sol\";\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport \"openzeppelin-solidity/contracts/introspection/ERC165.sol\";\n\n\ncontract PermissioningRelay is ISecretStorePermissioning, Ownable, ERC165 {\n\n ISecretStorePermissioning public permissioningContract;\n address[] public oldPermissioningContracts;\n\n IERC165Query public erc165Query;\n\n event NewPermissioningContract(address indexed newPermissioningContract);\n\n constructor(address _erc165Query, address _permissioningContract) public {\n require(_erc165Query != address(0), \"ERC 165 Query contract address cannot be 0x0.\");\n \n erc165Query = IERC165Query(_erc165Query);\n\n require(\n _isValidPermissioning(_permissioningContract),\n \"Provided contract does not implement the 'checkPermissions' function, or does not support ERC-165.\"\n );\n\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 permissioningContract = ISecretStorePermissioning(_permissioningContract);\n emit NewPermissioningContract(_permissioningContract);\n }\n\n function checkPermissions(address user, bytes32 document) public view returns (bool) {\n return permissioningContract.checkPermissions(user, document);\n }\n\n function setPermissioningContract(address _newContract) public onlyOwner returns (address) {\n require(address(permissioningContract) != _newContract, \"New permissioning contract address is the same as the old one.\");\n require(address(this) != _newContract, \"New permissioning contract cannot be this one.\");\n require(\n _isValidPermissioning(_newContract),\n \"Provided contract does not implement the 'checkPermissions' function, or does not support ERC-165.\"\n );\n\n oldPermissioningContracts.push(address(permissioningContract));\n permissioningContract = ISecretStorePermissioning(_newContract);\n\n emit NewPermissioningContract(_newContract);\n \n return oldPermissioningContracts[oldPermissioningContracts.length-1];\n }\n\n function setERC165Query(address _newContract) public onlyOwner returns (address) {\n require(_newContract != address(0), \"ERC 165 Query contract address cannot be 0x0.\");\n address _old = address(erc165Query);\n erc165Query = IERC165Query(_newContract);\n return _old;\n }\n\n function _isValidPermissioning(address _contract) internal view returns (bool) {\n return erc165Query.doesContractImplementInterface(\n _contract,\n this.checkPermissions.selector\n );\n }\n}\n",
"sourcePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/PermissioningRelay.sol",
"ast": {
"absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/PermissioningRelay.sol",
"exportedSymbols": {
"PermissioningRelay": [
700
]
},
"id": 701,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 488,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:3"
},
{
"absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/ERC165Query.sol",
"file": "./ERC165Query.sol",
"id": 489,
"nodeType": "ImportDirective",
"scope": 701,
"sourceUnit": 36,
"src": "26:27:3",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/interfaces/ISecretStorePermissioning.sol",
"file": "./interfaces/ISecretStorePermissioning.sol",
"id": 490,
"nodeType": "ImportDirective",
"scope": 701,
"sourceUnit": 725,
"src": "54:52:3",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/aznagy/work/secretstore/secretstore-contracts/contracts/interfaces/IERC165Query.sol",
"file": "./interfaces/IERC165Query.sol",
"id": 491,
"nodeType": "ImportDirective",
"scope": 701,
"sourceUnit": 713,
"src": "107:39:3",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"file": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"id": 492,
"nodeType": "ImportDirective",
"scope": 701,
"sourceUnit": 2605,
"src": "147:63:3",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "openzeppelin-solidity/contracts/introspection/ERC165.sol",
"file": "openzeppelin-solidity/contracts/introspection/ERC165.sol",
"id": 493,
"nodeType": "ImportDirective",
"scope": 701,
"sourceUnit": 2349,
"src": "211:66:3",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 494,
"name": "ISecretStorePermissioning",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 724,
"src": "311:25:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISecretStorePermissioning_$724",
"typeString": "contract ISecretStorePermissioning"
}
},
"id": 495,
"nodeType": "InheritanceSpecifier",
"src": "311:25:3"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 496,
"name": "Ownable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2604,
"src": "338:7:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Ownable_$2604",
"typeString": "contract Ownable"
}
},
"id": 497,
"nodeType": "InheritanceSpecifier",
"src": "338:7:3"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 498,
"name": "ERC165",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2348,
"src": "347:6:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC165_$2348",
"typeString": "contract ERC165"
}
},
"id": 499,
"nodeType": "InheritanceSpecifier",
"src": "347:6:3"
}
],
"contractDependencies": [
724,
2348,
2495,
2604
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 700,
"linearizedBaseContracts": [
700,
2348,
2495,
2604,
724
],
"name": "PermissioningRelay",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 501,
"name": "permissioningContract",
"nodeType": "VariableDeclaration",
"scope": 700,
"src": "361:54:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISecretStorePermissioning_$724",
"typeString": "contract ISecretStorePermissioning"
},
"typeName": {
"contractScope": null,
"id": 500,
"name": "ISecretStorePermissioning",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 724,
"src": "361:25:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ISecretStorePermissioning_$724",
"typeString": "contract ISecretStorePermissioning"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 504,
"name": "oldPermissioningContracts",
"nodeType": "VariableDeclaration",
"scope": 700,
"src": "421:42:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 502,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "421:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 503,
"length": null,
"nodeType": "ArrayTypeName",
"src": "421:9:3",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 506,
"name": "erc165Query",
"nodeType": "VariableDeclaration",
"scope": 700,
"src": "470:31:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC165Query_$712",
"typeString": "contract IERC165Query"
},
"typeName": {
"contractScope": null,
"id": 505,
"name": "IERC165Query",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 712,
"src": "470:12:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC165Query_$712",
"typeString": "contract IERC165Query"
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": null,
"id": 510,
"name": "NewPermissioningContract",
"nodeType": "EventDefinition",
"parameters": {
"id": 509,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 508,
"indexed": true,
"name": "newPermissioningContract",
"nodeType": "VariableDeclaration",
"scope": 510,
"src": "539:40:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 507,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "539:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "538:42:3"
},
"src": "508:73:3"
},
{
"body": {
"id": 573,
"nodeType": "Block",
"src": "660:803:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 522,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 518,
"name": "_erc165Query",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 512,
"src": "678:12:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 520,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "702:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 519,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "694:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 521,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "694:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "678:26:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4552432031363520517565727920636f6e747261637420616464726573732063616e6e6f74206265203078302e",
"id": 523,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "706:47:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_bb272a4aab39737b83423d6998a9e9f72cc41c2be260b79d96aef237c86388ef",
"typeString": "literal_string \"ERC 165 Query contract address cannot be 0x0.\""
},
"value": "ERC 165 Query contract address cannot be 0x0."
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_bb272a4aab39737b83423d6998a9e9f72cc41c2be260b79d96aef237c86388ef",
"typeString": "literal_string \"ERC 165 Query contract address cannot be 0x0.\""
}
],
"id": 517,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2622,
2623
],
"referencedDeclaration": 2623,
"src": "670:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 524,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "670:84:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 525,
"nodeType": "ExpressionStatement",
"src": "670:84:3"
},
{
"expression": {
"argumentTypes": null,
"id": 530,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 526,
"name": "erc165Query",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 506,
"src": "773:11:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC165Query_$712",
"typeString": "contract IERC165Query"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 528,
"name": "_erc165Query",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 512,
"src": "800:12:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 527,
"name": "IERC165Query",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 712,
"src": "787:12:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC165Query_$712_$",
"typeString": "type(contract IERC165Query)"
}
},
"id": 529,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "787:26:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC165Query_$712",
"typeString": "contract IERC165Query"
}
},
"src": "773:40:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC165Query_$712",
"typeString": "contract IERC165Query"
}
},
"id": 531,
"nodeType": "ExpressionStatement",
"src": "773:40:3"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 534,
"name": "_permissioningContract",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 514,
"src": "867:22:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 533,
"name": "_isValidPermissioning",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 699,
"src": "845:21:3",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$",
"typeString": "function (address) view returns (bool)"
}
},
"id": 535,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "845:45:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "50726f766964656420636f6e747261637420646f6573206e6f7420696d706c656d656e74207468652027636865636b5065726d697373696f6e73272066756e6374696f6e2c206f7220646f6573206e6f7420737570706f7274204552432d3136352e",
"id": 536,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "904:100:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e12f03bd870cf778aaafb2d27bae422ed46d1cfe8e663d49850a9386e52f11f6",
"typeString": "literal_string \"Provided contract does not implement the 'checkPermissions' function, or does not support ERC-165.\""
},
"value": "Provided contract does not implement the 'checkPermissions' function, or does not support ERC-165."
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e12f03bd870cf778aaafb2d27bae422ed46d1cfe8e663d49850a9386e52f11f6",
"typeString": "literal_string \"Provided contract does not implement the 'checkPermissions' function, or does not support ERC-165.\""
}
],
"id": 532,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2622,
2623
],
"referencedDeclaration": 2623,
"src": "824:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 537,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "824:190:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 538,
"nodeType": "ExpressionStatement",
"src": "824:190:3"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 540,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2650,
"src": "1071:4:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_PermissioningRelay_$700",
"typeString": "contract PermissioningRelay"
}
},
"id": 541,
"isConstant": false,
"isLValue": false,