{ "contractName": "XBRPaymentChannel", "abi": [ { "inputs": [ { "name": "marketId", "type": "bytes16" }, { "name": "sender", "type": "address" }, { "name": "delegate", "type": "address" }, { "name": "recipient", "type": "address" }, { "name": "amount", "type": "uint256" }, { "name": "channelTimeout", "type": "uint32" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "marketId", "type": "bytes16" }, { "indexed": false, "name": "signer", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" }, { "indexed": false, "name": "timeoutAt", "type": "uint256" } ], "name": "Closing", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "marketId", "type": "bytes16" }, { "indexed": false, "name": "signer", "type": "address" }, { "indexed": false, "name": "amount", "type": "uint256" }, { "indexed": false, "name": "closedAt", "type": "uint256" } ], "name": "Closed", "type": "event" }, { "constant": true, "inputs": [], "name": "marketId", "outputs": [ { "name": "", "type": "bytes16" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "sender", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "delegate", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "recipient", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "amount", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "openedAt", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "closedAt", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "channelTimeout", "outputs": [ { "name": "", "type": "uint32" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "h", "type": "bytes32" }, { "name": "v", "type": "uint8" }, { "name": "r", "type": "bytes32" }, { "name": "s", "type": "bytes32" }, { "name": "sequence", "type": "uint32" }, { "name": "value", "type": "uint256" } ], "name": "close", "outputs": [], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "timeout", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608060405234801561001057600080fd5b5060405160c080610640833981018060405260c081101561003057600080fd5b508051602082015160408301516060840151608085015160a09095015160008054610100608860020a0319166101007001000000000000000000000000000000009097049690960295909517855560018054600160a060020a0319908116600160a060020a03968716179091556002805482169486169490941790935560038054909316939091169290921790556004929092556007805463ffffffff191663ffffffff909316929092179091554360055561054e9081906100f290396000f3fe608060405234801561001057600080fd5b50600436106100bb576000357c01000000000000000000000000000000000000000000000000000000009004806370dea79a1161008357806370dea79a146101625780639d3718951461016c5780639ef27b00146101b0578063aa8c217c146101b8578063c89e4361146101c0576100bb565b80632ef2d55e146100c057806338930203146100e157806366d003ac146100fb57806367e404ce1461012c5780636ed71ede14610134575b600080fd5b6100c86101c8565b6040805163ffffffff9092168252519081900360200190f35b6100e96101d4565b60408051918252519081900360200190f35b6101036101da565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101036101f6565b61013c610212565b604080516fffffffffffffffffffffffffffffffff199092168252519081900360200190f35b61016a610230565b005b61016a600480360360c081101561018257600080fd5b5080359060ff6020820135169060408101359060608101359063ffffffff6080820135169060a001356102f4565b6100e96104b0565b6100e96104b6565b6101036104bc565b60075463ffffffff1690565b60055490565b60035473ffffffffffffffffffffffffffffffffffffffff1690565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60005461010090047001000000000000000000000000000000000290565b60065415610288576040805160e560020a62461bcd02815260206004820152601660248201527f4348414e4e454c5f414c52454144595f434c4f53454400000000000000000000604482015290519081900360640190fd5b6007546005544263ffffffff9092160111156102ee576040805160e560020a62461bcd02815260206004820152600f60248201527f6368616e6e656c2074696d656f75740000000000000000000000000000000000604482015290519081900360640190fd5b43600655565b60008060018888888860405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610354573d6000803e3d6000fd5b5050604051601f19015160015490935073ffffffffffffffffffffffffffffffffffffffff808516911614801591506103a8575060035473ffffffffffffffffffffffffffffffffffffffff838116911614155b156103fd576040805160e560020a62461bcd02815260206004820152601160248201527f696e76616c6964207369676e6174757265000000000000000000000000000000604482015290519081900360640190fd5b50604080516c0100000000000000000000000030026020808301919091527c010000000000000000000000000000000000000000000000000000000063ffffffff8716026034830152603880830186905283518084039091018152605890920190925280519101208781146104a65760405160e560020a62461bcd02815260040180806020018281038252604a8152602001806104d9604a913960600191505060405180910390fd5b5050505050505050565b60065490565b60045490565b60025473ffffffffffffffffffffffffffffffffffffffff169056fe696e76616c6964207369676e617475726520287369676e61747572652069732076616c69642062757420646f65736e2774206d617463682074686520646174612070726f766964656429a165627a7a7230582066279392851f52c4e99185bb0bd2d49787212a69da27e07155ba6a0d2ea6f1f30029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100bb576000357c01000000000000000000000000000000000000000000000000000000009004806370dea79a1161008357806370dea79a146101625780639d3718951461016c5780639ef27b00146101b0578063aa8c217c146101b8578063c89e4361146101c0576100bb565b80632ef2d55e146100c057806338930203146100e157806366d003ac146100fb57806367e404ce1461012c5780636ed71ede14610134575b600080fd5b6100c86101c8565b6040805163ffffffff9092168252519081900360200190f35b6100e96101d4565b60408051918252519081900360200190f35b6101036101da565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101036101f6565b61013c610212565b604080516fffffffffffffffffffffffffffffffff199092168252519081900360200190f35b61016a610230565b005b61016a600480360360c081101561018257600080fd5b5080359060ff6020820135169060408101359060608101359063ffffffff6080820135169060a001356102f4565b6100e96104b0565b6100e96104b6565b6101036104bc565b60075463ffffffff1690565b60055490565b60035473ffffffffffffffffffffffffffffffffffffffff1690565b60015473ffffffffffffffffffffffffffffffffffffffff1690565b60005461010090047001000000000000000000000000000000000290565b60065415610288576040805160e560020a62461bcd02815260206004820152601660248201527f4348414e4e454c5f414c52454144595f434c4f53454400000000000000000000604482015290519081900360640190fd5b6007546005544263ffffffff9092160111156102ee576040805160e560020a62461bcd02815260206004820152600f60248201527f6368616e6e656c2074696d656f75740000000000000000000000000000000000604482015290519081900360640190fd5b43600655565b60008060018888888860405160008152602001604052604051808581526020018460ff1660ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015610354573d6000803e3d6000fd5b5050604051601f19015160015490935073ffffffffffffffffffffffffffffffffffffffff808516911614801591506103a8575060035473ffffffffffffffffffffffffffffffffffffffff838116911614155b156103fd576040805160e560020a62461bcd02815260206004820152601160248201527f696e76616c6964207369676e6174757265000000000000000000000000000000604482015290519081900360640190fd5b50604080516c0100000000000000000000000030026020808301919091527c010000000000000000000000000000000000000000000000000000000063ffffffff8716026034830152603880830186905283518084039091018152605890920190925280519101208781146104a65760405160e560020a62461bcd02815260040180806020018281038252604a8152602001806104d9604a913960600191505060405180910390fd5b5050505050505050565b60065490565b60045490565b60025473ffffffffffffffffffffffffffffffffffffffff169056fe696e76616c6964207369676e617475726520287369676e61747572652069732076616c69642062757420646f65736e2774206d617463682074686520646174612070726f766964656429a165627a7a7230582066279392851f52c4e99185bb0bd2d49787212a69da27e07155ba6a0d2ea6f1f30029", "sourceMap": "1212:7760:4:-;;;4115:391;8:9:-1;5:2;;;30:1;27;20:12;5:2;4115:391:4;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;4115:391:4;;;;;;;;;;;;;;;;;;;;;;;4264:9;:20;;-1:-1:-1;;;;;;4264:20:4;;;;;;;;;;;;;;;;-1:-1:-1;4294:16:4;;-1:-1:-1;;;;;;4294:16:4;;;-1:-1:-1;;;;;4294:16:4;;;;;;;4320:9;:20;;;;;;;;;;;;;;4350:10;:22;;;;;;;;;;;;;;;4382:7;:16;;;;4408:15;:32;;-1:-1:-1;;4408:32:4;;;;;;;;;;;;4463:12;4451:9;:24;1212:7760;;;;;;;;", "deployedSourceMap": "1212:7760:4:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1212:7760:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6037:95;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5575:84;;;:::i;:::-;;;;;;;;;;;;;;;;5273:86;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4804:80;;;:::i;4593:84::-;;;:::i;:::-;;;;-1:-1:-1;;4593:84:4;;;;;;;;;;;;;;8231:399;;;:::i;:::-;;6741:1433;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;6741:1433:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;5759:84::-;;;:::i;5423:80::-;;;:::i;5061:84::-;;;:::i;6037:95::-;6110:15;;;;6037:95;:::o;5575:84::-;5643:9;;5575:84;:::o;5273:86::-;5342:10;;;;5273:86;:::o;4804:80::-;4870:7;;;;4804:80;:::o;4593:84::-;4635:7;4661:9;;;;;;;4593:84::o;8231:399::-;8276:9;;:14;8268:49;;;;;-1:-1:-1;8268:49:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;8415:15;;8403:9;;8433:3;8415:15;;;;8403:27;:33;8399:113;;;8476:25;;;-1:-1:-1;8476:25:4;;;;;;;;;;;;;;;;;;;;;;;;;;;8399:113;8533:12;8521:9;:24;8231:399::o;6741:1433::-;6854:14;6878:13;6948:21;6958:1;6961;6964;6967;6948:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;6948:21:4;;-1:-1:-1;;6948:21:4;;6994:7;;6948:21;;-1:-1:-1;6994:7:4;6984:17;;;6994:7;;6984:17;;;;-1:-1:-1;6984:41:4;;-1:-1:-1;7015:10:4;;;7005:20;;;7015:10;;7005:20;;6984:41;6980:99;;;7041:27;;;-1:-1:-1;7041:27:4;;;;;;;;;;;;;;;;;;;;;;;;;;;6980:99;-1:-1:-1;7107:39:4;;;;7124:4;7107:39;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;7107:39:4;;;;;;;7097:50;;;;;7162:10;;;7158:125;;7188:84;;-1:-1:-1;;;;;7188:84:4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7158:125;6741:1433;;;;;;;;:::o;5759:84::-;5827:9;;5759:84;:::o;5423:80::-;5489:7;;5423:80;:::o;5061:84::-;5129:9;;;;5061:84;:::o", "source": "///////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (C) 2018 Crossbar.io Technologies GmbH and contributors.\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//\n///////////////////////////////////////////////////////////////////////////////\n\npragma solidity ^0.5.2;\n\n// https://openzeppelin.org/api/docs/math_SafeMath.html\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\n\n// https://openzeppelin.org/api/docs/cryptography_ECDSA.html\nimport \"openzeppelin-solidity/contracts/cryptography/ECDSA.sol\";\n\n\n/**\n * XBR Payment Channel between a XBR data consumer and the XBR market maker,\n * or the XBR Market Maker and a XBR data provider.\n */\ncontract XBRPaymentChannel {\n\n // Add safe math functions to uint256 using SafeMath lib from OpenZeppelin\n using SafeMath for uint256;\n\n // Add recover method for bytes32 using ECDSA lib from OpenZeppelin\n using ECDSA for bytes32;\n\n /// Payment channel states.\n enum ChannelState { NONE, OPEN, CLOSING, CLOSED }\n\n /// Current payment channel state.\n ChannelState private state;\n\n /// The XBR Market ID this channel is operating payments for.\n bytes16 private _marketId;\n\n /// The sender of the payments in this channel. Either a XBR Consumer or XBR Market Maker (delegate).\n address private _sender;\n\n /**\n * The delegate working for the sender, and using this channel to pay for data keys.\n * E.g. a XBR Consumer (delegate) or XBR Provider (delegate).\n */\n address private _delegate;\n\n /// Recipient of the payments in this channel. Either a XBR Market Maker (delegate) or a XBR Provider.\n address private _recipient;\n\n /// Amount of XBR held in the channel.\n uint256 private _amount;\n\n /// Block number when the channel was created.\n uint256 private _openedAt;\n\n /// Block number when the channel was closed (finally, after the timeout).\n uint256 private _closedAt;\n\n /**\n * Timeout with which the channel will be closed (the grace period during which the\n * channel will wait for participants to submit their last signed transaction).\n */\n uint32 private _channelTimeout;\n\n /// Signatures of the channel participants (when channel is closing).\n mapping (bytes32 => address) private _signatures;\n\n /**\n * Event emitted when payment channel is closing (that is, one of the two state channel\n * participants has called \"close()\", initiating start of the channel timeout).\n */\n event Closing(bytes16 indexed marketId, address signer, uint256 amount, uint256 timeoutAt);\n\n /**\n * Event emitted when payment channel has finally closed, which happens after both state\n * channel participants have called close(), agreeing on last state, or after the timeout\n * at latest - in case the second participant doesn't react within timeout)\n */\n event Closed(bytes16 indexed marketId, address signer, uint256 amount, uint256 closedAt);\n\n /**\n * Create a new XBR payment channel for handling microtransactions of XBR tokens.\n *\n * @param marketId The ID of the XBR market this payment channel is associated with.\n * @param sender The sender (onchain) of the payments.\n * @param delegate The offchain delegate allowed to spend XBR offchain, from the channel,\n * in the name of the original sender.\n * @param recipient The receiver (onchain) of the payments.\n * @param amount The amount of XBR held in the channel.\n * @param channelTimeout The payment channel timeout period that begins with the first call to `close()`\n */\n constructor (bytes16 marketId, address sender, address delegate, address recipient, uint256 amount,\n uint32 channelTimeout) public {\n\n _marketId = marketId;\n _sender = sender;\n _delegate = delegate;\n _recipient = recipient;\n _amount = amount;\n _channelTimeout = channelTimeout;\n\n _openedAt = block.number; // solhint-disable-line\n }\n\n /**\n * The XBR Market ID this channel is operating payments for.\n */\n function marketId () public view returns (bytes16) {\n return _marketId;\n }\n\n /**\n * The sender of the payments in this channel. Either a XBR Consumer or XBR Market Maker (delegate).\n */\n function sender () public view returns (address) {\n return _sender;\n }\n\n /**\n * The delegate working for the sender, and using this channel to pay for data keys. E.g. a\n * XBR Consumer (delegate) or XBR Provider (delegate).\n */\n function delegate () public view returns (address) {\n return _delegate;\n }\n\n /**\n * Recipient of the payments in this channel. Either a XBR Market Maker (delegate) or a XBR Provider.\n */\n function recipient () public view returns (address) {\n return _recipient;\n }\n\n /**\n * Amount of XBR held in the channel.\n */\n function amount () public view returns (uint256) {\n return _amount;\n }\n\n /**\n * Block number when the channel was created.\n */\n function openedAt () public view returns (uint256) {\n return _openedAt;\n }\n\n /**\n * Block number when the channel was closed (finally, after the timeout).\n */\n function closedAt () public view returns (uint256) {\n return _closedAt;\n }\n\n /**\n * Timeout with which the channel will be closed (the grace period during which the\n * channel will wait for participants to submit their last signed transaction).\n */\n function channelTimeout () public view returns (uint32) {\n return _channelTimeout;\n }\n\n /**\n * Trigger closing this payment channel. When the first participant has called `close()`\n * submitting its latest transaction/state, a timeout period begins during which the\n * other party of the payment channel has to submit its latest transaction/state too.\n * When both transaction have been submitted, and the submitted transactions/states agree,\n * the channel immediately closes, and the consumed amount of token in the channel is\n * transferred to the channel recipient, and the remaining amount of token is transferred\n * back to the original sender.\n */\n function close (bytes32 h, uint8 v, bytes32 r, bytes32 s, uint32 sequence, uint256 value) public view {\n\n address signer;\n bytes32 proof;\n\n // get signer from signature\n signer = ecrecover(h, v, r, s);\n\n if (signer != _sender && signer != _recipient) {\n revert(\"invalid signature\");\n }\n\n proof = keccak256(abi.encodePacked(this, sequence, value));\n\n if (proof != h) {\n revert(\"invalid signature (signature is valid but doesn't match the data provided)\");\n }\n/* FIXME\n if (_signatures[proof] == 0) {\n _signatures[proof] = signer;\n\n // event Closing(bytes16 indexed marketId, address signer, uint256 amount, uint256 timeoutAt);\n emit Closing(_marketId, signer, value, block.number + _channelTimeout);\n\n } else if (_signatures[proof] != signer) {\n // channel completed, both _signatures provided\n _closedAt = block.number;\n if (!_recipient.send(value)) { // solhint-disable-line\n revert(\"transaction failed on the very last meter\");\n }\n\n // refund back anything left to the original opener of the payment channel\n selfdestruct(_sender);\n\n // event Closed(bytes16 indexed marketId, address signer, uint256 amount, uint256 closedAt);\n emit Closed(_marketId, signer, value, _closedAt);\n }\n*/\n }\n\n /**\n * Timeout this state channel.\n */\n function timeout () public {\n require(_closedAt == 0, \"CHANNEL_ALREADY_CLOSED\");\n // require(_signatures[proof] != 0, \"CHANNEL_NOT_YET_SIGNED\");\n\n if (_openedAt + _channelTimeout > now) { // solhint-disable-line\n revert(\"channel timeout\");\n }\n _closedAt = block.number;\n\n // FIXME\n // selfdestruct(_sender);\n // emit Closed();\n }\n\n function _verify (bytes32 hash, uint8 v, bytes16 r, bytes32 s, address expectedSigner) internal pure returns (bool)\n {\n bytes memory prefix = \"\\x19Ethereum Signed Message:\\n32\";\n bytes32 prefixedHash = keccak256(abi.encodePacked(prefix, hash));\n return ecrecover(prefixedHash, v, r, s) == expectedSigner;\n }\n}\n", "sourcePath": "/home/oberstet/scm/xbr/xbr-protocol/contracts/XBRPaymentChannel.sol", "ast": { "absolutePath": "/home/oberstet/scm/xbr/xbr-protocol/contracts/XBRPaymentChannel.sol", "exportedSymbols": { "XBRPaymentChannel": [ 2428 ] }, "id": 2429, "nodeType": "SourceUnit", "nodes": [ { "id": 2133, "literals": [ "solidity", "^", "0.5", ".2" ], "nodeType": "PragmaDirective", "src": "805:23:4" }, { "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", "id": 2134, "nodeType": "ImportDirective", "scope": 2429, "sourceUnit": 2765, "src": "886:59:4", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "openzeppelin-solidity/contracts/cryptography/ECDSA.sol", "file": "openzeppelin-solidity/contracts/cryptography/ECDSA.sol", "id": 2135, "nodeType": "ImportDirective", "scope": 2429, "sourceUnit": 2637, "src": "1008:64:4", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "XBR Payment Channel between a XBR data consumer and the XBR market maker,\nor the XBR Market Maker and a XBR data provider.", "fullyImplemented": true, "id": 2428, "linearizedBaseContracts": [ 2428 ], "name": "XBRPaymentChannel", "nodeType": "ContractDefinition", "nodes": [ { "id": 2138, "libraryName": { "contractScope": null, "id": 2136, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2764, "src": "1331:8:4", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$2764", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "1325:27:4", "typeName": { "id": 2137, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1344:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "id": 2141, "libraryName": { "contractScope": null, "id": 2139, "name": "ECDSA", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2636, "src": "1436:5:4", "typeDescriptions": { "typeIdentifier": "t_contract$_ECDSA_$2636", "typeString": "library ECDSA" } }, "nodeType": "UsingForDirective", "src": "1430:24:4", "typeName": { "id": 2140, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1446:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } }, { "canonicalName": "XBRPaymentChannel.ChannelState", "id": 2146, "members": [ { "id": 2142, "name": "NONE", "nodeType": "EnumValue", "src": "1512:4:4" }, { "id": 2143, "name": "OPEN", "nodeType": "EnumValue", "src": "1518:4:4" }, { "id": 2144, "name": "CLOSING", "nodeType": "EnumValue", "src": "1524:7:4" }, { "id": 2145, "name": "CLOSED", "nodeType": "EnumValue", "src": "1533:6:4" } ], "name": "ChannelState", "nodeType": "EnumDefinition", "src": "1492:49:4" }, { "constant": false, "id": 2148, "name": "state", "nodeType": "VariableDeclaration", "scope": 2428, "src": "1586:26:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_ChannelState_$2146", "typeString": "enum XBRPaymentChannel.ChannelState" }, "typeName": { "contractScope": null, "id": 2147, "name": "ChannelState", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2146, "src": "1586:12:4", "typeDescriptions": { "typeIdentifier": "t_enum$_ChannelState_$2146", "typeString": "enum XBRPaymentChannel.ChannelState" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2150, "name": "_marketId", "nodeType": "VariableDeclaration", "scope": 2428, "src": "1685:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2149, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "1685:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2152, "name": "_sender", "nodeType": "VariableDeclaration", "scope": 2428, "src": "1823:23:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2151, "name": "address", "nodeType": "ElementaryTypeName", "src": "1823:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2154, "name": "_delegate", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2024:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2153, "name": "address", "nodeType": "ElementaryTypeName", "src": "2024:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2156, "name": "_recipient", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2163:26:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2155, "name": "address", "nodeType": "ElementaryTypeName", "src": "2163:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2158, "name": "_amount", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2239:23:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2157, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2239:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2160, "name": "_openedAt", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2320:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2159, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2320:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2162, "name": "_closedAt", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2431:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2161, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2431:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2164, "name": "_channelTimeout", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2651:30:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2163, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "2651:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2168, "name": "_signatures", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2762:48:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_address_$", "typeString": "mapping(bytes32 => address)" }, "typeName": { "id": 2167, "keyType": { "id": 2165, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2771:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "2762:28:4", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_address_$", "typeString": "mapping(bytes32 => address)" }, "valueType": { "id": 2166, "name": "address", "nodeType": "ElementaryTypeName", "src": "2782:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } }, "value": null, "visibility": "private" }, { "anonymous": false, "documentation": "Event emitted when payment channel is closing (that is, one of the two state channel\nparticipants has called \"close()\", initiating start of the channel timeout).", "id": 2178, "name": "Closing", "nodeType": "EventDefinition", "parameters": { "id": 2177, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2170, "indexed": true, "name": "marketId", "nodeType": "VariableDeclaration", "scope": 2178, "src": "3023:24:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2169, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "3023:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2172, "indexed": false, "name": "signer", "nodeType": "VariableDeclaration", "scope": 2178, "src": "3049:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2171, "name": "address", "nodeType": "ElementaryTypeName", "src": "3049:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2174, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", "scope": 2178, "src": "3065:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2173, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3065:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2176, "indexed": false, "name": "timeoutAt", "nodeType": "VariableDeclaration", "scope": 2178, "src": "3081:17:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2175, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3081:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3022:77:4" }, "src": "3009:91:4" }, { "anonymous": false, "documentation": "Event emitted when payment channel has finally closed, which happens after both state\nchannel participants have called close(), agreeing on last state, or after the timeout\nat latest - in case the second participant doesn't react within timeout)", "id": 2188, "name": "Closed", "nodeType": "EventDefinition", "parameters": { "id": 2187, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2180, "indexed": true, "name": "marketId", "nodeType": "VariableDeclaration", "scope": 2188, "src": "3402:24:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2179, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "3402:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2182, "indexed": false, "name": "signer", "nodeType": "VariableDeclaration", "scope": 2188, "src": "3428:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2181, "name": "address", "nodeType": "ElementaryTypeName", "src": "3428:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2184, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", "scope": 2188, "src": "3444:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2183, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3444:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2186, "indexed": false, "name": "closedAt", "nodeType": "VariableDeclaration", "scope": 2188, "src": "3460:16:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2185, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3460:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3401:76:4" }, "src": "3389:89:4" }, { "body": { "id": 2232, "nodeType": "Block", "src": "4253:253:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2205, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2203, "name": "_marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2150, "src": "4264:9:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2204, "name": "marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2190, "src": "4276:8:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "src": "4264:20:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "id": 2206, "nodeType": "ExpressionStatement", "src": "4264:20:4" }, { "expression": { "argumentTypes": null, "id": 2209, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2207, "name": "_sender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2152, "src": "4294:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2208, "name": "sender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2192, "src": "4304:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "4294:16:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2210, "nodeType": "ExpressionStatement", "src": "4294:16:4" }, { "expression": { "argumentTypes": null, "id": 2213, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2211, "name": "_delegate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2154, "src": "4320:9:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2212, "name": "delegate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2194, "src": "4332:8:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "4320:20:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2214, "nodeType": "ExpressionStatement", "src": "4320:20:4" }, { "expression": { "argumentTypes": null, "id": 2217, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2215, "name": "_recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2156, "src": "4350:10:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2216, "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2196, "src": "4363:9:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "4350:22:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2218, "nodeType": "ExpressionStatement", "src": "4350:22:4" }, { "expression": { "argumentTypes": null, "id": 2221, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2219, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2158, "src": "4382:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2220, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2198, "src": "4392:6:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "4382:16:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2222, "nodeType": "ExpressionStatement", "src": "4382:16:4" }, { "expression": { "argumentTypes": null, "id": 2225, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2223, "name": "_channelTimeout", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2164, "src": "4408:15:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2224, "name": "channelTimeout", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2200, "src": "4426:14:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "4408:32:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "id": 2226, "nodeType": "ExpressionStatement", "src": "4408:32:4" }, { "expression": { "argumentTypes": null, "id": 2230, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2227, "name": "_openedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2160, "src": "4451:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2228, "name": "block", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3279, "src": "4463:5:4", "typeDescriptions": { "typeIdentifier": "t_magic_block", "typeString": "block" } }, "id": 2229, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "number", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "4463:12:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "4451:24:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2231, "nodeType": "ExpressionStatement", "src": "4451:24:4" } ] }, "documentation": "Create a new XBR payment channel for handling microtransactions of XBR tokens.\n * @param marketId The ID of the XBR market this payment channel is associated with.\n@param sender The sender (onchain) of the payments.\n@param delegate The offchain delegate allowed to spend XBR offchain, from the channel,\n in the name of the original sender.\n@param recipient The receiver (onchain) of the payments.\n@param amount The amount of XBR held in the channel.\n@param channelTimeout The payment channel timeout period that begins with the first call to `close()`", "id": 2233, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 2201, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2190, "name": "marketId", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4128:16:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2189, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "4128:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2192, "name": "sender", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4146:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2191, "name": "address", "nodeType": "ElementaryTypeName", "src": "4146:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2194, "name": "delegate", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4162:16:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2193, "name": "address", "nodeType": "ElementaryTypeName", "src": "4162:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2196, "name": "recipient", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4180:17:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2195, "name": "address", "nodeType": "ElementaryTypeName", "src": "4180:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2198, "name": "amount", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4199:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2197, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4199:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2200, "name": "channelTimeout", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4223:21:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2199, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "4223:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "4127:118:4" }, "returnParameters": { "id": 2202, "nodeType": "ParameterList", "parameters": [], "src": "4253:0:4" }, "scope": 2428, "src": "4115:391:4", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2240, "nodeType": "Block", "src": "4644:33:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2238, "name": "_marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2150, "src": "4661:9:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "functionReturnParameters": 2237, "id": 2239, "nodeType": "Return", "src": "4654:16:4" } ] }, "documentation": "The XBR Market ID this channel is operating payments for.", "id": 2241, "implemented": true, "kind": "function", "modifiers": [], "name": "marketId", "nodeType": "FunctionDefinition", "parameters": { "id": 2234, "nodeType": "ParameterList", "parameters": [], "src": "4611:2:4" }, "returnParameters": { "id": 2237, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2236, "name": "", "nodeType": "VariableDeclaration", "scope": 2241, "src": "4635:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2235, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "4635:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" } ], "src": "4634:9:4" }, "scope": 2428, "src": "4593:84:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2248, "nodeType": "Block", "src": "4853:31:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2246, "name": "_sender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2152, "src": "4870:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 2245, "id": 2247, "nodeType": "Return", "src": "4863:14:4" } ] }, "documentation": "The sender of the payments in this channel. Either a XBR Consumer or XBR Market Maker (delegate).", "id": 2249, "implemented": true, "kind": "function", "modifiers": [], "name": "sender", "nodeType": "FunctionDefinition", "parameters": { "id": 2242, "nodeType": "ParameterList", "parameters": [], "src": "4820:2:4" }, "returnParameters": { "id": 2245, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2244, "name": "", "nodeType": "VariableDeclaration", "scope": 2249, "src": "4844:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2243, "name": "address", "nodeType": "ElementaryTypeName", "src": "4844:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "4843:9:4" }, "scope": 2428, "src": "4804:80:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2256, "nodeType": "Block", "src": "5112:33:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2254, "name": "_delegate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2154, "src": "5129:9:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 2253, "id": 2255, "nodeType": "Return", "src": "5122:16:4" } ] }, "documentation": "The delegate working for the sender, and using this channel to pay for data keys. E.g. a\nXBR Consumer (delegate) or XBR Provider (delegate).", "id": 2257, "implemented": true, "kind": "function", "modifiers": [], "name": "delegate", "nodeType": "FunctionDefinition", "parameters": { "id": 2250, "nodeType": "ParameterList", "parameters": [], "src": "5079:2:4" }, "returnParameters": { "id": 2253, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2252, "name": "", "nodeType": "VariableDeclaration", "scope": 2257, "src": "5103:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2251, "name": "address", "nodeType": "ElementaryTypeName", "src": "5103:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "5102:9:4" }, "scope": 2428, "src": "5061:84:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2264, "nodeType": "Block", "src": "5325:34:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2262, "name": "_recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2156, "src": "5342:10:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 2261, "id": 2263, "nodeType": "Return", "src": "5335:17:4" } ] }, "documentation": "Recipient of the payments in this channel. Either a XBR Market Maker (delegate) or a XBR Provider.", "id": 2265, "implemented": true, "kind": "function", "modifiers": [], "name": "recipient", "nodeType": "FunctionDefinition", "parameters": { "id": 2258, "nodeType": "ParameterList", "parameters": [], "src": "5292:2:4" }, "returnParameters": { "id": 2261, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2260, "name": "", "nodeType": "VariableDeclaration", "scope": 2265, "src": "5316:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2259, "name": "address", "nodeType": "ElementaryTypeName", "src": "5316:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "5315:9:4" }, "scope": 2428, "src": "5273:86:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2272, "nodeType": "Block", "src": "5472:31:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2270, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2158, "src": "5489:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2269, "id": 2271, "nodeType": "Return", "src": "5482:14:4" } ] }, "documentation": "Amount of XBR held in the channel.", "id": 2273, "implemented": true, "kind": "function", "modifiers": [], "name": "amount", "nodeType": "FunctionDefinition", "parameters": { "id": 2266, "nodeType": "ParameterList", "parameters": [], "src": "5439:2:4" }, "returnParameters": { "id": 2269, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2268, "name": "", "nodeType": "VariableDeclaration", "scope": 2273, "src": "5463:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2267, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5463:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5462:9:4" }, "scope": 2428, "src": "5423:80:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2280, "nodeType": "Block", "src": "5626:33:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2278, "name": "_openedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2160, "src": "5643:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2277, "id": 2279, "nodeType": "Return", "src": "5636:16:4" } ] }, "documentation": "Block number when the channel was created.", "id": 2281, "implemented": true, "kind": "function", "modifiers": [], "name": "openedAt", "nodeType": "FunctionDefinition", "parameters": { "id": 2274, "nodeType": "ParameterList", "parameters": [], "src": "5593:2:4" }, "returnParameters": { "id": 2277, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2276, "name": "", "nodeType": "VariableDeclaration", "scope": 2281, "src": "5617:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2275, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5617:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5616:9:4" }, "scope": 2428, "src": "5575:84:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2288, "nodeType": "Block", "src": "5810:33:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2286, "name": "_closedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2162, "src": "5827:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2285, "id": 2287, "nodeType": "Return", "src": "5820:16:4" } ] }, "documentation": "Block number when the channel was closed (finally, after the timeout).", "id": 2289, "implemented": true, "kind": "function", "modifiers": [], "name": "closedAt", "nodeType": "FunctionDefinition", "parameters": { "id": 2282, "nodeType": "ParameterList", "parameters": [], "src": "5777:2:4" }, "returnParameters": { "id": 2285, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2284, "name": "", "nodeType": "VariableDeclaration", "scope": 2289, "src": "5801:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2283, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5801:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5800:9:4" }, "scope": 2428, "src": "5759:84:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2296, "nodeType": "Block", "src": "6093:39:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2294, "name": "_channelTimeout", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2164, "src": "6110:15:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "functionReturnParameters": 2293, "id": 2295, "nodeType": "Return", "src": "6103:22:4" } ] }, "documentation": "Timeout with which the channel will be closed (the grace period during which the\nchannel will wait for participants to submit their last signed transaction).", "id": 2297, "implemented": true, "kind": "function", "modifiers": [], "name": "channelTimeout", "nodeType": "FunctionDefinition", "parameters": { "id": 2290, "nodeType": "ParameterList", "parameters": [], "src": "6061:2:4" }, "returnParameters": { "id": 2293, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2292, "name": "", "nodeType": "VariableDeclaration", "scope": 2297, "src": "6085:6:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2291, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "6085:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "6084:8:4" }, "scope": 2428, "src": "6037:95:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2360, "nodeType": "Block", "src": "6843:1331:4", "statements": [ { "assignments": [ 2313 ], "declarations": [ { "constant": false, "id": 2313, "name": "signer", "nodeType": "VariableDeclaration", "scope": 2360, "src": "6854:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2312, "name": "address", "nodeType": "ElementaryTypeName", "src": "6854:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "id": 2314, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "6854:14:4" }, { "assignments": [ 2316 ], "declarations": [ { "constant": false, "id": 2316, "name": "proof", "nodeType": "VariableDeclaration", "scope": 2360, "src": "6878:13:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2315, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "6878:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 2317, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "6878:13:4" }, { "expression": { "argumentTypes": null, "id": 2325, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2318, "name": "signer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2313, "src": "6939:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2320, "name": "h", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2299, "src": "6958:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2321, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2301, "src": "6961:1:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 2322, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2303, "src": "6964:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2323, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2305, "src": "6967:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_uint8", "typeString": "uint8" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 2319, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3281, "src": "6948:9:4", "typeDescriptions": { "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" } }, "id": 2324, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "6948:21:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "6939:30:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2326, "nodeType": "ExpressionStatement", "src": "6939:30:4" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2333, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2329, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2327, "name": "signer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2313, "src": "6984:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "id": 2328, "name": "_sender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2152, "src": "6994:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "6984:17:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2332, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2330, "name": "signer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2313, "src": "7005:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "id": 2331, "name": "_recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2156, "src": "7015:10:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "7005:20:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "6984:41:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2339, "nodeType": "IfStatement", "src": "6980:99:4", "trueBody": { "id": 2338, "nodeType": "Block", "src": "7027:52:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "696e76616c6964207369676e6174757265", "id": 2335, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "7048:19:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_12a179e1a73f41ef8e1ba2f259a99bc53b6ace3abb110ac2ea058e42c6104e1a", "typeString": "literal_string \"invalid signature\"" }, "value": "invalid signature" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_12a179e1a73f41ef8e1ba2f259a99bc53b6ace3abb110ac2ea058e42c6104e1a", "typeString": "literal_string \"invalid signature\"" } ], "id": 2334, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 3294, 3295 ], "referencedDeclaration": 3295, "src": "7041:6:4", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 2336, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "7041:27:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2337, "nodeType": "ExpressionStatement", "src": "7041:27:4" } ] } }, { "expression": { "argumentTypes": null, "id": 2349, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2340, "name": "proof", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2316, "src": "7089:5:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2344, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3320, "src": "7124:4:4", "typeDescriptions": { "typeIdentifier": "t_contract$_XBRPaymentChannel_$2428", "typeString": "contract XBRPaymentChannel" } }, { "argumentTypes": null, "id": 2345, "name": "sequence", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2307, "src": "7130:8:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, { "argumentTypes": null, "id": 2346, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2309, "src": "7140:5:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_XBRPaymentChannel_$2428", "typeString": "contract XBRPaymentChannel" }, { "typeIdentifier": "t_uint32", "typeString": "uint32" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 2342, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3276, "src": "7107:3:4", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 2343, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "7107:16:4", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 2347, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "7107:39:4", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 2341, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3283, "src": "7097:9:4", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 2348, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "7097:50:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "7089:58:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 2350, "nodeType": "ExpressionStatement", "src": "7089:58:4" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "id": 2353, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2351, "name": "proof", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2316, "src": "7162:5:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "id": 2352, "name": "h", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2299, "src": "7171:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "7162:10:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2359, "nodeType": "IfStatement", "src": "7158:125:4", "trueBody": { "id": 2358, "nodeType": "Block", "src": "7174:109:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "696e76616c6964207369676e617475726520287369676e61747572652069732076616c69642062757420646f65736e2774206d617463682074686520646174612070726f766964656429", "id": 2355, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "7195:76:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_fd40a083a52679a812a75b1459ad45c6fcd5cef1c1ed0bb4c521bef01bb64bf7", "typeString": "literal_string \"invalid signature (signature is valid but doesn't match the data provided)\"" }, "value": "invalid signature (signature is valid but doesn't match the data provided)" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_fd40a083a52679a812a75b1459ad45c6fcd5cef1c1ed0bb4c521bef01bb64bf7", "typeString": "literal_string \"invalid signature (signature is valid but doesn't match the data provided)\"" } ], "id": 2354, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 3294, 3295 ], "referencedDeclaration": 3295, "src": "7188:6:4", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 2356, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "7188:84:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2357, "nodeType": "ExpressionStatement", "src": "7188:84:4" } ] } } ] }, "documentation": "Trigger closing this payment channel. When the first participant has called `close()`\nsubmitting its latest transaction/state, a timeout period begins during which the\nother party of the payment channel has to submit its latest transaction/state too.\nWhen both transaction have been submitted, and the submitted transactions/states agree,\nthe channel immediately closes, and the consumed amount of token in the channel is\ntransferred to the channel recipient, and the remaining amount of token is transferred\nback to the original sender.", "id": 2361, "implemented": true, "kind": "function", "modifiers": [], "name": "close", "nodeType": "FunctionDefinition", "parameters": { "id": 2310, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2299, "name": "h", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6757:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2298, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "6757:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2301, "name": "v", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6768:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2300, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "6768:5:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2303, "name": "r", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6777:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2302, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "6777:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2305, "name": "s", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6788:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2304, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "6788:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2307, "name": "sequence", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6799:15:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2306, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "6799:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2309, "name": "value", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6816:13:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2308, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6816:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "6756:74:4" }, "returnParameters": { "id": 2311, "nodeType": "ParameterList", "parameters": [], "src": "6843:0:4" }, "scope": 2428, "src": "6741:1433:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2387, "nodeType": "Block", "src": "8258:372:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2367, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2365, "name": "_closedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2162, "src": "8276:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2366, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8289:1:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "8276:14:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4348414e4e454c5f414c52454144595f434c4f534544", "id": 2368, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "8292:24:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_36e5e5742b34eb733b4e50ae24c76a25f04795f8d35aaaabda027d6b8962210e", "typeString": "literal_string \"CHANNEL_ALREADY_CLOSED\"" }, "value": "CHANNEL_ALREADY_CLOSED" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_36e5e5742b34eb733b4e50ae24c76a25f04795f8d35aaaabda027d6b8962210e", "typeString": "literal_string \"CHANNEL_ALREADY_CLOSED\"" } ], "id": 2364, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3293, "src": "8268:7:4", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2369, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8268:49:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2370, "nodeType": "ExpressionStatement", "src": "8268:49:4" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2375, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2373, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2371, "name": "_openedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2160, "src": "8403:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 2372, "name": "_channelTimeout", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2164, "src": "8415:15:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "8403:27:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "id": 2374, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3291, "src": "8433:3:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8403:33:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2381, "nodeType": "IfStatement", "src": "8399:113:4", "trueBody": { "id": 2380, "nodeType": "Block", "src": "8438:74:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "6368616e6e656c2074696d656f7574", "id": 2377, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "8483:17:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_c5af2bc3eb66a6cb7e1d835492106e09ac9b1b98fac06423519d74a73f7a196b", "typeString": "literal_string \"channel timeout\"" }, "value": "channel timeout" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_c5af2bc3eb66a6cb7e1d835492106e09ac9b1b98fac06423519d74a73f7a196b", "typeString": "literal_string \"channel timeout\"" } ], "id": 2376, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 3294, 3295 ], "referencedDeclaration": 3295, "src": "8476:6:4", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 2378, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8476:25:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2379, "nodeType": "ExpressionStatement", "src": "8476:25:4" } ] } }, { "expression": { "argumentTypes": null, "id": 2385, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2382, "name": "_closedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2162, "src": "8521:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2383, "name": "block", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3279, "src": "8533:5:4", "typeDescriptions": { "typeIdentifier": "t_magic_block", "typeString": "block" } }, "id": 2384, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "number", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "8533:12:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8521:24:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2386, "nodeType": "ExpressionStatement", "src": "8521:24:4" } ] }, "documentation": "Timeout this state channel.", "id": 2388, "implemented": true, "kind": "function", "modifiers": [], "name": "timeout", "nodeType": "FunctionDefinition", "parameters": { "id": 2362, "nodeType": "ParameterList", "parameters": [], "src": "8248:2:4" }, "returnParameters": { "id": 2363, "nodeType": "ParameterList", "parameters": [], "src": "8258:0:4" }, "scope": 2428, "src": "8231:399:4", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2426, "nodeType": "Block", "src": "8756:214:4", "statements": [ { "assignments": [ 2404 ], "declarations": [ { "constant": false, "id": 2404, "name": "prefix", "nodeType": "VariableDeclaration", "scope": 2426, "src": "8766:19:4", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 2403, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "8766:5:4", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "id": 2406, "initialValue": { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", "id": 2405, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "8788:34:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, "value": "\u0019Ethereum Signed Message:\n32" }, "nodeType": "VariableDeclarationStatement", "src": "8766:56:4" }, { "assignments": [ 2408 ], "declarations": [ { "constant": false, "id": 2408, "name": "prefixedHash", "nodeType": "VariableDeclaration", "scope": 2426, "src": "8832:20:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2407, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "8832:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 2416, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2412, "name": "prefix", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2404, "src": "8882:6:4", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, { "argumentTypes": null, "id": 2413, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2390, "src": "8890:4:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "argumentTypes": null, "id": 2410, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3276, "src": "8865:3:4", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 2411, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "8865:16:4", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 2414, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8865:30:4", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 2409, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3283, "src": "8855:9:4", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 2415, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8855:41:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "VariableDeclarationStatement", "src": "8832:64:4" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2424, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2418, "name": "prefixedHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "8923:12:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2419, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2392, "src": "8937:1:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 2420, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2394, "src": "8940:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, { "argumentTypes": null, "id": 2421, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2396, "src": "8943:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_uint8", "typeString": "uint8" }, { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 2417, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3281, "src": "8913:9:4", "typeDescriptions": { "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" } }, "id": 2422, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8913:32:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2423, "name": "expectedSigner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2398, "src": "8949:14:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "8913:50:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 2402, "id": 2425, "nodeType": "Return", "src": "8906:57:4" } ] }, "documentation": null, "id": 2427, "implemented": true, "kind": "function", "modifiers": [], "name": "_verify", "nodeType": "FunctionDefinition", "parameters": { "id": 2399, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2390, "name": "hash", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8654:12:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2389, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "8654:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2392, "name": "v", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8668:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2391, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "8668:5:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2394, "name": "r", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8677:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2393, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "8677:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2396, "name": "s", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8688:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2395, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "8688:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2398, "name": "expectedSigner", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8699:22:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2397, "name": "address", "nodeType": "ElementaryTypeName", "src": "8699:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "8653:69:4" }, "returnParameters": { "id": 2402, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2401, "name": "", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8746:4:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 2400, "name": "bool", "nodeType": "ElementaryTypeName", "src": "8746:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "8745:6:4" }, "scope": 2428, "src": "8636:334:4", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2429, "src": "1212:7760:4" } ], "src": "805:8168:4" }, "legacyAST": { "absolutePath": "/home/oberstet/scm/xbr/xbr-protocol/contracts/XBRPaymentChannel.sol", "exportedSymbols": { "XBRPaymentChannel": [ 2428 ] }, "id": 2429, "nodeType": "SourceUnit", "nodes": [ { "id": 2133, "literals": [ "solidity", "^", "0.5", ".2" ], "nodeType": "PragmaDirective", "src": "805:23:4" }, { "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", "id": 2134, "nodeType": "ImportDirective", "scope": 2429, "sourceUnit": 2765, "src": "886:59:4", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "openzeppelin-solidity/contracts/cryptography/ECDSA.sol", "file": "openzeppelin-solidity/contracts/cryptography/ECDSA.sol", "id": 2135, "nodeType": "ImportDirective", "scope": 2429, "sourceUnit": 2637, "src": "1008:64:4", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "XBR Payment Channel between a XBR data consumer and the XBR market maker,\nor the XBR Market Maker and a XBR data provider.", "fullyImplemented": true, "id": 2428, "linearizedBaseContracts": [ 2428 ], "name": "XBRPaymentChannel", "nodeType": "ContractDefinition", "nodes": [ { "id": 2138, "libraryName": { "contractScope": null, "id": 2136, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2764, "src": "1331:8:4", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$2764", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "1325:27:4", "typeName": { "id": 2137, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1344:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "id": 2141, "libraryName": { "contractScope": null, "id": 2139, "name": "ECDSA", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2636, "src": "1436:5:4", "typeDescriptions": { "typeIdentifier": "t_contract$_ECDSA_$2636", "typeString": "library ECDSA" } }, "nodeType": "UsingForDirective", "src": "1430:24:4", "typeName": { "id": 2140, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1446:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } }, { "canonicalName": "XBRPaymentChannel.ChannelState", "id": 2146, "members": [ { "id": 2142, "name": "NONE", "nodeType": "EnumValue", "src": "1512:4:4" }, { "id": 2143, "name": "OPEN", "nodeType": "EnumValue", "src": "1518:4:4" }, { "id": 2144, "name": "CLOSING", "nodeType": "EnumValue", "src": "1524:7:4" }, { "id": 2145, "name": "CLOSED", "nodeType": "EnumValue", "src": "1533:6:4" } ], "name": "ChannelState", "nodeType": "EnumDefinition", "src": "1492:49:4" }, { "constant": false, "id": 2148, "name": "state", "nodeType": "VariableDeclaration", "scope": 2428, "src": "1586:26:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_enum$_ChannelState_$2146", "typeString": "enum XBRPaymentChannel.ChannelState" }, "typeName": { "contractScope": null, "id": 2147, "name": "ChannelState", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2146, "src": "1586:12:4", "typeDescriptions": { "typeIdentifier": "t_enum$_ChannelState_$2146", "typeString": "enum XBRPaymentChannel.ChannelState" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2150, "name": "_marketId", "nodeType": "VariableDeclaration", "scope": 2428, "src": "1685:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2149, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "1685:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2152, "name": "_sender", "nodeType": "VariableDeclaration", "scope": 2428, "src": "1823:23:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2151, "name": "address", "nodeType": "ElementaryTypeName", "src": "1823:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2154, "name": "_delegate", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2024:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2153, "name": "address", "nodeType": "ElementaryTypeName", "src": "2024:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2156, "name": "_recipient", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2163:26:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2155, "name": "address", "nodeType": "ElementaryTypeName", "src": "2163:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2158, "name": "_amount", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2239:23:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2157, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2239:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2160, "name": "_openedAt", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2320:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2159, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2320:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2162, "name": "_closedAt", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2431:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2161, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2431:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2164, "name": "_channelTimeout", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2651:30:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2163, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "2651:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "private" }, { "constant": false, "id": 2168, "name": "_signatures", "nodeType": "VariableDeclaration", "scope": 2428, "src": "2762:48:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_address_$", "typeString": "mapping(bytes32 => address)" }, "typeName": { "id": 2167, "keyType": { "id": 2165, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "2771:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", "src": "2762:28:4", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_bytes32_$_t_address_$", "typeString": "mapping(bytes32 => address)" }, "valueType": { "id": 2166, "name": "address", "nodeType": "ElementaryTypeName", "src": "2782:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } }, "value": null, "visibility": "private" }, { "anonymous": false, "documentation": "Event emitted when payment channel is closing (that is, one of the two state channel\nparticipants has called \"close()\", initiating start of the channel timeout).", "id": 2178, "name": "Closing", "nodeType": "EventDefinition", "parameters": { "id": 2177, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2170, "indexed": true, "name": "marketId", "nodeType": "VariableDeclaration", "scope": 2178, "src": "3023:24:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2169, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "3023:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2172, "indexed": false, "name": "signer", "nodeType": "VariableDeclaration", "scope": 2178, "src": "3049:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2171, "name": "address", "nodeType": "ElementaryTypeName", "src": "3049:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2174, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", "scope": 2178, "src": "3065:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2173, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3065:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2176, "indexed": false, "name": "timeoutAt", "nodeType": "VariableDeclaration", "scope": 2178, "src": "3081:17:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2175, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3081:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3022:77:4" }, "src": "3009:91:4" }, { "anonymous": false, "documentation": "Event emitted when payment channel has finally closed, which happens after both state\nchannel participants have called close(), agreeing on last state, or after the timeout\nat latest - in case the second participant doesn't react within timeout)", "id": 2188, "name": "Closed", "nodeType": "EventDefinition", "parameters": { "id": 2187, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2180, "indexed": true, "name": "marketId", "nodeType": "VariableDeclaration", "scope": 2188, "src": "3402:24:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2179, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "3402:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2182, "indexed": false, "name": "signer", "nodeType": "VariableDeclaration", "scope": 2188, "src": "3428:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2181, "name": "address", "nodeType": "ElementaryTypeName", "src": "3428:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2184, "indexed": false, "name": "amount", "nodeType": "VariableDeclaration", "scope": 2188, "src": "3444:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2183, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3444:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2186, "indexed": false, "name": "closedAt", "nodeType": "VariableDeclaration", "scope": 2188, "src": "3460:16:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2185, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "3460:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "3401:76:4" }, "src": "3389:89:4" }, { "body": { "id": 2232, "nodeType": "Block", "src": "4253:253:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2205, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2203, "name": "_marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2150, "src": "4264:9:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2204, "name": "marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2190, "src": "4276:8:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "src": "4264:20:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "id": 2206, "nodeType": "ExpressionStatement", "src": "4264:20:4" }, { "expression": { "argumentTypes": null, "id": 2209, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2207, "name": "_sender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2152, "src": "4294:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2208, "name": "sender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2192, "src": "4304:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "4294:16:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2210, "nodeType": "ExpressionStatement", "src": "4294:16:4" }, { "expression": { "argumentTypes": null, "id": 2213, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2211, "name": "_delegate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2154, "src": "4320:9:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2212, "name": "delegate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2194, "src": "4332:8:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "4320:20:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2214, "nodeType": "ExpressionStatement", "src": "4320:20:4" }, { "expression": { "argumentTypes": null, "id": 2217, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2215, "name": "_recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2156, "src": "4350:10:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2216, "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2196, "src": "4363:9:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "4350:22:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2218, "nodeType": "ExpressionStatement", "src": "4350:22:4" }, { "expression": { "argumentTypes": null, "id": 2221, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2219, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2158, "src": "4382:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2220, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2198, "src": "4392:6:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "4382:16:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2222, "nodeType": "ExpressionStatement", "src": "4382:16:4" }, { "expression": { "argumentTypes": null, "id": 2225, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2223, "name": "_channelTimeout", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2164, "src": "4408:15:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2224, "name": "channelTimeout", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2200, "src": "4426:14:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "4408:32:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "id": 2226, "nodeType": "ExpressionStatement", "src": "4408:32:4" }, { "expression": { "argumentTypes": null, "id": 2230, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2227, "name": "_openedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2160, "src": "4451:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2228, "name": "block", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3279, "src": "4463:5:4", "typeDescriptions": { "typeIdentifier": "t_magic_block", "typeString": "block" } }, "id": 2229, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "number", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "4463:12:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "4451:24:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2231, "nodeType": "ExpressionStatement", "src": "4451:24:4" } ] }, "documentation": "Create a new XBR payment channel for handling microtransactions of XBR tokens.\n * @param marketId The ID of the XBR market this payment channel is associated with.\n@param sender The sender (onchain) of the payments.\n@param delegate The offchain delegate allowed to spend XBR offchain, from the channel,\n in the name of the original sender.\n@param recipient The receiver (onchain) of the payments.\n@param amount The amount of XBR held in the channel.\n@param channelTimeout The payment channel timeout period that begins with the first call to `close()`", "id": 2233, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 2201, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2190, "name": "marketId", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4128:16:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2189, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "4128:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2192, "name": "sender", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4146:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2191, "name": "address", "nodeType": "ElementaryTypeName", "src": "4146:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2194, "name": "delegate", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4162:16:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2193, "name": "address", "nodeType": "ElementaryTypeName", "src": "4162:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2196, "name": "recipient", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4180:17:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2195, "name": "address", "nodeType": "ElementaryTypeName", "src": "4180:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2198, "name": "amount", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4199:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2197, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "4199:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2200, "name": "channelTimeout", "nodeType": "VariableDeclaration", "scope": 2233, "src": "4223:21:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2199, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "4223:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "4127:118:4" }, "returnParameters": { "id": 2202, "nodeType": "ParameterList", "parameters": [], "src": "4253:0:4" }, "scope": 2428, "src": "4115:391:4", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2240, "nodeType": "Block", "src": "4644:33:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2238, "name": "_marketId", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2150, "src": "4661:9:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "functionReturnParameters": 2237, "id": 2239, "nodeType": "Return", "src": "4654:16:4" } ] }, "documentation": "The XBR Market ID this channel is operating payments for.", "id": 2241, "implemented": true, "kind": "function", "modifiers": [], "name": "marketId", "nodeType": "FunctionDefinition", "parameters": { "id": 2234, "nodeType": "ParameterList", "parameters": [], "src": "4611:2:4" }, "returnParameters": { "id": 2237, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2236, "name": "", "nodeType": "VariableDeclaration", "scope": 2241, "src": "4635:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2235, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "4635:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" } ], "src": "4634:9:4" }, "scope": 2428, "src": "4593:84:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2248, "nodeType": "Block", "src": "4853:31:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2246, "name": "_sender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2152, "src": "4870:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 2245, "id": 2247, "nodeType": "Return", "src": "4863:14:4" } ] }, "documentation": "The sender of the payments in this channel. Either a XBR Consumer or XBR Market Maker (delegate).", "id": 2249, "implemented": true, "kind": "function", "modifiers": [], "name": "sender", "nodeType": "FunctionDefinition", "parameters": { "id": 2242, "nodeType": "ParameterList", "parameters": [], "src": "4820:2:4" }, "returnParameters": { "id": 2245, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2244, "name": "", "nodeType": "VariableDeclaration", "scope": 2249, "src": "4844:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2243, "name": "address", "nodeType": "ElementaryTypeName", "src": "4844:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "4843:9:4" }, "scope": 2428, "src": "4804:80:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2256, "nodeType": "Block", "src": "5112:33:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2254, "name": "_delegate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2154, "src": "5129:9:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 2253, "id": 2255, "nodeType": "Return", "src": "5122:16:4" } ] }, "documentation": "The delegate working for the sender, and using this channel to pay for data keys. E.g. a\nXBR Consumer (delegate) or XBR Provider (delegate).", "id": 2257, "implemented": true, "kind": "function", "modifiers": [], "name": "delegate", "nodeType": "FunctionDefinition", "parameters": { "id": 2250, "nodeType": "ParameterList", "parameters": [], "src": "5079:2:4" }, "returnParameters": { "id": 2253, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2252, "name": "", "nodeType": "VariableDeclaration", "scope": 2257, "src": "5103:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2251, "name": "address", "nodeType": "ElementaryTypeName", "src": "5103:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "5102:9:4" }, "scope": 2428, "src": "5061:84:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2264, "nodeType": "Block", "src": "5325:34:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2262, "name": "_recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2156, "src": "5342:10:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 2261, "id": 2263, "nodeType": "Return", "src": "5335:17:4" } ] }, "documentation": "Recipient of the payments in this channel. Either a XBR Market Maker (delegate) or a XBR Provider.", "id": 2265, "implemented": true, "kind": "function", "modifiers": [], "name": "recipient", "nodeType": "FunctionDefinition", "parameters": { "id": 2258, "nodeType": "ParameterList", "parameters": [], "src": "5292:2:4" }, "returnParameters": { "id": 2261, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2260, "name": "", "nodeType": "VariableDeclaration", "scope": 2265, "src": "5316:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2259, "name": "address", "nodeType": "ElementaryTypeName", "src": "5316:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "5315:9:4" }, "scope": 2428, "src": "5273:86:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2272, "nodeType": "Block", "src": "5472:31:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2270, "name": "_amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2158, "src": "5489:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2269, "id": 2271, "nodeType": "Return", "src": "5482:14:4" } ] }, "documentation": "Amount of XBR held in the channel.", "id": 2273, "implemented": true, "kind": "function", "modifiers": [], "name": "amount", "nodeType": "FunctionDefinition", "parameters": { "id": 2266, "nodeType": "ParameterList", "parameters": [], "src": "5439:2:4" }, "returnParameters": { "id": 2269, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2268, "name": "", "nodeType": "VariableDeclaration", "scope": 2273, "src": "5463:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2267, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5463:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5462:9:4" }, "scope": 2428, "src": "5423:80:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2280, "nodeType": "Block", "src": "5626:33:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2278, "name": "_openedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2160, "src": "5643:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2277, "id": 2279, "nodeType": "Return", "src": "5636:16:4" } ] }, "documentation": "Block number when the channel was created.", "id": 2281, "implemented": true, "kind": "function", "modifiers": [], "name": "openedAt", "nodeType": "FunctionDefinition", "parameters": { "id": 2274, "nodeType": "ParameterList", "parameters": [], "src": "5593:2:4" }, "returnParameters": { "id": 2277, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2276, "name": "", "nodeType": "VariableDeclaration", "scope": 2281, "src": "5617:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2275, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5617:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5616:9:4" }, "scope": 2428, "src": "5575:84:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2288, "nodeType": "Block", "src": "5810:33:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2286, "name": "_closedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2162, "src": "5827:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 2285, "id": 2287, "nodeType": "Return", "src": "5820:16:4" } ] }, "documentation": "Block number when the channel was closed (finally, after the timeout).", "id": 2289, "implemented": true, "kind": "function", "modifiers": [], "name": "closedAt", "nodeType": "FunctionDefinition", "parameters": { "id": 2282, "nodeType": "ParameterList", "parameters": [], "src": "5777:2:4" }, "returnParameters": { "id": 2285, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2284, "name": "", "nodeType": "VariableDeclaration", "scope": 2289, "src": "5801:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2283, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "5801:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "5800:9:4" }, "scope": 2428, "src": "5759:84:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2296, "nodeType": "Block", "src": "6093:39:4", "statements": [ { "expression": { "argumentTypes": null, "id": 2294, "name": "_channelTimeout", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2164, "src": "6110:15:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "functionReturnParameters": 2293, "id": 2295, "nodeType": "Return", "src": "6103:22:4" } ] }, "documentation": "Timeout with which the channel will be closed (the grace period during which the\nchannel will wait for participants to submit their last signed transaction).", "id": 2297, "implemented": true, "kind": "function", "modifiers": [], "name": "channelTimeout", "nodeType": "FunctionDefinition", "parameters": { "id": 2290, "nodeType": "ParameterList", "parameters": [], "src": "6061:2:4" }, "returnParameters": { "id": 2293, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2292, "name": "", "nodeType": "VariableDeclaration", "scope": 2297, "src": "6085:6:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2291, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "6085:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "6084:8:4" }, "scope": 2428, "src": "6037:95:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2360, "nodeType": "Block", "src": "6843:1331:4", "statements": [ { "assignments": [ 2313 ], "declarations": [ { "constant": false, "id": 2313, "name": "signer", "nodeType": "VariableDeclaration", "scope": 2360, "src": "6854:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2312, "name": "address", "nodeType": "ElementaryTypeName", "src": "6854:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "id": 2314, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "6854:14:4" }, { "assignments": [ 2316 ], "declarations": [ { "constant": false, "id": 2316, "name": "proof", "nodeType": "VariableDeclaration", "scope": 2360, "src": "6878:13:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2315, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "6878:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 2317, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "6878:13:4" }, { "expression": { "argumentTypes": null, "id": 2325, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2318, "name": "signer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2313, "src": "6939:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2320, "name": "h", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2299, "src": "6958:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2321, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2301, "src": "6961:1:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 2322, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2303, "src": "6964:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2323, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2305, "src": "6967:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_uint8", "typeString": "uint8" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 2319, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3281, "src": "6948:9:4", "typeDescriptions": { "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" } }, "id": 2324, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "6948:21:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "6939:30:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 2326, "nodeType": "ExpressionStatement", "src": "6939:30:4" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2333, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2329, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2327, "name": "signer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2313, "src": "6984:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "id": 2328, "name": "_sender", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2152, "src": "6994:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "6984:17:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "&&", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2332, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2330, "name": "signer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2313, "src": "7005:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "id": 2331, "name": "_recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2156, "src": "7015:10:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "7005:20:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "6984:41:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2339, "nodeType": "IfStatement", "src": "6980:99:4", "trueBody": { "id": 2338, "nodeType": "Block", "src": "7027:52:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "696e76616c6964207369676e6174757265", "id": 2335, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "7048:19:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_12a179e1a73f41ef8e1ba2f259a99bc53b6ace3abb110ac2ea058e42c6104e1a", "typeString": "literal_string \"invalid signature\"" }, "value": "invalid signature" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_12a179e1a73f41ef8e1ba2f259a99bc53b6ace3abb110ac2ea058e42c6104e1a", "typeString": "literal_string \"invalid signature\"" } ], "id": 2334, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 3294, 3295 ], "referencedDeclaration": 3295, "src": "7041:6:4", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 2336, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "7041:27:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2337, "nodeType": "ExpressionStatement", "src": "7041:27:4" } ] } }, { "expression": { "argumentTypes": null, "id": 2349, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2340, "name": "proof", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2316, "src": "7089:5:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2344, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3320, "src": "7124:4:4", "typeDescriptions": { "typeIdentifier": "t_contract$_XBRPaymentChannel_$2428", "typeString": "contract XBRPaymentChannel" } }, { "argumentTypes": null, "id": 2345, "name": "sequence", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2307, "src": "7130:8:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, { "argumentTypes": null, "id": 2346, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2309, "src": "7140:5:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_XBRPaymentChannel_$2428", "typeString": "contract XBRPaymentChannel" }, { "typeIdentifier": "t_uint32", "typeString": "uint32" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 2342, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3276, "src": "7107:3:4", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 2343, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "7107:16:4", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 2347, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "7107:39:4", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 2341, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3283, "src": "7097:9:4", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 2348, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "7097:50:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "7089:58:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 2350, "nodeType": "ExpressionStatement", "src": "7089:58:4" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "id": 2353, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2351, "name": "proof", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2316, "src": "7162:5:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "id": 2352, "name": "h", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2299, "src": "7171:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "7162:10:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2359, "nodeType": "IfStatement", "src": "7158:125:4", "trueBody": { "id": 2358, "nodeType": "Block", "src": "7174:109:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "696e76616c6964207369676e617475726520287369676e61747572652069732076616c69642062757420646f65736e2774206d617463682074686520646174612070726f766964656429", "id": 2355, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "7195:76:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_fd40a083a52679a812a75b1459ad45c6fcd5cef1c1ed0bb4c521bef01bb64bf7", "typeString": "literal_string \"invalid signature (signature is valid but doesn't match the data provided)\"" }, "value": "invalid signature (signature is valid but doesn't match the data provided)" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_fd40a083a52679a812a75b1459ad45c6fcd5cef1c1ed0bb4c521bef01bb64bf7", "typeString": "literal_string \"invalid signature (signature is valid but doesn't match the data provided)\"" } ], "id": 2354, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 3294, 3295 ], "referencedDeclaration": 3295, "src": "7188:6:4", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 2356, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "7188:84:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2357, "nodeType": "ExpressionStatement", "src": "7188:84:4" } ] } } ] }, "documentation": "Trigger closing this payment channel. When the first participant has called `close()`\nsubmitting its latest transaction/state, a timeout period begins during which the\nother party of the payment channel has to submit its latest transaction/state too.\nWhen both transaction have been submitted, and the submitted transactions/states agree,\nthe channel immediately closes, and the consumed amount of token in the channel is\ntransferred to the channel recipient, and the remaining amount of token is transferred\nback to the original sender.", "id": 2361, "implemented": true, "kind": "function", "modifiers": [], "name": "close", "nodeType": "FunctionDefinition", "parameters": { "id": 2310, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2299, "name": "h", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6757:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2298, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "6757:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2301, "name": "v", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6768:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2300, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "6768:5:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2303, "name": "r", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6777:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2302, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "6777:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2305, "name": "s", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6788:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2304, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "6788:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2307, "name": "sequence", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6799:15:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2306, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "6799:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2309, "name": "value", "nodeType": "VariableDeclaration", "scope": 2361, "src": "6816:13:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2308, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "6816:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "6756:74:4" }, "returnParameters": { "id": 2311, "nodeType": "ParameterList", "parameters": [], "src": "6843:0:4" }, "scope": 2428, "src": "6741:1433:4", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 2387, "nodeType": "Block", "src": "8258:372:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2367, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2365, "name": "_closedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2162, "src": "8276:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2366, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "8289:1:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "8276:14:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4348414e4e454c5f414c52454144595f434c4f534544", "id": 2368, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "8292:24:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_36e5e5742b34eb733b4e50ae24c76a25f04795f8d35aaaabda027d6b8962210e", "typeString": "literal_string \"CHANNEL_ALREADY_CLOSED\"" }, "value": "CHANNEL_ALREADY_CLOSED" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_36e5e5742b34eb733b4e50ae24c76a25f04795f8d35aaaabda027d6b8962210e", "typeString": "literal_string \"CHANNEL_ALREADY_CLOSED\"" } ], "id": 2364, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3293, "src": "8268:7:4", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2369, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8268:49:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2370, "nodeType": "ExpressionStatement", "src": "8268:49:4" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2375, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2373, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2371, "name": "_openedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2160, "src": "8403:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 2372, "name": "_channelTimeout", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2164, "src": "8415:15:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "8403:27:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "id": 2374, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3291, "src": "8433:3:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8403:33:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 2381, "nodeType": "IfStatement", "src": "8399:113:4", "trueBody": { "id": 2380, "nodeType": "Block", "src": "8438:74:4", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "6368616e6e656c2074696d656f7574", "id": 2377, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "8483:17:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_c5af2bc3eb66a6cb7e1d835492106e09ac9b1b98fac06423519d74a73f7a196b", "typeString": "literal_string \"channel timeout\"" }, "value": "channel timeout" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_c5af2bc3eb66a6cb7e1d835492106e09ac9b1b98fac06423519d74a73f7a196b", "typeString": "literal_string \"channel timeout\"" } ], "id": 2376, "name": "revert", "nodeType": "Identifier", "overloadedDeclarations": [ 3294, 3295 ], "referencedDeclaration": 3295, "src": "8476:6:4", "typeDescriptions": { "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", "typeString": "function (string memory) pure" } }, "id": 2378, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8476:25:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2379, "nodeType": "ExpressionStatement", "src": "8476:25:4" } ] } }, { "expression": { "argumentTypes": null, "id": 2385, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2382, "name": "_closedAt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2162, "src": "8521:9:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2383, "name": "block", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3279, "src": "8533:5:4", "typeDescriptions": { "typeIdentifier": "t_magic_block", "typeString": "block" } }, "id": 2384, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "number", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "8533:12:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "8521:24:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 2386, "nodeType": "ExpressionStatement", "src": "8521:24:4" } ] }, "documentation": "Timeout this state channel.", "id": 2388, "implemented": true, "kind": "function", "modifiers": [], "name": "timeout", "nodeType": "FunctionDefinition", "parameters": { "id": 2362, "nodeType": "ParameterList", "parameters": [], "src": "8248:2:4" }, "returnParameters": { "id": 2363, "nodeType": "ParameterList", "parameters": [], "src": "8258:0:4" }, "scope": 2428, "src": "8231:399:4", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2426, "nodeType": "Block", "src": "8756:214:4", "statements": [ { "assignments": [ 2404 ], "declarations": [ { "constant": false, "id": 2404, "name": "prefix", "nodeType": "VariableDeclaration", "scope": 2426, "src": "8766:19:4", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 2403, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "8766:5:4", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "id": 2406, "initialValue": { "argumentTypes": null, "hexValue": "19457468657265756d205369676e6564204d6573736167653a0a3332", "id": 2405, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "8788:34:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_178a2411ab6fbc1ba11064408972259c558d0e82fd48b0aba3ad81d14f065e73", "typeString": "literal_string \"\u0019Ethereum Signed Message:\n32\"" }, "value": "\u0019Ethereum Signed Message:\n32" }, "nodeType": "VariableDeclarationStatement", "src": "8766:56:4" }, { "assignments": [ 2408 ], "declarations": [ { "constant": false, "id": 2408, "name": "prefixedHash", "nodeType": "VariableDeclaration", "scope": 2426, "src": "8832:20:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2407, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "8832:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" } ], "id": 2416, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2412, "name": "prefix", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2404, "src": "8882:6:4", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, { "argumentTypes": null, "id": 2413, "name": "hash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2390, "src": "8890:4:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "expression": { "argumentTypes": null, "id": 2410, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3276, "src": "8865:3:4", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, "id": 2411, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "8865:16:4", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, "id": 2414, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8865:30:4", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 2409, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3283, "src": "8855:9:4", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 2415, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8855:41:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "VariableDeclarationStatement", "src": "8832:64:4" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 2424, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2418, "name": "prefixedHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2408, "src": "8923:12:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { "argumentTypes": null, "id": 2419, "name": "v", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2392, "src": "8937:1:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, { "argumentTypes": null, "id": 2420, "name": "r", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2394, "src": "8940:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, { "argumentTypes": null, "id": 2421, "name": "s", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2396, "src": "8943:1:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, { "typeIdentifier": "t_uint8", "typeString": "uint8" }, { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } ], "id": 2417, "name": "ecrecover", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3281, "src": "8913:9:4", "typeDescriptions": { "typeIdentifier": "t_function_ecrecover_pure$_t_bytes32_$_t_uint8_$_t_bytes32_$_t_bytes32_$returns$_t_address_$", "typeString": "function (bytes32,uint8,bytes32,bytes32) pure returns (address)" } }, "id": 2422, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "8913:32:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2423, "name": "expectedSigner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2398, "src": "8949:14:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "8913:50:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 2402, "id": 2425, "nodeType": "Return", "src": "8906:57:4" } ] }, "documentation": null, "id": 2427, "implemented": true, "kind": "function", "modifiers": [], "name": "_verify", "nodeType": "FunctionDefinition", "parameters": { "id": 2399, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2390, "name": "hash", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8654:12:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2389, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "8654:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2392, "name": "v", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8668:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 2391, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "8668:5:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2394, "name": "r", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8677:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 2393, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "8677:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2396, "name": "s", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8688:9:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 2395, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "8688:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2398, "name": "expectedSigner", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8699:22:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2397, "name": "address", "nodeType": "ElementaryTypeName", "src": "8699:7:4", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "8653:69:4" }, "returnParameters": { "id": 2402, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2401, "name": "", "nodeType": "VariableDeclaration", "scope": 2427, "src": "8746:4:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 2400, "name": "bool", "nodeType": "ElementaryTypeName", "src": "8746:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "8745:6:4" }, "scope": 2428, "src": "8636:334:4", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2429, "src": "1212:7760:4" } ], "src": "805:8168:4" }, "compiler": { "name": "solc", "version": "0.5.2+commit.1df8f40c.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.5", "updatedAt": "2019-06-04T10:01:11.429Z", "devdoc": { "methods": { "constructor": { "params": { "amount": "The amount of XBR held in the channel.", "channelTimeout": "The payment channel timeout period that begins with the first call to `close()`", "delegate": "The offchain delegate allowed to spend XBR offchain, from the channel, in the name of the original sender.", "marketId": "The ID of the XBR market this payment channel is associated with.", "recipient": "The receiver (onchain) of the payments.", "sender": "The sender (onchain) of the payments." } } } }, "userdoc": { "methods": { "amount()": { "notice": "Amount of XBR held in the channel." }, "channelTimeout()": { "notice": "Timeout with which the channel will be closed (the grace period during which the channel will wait for participants to submit their last signed transaction)." }, "close(bytes32,uint8,bytes32,bytes32,uint32,uint256)": { "notice": "Trigger closing this payment channel. When the first participant has called `close()` submitting its latest transaction/state, a timeout period begins during which the other party of the payment channel has to submit its latest transaction/state too. When both transaction have been submitted, and the submitted transactions/states agree, the channel immediately closes, and the consumed amount of token in the channel is transferred to the channel recipient, and the remaining amount of token is transferred back to the original sender." }, "closedAt()": { "notice": "Block number when the channel was closed (finally, after the timeout)." }, "constructor": "Create a new XBR payment channel for handling microtransactions of XBR tokens.", "delegate()": { "notice": "The delegate working for the sender, and using this channel to pay for data keys. E.g. a XBR Consumer (delegate) or XBR Provider (delegate)." }, "marketId()": { "notice": "The XBR Market ID this channel is operating payments for." }, "openedAt()": { "notice": "Block number when the channel was created." }, "recipient()": { "notice": "Recipient of the payments in this channel. Either a XBR Market Maker (delegate) or a XBR Provider." }, "sender()": { "notice": "The sender of the payments in this channel. Either a XBR Consumer or XBR Market Maker (delegate)." }, "timeout()": { "notice": "Timeout this state channel." } }, "notice": "XBR Payment Channel between a XBR data consumer and the XBR market maker, or the XBR Market Maker and a XBR data provider." } }