From 5db6595c618c6535c2da719ae2a522657361791a Mon Sep 17 00:00:00 2001 From: poma Date: Tue, 9 Jul 2019 16:10:39 +0300 Subject: [PATCH] remove build --- contracts/.gitignore | 1 + contracts/build/contracts/IVerifier.json | 5692 ---------- .../contracts/MerkleTreeWithHistory.json | 9765 ----------------- contracts/build/contracts/MiMC.json | 9642 ---------------- contracts/build/contracts/Migrations.json | 1385 --- contracts/build/contracts/Mixer.json | 5927 ---------- contracts/build/contracts/SafeMath.json | 3507 ------ 7 files changed, 1 insertion(+), 35918 deletions(-) create mode 100644 contracts/.gitignore delete mode 100644 contracts/build/contracts/IVerifier.json delete mode 100644 contracts/build/contracts/MerkleTreeWithHistory.json delete mode 100644 contracts/build/contracts/MiMC.json delete mode 100644 contracts/build/contracts/Migrations.json delete mode 100644 contracts/build/contracts/Mixer.json delete mode 100644 contracts/build/contracts/SafeMath.json diff --git a/contracts/.gitignore b/contracts/.gitignore new file mode 100644 index 0000000..c795b05 --- /dev/null +++ b/contracts/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/contracts/build/contracts/IVerifier.json b/contracts/build/contracts/IVerifier.json deleted file mode 100644 index ebca0d9..0000000 --- a/contracts/build/contracts/IVerifier.json +++ /dev/null @@ -1,5692 +0,0 @@ -{ - "contractName": "IVerifier", - "abi": [ - { - "constant": false, - "inputs": [ - { - "name": "a", - "type": "uint256[2]" - }, - { - "name": "b", - "type": "uint256[2][2]" - }, - { - "name": "c", - "type": "uint256[2]" - }, - { - "name": "input", - "type": "uint256[4]" - } - ], - "name": "verify", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"a\",\"type\":\"uint256[2]\"},{\"name\":\"b\",\"type\":\"uint256[2][2]\"},{\"name\":\"c\",\"type\":\"uint256[2]\"},{\"name\":\"input\",\"type\":\"uint256[4]\"}],\"name\":\"verify\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/poma/dev/mixer/contracts/contracts/Mixer.sol\":\"IVerifier\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol\":{\"keccak256\":\"0x642b31dbef7c34b66cd911042cfc6d5a6821cbf631e87c8b8a9fc4f7a2db7280\",\"urls\":[\"bzzr://0b616b34d1ca9c10f095eb402edc09f3f9d6cc1e4ec37da29f67c2c86d2f964a\"]},\"/Users/poma/dev/mixer/contracts/contracts/Mixer.sol\":{\"keccak256\":\"0xf7fa5b07896d32af414cd93b23031f766d9491526456fa1e316b479f239e63e9\",\"urls\":[\"bzzr://407758b01a03c7795de7160b22c8453db22d483a3e52e8f11b1f24f7a3ad28a0\"]},\"/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x4ccf2d7b51873db1ccfd54ca2adae5eac3b184f9699911ed4490438419f1c690\",\"urls\":[\"bzzr://1604f5b6d6e916c154efd8c6720cda069e5ba32dfa0a9dedf2b42e5b02d07f89\"]}},\"version\":1}", - "bytecode": "0x", - "deployedBytecode": "0x", - "sourceMap": "", - "deployedSourceMap": "", - "source": "pragma solidity ^0.5.8;\n\nimport \"./MerkleTreeWithHistory.sol\";\nimport \"../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol\";\n\ncontract IVerifier {\n function verify(uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c, uint256[4] memory input) public returns(bool);\n}\n\ncontract Mixer is MerkleTreeWithHistory {\n using SafeMath for uint256;\n\n uint256 public transferValue;\n mapping(uint256 => bool) public nullifiers;\n IVerifier verifier;\n\n event Deposit(address from, uint256 commitment);\n event Withdraw(address to, uint256 nullifier, uint256 fee);\n\n constructor(address _verifier, uint256 _transferValue) public {\n verifier = IVerifier(_verifier);\n transferValue = _transferValue;\n }\n\n function deposit(uint256 commitment) public payable {\n require(msg.value == transferValue, \"Please send `transferValue` funds alone with transaction\");\n insert(commitment);\n emit Deposit(msg.sender, commitment);\n }\n\n function withdraw(uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c, uint256[4] memory input) public {\n address payable receiver = address(input[0]);\n uint256 nullifier = input[1];\n uint256 fee = input[2];\n uint256 root = input[3];\n\n require(fee < transferValue, \"Fee exceeds transfer value\");\n require(!nullifiers[nullifier], \"The note has been already spent\");\n require(isKnownRoot(root), \"Cannot find your merkle root\"); // Make sure to use a recent one\n require(verifier.verify(a, b, c, input), \"Invalid withdraw proof\");\n\n nullifiers[nullifier] = true;\n receiver.transfer(transferValue - fee);\n if (fee > 0) {\n msg.sender.transfer(fee);\n }\n emit Withdraw(receiver, nullifier, fee);\n }\n}", - "sourcePath": "/Users/poma/dev/mixer/contracts/contracts/Mixer.sol", - "ast": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/Mixer.sol", - "exportedSymbols": { - "IVerifier": [ - 458 - ], - "Mixer": [ - 642 - ] - }, - "id": 643, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 432, - "literals": [ - "solidity", - "^", - "0.5", - ".8" - ], - "nodeType": "PragmaDirective", - "src": "0:23:2" - }, - { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "file": "./MerkleTreeWithHistory.sol", - "id": 433, - "nodeType": "ImportDirective", - "scope": 643, - "sourceUnit": 374, - "src": "25:37:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 434, - "nodeType": "ImportDirective", - "scope": 643, - "sourceUnit": 776, - "src": "63:75:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": false, - "id": 458, - "linearizedBaseContracts": [ - 458 - ], - "name": "IVerifier", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": null, - "id": 457, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "verify", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 453, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 438, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "179:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 435, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "179:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 437, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "187:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "179:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 444, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "200:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2][2]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 439, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "200:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 441, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 440, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "208:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "200:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "id": 443, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 442, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "211:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "200:13:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$2_storage_ptr", - "typeString": "uint256[2][2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 448, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "224:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 445, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "224:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 447, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 446, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "232:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "224:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 452, - "name": "input", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "245:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4]" - }, - "typeName": { - "baseType": { - "id": 449, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "245:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 451, - "length": { - "argumentTypes": null, - "hexValue": "34", - "id": 450, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "253:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "245:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_storage_ptr", - "typeString": "uint256[4]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "178:91:2" - }, - "returnParameters": { - "id": 456, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 455, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "285:4:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 454, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "285:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "284:6:2" - }, - "scope": 458, - "src": "163:128:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 643, - "src": "140:153:2" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 459, - "name": "MerkleTreeWithHistory", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 373, - "src": "313:21:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_MerkleTreeWithHistory_$373", - "typeString": "contract MerkleTreeWithHistory" - } - }, - "id": 460, - "nodeType": "InheritanceSpecifier", - "src": "313:21:2" - } - ], - "contractDependencies": [ - 373 - ], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": false, - "id": 642, - "linearizedBaseContracts": [ - 642, - 373 - ], - "name": "Mixer", - "nodeType": "ContractDefinition", - "nodes": [ - { - "id": 463, - "libraryName": { - "contractScope": null, - "id": 461, - "name": "SafeMath", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 775, - "src": "345:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SafeMath_$775", - "typeString": "library SafeMath" - } - }, - "nodeType": "UsingForDirective", - "src": "339:27:2", - "typeName": { - "id": 462, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "358:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - { - "constant": false, - "id": 465, - "name": "transferValue", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "370:28:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 464, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "370:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 469, - "name": "nullifiers", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "402:42:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - }, - "typeName": { - "id": 468, - "keyType": { - "id": 466, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "410:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "402:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - }, - "valueType": { - "id": 467, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "421:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 471, - "name": "verifier", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "448:18:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - }, - "typeName": { - "contractScope": null, - "id": 470, - "name": "IVerifier", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 458, - "src": "448:9:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "value": null, - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 477, - "name": "Deposit", - "nodeType": "EventDefinition", - "parameters": { - "id": 476, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 473, - "indexed": false, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 477, - "src": "485:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 472, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "485:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 475, - "indexed": false, - "name": "commitment", - "nodeType": "VariableDeclaration", - "scope": 477, - "src": "499:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 474, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "499:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "484:34:2" - }, - "src": "471:48:2" - }, - { - "anonymous": false, - "documentation": null, - "id": 485, - "name": "Withdraw", - "nodeType": "EventDefinition", - "parameters": { - "id": 484, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 479, - "indexed": false, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "537:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 478, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "537:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 481, - "indexed": false, - "name": "nullifier", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "549:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 480, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "549:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 483, - "indexed": false, - "name": "fee", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "568:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 482, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "568:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "536:44:2" - }, - "src": "522:59:2" - }, - { - "body": { - "id": 502, - "nodeType": "Block", - "src": "647:78:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 496, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 492, - "name": "verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 471, - "src": "653:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 494, - "name": "_verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 487, - "src": "674:9:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 493, - "name": "IVerifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 458, - "src": "664:9:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IVerifier_$458_$", - "typeString": "type(contract IVerifier)" - } - }, - "id": 495, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "664:20:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "src": "653:31:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "id": 497, - "nodeType": "ExpressionStatement", - "src": "653:31:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 500, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 498, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "690:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 499, - "name": "_transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 489, - "src": "706:14:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "690:30:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 501, - "nodeType": "ExpressionStatement", - "src": "690:30:2" - } - ] - }, - "documentation": null, - "id": 503, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 490, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 487, - "name": "_verifier", - "nodeType": "VariableDeclaration", - "scope": 503, - "src": "597:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 486, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "597:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 489, - "name": "_transferValue", - "nodeType": "VariableDeclaration", - "scope": 503, - "src": "616:22:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 488, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "616:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "596:43:2" - }, - "returnParameters": { - "id": 491, - "nodeType": "ParameterList", - "parameters": [], - "src": "647:0:2" - }, - "scope": 642, - "src": "585:140:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 526, - "nodeType": "Block", - "src": "781:172:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 512, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 509, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "795:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 510, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "795:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 511, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "808:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "795:26:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "506c656173652073656e6420607472616e7366657256616c7565602066756e647320616c6f6e652077697468207472616e73616374696f6e", - "id": 513, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "823:58:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_30309aa06eb27a30f0f30e53c4b574d416938a818a214b58fc4b0c136c70d5bd", - "typeString": "literal_string \"Please send `transferValue` funds alone with transaction\"" - }, - "value": "Please send `transferValue` funds alone with transaction" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_30309aa06eb27a30f0f30e53c4b574d416938a818a214b58fc4b0c136c70d5bd", - "typeString": "literal_string \"Please send `transferValue` funds alone with transaction\"" - } - ], - "id": 508, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "787:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 514, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "787:95:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 515, - "nodeType": "ExpressionStatement", - "src": "787:95:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 517, - "name": "commitment", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 505, - "src": "895:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 516, - "name": "insert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 298, - "src": "888:6:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 518, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "888:18:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 519, - "nodeType": "ExpressionStatement", - "src": "888:18:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 521, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "925:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 522, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "925:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 523, - "name": "commitment", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 505, - "src": "937:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 520, - "name": "Deposit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 477, - "src": "917:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "917:31:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 525, - "nodeType": "EmitStatement", - "src": "912:36:2" - } - ] - }, - "documentation": null, - "id": 527, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "deposit", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 506, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 505, - "name": "commitment", - "nodeType": "VariableDeclaration", - "scope": 527, - "src": "746:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 504, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "746:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "745:20:2" - }, - "returnParameters": { - "id": 507, - "nodeType": "ParameterList", - "parameters": [], - "src": "781:0:2" - }, - "scope": 642, - "src": "729:224:2", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 640, - "nodeType": "Block", - "src": "1073:633:2", - "statements": [ - { - "assignments": [ - 549 - ], - "declarations": [ - { - "constant": false, - "id": 549, - "name": "receiver", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1079:24:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 548, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1079:15:2", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 555, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 551, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1114:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 553, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 552, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1120:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1114:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 550, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1106:7:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 554, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1106:17:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1079:44:2" - }, - { - "assignments": [ - 557 - ], - "declarations": [ - { - "constant": false, - "id": 557, - "name": "nullifier", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1129:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 556, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1129:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 561, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 558, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1149:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 560, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 559, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1155:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1149:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1129:28:2" - }, - { - "assignments": [ - 563 - ], - "declarations": [ - { - "constant": false, - "id": 563, - "name": "fee", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1163:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 562, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1163:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 567, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 564, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1177:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 566, - "indexExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 565, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1183:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1177:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1163:22:2" - }, - { - "assignments": [ - 569 - ], - "declarations": [ - { - "constant": false, - "id": 569, - "name": "root", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1191:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 568, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1191:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 573, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 570, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1206:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 572, - "indexExpression": { - "argumentTypes": null, - "hexValue": "33", - "id": 571, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1212:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_3_by_1", - "typeString": "int_const 3" - }, - "value": "3" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1206:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1191:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 577, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 575, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1229:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 576, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "1235:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1229:19:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4665652065786365656473207472616e736665722076616c7565", - "id": 578, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1250:28:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2ce218df547d416f80ea8a5deadaf9453d23523ffa5f2e880a48adfdb4053a9c", - "typeString": "literal_string \"Fee exceeds transfer value\"" - }, - "value": "Fee exceeds transfer value" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2ce218df547d416f80ea8a5deadaf9453d23523ffa5f2e880a48adfdb4053a9c", - "typeString": "literal_string \"Fee exceeds transfer value\"" - } - ], - "id": 574, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1221:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1221:58:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 580, - "nodeType": "ExpressionStatement", - "src": "1221:58:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "1293:22:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "nullifiers", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 469, - "src": "1294:10:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - } - }, - "id": 584, - "indexExpression": { - "argumentTypes": null, - "id": 583, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1305:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1294:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "546865206e6f746520686173206265656e20616c7265616479207370656e74", - "id": 586, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1317:33:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_a1bef92d7a18b1c6975dc8de68df6140a52afea05a2c6c91da2b1562c617e896", - "typeString": "literal_string \"The note has been already spent\"" - }, - "value": "The note has been already spent" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_a1bef92d7a18b1c6975dc8de68df6140a52afea05a2c6c91da2b1562c617e896", - "typeString": "literal_string \"The note has been already spent\"" - } - ], - "id": 581, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1285:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 587, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1285:66:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 588, - "nodeType": "ExpressionStatement", - "src": "1285:66:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 591, - "name": "root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 569, - "src": "1377:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 590, - "name": "isKnownRoot", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 362, - "src": "1365:11:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 592, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1365:17:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616e6e6f742066696e6420796f7572206d65726b6c6520726f6f74", - "id": 593, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1384:30:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2a69086763073955418d2fd7dfee3d2f1fbc5b21047a216b7855d3f313d8e204", - "typeString": "literal_string \"Cannot find your merkle root\"" - }, - "value": "Cannot find your merkle root" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2a69086763073955418d2fd7dfee3d2f1fbc5b21047a216b7855d3f313d8e204", - "typeString": "literal_string \"Cannot find your merkle root\"" - } - ], - "id": 589, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1357:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 594, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1357:58:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 595, - "nodeType": "ExpressionStatement", - "src": "1357:58:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 599, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 531, - "src": "1478:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - { - "argumentTypes": null, - "id": 600, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 537, - "src": "1481:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2] memory[2] memory" - } - }, - { - "argumentTypes": null, - "id": 601, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "1484:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - { - "argumentTypes": null, - "id": 602, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1487:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - }, - { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2] memory[2] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - ], - "expression": { - "argumentTypes": null, - "id": 597, - "name": "verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 471, - "src": "1462:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "id": 598, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "verify", - "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "1462:15:2", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_array$_t_uint256_$2_memory_ptr_$_t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr_$_t_array$_t_uint256_$2_memory_ptr_$_t_array$_t_uint256_$4_memory_ptr_$returns$_t_bool_$", - "typeString": "function (uint256[2] memory,uint256[2] memory[2] memory,uint256[2] memory,uint256[4] memory) external returns (bool)" - } - }, - "id": 603, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1462:31:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c69642077697468647261772070726f6f66", - "id": 604, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1495:24:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7021ea58137dba96e572e94936410b0b0e4cbc344e1ab2ee7f47660768b81ff4", - "typeString": "literal_string \"Invalid withdraw proof\"" - }, - "value": "Invalid withdraw proof" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7021ea58137dba96e572e94936410b0b0e4cbc344e1ab2ee7f47660768b81ff4", - "typeString": "literal_string \"Invalid withdraw proof\"" - } - ], - "id": 596, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1454:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 605, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1454:66:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 606, - "nodeType": "ExpressionStatement", - "src": "1454:66:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 611, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 607, - "name": "nullifiers", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 469, - "src": "1527:10:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - } - }, - "id": 609, - "indexExpression": { - "argumentTypes": null, - "id": 608, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1538:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1527:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 610, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1551:4:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "1527:28:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 612, - "nodeType": "ExpressionStatement", - "src": "1527:28:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 616, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "1579:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 617, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1595:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1579:19:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 613, - "name": "receiver", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 549, - "src": "1561:8:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 615, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1561:17:2", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 619, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1561:38:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 620, - "nodeType": "ExpressionStatement", - "src": "1561:38:2" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 623, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 621, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1609:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 622, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1615:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1609:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 633, - "nodeType": "IfStatement", - "src": "1605:52:2", - "trueBody": { - "id": 632, - "nodeType": "Block", - "src": "1618:39:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 629, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1646:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 624, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "1626:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 627, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1626:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1626:19:2", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 630, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1626:24:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 631, - "nodeType": "ExpressionStatement", - "src": "1626:24:2" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 635, - "name": "receiver", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 549, - "src": "1676:8:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 636, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1686:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 637, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1697:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 634, - "name": "Withdraw", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 485, - "src": "1667:8:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256,uint256)" - } - }, - "id": 638, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1667:34:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 639, - "nodeType": "EmitStatement", - "src": "1662:39:2" - } - ] - }, - "documentation": null, - "id": 641, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "withdraw", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 546, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 531, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "975:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 528, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "975:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 530, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 529, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "983:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "975:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 537, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "996:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2][2]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 532, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "996:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 534, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1004:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "996:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "id": 536, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1007:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "996:13:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$2_storage_ptr", - "typeString": "uint256[2][2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 541, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "1020:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 538, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1020:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 540, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 539, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1028:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1020:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 545, - "name": "input", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "1041:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4]" - }, - "typeName": { - "baseType": { - "id": 542, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1041:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 544, - "length": { - "argumentTypes": null, - "hexValue": "34", - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1049:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "1041:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_storage_ptr", - "typeString": "uint256[4]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "974:91:2" - }, - "returnParameters": { - "id": 547, - "nodeType": "ParameterList", - "parameters": [], - "src": "1073:0:2" - }, - "scope": 642, - "src": "957:749:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 643, - "src": "295:1413:2" - } - ], - "src": "0:1708:2" - }, - "legacyAST": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/Mixer.sol", - "exportedSymbols": { - "IVerifier": [ - 458 - ], - "Mixer": [ - 642 - ] - }, - "id": 643, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 432, - "literals": [ - "solidity", - "^", - "0.5", - ".8" - ], - "nodeType": "PragmaDirective", - "src": "0:23:2" - }, - { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "file": "./MerkleTreeWithHistory.sol", - "id": 433, - "nodeType": "ImportDirective", - "scope": 643, - "sourceUnit": 374, - "src": "25:37:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 434, - "nodeType": "ImportDirective", - "scope": 643, - "sourceUnit": 776, - "src": "63:75:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": false, - "id": 458, - "linearizedBaseContracts": [ - 458 - ], - "name": "IVerifier", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": null, - "id": 457, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "verify", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 453, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 438, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "179:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 435, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "179:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 437, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "187:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "179:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 444, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "200:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2][2]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 439, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "200:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 441, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 440, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "208:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "200:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "id": 443, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 442, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "211:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "200:13:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$2_storage_ptr", - "typeString": "uint256[2][2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 448, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "224:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 445, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "224:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 447, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 446, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "232:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "224:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 452, - "name": "input", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "245:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4]" - }, - "typeName": { - "baseType": { - "id": 449, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "245:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 451, - "length": { - "argumentTypes": null, - "hexValue": "34", - "id": 450, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "253:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "245:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_storage_ptr", - "typeString": "uint256[4]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "178:91:2" - }, - "returnParameters": { - "id": 456, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 455, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "285:4:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 454, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "285:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "284:6:2" - }, - "scope": 458, - "src": "163:128:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 643, - "src": "140:153:2" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 459, - "name": "MerkleTreeWithHistory", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 373, - "src": "313:21:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_MerkleTreeWithHistory_$373", - "typeString": "contract MerkleTreeWithHistory" - } - }, - "id": 460, - "nodeType": "InheritanceSpecifier", - "src": "313:21:2" - } - ], - "contractDependencies": [ - 373 - ], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": false, - "id": 642, - "linearizedBaseContracts": [ - 642, - 373 - ], - "name": "Mixer", - "nodeType": "ContractDefinition", - "nodes": [ - { - "id": 463, - "libraryName": { - "contractScope": null, - "id": 461, - "name": "SafeMath", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 775, - "src": "345:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SafeMath_$775", - "typeString": "library SafeMath" - } - }, - "nodeType": "UsingForDirective", - "src": "339:27:2", - "typeName": { - "id": 462, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "358:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - { - "constant": false, - "id": 465, - "name": "transferValue", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "370:28:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 464, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "370:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 469, - "name": "nullifiers", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "402:42:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - }, - "typeName": { - "id": 468, - "keyType": { - "id": 466, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "410:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "402:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - }, - "valueType": { - "id": 467, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "421:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 471, - "name": "verifier", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "448:18:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - }, - "typeName": { - "contractScope": null, - "id": 470, - "name": "IVerifier", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 458, - "src": "448:9:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "value": null, - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 477, - "name": "Deposit", - "nodeType": "EventDefinition", - "parameters": { - "id": 476, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 473, - "indexed": false, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 477, - "src": "485:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 472, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "485:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 475, - "indexed": false, - "name": "commitment", - "nodeType": "VariableDeclaration", - "scope": 477, - "src": "499:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 474, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "499:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "484:34:2" - }, - "src": "471:48:2" - }, - { - "anonymous": false, - "documentation": null, - "id": 485, - "name": "Withdraw", - "nodeType": "EventDefinition", - "parameters": { - "id": 484, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 479, - "indexed": false, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "537:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 478, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "537:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 481, - "indexed": false, - "name": "nullifier", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "549:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 480, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "549:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 483, - "indexed": false, - "name": "fee", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "568:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 482, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "568:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "536:44:2" - }, - "src": "522:59:2" - }, - { - "body": { - "id": 502, - "nodeType": "Block", - "src": "647:78:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 496, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 492, - "name": "verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 471, - "src": "653:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 494, - "name": "_verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 487, - "src": "674:9:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 493, - "name": "IVerifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 458, - "src": "664:9:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IVerifier_$458_$", - "typeString": "type(contract IVerifier)" - } - }, - "id": 495, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "664:20:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "src": "653:31:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "id": 497, - "nodeType": "ExpressionStatement", - "src": "653:31:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 500, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 498, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "690:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 499, - "name": "_transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 489, - "src": "706:14:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "690:30:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 501, - "nodeType": "ExpressionStatement", - "src": "690:30:2" - } - ] - }, - "documentation": null, - "id": 503, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 490, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 487, - "name": "_verifier", - "nodeType": "VariableDeclaration", - "scope": 503, - "src": "597:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 486, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "597:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 489, - "name": "_transferValue", - "nodeType": "VariableDeclaration", - "scope": 503, - "src": "616:22:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 488, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "616:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "596:43:2" - }, - "returnParameters": { - "id": 491, - "nodeType": "ParameterList", - "parameters": [], - "src": "647:0:2" - }, - "scope": 642, - "src": "585:140:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 526, - "nodeType": "Block", - "src": "781:172:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 512, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 509, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "795:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 510, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "795:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 511, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "808:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "795:26:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "506c656173652073656e6420607472616e7366657256616c7565602066756e647320616c6f6e652077697468207472616e73616374696f6e", - "id": 513, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "823:58:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_30309aa06eb27a30f0f30e53c4b574d416938a818a214b58fc4b0c136c70d5bd", - "typeString": "literal_string \"Please send `transferValue` funds alone with transaction\"" - }, - "value": "Please send `transferValue` funds alone with transaction" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_30309aa06eb27a30f0f30e53c4b574d416938a818a214b58fc4b0c136c70d5bd", - "typeString": "literal_string \"Please send `transferValue` funds alone with transaction\"" - } - ], - "id": 508, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "787:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 514, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "787:95:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 515, - "nodeType": "ExpressionStatement", - "src": "787:95:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 517, - "name": "commitment", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 505, - "src": "895:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 516, - "name": "insert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 298, - "src": "888:6:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 518, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "888:18:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 519, - "nodeType": "ExpressionStatement", - "src": "888:18:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 521, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "925:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 522, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "925:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 523, - "name": "commitment", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 505, - "src": "937:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 520, - "name": "Deposit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 477, - "src": "917:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "917:31:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 525, - "nodeType": "EmitStatement", - "src": "912:36:2" - } - ] - }, - "documentation": null, - "id": 527, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "deposit", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 506, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 505, - "name": "commitment", - "nodeType": "VariableDeclaration", - "scope": 527, - "src": "746:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 504, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "746:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "745:20:2" - }, - "returnParameters": { - "id": 507, - "nodeType": "ParameterList", - "parameters": [], - "src": "781:0:2" - }, - "scope": 642, - "src": "729:224:2", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 640, - "nodeType": "Block", - "src": "1073:633:2", - "statements": [ - { - "assignments": [ - 549 - ], - "declarations": [ - { - "constant": false, - "id": 549, - "name": "receiver", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1079:24:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 548, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1079:15:2", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 555, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 551, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1114:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 553, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 552, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1120:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1114:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 550, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1106:7:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 554, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1106:17:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1079:44:2" - }, - { - "assignments": [ - 557 - ], - "declarations": [ - { - "constant": false, - "id": 557, - "name": "nullifier", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1129:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 556, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1129:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 561, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 558, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1149:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 560, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 559, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1155:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1149:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1129:28:2" - }, - { - "assignments": [ - 563 - ], - "declarations": [ - { - "constant": false, - "id": 563, - "name": "fee", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1163:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 562, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1163:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 567, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 564, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1177:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 566, - "indexExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 565, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1183:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1177:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1163:22:2" - }, - { - "assignments": [ - 569 - ], - "declarations": [ - { - "constant": false, - "id": 569, - "name": "root", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1191:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 568, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1191:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 573, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 570, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1206:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 572, - "indexExpression": { - "argumentTypes": null, - "hexValue": "33", - "id": 571, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1212:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_3_by_1", - "typeString": "int_const 3" - }, - "value": "3" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1206:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1191:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 577, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 575, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1229:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 576, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "1235:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1229:19:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4665652065786365656473207472616e736665722076616c7565", - "id": 578, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1250:28:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2ce218df547d416f80ea8a5deadaf9453d23523ffa5f2e880a48adfdb4053a9c", - "typeString": "literal_string \"Fee exceeds transfer value\"" - }, - "value": "Fee exceeds transfer value" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2ce218df547d416f80ea8a5deadaf9453d23523ffa5f2e880a48adfdb4053a9c", - "typeString": "literal_string \"Fee exceeds transfer value\"" - } - ], - "id": 574, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1221:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1221:58:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 580, - "nodeType": "ExpressionStatement", - "src": "1221:58:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "1293:22:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "nullifiers", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 469, - "src": "1294:10:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - } - }, - "id": 584, - "indexExpression": { - "argumentTypes": null, - "id": 583, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1305:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1294:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "546865206e6f746520686173206265656e20616c7265616479207370656e74", - "id": 586, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1317:33:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_a1bef92d7a18b1c6975dc8de68df6140a52afea05a2c6c91da2b1562c617e896", - "typeString": "literal_string \"The note has been already spent\"" - }, - "value": "The note has been already spent" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_a1bef92d7a18b1c6975dc8de68df6140a52afea05a2c6c91da2b1562c617e896", - "typeString": "literal_string \"The note has been already spent\"" - } - ], - "id": 581, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1285:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 587, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1285:66:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 588, - "nodeType": "ExpressionStatement", - "src": "1285:66:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 591, - "name": "root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 569, - "src": "1377:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 590, - "name": "isKnownRoot", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 362, - "src": "1365:11:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 592, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1365:17:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616e6e6f742066696e6420796f7572206d65726b6c6520726f6f74", - "id": 593, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1384:30:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2a69086763073955418d2fd7dfee3d2f1fbc5b21047a216b7855d3f313d8e204", - "typeString": "literal_string \"Cannot find your merkle root\"" - }, - "value": "Cannot find your merkle root" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2a69086763073955418d2fd7dfee3d2f1fbc5b21047a216b7855d3f313d8e204", - "typeString": "literal_string \"Cannot find your merkle root\"" - } - ], - "id": 589, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1357:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 594, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1357:58:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 595, - "nodeType": "ExpressionStatement", - "src": "1357:58:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 599, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 531, - "src": "1478:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - { - "argumentTypes": null, - "id": 600, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 537, - "src": "1481:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2] memory[2] memory" - } - }, - { - "argumentTypes": null, - "id": 601, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "1484:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - { - "argumentTypes": null, - "id": 602, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1487:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - }, - { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2] memory[2] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - ], - "expression": { - "argumentTypes": null, - "id": 597, - "name": "verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 471, - "src": "1462:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "id": 598, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "verify", - "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "1462:15:2", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_array$_t_uint256_$2_memory_ptr_$_t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr_$_t_array$_t_uint256_$2_memory_ptr_$_t_array$_t_uint256_$4_memory_ptr_$returns$_t_bool_$", - "typeString": "function (uint256[2] memory,uint256[2] memory[2] memory,uint256[2] memory,uint256[4] memory) external returns (bool)" - } - }, - "id": 603, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1462:31:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c69642077697468647261772070726f6f66", - "id": 604, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1495:24:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7021ea58137dba96e572e94936410b0b0e4cbc344e1ab2ee7f47660768b81ff4", - "typeString": "literal_string \"Invalid withdraw proof\"" - }, - "value": "Invalid withdraw proof" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7021ea58137dba96e572e94936410b0b0e4cbc344e1ab2ee7f47660768b81ff4", - "typeString": "literal_string \"Invalid withdraw proof\"" - } - ], - "id": 596, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1454:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 605, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1454:66:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 606, - "nodeType": "ExpressionStatement", - "src": "1454:66:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 611, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 607, - "name": "nullifiers", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 469, - "src": "1527:10:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - } - }, - "id": 609, - "indexExpression": { - "argumentTypes": null, - "id": 608, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1538:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1527:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 610, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1551:4:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "1527:28:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 612, - "nodeType": "ExpressionStatement", - "src": "1527:28:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 616, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "1579:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 617, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1595:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1579:19:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 613, - "name": "receiver", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 549, - "src": "1561:8:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 615, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1561:17:2", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 619, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1561:38:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 620, - "nodeType": "ExpressionStatement", - "src": "1561:38:2" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 623, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 621, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1609:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 622, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1615:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1609:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 633, - "nodeType": "IfStatement", - "src": "1605:52:2", - "trueBody": { - "id": 632, - "nodeType": "Block", - "src": "1618:39:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 629, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1646:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 624, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "1626:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 627, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1626:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1626:19:2", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 630, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1626:24:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 631, - "nodeType": "ExpressionStatement", - "src": "1626:24:2" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 635, - "name": "receiver", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 549, - "src": "1676:8:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 636, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1686:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 637, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1697:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 634, - "name": "Withdraw", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 485, - "src": "1667:8:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256,uint256)" - } - }, - "id": 638, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1667:34:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 639, - "nodeType": "EmitStatement", - "src": "1662:39:2" - } - ] - }, - "documentation": null, - "id": 641, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "withdraw", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 546, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 531, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "975:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 528, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "975:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 530, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 529, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "983:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "975:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 537, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "996:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2][2]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 532, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "996:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 534, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1004:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "996:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "id": 536, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1007:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "996:13:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$2_storage_ptr", - "typeString": "uint256[2][2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 541, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "1020:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 538, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1020:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 540, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 539, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1028:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1020:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 545, - "name": "input", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "1041:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4]" - }, - "typeName": { - "baseType": { - "id": 542, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1041:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 544, - "length": { - "argumentTypes": null, - "hexValue": "34", - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1049:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "1041:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_storage_ptr", - "typeString": "uint256[4]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "974:91:2" - }, - "returnParameters": { - "id": 547, - "nodeType": "ParameterList", - "parameters": [], - "src": "1073:0:2" - }, - "scope": 642, - "src": "957:749:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 643, - "src": "295:1413:2" - } - ], - "src": "0:1708:2" - }, - "compiler": { - "name": "solc", - "version": "0.5.8+commit.23d335f2.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-07-09T12:37:28.581Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/contracts/build/contracts/MerkleTreeWithHistory.json b/contracts/build/contracts/MerkleTreeWithHistory.json deleted file mode 100644 index bf27df2..0000000 --- a/contracts/build/contracts/MerkleTreeWithHistory.json +++ /dev/null @@ -1,9765 +0,0 @@ -{ - "contractName": "MerkleTreeWithHistory", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "next_index", - "outputs": [ - { - "name": "", - "type": "uint32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "current_root", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "filled_subtrees", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "roots", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "zeros", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "tree_levels", - "type": "uint8" - }, - { - "name": "zero_value", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "leaf", - "type": "uint256" - }, - { - "indexed": false, - "name": "leaf_index", - "type": "uint32" - } - ], - "name": "LeafAdded", - "type": "event" - }, - { - "constant": true, - "inputs": [ - { - "name": "left", - "type": "uint256" - }, - { - "name": "right", - "type": "uint256" - } - ], - "name": "HashLeftRight", - "outputs": [ - { - "name": "mimc_hash", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getLastRoot", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"left\",\"type\":\"uint256\"},{\"name\":\"right\",\"type\":\"uint256\"}],\"name\":\"HashLeftRight\",\"outputs\":[{\"name\":\"mimc_hash\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"next_index\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"current_root\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"filled_subtrees\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getLastRoot\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"roots\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"zeros\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"tree_levels\",\"type\":\"uint8\"},{\"name\":\"zero_value\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"leaf\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"leaf_index\",\"type\":\"uint32\"}],\"name\":\"LeafAdded\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol\":\"MerkleTreeWithHistory\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol\":{\"keccak256\":\"0x642b31dbef7c34b66cd911042cfc6d5a6821cbf631e87c8b8a9fc4f7a2db7280\",\"urls\":[\"bzzr://0b616b34d1ca9c10f095eb402edc09f3f9d6cc1e4ec37da29f67c2c86d2f964a\"]}},\"version\":1}", - "bytecode": "0x608060405260006002556000600560006101000a81548163ffffffff021916908363ffffffff16021790555034801561003757600080fd5b5060405160408061095e8339810180604052604081101561005757600080fd5b810190808051906020019092919080519060200190929190505050816000806101000a81548160ff021916908360ff1602179055506004819080600181540180825580915050906001820390600052602060002001600090919290919091505550600360046000815481106100c857fe5b906000526020600020015490806001815401808255809150509060018203906000526020600020016000909192909190915055506000600190505b6000809054906101000a900460ff1660ff168160ff1610156101e757600461016b60046001840360ff168154811061013757fe5b906000526020600020015460046001850360ff168154811061015557fe5b90600052602060002001546102bb60201b60201c565b9080600181540180825580915050906001820390600052602060002001600090919290919091505550600360048260ff16815481106101a657fe5b906000526020600020015490806001815401808255809150509060018203906000526020600020016000909192909190915055508080600101915050610103565b50606460ff1660405190808252806020026020018201604052801561021b5781602001602082028038833980820191505090505b5060019080519060200190610231929190610469565b50610298600460016000809054906101000a900460ff160360ff168154811061025657fe5b9060005260206000200154600460016000809054906101000a900460ff160360ff168154811061028257fe5b90600052602060002001546102bb60201b60201c565b60016000815481106102a657fe5b906000526020600020018190555050506104db565b6000807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190506000809050600080905082806102f357fe5b868308915073__MiMC__________________________________633f1a1187838360006040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050604080518083038186803b15801561035757600080fd5b505af415801561036b573d6000803e3d6000fd5b505050506040513d604081101561038157600080fd5b810190808051906020019092919080519060200190929190505050809250819350505082806103ac57fe5b858308915073__MiMC__________________________________633f1a1187838360006040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050604080518083038186803b15801561041057600080fd5b505af4158015610424573d6000803e3d6000fd5b505050506040513d604081101561043a57600080fd5b810190808051906020019092919080519060200190929190505050809250819350505081935050505092915050565b8280548282559060005260206000209081019282156104a5579160200282015b828111156104a4578251825591602001919060010190610489565b5b5090506104b291906104b6565b5090565b6104d891905b808211156104d45760008160009055506001016104bc565b5090565b90565b610474806104ea6000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063a9e5a7f51161005b578063a9e5a7f514610116578063ba70f75714610158578063c2b40ae414610176578063e8295588146101b85761007d565b8063424619c21461008257806365576fab146100ce5780638b145d6d146100f8575b600080fd5b6100b86004803603604081101561009857600080fd5b8101908080359060200190929190803590602001909291905050506101fa565b6040518082815260200191505060405180910390f35b6100d66103a8565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6101006103be565b6040518082815260200191505060405180910390f35b6101426004803603602081101561012c57600080fd5b81019080803590602001909291905050506103c4565b6040518082815260200191505060405180910390f35b6101606103e5565b6040518082815260200191505060405180910390f35b6101a26004803603602081101561018c57600080fd5b8101908080359060200190929190505050610406565b6040518082815260200191505060405180910390f35b6101e4600480360360208110156101ce57600080fd5b8101908080359060200190929190505050610427565b6040518082815260200191505060405180910390f35b6000807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001905060008090506000809050828061023257fe5b868308915073__MiMC__________________________________633f1a1187838360006040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050604080518083038186803b15801561029657600080fd5b505af41580156102aa573d6000803e3d6000fd5b505050506040513d60408110156102c057600080fd5b810190808051906020019092919080519060200190929190505050809250819350505082806102eb57fe5b858308915073__MiMC__________________________________633f1a1187838360006040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050604080518083038186803b15801561034f57600080fd5b505af4158015610363573d6000803e3d6000fd5b505050506040513d604081101561037957600080fd5b810190808051906020019092919080519060200190929190505050809250819350505081935050505092915050565b600560009054906101000a900463ffffffff1681565b60025481565b600381815481106103d157fe5b906000526020600020016000915090505481565b60006001600254815481106103f657fe5b9060005260206000200154905090565b6001818154811061041357fe5b906000526020600020016000915090505481565b6004818154811061043457fe5b90600052602060002001600091509050548156fea165627a7a72305820ceea928cb86b2c5754c8b2a0988aa329ea26eabb70a7fd803aa24baab04c72e80029", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063a9e5a7f51161005b578063a9e5a7f514610116578063ba70f75714610158578063c2b40ae414610176578063e8295588146101b85761007d565b8063424619c21461008257806365576fab146100ce5780638b145d6d146100f8575b600080fd5b6100b86004803603604081101561009857600080fd5b8101908080359060200190929190803590602001909291905050506101fa565b6040518082815260200191505060405180910390f35b6100d66103a8565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6101006103be565b6040518082815260200191505060405180910390f35b6101426004803603602081101561012c57600080fd5b81019080803590602001909291905050506103c4565b6040518082815260200191505060405180910390f35b6101606103e5565b6040518082815260200191505060405180910390f35b6101a26004803603602081101561018c57600080fd5b8101908080359060200190929190505050610406565b6040518082815260200191505060405180910390f35b6101e4600480360360208110156101ce57600080fd5b8101908080359060200190929190505050610427565b6040518082815260200191505060405180910390f35b6000807f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001905060008090506000809050828061023257fe5b868308915073__MiMC__________________________________633f1a1187838360006040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050604080518083038186803b15801561029657600080fd5b505af41580156102aa573d6000803e3d6000fd5b505050506040513d60408110156102c057600080fd5b810190808051906020019092919080519060200190929190505050809250819350505082806102eb57fe5b858308915073__MiMC__________________________________633f1a1187838360006040518463ffffffff1660e01b8152600401808481526020018381526020018281526020019350505050604080518083038186803b15801561034f57600080fd5b505af4158015610363573d6000803e3d6000fd5b505050506040513d604081101561037957600080fd5b810190808051906020019092919080519060200190929190505050809250819350505081935050505092915050565b600560009054906101000a900463ffffffff1681565b60025481565b600381815481106103d157fe5b906000526020600020016000915090505481565b60006001600254815481106103f657fe5b9060005260206000200154905090565b6001818154811061041357fe5b906000526020600020016000915090505481565b6004818154811061043457fe5b90600052602060002001600091509050548156fea165627a7a72305820ceea928cb86b2c5754c8b2a0988aa329ea26eabb70a7fd803aa24baab04c72e80029", - "sourceMap": "155:2357:0:-;;;305:1;275:31;;401:1;374:28;;;;;;;;;;;;;;;;;;;;460:412;8:9:-1;5:2;;;30:1;27;20:12;5:2;460:412:0;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;460:412:0;;;;;;;;;;;;;;;;;;;;;;;;;533:11;524:6;;:20;;;;;;;;;;;;;;;;;;551:5;562:10;551:22;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;551:22:0;;;;;;;;;;;;;;;;;;;;;;579:15;600:5;606:1;600:8;;;;;;;;;;;;;;;;579:30;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;579:30:0;;;;;;;;;;;;;;;;;;;;;;621:7;631:1;621:11;;616:137;638:6;;;;;;;;;;;634:10;;:1;:10;;;616:137;;;659:5;670:37;684:5;692:1;690;:3;684:10;;;;;;;;;;;;;;;;;;696:5;704:1;702;:3;696:10;;;;;;;;;;;;;;;;;;670:13;;;:37;;:::i;:::-;659:49;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;659:49:0;;;;;;;;;;;;;;;;;;;;;;716:15;737:5;743:1;737:8;;;;;;;;;;;;;;;;;;716:30;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;716:30:0;;;;;;;;;;;;;;;;;;;;;;646:3;;;;;;;616:137;;;;242:3;767:32;;;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;767:32:0;;;;759:5;:40;;;;;;;;;;;;:::i;:::-;;816:51;830:5;845:1;836:6;;;;;;;;;;;:10;830:17;;;;;;;;;;;;;;;;;;849:5;864:1;855:6;;;;;;;;;;;:10;849:17;;;;;;;;;;;;;;;;;;816:13;;;:51;;:::i;:::-;805:5;811:1;805:8;;;;;;;;;;;;;;;:62;;;;460:412;;155:2357;;876:387;949:17;974:9;986:77;974:89;;1069:9;1081:1;1069:13;;1088:9;1100:1;1088:13;;1128:1;1112:18;;;;;1122:4;1119:1;1112:18;1108:22;;1145:4;:15;1161:1;1164;1167;1145:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1145:24:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1145:24:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1145:24:0;;;;;;;;;;;;;;;;;;;;;;;;;1136:33;;;;;;;;1197:1;1180:19;;;;;1190:5;1187:1;1180:19;1176:23;;1214:4;:15;1230:1;1233;1236;1214:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1214:24:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1214:24:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1214:24:0;;;;;;;;;;;;;;;;;;;;;;;;;1205:33;;;;;;;;1257:1;1245:13;;876:387;;;;;;;:::o;155:2357::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "155:2357:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;155:2357:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;876:387;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;876:387:0;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;374:28;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;275:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;311:32;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;311:32:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2421:89;;;:::i;:::-;;;;;;;;;;;;;;;;;;;249:22;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;249:22:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;347;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;347:22:0;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;876:387;949:17;974:9;986:77;974:89;;1069:9;1081:1;1069:13;;1088:9;1100:1;1088:13;;1128:1;1112:18;;;;;1122:4;1119:1;1112:18;1108:22;;1145:4;:15;1161:1;1164;1167;1145:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1145:24:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1145:24:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1145:24:0;;;;;;;;;;;;;;;;;;;;;;;;;1136:33;;;;;;;;1197:1;1180:19;;;;;1190:5;1187:1;1180:19;1176:23;;1214:4;:15;1230:1;1233;1236;1214:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1214:24:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1214:24:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1214:24:0;;;;;;;;;;;;;;;;;;;;;;;;;1205:33;;;;;;;;1257:1;1245:13;;876:387;;;;;;;:::o;374:28::-;;;;;;;;;;;;;:::o;275:31::-;;;;:::o;311:32::-;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2421:89::-;2464:7;2486:5;2492:12;;2486:19;;;;;;;;;;;;;;;;2479:26;;2421:89;:::o;249:22::-;;;;;;;;;;;;;;;;;;;;;;;;;:::o;347:::-;;;;;;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity ^0.5.8;\n\nlibrary MiMC {\n function MiMCSponge(uint256 in_xL, uint256 in_xR, uint256 in_k) public pure returns (uint256 xL, uint256 xR);\n}\n\ncontract MerkleTreeWithHistory {\n uint8 levels;\n\n uint8 constant ROOT_HISTORY_SIZE = 100;\n uint256[] public roots;\n uint256 public current_root = 0;\n\n uint256[] public filled_subtrees;\n uint256[] public zeros;\n\n uint32 public next_index = 0;\n\n event LeafAdded(uint256 leaf, uint32 leaf_index);\n\n constructor(uint8 tree_levels, uint256 zero_value) public {\n levels = tree_levels;\n\n zeros.push(zero_value);\n filled_subtrees.push(zeros[0]);\n\n for (uint8 i = 1; i < levels; i++) {\n zeros.push(HashLeftRight(zeros[i-1], zeros[i-1]));\n filled_subtrees.push(zeros[i]);\n }\n\n roots = new uint256[](ROOT_HISTORY_SIZE);\n roots[0] = HashLeftRight(zeros[levels - 1], zeros[levels - 1]);\n }\n\n function HashLeftRight(uint256 left, uint256 right) public pure returns (uint256 mimc_hash) {\n uint256 k = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n uint256 R = 0;\n uint256 C = 0;\n\n R = addmod(R, left, k);\n (R, C) = MiMC.MiMCSponge(R, C, 0);\n\n R = addmod(R, right, k);\n (R, C) = MiMC.MiMCSponge(R, C, 0);\n\n mimc_hash = R;\n }\n\n function insert(uint256 leaf) internal {\n uint32 leaf_index = next_index;\n uint32 current_index = next_index;\n next_index += 1;\n\n uint256 current_level_hash = leaf;\n uint256 left;\n uint256 right;\n\n for (uint8 i = 0; i < levels; i++) {\n if (current_index % 2 == 0) {\n left = current_level_hash;\n right = zeros[i];\n\n filled_subtrees[i] = current_level_hash;\n } else {\n left = filled_subtrees[i];\n right = current_level_hash;\n }\n\n current_level_hash = HashLeftRight(left, right);\n\n current_index /= 2;\n }\n\n current_root = (current_root + 1) % ROOT_HISTORY_SIZE;\n roots[current_root] = current_level_hash;\n\n emit LeafAdded(leaf, leaf_index);\n }\n\n function isKnownRoot(uint _root) internal view returns(bool) {\n if (_root == 0) {\n return false;\n }\n // search most recent first\n uint256 i;\n for(i = current_root; i >= 0; i--) {\n if (_root == roots[i]) {\n return true;\n }\n }\n for(i = ROOT_HISTORY_SIZE - 1; i > current_root; i--) {\n if (_root == roots[i]) {\n return true;\n }\n }\n return false;\n }\n\n function getLastRoot() public view returns(uint256) {\n return roots[current_root];\n }\n}\n\n\n", - "sourcePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "ast": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "exportedSymbols": { - "MerkleTreeWithHistory": [ - 373 - ], - "MiMC": [ - 15 - ] - }, - "id": 374, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".8" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "library", - "documentation": null, - "fullyImplemented": false, - "id": 15, - "linearizedBaseContracts": [ - 15 - ], - "name": "MiMC", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": null, - "id": 14, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "MiMCSponge", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3, - "name": "in_xL", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "62:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "62:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5, - "name": "in_xR", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "77:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "77:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 7, - "name": "in_k", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "92:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "92:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "61:44:0" - }, - "returnParameters": { - "id": 13, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 10, - "name": "xL", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "127:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "127:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 12, - "name": "xR", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "139:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 11, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "126:24:0" - }, - "scope": 15, - "src": "42:109:0", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 374, - "src": "25:128:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 373, - "linearizedBaseContracts": [ - 373 - ], - "name": "MerkleTreeWithHistory", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 17, - "name": "levels", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "190:12:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 16, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "190:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": true, - "id": 20, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "207:38:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 18, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "207:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "313030", - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "242:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_100_by_1", - "typeString": "int_const 100" - }, - "value": "100" - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 23, - "name": "roots", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "249:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 21, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "249:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 22, - "length": null, - "nodeType": "ArrayTypeName", - "src": "249:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 26, - "name": "current_root", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "275:31:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 24, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "275:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 25, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "305:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "constant": false, - "id": 29, - "name": "filled_subtrees", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "311:32:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 27, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "311:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 28, - "length": null, - "nodeType": "ArrayTypeName", - "src": "311:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 32, - "name": "zeros", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "347:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 30, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "347:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 31, - "length": null, - "nodeType": "ArrayTypeName", - "src": "347:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 35, - "name": "next_index", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "374:28:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 33, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "374:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 34, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "401:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 41, - "name": "LeafAdded", - "nodeType": "EventDefinition", - "parameters": { - "id": 40, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 37, - "indexed": false, - "name": "leaf", - "nodeType": "VariableDeclaration", - "scope": 41, - "src": "423:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "423:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "indexed": false, - "name": "leaf_index", - "nodeType": "VariableDeclaration", - "scope": 41, - "src": "437:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 38, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "437:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "422:33:0" - }, - "src": "407:49:0" - }, - { - "body": { - "id": 128, - "nodeType": "Block", - "src": "518:354:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 50, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 48, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "524:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 49, - "name": "tree_levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "533:11:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "524:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 51, - "nodeType": "ExpressionStatement", - "src": "524:20:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 55, - "name": "zero_value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "562:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 52, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "551:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "551:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 56, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "551:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 57, - "nodeType": "ExpressionStatement", - "src": "551:22:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 61, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "600:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 63, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 62, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "606:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "600:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 58, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "579:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 60, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "579:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 64, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "579:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 65, - "nodeType": "ExpressionStatement", - "src": "579:30:0" - }, - { - "body": { - "id": 101, - "nodeType": "Block", - "src": "651:102:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 80, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "684:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 84, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 81, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "690:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 82, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "692:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "690:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "684:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 85, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "696:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 89, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 88, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 86, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "702:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 87, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "704:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "702:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "696:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 79, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "670:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "670:37:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 76, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "659:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 78, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "659:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 91, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "659:49:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 92, - "nodeType": "ExpressionStatement", - "src": "659:49:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 96, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "737:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 98, - "indexExpression": { - "argumentTypes": null, - "id": 97, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "743:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "737:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 93, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "716:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 95, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "716:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 99, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "716:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 100, - "nodeType": "ExpressionStatement", - "src": "716:30:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 72, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 70, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "634:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 71, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "638:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "634:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 102, - "initializationExpression": { - "assignments": [ - 67 - ], - "declarations": [ - { - "constant": false, - "id": 67, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "621:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 66, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "621:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 69, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 68, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "631:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "621:11:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 74, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "646:3:0", - "subExpression": { - "argumentTypes": null, - "id": 73, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "646:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 75, - "nodeType": "ExpressionStatement", - "src": "646:3:0" - }, - "nodeType": "ForStatement", - "src": "616:137:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 103, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "759:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 107, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "781:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "767:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", - "typeString": "function (uint256) pure returns (uint256[] memory)" - }, - "typeName": { - "baseType": { - "id": 104, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "771:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 105, - "length": null, - "nodeType": "ArrayTypeName", - "src": "771:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 108, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "767:32:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "src": "759:40:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 110, - "nodeType": "ExpressionStatement", - "src": "759:40:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 111, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "805:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 113, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 112, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "811:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "805:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 115, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "830:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 119, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 116, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "836:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "845:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "836:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "830:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 120, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "849:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 124, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 123, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 121, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "855:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 122, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "864:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "855:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "849:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 114, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "816:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "816:51:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "805:62:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "805:62:0" - } - ] - }, - "documentation": null, - "id": 129, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 46, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 43, - "name": "tree_levels", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "472:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 42, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "472:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 45, - "name": "zero_value", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "491:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 44, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "491:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "471:39:0" - }, - "returnParameters": { - "id": 47, - "nodeType": "ParameterList", - "parameters": [], - "src": "518:0:0" - }, - "scope": 373, - "src": "460:412:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 192, - "nodeType": "Block", - "src": "968:295:0", - "statements": [ - { - "assignments": [ - 139 - ], - "declarations": [ - { - "constant": false, - "id": 139, - "name": "k", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "974:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 138, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "974:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 141, - "initialValue": { - "argumentTypes": null, - "hexValue": "3231383838323432383731383339323735323232323436343035373435323537323735303838353438333634343030343136303334333433363938323034313836353735383038343935363137", - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "986:77:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_21888242871839275222246405745257275088548364400416034343698204186575808495617_by_1", - "typeString": "int_const 2188...(69 digits omitted)...5617" - }, - "value": "21888242871839275222246405745257275088548364400416034343698204186575808495617" - }, - "nodeType": "VariableDeclarationStatement", - "src": "974:89:0" - }, - { - "assignments": [ - 143 - ], - "declarations": [ - { - "constant": false, - "id": 143, - "name": "R", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "1069:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 142, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1069:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 145, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1081:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1069:13:0" - }, - { - "assignments": [ - 147 - ], - "declarations": [ - { - "constant": false, - "id": 147, - "name": "C", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "1088:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 146, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1088:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 149, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 148, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1100:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1088:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 150, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1108:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 152, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1119:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 153, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 131, - "src": "1122:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 154, - "name": "k", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "1128:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 151, - "name": "addmod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 778, - "src": "1112:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_addmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" - } - }, - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1112:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1108:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 157, - "nodeType": "ExpressionStatement", - "src": "1108:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 167, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 158, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1137:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 159, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1140:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 160, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "1136:6:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 163, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1161:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 164, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1164:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 165, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1167:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "expression": { - "argumentTypes": null, - "id": 161, - "name": "MiMC", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "1145:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_MiMC_$15_$", - "typeString": "type(library MiMC)" - } - }, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "MiMCSponge", - "nodeType": "MemberAccess", - "referencedDeclaration": 14, - "src": "1145:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)" - } - }, - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1145:24:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "src": "1136:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 168, - "nodeType": "ExpressionStatement", - "src": "1136:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 175, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 169, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1176:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 171, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1187:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 172, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "1190:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 173, - "name": "k", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "1197:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 170, - "name": "addmod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 778, - "src": "1180:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_addmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" - } - }, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1180:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1176:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 176, - "nodeType": "ExpressionStatement", - "src": "1176:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 186, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 177, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1206:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 178, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1209:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 179, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "1205:6:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 182, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1230:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 183, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1233:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 184, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1236:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "expression": { - "argumentTypes": null, - "id": 180, - "name": "MiMC", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "1214:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_MiMC_$15_$", - "typeString": "type(library MiMC)" - } - }, - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "MiMCSponge", - "nodeType": "MemberAccess", - "referencedDeclaration": 14, - "src": "1214:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)" - } - }, - "id": 185, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1214:24:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "src": "1205:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 187, - "nodeType": "ExpressionStatement", - "src": "1205:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 188, - "name": "mimc_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 136, - "src": "1245:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 189, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1257:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1245:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 191, - "nodeType": "ExpressionStatement", - "src": "1245:13:0" - } - ] - }, - "documentation": null, - "id": 193, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "HashLeftRight", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 134, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 131, - "name": "left", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "899:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 130, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "899:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 133, - "name": "right", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "913:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 132, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "913:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "898:29:0" - }, - "returnParameters": { - "id": 137, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 136, - "name": "mimc_hash", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "949:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 135, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "949:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "948:19:0" - }, - "scope": 373, - "src": "876:387:0", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 297, - "nodeType": "Block", - "src": "1306:695:0", - "statements": [ - { - "assignments": [ - 199 - ], - "declarations": [ - { - "constant": false, - "id": 199, - "name": "leaf_index", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1312:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 198, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "1312:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 201, - "initialValue": { - "argumentTypes": null, - "id": 200, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1332:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1312:30:0" - }, - { - "assignments": [ - 203 - ], - "declarations": [ - { - "constant": false, - "id": 203, - "name": "current_index", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1348:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 202, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "1348:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 205, - "initialValue": { - "argumentTypes": null, - "id": 204, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1371:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1348:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 206, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1387:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 207, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1401:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1387:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "id": 209, - "nodeType": "ExpressionStatement", - "src": "1387:15:0" - }, - { - "assignments": [ - 211 - ], - "declarations": [ - { - "constant": false, - "id": 211, - "name": "current_level_hash", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1409:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 210, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1409:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 213, - "initialValue": { - "argumentTypes": null, - "id": 212, - "name": "leaf", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 195, - "src": "1438:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1409:33:0" - }, - { - "assignments": [ - 215 - ], - "declarations": [ - { - "constant": false, - "id": 215, - "name": "left", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1448:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 214, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1448:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 216, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "1448:12:0" - }, - { - "assignments": [ - 218 - ], - "declarations": [ - { - "constant": false, - "id": 218, - "name": "right", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1466:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 217, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1466:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 219, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "1466:13:0" - }, - { - "body": { - "id": 275, - "nodeType": "Block", - "src": "1521:331:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 234, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 230, - "name": "current_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 203, - "src": "1533:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1549:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "1533:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1554:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1533:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 262, - "nodeType": "Block", - "src": "1683:80:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 252, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1693:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 253, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "1700:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 255, - "indexExpression": { - "argumentTypes": null, - "id": 254, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1716:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1700:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1693:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 257, - "nodeType": "ExpressionStatement", - "src": "1693:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 260, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 258, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1728:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 259, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1736:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1728:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 261, - "nodeType": "ExpressionStatement", - "src": "1728:26:0" - } - ] - }, - "id": 263, - "nodeType": "IfStatement", - "src": "1529:234:0", - "trueBody": { - "id": 251, - "nodeType": "Block", - "src": "1557:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 237, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 235, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1567:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 236, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1574:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1567:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 238, - "nodeType": "ExpressionStatement", - "src": "1567:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 239, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1602:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 240, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "1610:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 242, - "indexExpression": { - "argumentTypes": null, - "id": 241, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1616:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1610:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1602:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 244, - "nodeType": "ExpressionStatement", - "src": "1602:16:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 245, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "1629:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 247, - "indexExpression": { - "argumentTypes": null, - "id": 246, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1645:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1629:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 248, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1650:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1629:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 250, - "nodeType": "ExpressionStatement", - "src": "1629:39:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 264, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1771:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 266, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1806:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 267, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1812:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 265, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "1792:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 268, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1792:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1771:47:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 270, - "nodeType": "ExpressionStatement", - "src": "1771:47:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 271, - "name": "current_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 203, - "src": "1827:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "Assignment", - "operator": "/=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "32", - "id": 272, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1844:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "1827:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "id": 274, - "nodeType": "ExpressionStatement", - "src": "1827:18:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 226, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 224, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1504:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 225, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "1508:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "1504:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 276, - "initializationExpression": { - "assignments": [ - 221 - ], - "declarations": [ - { - "constant": false, - "id": 221, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 276, - "src": "1491:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 220, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "1491:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 223, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1501:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1491:11:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 228, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "1516:3:0", - "subExpression": { - "argumentTypes": null, - "id": 227, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1516:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 229, - "nodeType": "ExpressionStatement", - "src": "1516:3:0" - }, - "nodeType": "ForStatement", - "src": "1486:366:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 284, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 277, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1858:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 283, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1874:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1889:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1874:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 281, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "1873:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "id": 282, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "1894:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "1873:38:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1858:53:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 285, - "nodeType": "ExpressionStatement", - "src": "1858:53:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 286, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "1917:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 288, - "indexExpression": { - "argumentTypes": null, - "id": 287, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1923:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1917:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 289, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1939:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1917:40:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 291, - "nodeType": "ExpressionStatement", - "src": "1917:40:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 293, - "name": "leaf", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 195, - "src": "1979:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 294, - "name": "leaf_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 199, - "src": "1985:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - ], - "id": 292, - "name": "LeafAdded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 41, - "src": "1969:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint32_$returns$__$", - "typeString": "function (uint256,uint32)" - } - }, - "id": 295, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1969:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 296, - "nodeType": "EmitStatement", - "src": "1964:32:0" - } - ] - }, - "documentation": null, - "id": 298, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "insert", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 196, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 195, - "name": "leaf", - "nodeType": "VariableDeclaration", - "scope": 298, - "src": "1283:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 194, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1283:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1282:14:0" - }, - "returnParameters": { - "id": 197, - "nodeType": "ParameterList", - "parameters": [], - "src": "1306:0:0" - }, - "scope": 373, - "src": "1267:734:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 361, - "nodeType": "Block", - "src": "2066:351:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 305, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2076:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 306, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2085:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2076:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 311, - "nodeType": "IfStatement", - "src": "2072:43:0", - "trueBody": { - "id": 310, - "nodeType": "Block", - "src": "2088:27:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 308, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2103:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 304, - "id": 309, - "nodeType": "Return", - "src": "2096:12:0" - } - ] - } - }, - { - "assignments": [ - 313 - ], - "declarations": [ - { - "constant": false, - "id": 313, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 361, - "src": "2152:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 312, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2152:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 314, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "2152:9:0" - }, - { - "body": { - "id": 334, - "nodeType": "Block", - "src": "2202:67:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 329, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 325, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2214:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 326, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2223:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 328, - "indexExpression": { - "argumentTypes": null, - "id": 327, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2229:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2223:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2214:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 333, - "nodeType": "IfStatement", - "src": "2210:53:0", - "trueBody": { - "id": 332, - "nodeType": "Block", - "src": "2233:30:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2250:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 304, - "id": 331, - "nodeType": "Return", - "src": "2243:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 321, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 319, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2189:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 320, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2194:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2189:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 335, - "initializationExpression": { - "expression": { - "argumentTypes": null, - "id": 317, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 315, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2171:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 316, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2175:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2171:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 318, - "nodeType": "ExpressionStatement", - "src": "2171:16:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 323, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "2197:3:0", - "subExpression": { - "argumentTypes": null, - "id": 322, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2197:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 324, - "nodeType": "ExpressionStatement", - "src": "2197:3:0" - }, - "nodeType": "ForStatement", - "src": "2167:102:0" - }, - { - "body": { - "id": 357, - "nodeType": "Block", - "src": "2328:67:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 352, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 348, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2340:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 349, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2349:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 351, - "indexExpression": { - "argumentTypes": null, - "id": 350, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2355:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2349:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2340:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 356, - "nodeType": "IfStatement", - "src": "2336:53:0", - "trueBody": { - "id": 355, - "nodeType": "Block", - "src": "2359:30:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 353, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2376:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 304, - "id": 354, - "nodeType": "Return", - "src": "2369:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 342, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2305:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 343, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2309:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2305:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 358, - "initializationExpression": { - "expression": { - "argumentTypes": null, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 336, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2278:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 337, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "2282:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 338, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2302:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2282:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "2278:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 341, - "nodeType": "ExpressionStatement", - "src": "2278:25:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 346, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "2323:3:0", - "subExpression": { - "argumentTypes": null, - "id": 345, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2323:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 347, - "nodeType": "ExpressionStatement", - "src": "2323:3:0" - }, - "nodeType": "ForStatement", - "src": "2274:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2407:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 304, - "id": 360, - "nodeType": "Return", - "src": "2400:12:0" - } - ] - }, - "documentation": null, - "id": 362, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "isKnownRoot", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 301, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 300, - "name": "_root", - "nodeType": "VariableDeclaration", - "scope": 362, - "src": "2026:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 299, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2026:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2025:12:0" - }, - "returnParameters": { - "id": 304, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 303, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 362, - "src": "2060:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 302, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2060:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2059:6:0" - }, - "scope": 373, - "src": "2005:412:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 371, - "nodeType": "Block", - "src": "2473:37:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 367, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2486:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 369, - "indexExpression": { - "argumentTypes": null, - "id": 368, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2492:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2486:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 366, - "id": 370, - "nodeType": "Return", - "src": "2479:26:0" - } - ] - }, - "documentation": null, - "id": 372, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getLastRoot", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 363, - "nodeType": "ParameterList", - "parameters": [], - "src": "2441:2:0" - }, - "returnParameters": { - "id": 366, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 365, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 372, - "src": "2464:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 364, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2464:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2463:9:0" - }, - "scope": 373, - "src": "2421:89:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 374, - "src": "155:2357:0" - } - ], - "src": "0:2515:0" - }, - "legacyAST": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "exportedSymbols": { - "MerkleTreeWithHistory": [ - 373 - ], - "MiMC": [ - 15 - ] - }, - "id": 374, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".8" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "library", - "documentation": null, - "fullyImplemented": false, - "id": 15, - "linearizedBaseContracts": [ - 15 - ], - "name": "MiMC", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": null, - "id": 14, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "MiMCSponge", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3, - "name": "in_xL", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "62:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "62:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5, - "name": "in_xR", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "77:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "77:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 7, - "name": "in_k", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "92:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "92:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "61:44:0" - }, - "returnParameters": { - "id": 13, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 10, - "name": "xL", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "127:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "127:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 12, - "name": "xR", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "139:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 11, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "126:24:0" - }, - "scope": 15, - "src": "42:109:0", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 374, - "src": "25:128:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 373, - "linearizedBaseContracts": [ - 373 - ], - "name": "MerkleTreeWithHistory", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 17, - "name": "levels", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "190:12:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 16, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "190:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": true, - "id": 20, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "207:38:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 18, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "207:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "313030", - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "242:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_100_by_1", - "typeString": "int_const 100" - }, - "value": "100" - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 23, - "name": "roots", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "249:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 21, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "249:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 22, - "length": null, - "nodeType": "ArrayTypeName", - "src": "249:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 26, - "name": "current_root", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "275:31:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 24, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "275:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 25, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "305:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "constant": false, - "id": 29, - "name": "filled_subtrees", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "311:32:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 27, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "311:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 28, - "length": null, - "nodeType": "ArrayTypeName", - "src": "311:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 32, - "name": "zeros", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "347:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 30, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "347:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 31, - "length": null, - "nodeType": "ArrayTypeName", - "src": "347:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 35, - "name": "next_index", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "374:28:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 33, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "374:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 34, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "401:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 41, - "name": "LeafAdded", - "nodeType": "EventDefinition", - "parameters": { - "id": 40, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 37, - "indexed": false, - "name": "leaf", - "nodeType": "VariableDeclaration", - "scope": 41, - "src": "423:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "423:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "indexed": false, - "name": "leaf_index", - "nodeType": "VariableDeclaration", - "scope": 41, - "src": "437:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 38, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "437:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "422:33:0" - }, - "src": "407:49:0" - }, - { - "body": { - "id": 128, - "nodeType": "Block", - "src": "518:354:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 50, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 48, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "524:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 49, - "name": "tree_levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "533:11:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "524:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 51, - "nodeType": "ExpressionStatement", - "src": "524:20:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 55, - "name": "zero_value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "562:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 52, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "551:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "551:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 56, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "551:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 57, - "nodeType": "ExpressionStatement", - "src": "551:22:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 61, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "600:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 63, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 62, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "606:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "600:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 58, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "579:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 60, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "579:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 64, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "579:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 65, - "nodeType": "ExpressionStatement", - "src": "579:30:0" - }, - { - "body": { - "id": 101, - "nodeType": "Block", - "src": "651:102:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 80, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "684:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 84, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 81, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "690:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 82, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "692:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "690:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "684:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 85, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "696:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 89, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 88, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 86, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "702:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 87, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "704:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "702:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "696:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 79, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "670:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "670:37:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 76, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "659:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 78, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "659:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 91, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "659:49:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 92, - "nodeType": "ExpressionStatement", - "src": "659:49:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 96, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "737:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 98, - "indexExpression": { - "argumentTypes": null, - "id": 97, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "743:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "737:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 93, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "716:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 95, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "716:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 99, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "716:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 100, - "nodeType": "ExpressionStatement", - "src": "716:30:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 72, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 70, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "634:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 71, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "638:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "634:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 102, - "initializationExpression": { - "assignments": [ - 67 - ], - "declarations": [ - { - "constant": false, - "id": 67, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "621:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 66, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "621:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 69, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 68, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "631:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "621:11:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 74, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "646:3:0", - "subExpression": { - "argumentTypes": null, - "id": 73, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "646:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 75, - "nodeType": "ExpressionStatement", - "src": "646:3:0" - }, - "nodeType": "ForStatement", - "src": "616:137:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 103, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "759:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 107, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "781:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "767:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", - "typeString": "function (uint256) pure returns (uint256[] memory)" - }, - "typeName": { - "baseType": { - "id": 104, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "771:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 105, - "length": null, - "nodeType": "ArrayTypeName", - "src": "771:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 108, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "767:32:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "src": "759:40:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 110, - "nodeType": "ExpressionStatement", - "src": "759:40:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 111, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "805:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 113, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 112, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "811:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "805:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 115, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "830:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 119, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 116, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "836:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "845:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "836:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "830:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 120, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "849:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 124, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 123, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 121, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "855:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 122, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "864:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "855:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "849:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 114, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "816:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "816:51:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "805:62:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "805:62:0" - } - ] - }, - "documentation": null, - "id": 129, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 46, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 43, - "name": "tree_levels", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "472:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 42, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "472:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 45, - "name": "zero_value", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "491:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 44, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "491:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "471:39:0" - }, - "returnParameters": { - "id": 47, - "nodeType": "ParameterList", - "parameters": [], - "src": "518:0:0" - }, - "scope": 373, - "src": "460:412:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 192, - "nodeType": "Block", - "src": "968:295:0", - "statements": [ - { - "assignments": [ - 139 - ], - "declarations": [ - { - "constant": false, - "id": 139, - "name": "k", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "974:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 138, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "974:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 141, - "initialValue": { - "argumentTypes": null, - "hexValue": "3231383838323432383731383339323735323232323436343035373435323537323735303838353438333634343030343136303334333433363938323034313836353735383038343935363137", - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "986:77:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_21888242871839275222246405745257275088548364400416034343698204186575808495617_by_1", - "typeString": "int_const 2188...(69 digits omitted)...5617" - }, - "value": "21888242871839275222246405745257275088548364400416034343698204186575808495617" - }, - "nodeType": "VariableDeclarationStatement", - "src": "974:89:0" - }, - { - "assignments": [ - 143 - ], - "declarations": [ - { - "constant": false, - "id": 143, - "name": "R", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "1069:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 142, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1069:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 145, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1081:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1069:13:0" - }, - { - "assignments": [ - 147 - ], - "declarations": [ - { - "constant": false, - "id": 147, - "name": "C", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "1088:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 146, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1088:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 149, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 148, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1100:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1088:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 150, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1108:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 152, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1119:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 153, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 131, - "src": "1122:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 154, - "name": "k", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "1128:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 151, - "name": "addmod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 778, - "src": "1112:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_addmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" - } - }, - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1112:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1108:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 157, - "nodeType": "ExpressionStatement", - "src": "1108:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 167, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 158, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1137:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 159, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1140:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 160, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "1136:6:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 163, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1161:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 164, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1164:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 165, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1167:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "expression": { - "argumentTypes": null, - "id": 161, - "name": "MiMC", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "1145:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_MiMC_$15_$", - "typeString": "type(library MiMC)" - } - }, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "MiMCSponge", - "nodeType": "MemberAccess", - "referencedDeclaration": 14, - "src": "1145:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)" - } - }, - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1145:24:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "src": "1136:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 168, - "nodeType": "ExpressionStatement", - "src": "1136:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 175, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 169, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1176:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 171, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1187:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 172, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "1190:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 173, - "name": "k", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "1197:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 170, - "name": "addmod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 778, - "src": "1180:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_addmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" - } - }, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1180:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1176:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 176, - "nodeType": "ExpressionStatement", - "src": "1176:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 186, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 177, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1206:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 178, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1209:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 179, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "1205:6:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 182, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1230:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 183, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1233:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 184, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1236:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "expression": { - "argumentTypes": null, - "id": 180, - "name": "MiMC", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "1214:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_MiMC_$15_$", - "typeString": "type(library MiMC)" - } - }, - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "MiMCSponge", - "nodeType": "MemberAccess", - "referencedDeclaration": 14, - "src": "1214:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)" - } - }, - "id": 185, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1214:24:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "src": "1205:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 187, - "nodeType": "ExpressionStatement", - "src": "1205:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 188, - "name": "mimc_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 136, - "src": "1245:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 189, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1257:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1245:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 191, - "nodeType": "ExpressionStatement", - "src": "1245:13:0" - } - ] - }, - "documentation": null, - "id": 193, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "HashLeftRight", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 134, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 131, - "name": "left", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "899:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 130, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "899:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 133, - "name": "right", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "913:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 132, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "913:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "898:29:0" - }, - "returnParameters": { - "id": 137, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 136, - "name": "mimc_hash", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "949:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 135, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "949:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "948:19:0" - }, - "scope": 373, - "src": "876:387:0", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 297, - "nodeType": "Block", - "src": "1306:695:0", - "statements": [ - { - "assignments": [ - 199 - ], - "declarations": [ - { - "constant": false, - "id": 199, - "name": "leaf_index", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1312:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 198, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "1312:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 201, - "initialValue": { - "argumentTypes": null, - "id": 200, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1332:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1312:30:0" - }, - { - "assignments": [ - 203 - ], - "declarations": [ - { - "constant": false, - "id": 203, - "name": "current_index", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1348:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 202, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "1348:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 205, - "initialValue": { - "argumentTypes": null, - "id": 204, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1371:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1348:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 206, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1387:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 207, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1401:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1387:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "id": 209, - "nodeType": "ExpressionStatement", - "src": "1387:15:0" - }, - { - "assignments": [ - 211 - ], - "declarations": [ - { - "constant": false, - "id": 211, - "name": "current_level_hash", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1409:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 210, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1409:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 213, - "initialValue": { - "argumentTypes": null, - "id": 212, - "name": "leaf", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 195, - "src": "1438:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1409:33:0" - }, - { - "assignments": [ - 215 - ], - "declarations": [ - { - "constant": false, - "id": 215, - "name": "left", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1448:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 214, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1448:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 216, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "1448:12:0" - }, - { - "assignments": [ - 218 - ], - "declarations": [ - { - "constant": false, - "id": 218, - "name": "right", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1466:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 217, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1466:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 219, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "1466:13:0" - }, - { - "body": { - "id": 275, - "nodeType": "Block", - "src": "1521:331:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 234, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 230, - "name": "current_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 203, - "src": "1533:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1549:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "1533:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1554:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1533:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 262, - "nodeType": "Block", - "src": "1683:80:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 252, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1693:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 253, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "1700:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 255, - "indexExpression": { - "argumentTypes": null, - "id": 254, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1716:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1700:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1693:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 257, - "nodeType": "ExpressionStatement", - "src": "1693:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 260, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 258, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1728:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 259, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1736:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1728:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 261, - "nodeType": "ExpressionStatement", - "src": "1728:26:0" - } - ] - }, - "id": 263, - "nodeType": "IfStatement", - "src": "1529:234:0", - "trueBody": { - "id": 251, - "nodeType": "Block", - "src": "1557:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 237, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 235, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1567:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 236, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1574:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1567:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 238, - "nodeType": "ExpressionStatement", - "src": "1567:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 239, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1602:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 240, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "1610:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 242, - "indexExpression": { - "argumentTypes": null, - "id": 241, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1616:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1610:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1602:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 244, - "nodeType": "ExpressionStatement", - "src": "1602:16:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 245, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "1629:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 247, - "indexExpression": { - "argumentTypes": null, - "id": 246, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1645:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1629:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 248, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1650:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1629:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 250, - "nodeType": "ExpressionStatement", - "src": "1629:39:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 264, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1771:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 266, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1806:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 267, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1812:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 265, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "1792:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 268, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1792:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1771:47:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 270, - "nodeType": "ExpressionStatement", - "src": "1771:47:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 271, - "name": "current_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 203, - "src": "1827:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "Assignment", - "operator": "/=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "32", - "id": 272, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1844:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "1827:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "id": 274, - "nodeType": "ExpressionStatement", - "src": "1827:18:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 226, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 224, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1504:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 225, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "1508:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "1504:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 276, - "initializationExpression": { - "assignments": [ - 221 - ], - "declarations": [ - { - "constant": false, - "id": 221, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 276, - "src": "1491:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 220, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "1491:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 223, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1501:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1491:11:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 228, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "1516:3:0", - "subExpression": { - "argumentTypes": null, - "id": 227, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1516:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 229, - "nodeType": "ExpressionStatement", - "src": "1516:3:0" - }, - "nodeType": "ForStatement", - "src": "1486:366:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 284, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 277, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1858:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 283, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1874:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1889:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1874:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 281, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "1873:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "id": 282, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "1894:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "1873:38:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1858:53:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 285, - "nodeType": "ExpressionStatement", - "src": "1858:53:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 286, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "1917:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 288, - "indexExpression": { - "argumentTypes": null, - "id": 287, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1923:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1917:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 289, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1939:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1917:40:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 291, - "nodeType": "ExpressionStatement", - "src": "1917:40:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 293, - "name": "leaf", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 195, - "src": "1979:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 294, - "name": "leaf_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 199, - "src": "1985:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - ], - "id": 292, - "name": "LeafAdded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 41, - "src": "1969:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint32_$returns$__$", - "typeString": "function (uint256,uint32)" - } - }, - "id": 295, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1969:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 296, - "nodeType": "EmitStatement", - "src": "1964:32:0" - } - ] - }, - "documentation": null, - "id": 298, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "insert", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 196, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 195, - "name": "leaf", - "nodeType": "VariableDeclaration", - "scope": 298, - "src": "1283:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 194, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1283:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1282:14:0" - }, - "returnParameters": { - "id": 197, - "nodeType": "ParameterList", - "parameters": [], - "src": "1306:0:0" - }, - "scope": 373, - "src": "1267:734:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 361, - "nodeType": "Block", - "src": "2066:351:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 305, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2076:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 306, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2085:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2076:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 311, - "nodeType": "IfStatement", - "src": "2072:43:0", - "trueBody": { - "id": 310, - "nodeType": "Block", - "src": "2088:27:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 308, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2103:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 304, - "id": 309, - "nodeType": "Return", - "src": "2096:12:0" - } - ] - } - }, - { - "assignments": [ - 313 - ], - "declarations": [ - { - "constant": false, - "id": 313, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 361, - "src": "2152:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 312, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2152:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 314, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "2152:9:0" - }, - { - "body": { - "id": 334, - "nodeType": "Block", - "src": "2202:67:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 329, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 325, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2214:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 326, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2223:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 328, - "indexExpression": { - "argumentTypes": null, - "id": 327, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2229:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2223:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2214:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 333, - "nodeType": "IfStatement", - "src": "2210:53:0", - "trueBody": { - "id": 332, - "nodeType": "Block", - "src": "2233:30:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2250:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 304, - "id": 331, - "nodeType": "Return", - "src": "2243:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 321, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 319, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2189:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 320, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2194:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2189:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 335, - "initializationExpression": { - "expression": { - "argumentTypes": null, - "id": 317, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 315, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2171:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 316, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2175:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2171:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 318, - "nodeType": "ExpressionStatement", - "src": "2171:16:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 323, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "2197:3:0", - "subExpression": { - "argumentTypes": null, - "id": 322, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2197:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 324, - "nodeType": "ExpressionStatement", - "src": "2197:3:0" - }, - "nodeType": "ForStatement", - "src": "2167:102:0" - }, - { - "body": { - "id": 357, - "nodeType": "Block", - "src": "2328:67:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 352, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 348, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2340:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 349, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2349:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 351, - "indexExpression": { - "argumentTypes": null, - "id": 350, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2355:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2349:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2340:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 356, - "nodeType": "IfStatement", - "src": "2336:53:0", - "trueBody": { - "id": 355, - "nodeType": "Block", - "src": "2359:30:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 353, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2376:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 304, - "id": 354, - "nodeType": "Return", - "src": "2369:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 342, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2305:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 343, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2309:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2305:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 358, - "initializationExpression": { - "expression": { - "argumentTypes": null, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 336, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2278:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 337, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "2282:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 338, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2302:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2282:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "2278:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 341, - "nodeType": "ExpressionStatement", - "src": "2278:25:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 346, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "2323:3:0", - "subExpression": { - "argumentTypes": null, - "id": 345, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2323:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 347, - "nodeType": "ExpressionStatement", - "src": "2323:3:0" - }, - "nodeType": "ForStatement", - "src": "2274:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2407:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 304, - "id": 360, - "nodeType": "Return", - "src": "2400:12:0" - } - ] - }, - "documentation": null, - "id": 362, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "isKnownRoot", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 301, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 300, - "name": "_root", - "nodeType": "VariableDeclaration", - "scope": 362, - "src": "2026:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 299, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2026:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2025:12:0" - }, - "returnParameters": { - "id": 304, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 303, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 362, - "src": "2060:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 302, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2060:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2059:6:0" - }, - "scope": 373, - "src": "2005:412:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 371, - "nodeType": "Block", - "src": "2473:37:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 367, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2486:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 369, - "indexExpression": { - "argumentTypes": null, - "id": 368, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2492:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2486:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 366, - "id": 370, - "nodeType": "Return", - "src": "2479:26:0" - } - ] - }, - "documentation": null, - "id": 372, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getLastRoot", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 363, - "nodeType": "ParameterList", - "parameters": [], - "src": "2441:2:0" - }, - "returnParameters": { - "id": 366, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 365, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 372, - "src": "2464:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 364, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2464:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2463:9:0" - }, - "scope": 373, - "src": "2421:89:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 374, - "src": "155:2357:0" - } - ], - "src": "0:2515:0" - }, - "compiler": { - "name": "solc", - "version": "0.5.8+commit.23d335f2.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-07-09T12:37:28.573Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/contracts/build/contracts/MiMC.json b/contracts/build/contracts/MiMC.json deleted file mode 100644 index e2e0c21..0000000 --- a/contracts/build/contracts/MiMC.json +++ /dev/null @@ -1,9642 +0,0 @@ -{ - "contractName": "MiMC", - "abi": [ - { - "constant": true, - "inputs": [ - { - "name": "in_xL", - "type": "uint256" - }, - { - "name": "in_xR", - "type": "uint256" - }, - { - "name": "in_k", - "type": "uint256" - } - ], - "name": "MiMCSponge", - "outputs": [ - { - "name": "xL", - "type": "uint256" - }, - { - "name": "xR", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"in_xL\",\"type\":\"uint256\"},{\"name\":\"in_xR\",\"type\":\"uint256\"},{\"name\":\"in_k\",\"type\":\"uint256\"}],\"name\":\"MiMCSponge\",\"outputs\":[{\"name\":\"xL\",\"type\":\"uint256\"},{\"name\":\"xR\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol\":\"MiMC\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol\":{\"keccak256\":\"0x642b31dbef7c34b66cd911042cfc6d5a6821cbf631e87c8b8a9fc4f7a2db7280\",\"urls\":[\"bzzr://0b616b34d1ca9c10f095eb402edc09f3f9d6cc1e4ec37da29f67c2c86d2f964a\"]}},\"version\":1}", - "bytecode": "0x", - "deployedBytecode": "0x", - "sourceMap": "", - "deployedSourceMap": "", - "source": "pragma solidity ^0.5.8;\n\nlibrary MiMC {\n function MiMCSponge(uint256 in_xL, uint256 in_xR, uint256 in_k) public pure returns (uint256 xL, uint256 xR);\n}\n\ncontract MerkleTreeWithHistory {\n uint8 levels;\n\n uint8 constant ROOT_HISTORY_SIZE = 100;\n uint256[] public roots;\n uint256 public current_root = 0;\n\n uint256[] public filled_subtrees;\n uint256[] public zeros;\n\n uint32 public next_index = 0;\n\n event LeafAdded(uint256 leaf, uint32 leaf_index);\n\n constructor(uint8 tree_levels, uint256 zero_value) public {\n levels = tree_levels;\n\n zeros.push(zero_value);\n filled_subtrees.push(zeros[0]);\n\n for (uint8 i = 1; i < levels; i++) {\n zeros.push(HashLeftRight(zeros[i-1], zeros[i-1]));\n filled_subtrees.push(zeros[i]);\n }\n\n roots = new uint256[](ROOT_HISTORY_SIZE);\n roots[0] = HashLeftRight(zeros[levels - 1], zeros[levels - 1]);\n }\n\n function HashLeftRight(uint256 left, uint256 right) public pure returns (uint256 mimc_hash) {\n uint256 k = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n uint256 R = 0;\n uint256 C = 0;\n\n R = addmod(R, left, k);\n (R, C) = MiMC.MiMCSponge(R, C, 0);\n\n R = addmod(R, right, k);\n (R, C) = MiMC.MiMCSponge(R, C, 0);\n\n mimc_hash = R;\n }\n\n function insert(uint256 leaf) internal {\n uint32 leaf_index = next_index;\n uint32 current_index = next_index;\n next_index += 1;\n\n uint256 current_level_hash = leaf;\n uint256 left;\n uint256 right;\n\n for (uint8 i = 0; i < levels; i++) {\n if (current_index % 2 == 0) {\n left = current_level_hash;\n right = zeros[i];\n\n filled_subtrees[i] = current_level_hash;\n } else {\n left = filled_subtrees[i];\n right = current_level_hash;\n }\n\n current_level_hash = HashLeftRight(left, right);\n\n current_index /= 2;\n }\n\n current_root = (current_root + 1) % ROOT_HISTORY_SIZE;\n roots[current_root] = current_level_hash;\n\n emit LeafAdded(leaf, leaf_index);\n }\n\n function isKnownRoot(uint _root) internal view returns(bool) {\n if (_root == 0) {\n return false;\n }\n // search most recent first\n uint256 i;\n for(i = current_root; i >= 0; i--) {\n if (_root == roots[i]) {\n return true;\n }\n }\n for(i = ROOT_HISTORY_SIZE - 1; i > current_root; i--) {\n if (_root == roots[i]) {\n return true;\n }\n }\n return false;\n }\n\n function getLastRoot() public view returns(uint256) {\n return roots[current_root];\n }\n}\n\n\n", - "sourcePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "ast": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "exportedSymbols": { - "MerkleTreeWithHistory": [ - 373 - ], - "MiMC": [ - 15 - ] - }, - "id": 374, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".8" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "library", - "documentation": null, - "fullyImplemented": false, - "id": 15, - "linearizedBaseContracts": [ - 15 - ], - "name": "MiMC", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": null, - "id": 14, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "MiMCSponge", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3, - "name": "in_xL", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "62:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "62:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5, - "name": "in_xR", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "77:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "77:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 7, - "name": "in_k", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "92:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "92:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "61:44:0" - }, - "returnParameters": { - "id": 13, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 10, - "name": "xL", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "127:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "127:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 12, - "name": "xR", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "139:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 11, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "126:24:0" - }, - "scope": 15, - "src": "42:109:0", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 374, - "src": "25:128:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 373, - "linearizedBaseContracts": [ - 373 - ], - "name": "MerkleTreeWithHistory", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 17, - "name": "levels", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "190:12:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 16, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "190:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": true, - "id": 20, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "207:38:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 18, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "207:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "313030", - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "242:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_100_by_1", - "typeString": "int_const 100" - }, - "value": "100" - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 23, - "name": "roots", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "249:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 21, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "249:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 22, - "length": null, - "nodeType": "ArrayTypeName", - "src": "249:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 26, - "name": "current_root", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "275:31:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 24, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "275:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 25, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "305:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "constant": false, - "id": 29, - "name": "filled_subtrees", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "311:32:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 27, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "311:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 28, - "length": null, - "nodeType": "ArrayTypeName", - "src": "311:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 32, - "name": "zeros", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "347:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 30, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "347:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 31, - "length": null, - "nodeType": "ArrayTypeName", - "src": "347:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 35, - "name": "next_index", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "374:28:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 33, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "374:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 34, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "401:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 41, - "name": "LeafAdded", - "nodeType": "EventDefinition", - "parameters": { - "id": 40, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 37, - "indexed": false, - "name": "leaf", - "nodeType": "VariableDeclaration", - "scope": 41, - "src": "423:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "423:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "indexed": false, - "name": "leaf_index", - "nodeType": "VariableDeclaration", - "scope": 41, - "src": "437:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 38, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "437:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "422:33:0" - }, - "src": "407:49:0" - }, - { - "body": { - "id": 128, - "nodeType": "Block", - "src": "518:354:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 50, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 48, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "524:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 49, - "name": "tree_levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "533:11:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "524:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 51, - "nodeType": "ExpressionStatement", - "src": "524:20:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 55, - "name": "zero_value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "562:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 52, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "551:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "551:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 56, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "551:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 57, - "nodeType": "ExpressionStatement", - "src": "551:22:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 61, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "600:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 63, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 62, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "606:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "600:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 58, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "579:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 60, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "579:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 64, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "579:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 65, - "nodeType": "ExpressionStatement", - "src": "579:30:0" - }, - { - "body": { - "id": 101, - "nodeType": "Block", - "src": "651:102:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 80, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "684:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 84, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 81, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "690:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 82, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "692:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "690:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "684:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 85, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "696:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 89, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 88, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 86, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "702:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 87, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "704:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "702:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "696:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 79, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "670:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "670:37:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 76, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "659:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 78, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "659:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 91, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "659:49:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 92, - "nodeType": "ExpressionStatement", - "src": "659:49:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 96, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "737:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 98, - "indexExpression": { - "argumentTypes": null, - "id": 97, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "743:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "737:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 93, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "716:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 95, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "716:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 99, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "716:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 100, - "nodeType": "ExpressionStatement", - "src": "716:30:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 72, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 70, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "634:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 71, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "638:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "634:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 102, - "initializationExpression": { - "assignments": [ - 67 - ], - "declarations": [ - { - "constant": false, - "id": 67, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "621:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 66, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "621:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 69, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 68, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "631:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "621:11:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 74, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "646:3:0", - "subExpression": { - "argumentTypes": null, - "id": 73, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "646:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 75, - "nodeType": "ExpressionStatement", - "src": "646:3:0" - }, - "nodeType": "ForStatement", - "src": "616:137:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 103, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "759:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 107, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "781:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "767:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", - "typeString": "function (uint256) pure returns (uint256[] memory)" - }, - "typeName": { - "baseType": { - "id": 104, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "771:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 105, - "length": null, - "nodeType": "ArrayTypeName", - "src": "771:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 108, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "767:32:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "src": "759:40:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 110, - "nodeType": "ExpressionStatement", - "src": "759:40:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 111, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "805:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 113, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 112, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "811:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "805:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 115, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "830:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 119, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 116, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "836:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "845:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "836:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "830:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 120, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "849:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 124, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 123, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 121, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "855:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 122, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "864:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "855:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "849:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 114, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "816:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "816:51:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "805:62:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "805:62:0" - } - ] - }, - "documentation": null, - "id": 129, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 46, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 43, - "name": "tree_levels", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "472:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 42, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "472:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 45, - "name": "zero_value", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "491:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 44, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "491:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "471:39:0" - }, - "returnParameters": { - "id": 47, - "nodeType": "ParameterList", - "parameters": [], - "src": "518:0:0" - }, - "scope": 373, - "src": "460:412:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 192, - "nodeType": "Block", - "src": "968:295:0", - "statements": [ - { - "assignments": [ - 139 - ], - "declarations": [ - { - "constant": false, - "id": 139, - "name": "k", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "974:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 138, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "974:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 141, - "initialValue": { - "argumentTypes": null, - "hexValue": "3231383838323432383731383339323735323232323436343035373435323537323735303838353438333634343030343136303334333433363938323034313836353735383038343935363137", - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "986:77:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_21888242871839275222246405745257275088548364400416034343698204186575808495617_by_1", - "typeString": "int_const 2188...(69 digits omitted)...5617" - }, - "value": "21888242871839275222246405745257275088548364400416034343698204186575808495617" - }, - "nodeType": "VariableDeclarationStatement", - "src": "974:89:0" - }, - { - "assignments": [ - 143 - ], - "declarations": [ - { - "constant": false, - "id": 143, - "name": "R", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "1069:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 142, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1069:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 145, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1081:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1069:13:0" - }, - { - "assignments": [ - 147 - ], - "declarations": [ - { - "constant": false, - "id": 147, - "name": "C", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "1088:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 146, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1088:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 149, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 148, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1100:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1088:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 150, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1108:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 152, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1119:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 153, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 131, - "src": "1122:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 154, - "name": "k", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "1128:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 151, - "name": "addmod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 778, - "src": "1112:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_addmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" - } - }, - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1112:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1108:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 157, - "nodeType": "ExpressionStatement", - "src": "1108:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 167, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 158, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1137:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 159, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1140:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 160, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "1136:6:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 163, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1161:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 164, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1164:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 165, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1167:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "expression": { - "argumentTypes": null, - "id": 161, - "name": "MiMC", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "1145:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_MiMC_$15_$", - "typeString": "type(library MiMC)" - } - }, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "MiMCSponge", - "nodeType": "MemberAccess", - "referencedDeclaration": 14, - "src": "1145:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)" - } - }, - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1145:24:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "src": "1136:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 168, - "nodeType": "ExpressionStatement", - "src": "1136:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 175, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 169, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1176:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 171, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1187:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 172, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "1190:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 173, - "name": "k", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "1197:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 170, - "name": "addmod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 778, - "src": "1180:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_addmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" - } - }, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1180:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1176:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 176, - "nodeType": "ExpressionStatement", - "src": "1176:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 186, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 177, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1206:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 178, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1209:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 179, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "1205:6:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 182, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1230:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 183, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1233:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 184, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1236:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "expression": { - "argumentTypes": null, - "id": 180, - "name": "MiMC", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "1214:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_MiMC_$15_$", - "typeString": "type(library MiMC)" - } - }, - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "MiMCSponge", - "nodeType": "MemberAccess", - "referencedDeclaration": 14, - "src": "1214:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)" - } - }, - "id": 185, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1214:24:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "src": "1205:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 187, - "nodeType": "ExpressionStatement", - "src": "1205:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 188, - "name": "mimc_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 136, - "src": "1245:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 189, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1257:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1245:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 191, - "nodeType": "ExpressionStatement", - "src": "1245:13:0" - } - ] - }, - "documentation": null, - "id": 193, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "HashLeftRight", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 134, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 131, - "name": "left", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "899:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 130, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "899:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 133, - "name": "right", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "913:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 132, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "913:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "898:29:0" - }, - "returnParameters": { - "id": 137, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 136, - "name": "mimc_hash", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "949:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 135, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "949:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "948:19:0" - }, - "scope": 373, - "src": "876:387:0", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 297, - "nodeType": "Block", - "src": "1306:695:0", - "statements": [ - { - "assignments": [ - 199 - ], - "declarations": [ - { - "constant": false, - "id": 199, - "name": "leaf_index", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1312:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 198, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "1312:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 201, - "initialValue": { - "argumentTypes": null, - "id": 200, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1332:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1312:30:0" - }, - { - "assignments": [ - 203 - ], - "declarations": [ - { - "constant": false, - "id": 203, - "name": "current_index", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1348:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 202, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "1348:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 205, - "initialValue": { - "argumentTypes": null, - "id": 204, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1371:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1348:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 206, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1387:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 207, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1401:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1387:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "id": 209, - "nodeType": "ExpressionStatement", - "src": "1387:15:0" - }, - { - "assignments": [ - 211 - ], - "declarations": [ - { - "constant": false, - "id": 211, - "name": "current_level_hash", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1409:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 210, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1409:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 213, - "initialValue": { - "argumentTypes": null, - "id": 212, - "name": "leaf", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 195, - "src": "1438:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1409:33:0" - }, - { - "assignments": [ - 215 - ], - "declarations": [ - { - "constant": false, - "id": 215, - "name": "left", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1448:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 214, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1448:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 216, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "1448:12:0" - }, - { - "assignments": [ - 218 - ], - "declarations": [ - { - "constant": false, - "id": 218, - "name": "right", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1466:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 217, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1466:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 219, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "1466:13:0" - }, - { - "body": { - "id": 275, - "nodeType": "Block", - "src": "1521:331:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 234, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 230, - "name": "current_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 203, - "src": "1533:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1549:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "1533:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1554:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1533:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 262, - "nodeType": "Block", - "src": "1683:80:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 252, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1693:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 253, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "1700:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 255, - "indexExpression": { - "argumentTypes": null, - "id": 254, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1716:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1700:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1693:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 257, - "nodeType": "ExpressionStatement", - "src": "1693:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 260, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 258, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1728:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 259, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1736:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1728:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 261, - "nodeType": "ExpressionStatement", - "src": "1728:26:0" - } - ] - }, - "id": 263, - "nodeType": "IfStatement", - "src": "1529:234:0", - "trueBody": { - "id": 251, - "nodeType": "Block", - "src": "1557:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 237, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 235, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1567:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 236, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1574:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1567:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 238, - "nodeType": "ExpressionStatement", - "src": "1567:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 239, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1602:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 240, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "1610:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 242, - "indexExpression": { - "argumentTypes": null, - "id": 241, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1616:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1610:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1602:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 244, - "nodeType": "ExpressionStatement", - "src": "1602:16:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 245, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "1629:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 247, - "indexExpression": { - "argumentTypes": null, - "id": 246, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1645:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1629:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 248, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1650:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1629:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 250, - "nodeType": "ExpressionStatement", - "src": "1629:39:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 264, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1771:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 266, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1806:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 267, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1812:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 265, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "1792:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 268, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1792:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1771:47:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 270, - "nodeType": "ExpressionStatement", - "src": "1771:47:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 271, - "name": "current_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 203, - "src": "1827:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "Assignment", - "operator": "/=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "32", - "id": 272, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1844:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "1827:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "id": 274, - "nodeType": "ExpressionStatement", - "src": "1827:18:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 226, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 224, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1504:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 225, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "1508:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "1504:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 276, - "initializationExpression": { - "assignments": [ - 221 - ], - "declarations": [ - { - "constant": false, - "id": 221, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 276, - "src": "1491:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 220, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "1491:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 223, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1501:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1491:11:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 228, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "1516:3:0", - "subExpression": { - "argumentTypes": null, - "id": 227, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1516:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 229, - "nodeType": "ExpressionStatement", - "src": "1516:3:0" - }, - "nodeType": "ForStatement", - "src": "1486:366:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 284, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 277, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1858:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 283, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1874:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1889:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1874:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 281, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "1873:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "id": 282, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "1894:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "1873:38:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1858:53:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 285, - "nodeType": "ExpressionStatement", - "src": "1858:53:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 286, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "1917:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 288, - "indexExpression": { - "argumentTypes": null, - "id": 287, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1923:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1917:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 289, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1939:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1917:40:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 291, - "nodeType": "ExpressionStatement", - "src": "1917:40:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 293, - "name": "leaf", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 195, - "src": "1979:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 294, - "name": "leaf_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 199, - "src": "1985:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - ], - "id": 292, - "name": "LeafAdded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 41, - "src": "1969:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint32_$returns$__$", - "typeString": "function (uint256,uint32)" - } - }, - "id": 295, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1969:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 296, - "nodeType": "EmitStatement", - "src": "1964:32:0" - } - ] - }, - "documentation": null, - "id": 298, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "insert", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 196, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 195, - "name": "leaf", - "nodeType": "VariableDeclaration", - "scope": 298, - "src": "1283:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 194, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1283:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1282:14:0" - }, - "returnParameters": { - "id": 197, - "nodeType": "ParameterList", - "parameters": [], - "src": "1306:0:0" - }, - "scope": 373, - "src": "1267:734:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 361, - "nodeType": "Block", - "src": "2066:351:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 305, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2076:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 306, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2085:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2076:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 311, - "nodeType": "IfStatement", - "src": "2072:43:0", - "trueBody": { - "id": 310, - "nodeType": "Block", - "src": "2088:27:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 308, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2103:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 304, - "id": 309, - "nodeType": "Return", - "src": "2096:12:0" - } - ] - } - }, - { - "assignments": [ - 313 - ], - "declarations": [ - { - "constant": false, - "id": 313, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 361, - "src": "2152:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 312, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2152:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 314, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "2152:9:0" - }, - { - "body": { - "id": 334, - "nodeType": "Block", - "src": "2202:67:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 329, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 325, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2214:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 326, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2223:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 328, - "indexExpression": { - "argumentTypes": null, - "id": 327, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2229:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2223:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2214:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 333, - "nodeType": "IfStatement", - "src": "2210:53:0", - "trueBody": { - "id": 332, - "nodeType": "Block", - "src": "2233:30:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2250:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 304, - "id": 331, - "nodeType": "Return", - "src": "2243:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 321, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 319, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2189:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 320, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2194:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2189:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 335, - "initializationExpression": { - "expression": { - "argumentTypes": null, - "id": 317, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 315, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2171:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 316, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2175:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2171:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 318, - "nodeType": "ExpressionStatement", - "src": "2171:16:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 323, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "2197:3:0", - "subExpression": { - "argumentTypes": null, - "id": 322, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2197:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 324, - "nodeType": "ExpressionStatement", - "src": "2197:3:0" - }, - "nodeType": "ForStatement", - "src": "2167:102:0" - }, - { - "body": { - "id": 357, - "nodeType": "Block", - "src": "2328:67:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 352, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 348, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2340:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 349, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2349:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 351, - "indexExpression": { - "argumentTypes": null, - "id": 350, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2355:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2349:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2340:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 356, - "nodeType": "IfStatement", - "src": "2336:53:0", - "trueBody": { - "id": 355, - "nodeType": "Block", - "src": "2359:30:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 353, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2376:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 304, - "id": 354, - "nodeType": "Return", - "src": "2369:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 342, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2305:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 343, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2309:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2305:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 358, - "initializationExpression": { - "expression": { - "argumentTypes": null, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 336, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2278:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 337, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "2282:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 338, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2302:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2282:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "2278:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 341, - "nodeType": "ExpressionStatement", - "src": "2278:25:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 346, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "2323:3:0", - "subExpression": { - "argumentTypes": null, - "id": 345, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2323:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 347, - "nodeType": "ExpressionStatement", - "src": "2323:3:0" - }, - "nodeType": "ForStatement", - "src": "2274:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2407:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 304, - "id": 360, - "nodeType": "Return", - "src": "2400:12:0" - } - ] - }, - "documentation": null, - "id": 362, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "isKnownRoot", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 301, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 300, - "name": "_root", - "nodeType": "VariableDeclaration", - "scope": 362, - "src": "2026:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 299, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2026:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2025:12:0" - }, - "returnParameters": { - "id": 304, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 303, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 362, - "src": "2060:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 302, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2060:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2059:6:0" - }, - "scope": 373, - "src": "2005:412:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 371, - "nodeType": "Block", - "src": "2473:37:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 367, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2486:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 369, - "indexExpression": { - "argumentTypes": null, - "id": 368, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2492:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2486:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 366, - "id": 370, - "nodeType": "Return", - "src": "2479:26:0" - } - ] - }, - "documentation": null, - "id": 372, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getLastRoot", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 363, - "nodeType": "ParameterList", - "parameters": [], - "src": "2441:2:0" - }, - "returnParameters": { - "id": 366, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 365, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 372, - "src": "2464:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 364, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2464:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2463:9:0" - }, - "scope": 373, - "src": "2421:89:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 374, - "src": "155:2357:0" - } - ], - "src": "0:2515:0" - }, - "legacyAST": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "exportedSymbols": { - "MerkleTreeWithHistory": [ - 373 - ], - "MiMC": [ - 15 - ] - }, - "id": 374, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.5", - ".8" - ], - "nodeType": "PragmaDirective", - "src": "0:23:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "library", - "documentation": null, - "fullyImplemented": false, - "id": 15, - "linearizedBaseContracts": [ - 15 - ], - "name": "MiMC", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": null, - "id": 14, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "MiMCSponge", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 8, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3, - "name": "in_xL", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "62:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "62:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5, - "name": "in_xR", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "77:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "77:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 7, - "name": "in_k", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "92:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 6, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "92:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "61:44:0" - }, - "returnParameters": { - "id": 13, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 10, - "name": "xL", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "127:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 9, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "127:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 12, - "name": "xR", - "nodeType": "VariableDeclaration", - "scope": 14, - "src": "139:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 11, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "126:24:0" - }, - "scope": 15, - "src": "42:109:0", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 374, - "src": "25:128:0" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 373, - "linearizedBaseContracts": [ - 373 - ], - "name": "MerkleTreeWithHistory", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 17, - "name": "levels", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "190:12:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 16, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "190:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": true, - "id": 20, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "207:38:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 18, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "207:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "313030", - "id": 19, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "242:3:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_100_by_1", - "typeString": "int_const 100" - }, - "value": "100" - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 23, - "name": "roots", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "249:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 21, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "249:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 22, - "length": null, - "nodeType": "ArrayTypeName", - "src": "249:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 26, - "name": "current_root", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "275:31:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 24, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "275:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 25, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "305:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "constant": false, - "id": 29, - "name": "filled_subtrees", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "311:32:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 27, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "311:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 28, - "length": null, - "nodeType": "ArrayTypeName", - "src": "311:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 32, - "name": "zeros", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "347:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 30, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "347:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 31, - "length": null, - "nodeType": "ArrayTypeName", - "src": "347:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 35, - "name": "next_index", - "nodeType": "VariableDeclaration", - "scope": 373, - "src": "374:28:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 33, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "374:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 34, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "401:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 41, - "name": "LeafAdded", - "nodeType": "EventDefinition", - "parameters": { - "id": 40, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 37, - "indexed": false, - "name": "leaf", - "nodeType": "VariableDeclaration", - "scope": 41, - "src": "423:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 36, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "423:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 39, - "indexed": false, - "name": "leaf_index", - "nodeType": "VariableDeclaration", - "scope": 41, - "src": "437:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 38, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "437:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "422:33:0" - }, - "src": "407:49:0" - }, - { - "body": { - "id": 128, - "nodeType": "Block", - "src": "518:354:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 50, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 48, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "524:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 49, - "name": "tree_levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 43, - "src": "533:11:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "524:20:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 51, - "nodeType": "ExpressionStatement", - "src": "524:20:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 55, - "name": "zero_value", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 45, - "src": "562:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 52, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "551:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 54, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "551:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 56, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "551:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 57, - "nodeType": "ExpressionStatement", - "src": "551:22:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 61, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "600:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 63, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 62, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "606:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "600:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 58, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "579:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 60, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "579:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 64, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "579:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 65, - "nodeType": "ExpressionStatement", - "src": "579:30:0" - }, - { - "body": { - "id": 101, - "nodeType": "Block", - "src": "651:102:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 80, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "684:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 84, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 81, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "690:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 82, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "692:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "690:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "684:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 85, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "696:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 89, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 88, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 86, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "702:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 87, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "704:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "702:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "696:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 79, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "670:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "670:37:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 76, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "659:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 78, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "659:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 91, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "659:49:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 92, - "nodeType": "ExpressionStatement", - "src": "659:49:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 96, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "737:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 98, - "indexExpression": { - "argumentTypes": null, - "id": 97, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "743:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "737:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 93, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "716:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 95, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "716:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 99, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "716:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 100, - "nodeType": "ExpressionStatement", - "src": "716:30:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 72, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 70, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "634:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 71, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "638:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "634:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 102, - "initializationExpression": { - "assignments": [ - 67 - ], - "declarations": [ - { - "constant": false, - "id": 67, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "621:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 66, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "621:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 69, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 68, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "631:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "621:11:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 74, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "646:3:0", - "subExpression": { - "argumentTypes": null, - "id": 73, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 67, - "src": "646:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 75, - "nodeType": "ExpressionStatement", - "src": "646:3:0" - }, - "nodeType": "ForStatement", - "src": "616:137:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 103, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "759:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 107, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "781:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "767:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", - "typeString": "function (uint256) pure returns (uint256[] memory)" - }, - "typeName": { - "baseType": { - "id": 104, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "771:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 105, - "length": null, - "nodeType": "ArrayTypeName", - "src": "771:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 108, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "767:32:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "src": "759:40:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 110, - "nodeType": "ExpressionStatement", - "src": "759:40:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 111, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "805:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 113, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 112, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "811:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "805:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 115, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "830:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 119, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 116, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "836:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 117, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "845:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "836:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "830:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 120, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "849:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 124, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 123, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 121, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "855:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 122, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "864:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "855:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "849:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 114, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "816:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "816:51:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "805:62:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 127, - "nodeType": "ExpressionStatement", - "src": "805:62:0" - } - ] - }, - "documentation": null, - "id": 129, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 46, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 43, - "name": "tree_levels", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "472:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 42, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "472:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 45, - "name": "zero_value", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "491:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 44, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "491:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "471:39:0" - }, - "returnParameters": { - "id": 47, - "nodeType": "ParameterList", - "parameters": [], - "src": "518:0:0" - }, - "scope": 373, - "src": "460:412:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 192, - "nodeType": "Block", - "src": "968:295:0", - "statements": [ - { - "assignments": [ - 139 - ], - "declarations": [ - { - "constant": false, - "id": 139, - "name": "k", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "974:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 138, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "974:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 141, - "initialValue": { - "argumentTypes": null, - "hexValue": "3231383838323432383731383339323735323232323436343035373435323537323735303838353438333634343030343136303334333433363938323034313836353735383038343935363137", - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "986:77:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_21888242871839275222246405745257275088548364400416034343698204186575808495617_by_1", - "typeString": "int_const 2188...(69 digits omitted)...5617" - }, - "value": "21888242871839275222246405745257275088548364400416034343698204186575808495617" - }, - "nodeType": "VariableDeclarationStatement", - "src": "974:89:0" - }, - { - "assignments": [ - 143 - ], - "declarations": [ - { - "constant": false, - "id": 143, - "name": "R", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "1069:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 142, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1069:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 145, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 144, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1081:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1069:13:0" - }, - { - "assignments": [ - 147 - ], - "declarations": [ - { - "constant": false, - "id": 147, - "name": "C", - "nodeType": "VariableDeclaration", - "scope": 192, - "src": "1088:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 146, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1088:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 149, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 148, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1100:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1088:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 156, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 150, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1108:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 152, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1119:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 153, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 131, - "src": "1122:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 154, - "name": "k", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "1128:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 151, - "name": "addmod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 778, - "src": "1112:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_addmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" - } - }, - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1112:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1108:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 157, - "nodeType": "ExpressionStatement", - "src": "1108:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 167, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 158, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1137:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 159, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1140:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 160, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "1136:6:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 163, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1161:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 164, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1164:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 165, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1167:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "expression": { - "argumentTypes": null, - "id": 161, - "name": "MiMC", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "1145:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_MiMC_$15_$", - "typeString": "type(library MiMC)" - } - }, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "MiMCSponge", - "nodeType": "MemberAccess", - "referencedDeclaration": 14, - "src": "1145:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)" - } - }, - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1145:24:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "src": "1136:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 168, - "nodeType": "ExpressionStatement", - "src": "1136:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 175, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 169, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1176:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 171, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1187:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 172, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "1190:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 173, - "name": "k", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "1197:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 170, - "name": "addmod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 778, - "src": "1180:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_addmod_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256)" - } - }, - "id": 174, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1180:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1176:23:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 176, - "nodeType": "ExpressionStatement", - "src": "1176:23:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 186, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 177, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1206:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 178, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1209:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 179, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "1205:6:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 182, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1230:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 183, - "name": "C", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 147, - "src": "1233:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 184, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1236:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "expression": { - "argumentTypes": null, - "id": 180, - "name": "MiMC", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 15, - "src": "1214:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_MiMC_$15_$", - "typeString": "type(library MiMC)" - } - }, - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "MiMCSponge", - "nodeType": "MemberAccess", - "referencedDeclaration": 14, - "src": "1214:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_delegatecall_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$_t_uint256_$", - "typeString": "function (uint256,uint256,uint256) pure returns (uint256,uint256)" - } - }, - "id": 185, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1214:24:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "src": "1205:33:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 187, - "nodeType": "ExpressionStatement", - "src": "1205:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 188, - "name": "mimc_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 136, - "src": "1245:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 189, - "name": "R", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 143, - "src": "1257:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1245:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 191, - "nodeType": "ExpressionStatement", - "src": "1245:13:0" - } - ] - }, - "documentation": null, - "id": 193, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "HashLeftRight", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 134, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 131, - "name": "left", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "899:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 130, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "899:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 133, - "name": "right", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "913:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 132, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "913:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "898:29:0" - }, - "returnParameters": { - "id": 137, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 136, - "name": "mimc_hash", - "nodeType": "VariableDeclaration", - "scope": 193, - "src": "949:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 135, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "949:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "948:19:0" - }, - "scope": 373, - "src": "876:387:0", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 297, - "nodeType": "Block", - "src": "1306:695:0", - "statements": [ - { - "assignments": [ - 199 - ], - "declarations": [ - { - "constant": false, - "id": 199, - "name": "leaf_index", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1312:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 198, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "1312:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 201, - "initialValue": { - "argumentTypes": null, - "id": 200, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1332:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1312:30:0" - }, - { - "assignments": [ - 203 - ], - "declarations": [ - { - "constant": false, - "id": 203, - "name": "current_index", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1348:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "typeName": { - "id": 202, - "name": "uint32", - "nodeType": "ElementaryTypeName", - "src": "1348:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 205, - "initialValue": { - "argumentTypes": null, - "id": 204, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1371:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1348:33:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 206, - "name": "next_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 35, - "src": "1387:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 207, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1401:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1387:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "id": 209, - "nodeType": "ExpressionStatement", - "src": "1387:15:0" - }, - { - "assignments": [ - 211 - ], - "declarations": [ - { - "constant": false, - "id": 211, - "name": "current_level_hash", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1409:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 210, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1409:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 213, - "initialValue": { - "argumentTypes": null, - "id": 212, - "name": "leaf", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 195, - "src": "1438:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1409:33:0" - }, - { - "assignments": [ - 215 - ], - "declarations": [ - { - "constant": false, - "id": 215, - "name": "left", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1448:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 214, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1448:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 216, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "1448:12:0" - }, - { - "assignments": [ - 218 - ], - "declarations": [ - { - "constant": false, - "id": 218, - "name": "right", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "1466:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 217, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1466:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 219, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "1466:13:0" - }, - { - "body": { - "id": 275, - "nodeType": "Block", - "src": "1521:331:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 234, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - }, - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 230, - "name": "current_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 203, - "src": "1533:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1549:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "1533:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1554:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1533:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 262, - "nodeType": "Block", - "src": "1683:80:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 252, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1693:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 253, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "1700:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 255, - "indexExpression": { - "argumentTypes": null, - "id": 254, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1716:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1700:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1693:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 257, - "nodeType": "ExpressionStatement", - "src": "1693:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 260, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 258, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1728:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 259, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1736:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1728:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 261, - "nodeType": "ExpressionStatement", - "src": "1728:26:0" - } - ] - }, - "id": 263, - "nodeType": "IfStatement", - "src": "1529:234:0", - "trueBody": { - "id": 251, - "nodeType": "Block", - "src": "1557:120:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 237, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 235, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1567:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 236, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1574:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1567:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 238, - "nodeType": "ExpressionStatement", - "src": "1567:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 239, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1602:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 240, - "name": "zeros", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 32, - "src": "1610:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 242, - "indexExpression": { - "argumentTypes": null, - "id": 241, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1616:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1610:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1602:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 244, - "nodeType": "ExpressionStatement", - "src": "1602:16:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 245, - "name": "filled_subtrees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 29, - "src": "1629:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 247, - "indexExpression": { - "argumentTypes": null, - "id": 246, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1645:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1629:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 248, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1650:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1629:39:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 250, - "nodeType": "ExpressionStatement", - "src": "1629:39:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 264, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1771:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 266, - "name": "left", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1806:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 267, - "name": "right", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 218, - "src": "1812:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 265, - "name": "HashLeftRight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "1792:13:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 268, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1792:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1771:47:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 270, - "nodeType": "ExpressionStatement", - "src": "1771:47:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 271, - "name": "current_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 203, - "src": "1827:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "nodeType": "Assignment", - "operator": "/=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "32", - "id": 272, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1844:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "1827:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - }, - "id": 274, - "nodeType": "ExpressionStatement", - "src": "1827:18:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 226, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 224, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1504:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 225, - "name": "levels", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 17, - "src": "1508:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "1504:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 276, - "initializationExpression": { - "assignments": [ - 221 - ], - "declarations": [ - { - "constant": false, - "id": 221, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 276, - "src": "1491:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 220, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "1491:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 223, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1501:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "1491:11:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 228, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "1516:3:0", - "subExpression": { - "argumentTypes": null, - "id": 227, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "1516:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 229, - "nodeType": "ExpressionStatement", - "src": "1516:3:0" - }, - "nodeType": "ForStatement", - "src": "1486:366:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 284, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 277, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1858:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 283, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1874:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1889:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1874:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 281, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "1873:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "id": 282, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "1894:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "1873:38:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1858:53:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 285, - "nodeType": "ExpressionStatement", - "src": "1858:53:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 286, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "1917:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 288, - "indexExpression": { - "argumentTypes": null, - "id": 287, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "1923:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1917:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 289, - "name": "current_level_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 211, - "src": "1939:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1917:40:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 291, - "nodeType": "ExpressionStatement", - "src": "1917:40:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 293, - "name": "leaf", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 195, - "src": "1979:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 294, - "name": "leaf_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 199, - "src": "1985:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint32", - "typeString": "uint32" - } - ], - "id": 292, - "name": "LeafAdded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 41, - "src": "1969:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint32_$returns$__$", - "typeString": "function (uint256,uint32)" - } - }, - "id": 295, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1969:27:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 296, - "nodeType": "EmitStatement", - "src": "1964:32:0" - } - ] - }, - "documentation": null, - "id": 298, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "insert", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 196, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 195, - "name": "leaf", - "nodeType": "VariableDeclaration", - "scope": 298, - "src": "1283:12:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 194, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1283:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1282:14:0" - }, - "returnParameters": { - "id": 197, - "nodeType": "ParameterList", - "parameters": [], - "src": "1306:0:0" - }, - "scope": 373, - "src": "1267:734:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 361, - "nodeType": "Block", - "src": "2066:351:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 305, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2076:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 306, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2085:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2076:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 311, - "nodeType": "IfStatement", - "src": "2072:43:0", - "trueBody": { - "id": 310, - "nodeType": "Block", - "src": "2088:27:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 308, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2103:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 304, - "id": 309, - "nodeType": "Return", - "src": "2096:12:0" - } - ] - } - }, - { - "assignments": [ - 313 - ], - "declarations": [ - { - "constant": false, - "id": 313, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 361, - "src": "2152:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 312, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2152:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 314, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "2152:9:0" - }, - { - "body": { - "id": 334, - "nodeType": "Block", - "src": "2202:67:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 329, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 325, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2214:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 326, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2223:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 328, - "indexExpression": { - "argumentTypes": null, - "id": 327, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2229:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2223:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2214:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 333, - "nodeType": "IfStatement", - "src": "2210:53:0", - "trueBody": { - "id": 332, - "nodeType": "Block", - "src": "2233:30:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2250:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 304, - "id": 331, - "nodeType": "Return", - "src": "2243:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 321, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 319, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2189:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 320, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2194:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2189:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 335, - "initializationExpression": { - "expression": { - "argumentTypes": null, - "id": 317, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 315, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2171:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 316, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2175:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2171:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 318, - "nodeType": "ExpressionStatement", - "src": "2171:16:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 323, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "2197:3:0", - "subExpression": { - "argumentTypes": null, - "id": 322, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2197:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 324, - "nodeType": "ExpressionStatement", - "src": "2197:3:0" - }, - "nodeType": "ForStatement", - "src": "2167:102:0" - }, - { - "body": { - "id": 357, - "nodeType": "Block", - "src": "2328:67:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 352, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 348, - "name": "_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "2340:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 349, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2349:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 351, - "indexExpression": { - "argumentTypes": null, - "id": 350, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2355:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2349:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2340:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 356, - "nodeType": "IfStatement", - "src": "2336:53:0", - "trueBody": { - "id": 355, - "nodeType": "Block", - "src": "2359:30:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 353, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2376:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 304, - "id": 354, - "nodeType": "Return", - "src": "2369:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 342, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2305:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 343, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2309:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2305:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 358, - "initializationExpression": { - "expression": { - "argumentTypes": null, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 336, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2278:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 337, - "name": "ROOT_HISTORY_SIZE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "2282:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 338, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2302:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2282:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "2278:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 341, - "nodeType": "ExpressionStatement", - "src": "2278:25:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 346, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "--", - "prefix": false, - "src": "2323:3:0", - "subExpression": { - "argumentTypes": null, - "id": 345, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 313, - "src": "2323:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 347, - "nodeType": "ExpressionStatement", - "src": "2323:3:0" - }, - "nodeType": "ForStatement", - "src": "2274:121:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2407:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 304, - "id": 360, - "nodeType": "Return", - "src": "2400:12:0" - } - ] - }, - "documentation": null, - "id": 362, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "isKnownRoot", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 301, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 300, - "name": "_root", - "nodeType": "VariableDeclaration", - "scope": 362, - "src": "2026:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 299, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2026:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2025:12:0" - }, - "returnParameters": { - "id": 304, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 303, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 362, - "src": "2060:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 302, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2060:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2059:6:0" - }, - "scope": 373, - "src": "2005:412:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 371, - "nodeType": "Block", - "src": "2473:37:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 367, - "name": "roots", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23, - "src": "2486:5:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 369, - "indexExpression": { - "argumentTypes": null, - "id": 368, - "name": "current_root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 26, - "src": "2492:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2486:19:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 366, - "id": 370, - "nodeType": "Return", - "src": "2479:26:0" - } - ] - }, - "documentation": null, - "id": 372, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getLastRoot", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 363, - "nodeType": "ParameterList", - "parameters": [], - "src": "2441:2:0" - }, - "returnParameters": { - "id": 366, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 365, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 372, - "src": "2464:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 364, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2464:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2463:9:0" - }, - "scope": 373, - "src": "2421:89:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 374, - "src": "155:2357:0" - } - ], - "src": "0:2515:0" - }, - "compiler": { - "name": "solc", - "version": "0.5.8+commit.23d335f2.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-07-09T12:37:28.577Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/contracts/build/contracts/Migrations.json b/contracts/build/contracts/Migrations.json deleted file mode 100644 index e652c70..0000000 --- a/contracts/build/contracts/Migrations.json +++ /dev/null @@ -1,1385 +0,0 @@ -{ - "contractName": "Migrations", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "last_completed_migration", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "constant": false, - "inputs": [ - { - "name": "completed", - "type": "uint256" - } - ], - "name": "setCompleted", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "new_address", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"new_address\",\"type\":\"address\"}],\"name\":\"upgrade\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/poma/dev/mixer/contracts/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/poma/dev/mixer/contracts/contracts/Migrations.sol\":{\"keccak256\":\"0xfdb731592344e2a2890faf03baec7b4bee7057ffba18ba6dbb6eec8db85f8f4c\",\"urls\":[\"bzzr://ddc8801d0a2a7220c2c9bf3881b4921817e72fdd96827ec8be4428fa009ace07\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102ae806100606000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100955780638da5cb5b146100b3578063fdacd576146100fd575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061012b565b005b61009d6101f7565b6040518082815260200191505060405180910390f35b6100bb6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101296004803603602081101561011357600080fd5b8101908080359060200190929190505050610222565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101f45760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101da57600080fd5b505af11580156101ee573d6000803e3d6000fd5b50505050505b50565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561027f57806001819055505b5056fea165627a7a7230582065be3761050587424fd2d5f0e9df332753191f270472bb1cd3df30edda3faef40029", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100955780638da5cb5b146100b3578063fdacd576146100fd575b600080fd5b6100936004803603602081101561006757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061012b565b005b61009d6101f7565b6040518082815260200191505060405180910390f35b6100bb6101fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101296004803603602081101561011357600080fd5b8101908080359060200190929190505050610222565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101f45760008190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156101da57600080fd5b505af11580156101ee573d6000803e3d6000fd5b50505050505b50565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561027f57806001819055505b5056fea165627a7a7230582065be3761050587424fd2d5f0e9df332753191f270472bb1cd3df30edda3faef40029", - "sourceMap": "34:480:1:-;;;123:50;8:9:-1;5:2;;;30:1;27;20:12;5:2;123:50:1;158:10;150:5;;:18;;;;;;;;;;;;;;;;;;34:480;;;;;;", - "deployedSourceMap": "34:480:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;34:480:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;347:165;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;347:165:1;;;;;;;;;;;;;;;;;;;:::i;:::-;;82:36;;;:::i;:::-;;;;;;;;;;;;;;;;;;;58:20;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;240:103;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;240:103:1;;;;;;;;;;;;;;;;;:::i;:::-;;347:165;223:5;;;;;;;;;;;209:19;;:10;:19;;;205:26;;;409:19;442:11;409:45;;460:8;:21;;;482:24;;460:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;460:47:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;460:47:1;;;;230:1;205:26;347:165;:::o;82:36::-;;;;:::o;58:20::-;;;;;;;;;;;;;:::o;240:103::-;223:5;;;;;;;;;;;209:19;;:10;:19;;;205:26;;;329:9;302:24;:36;;;;205:26;240:103;:::o", - "source": "pragma solidity >=0.4.21 <0.6.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n constructor() public {\n owner = msg.sender;\n }\n\n modifier restricted() {\n if (msg.sender == owner) _;\n }\n\n function setCompleted(uint completed) public restricted {\n last_completed_migration = completed;\n }\n\n function upgrade(address new_address) public restricted {\n Migrations upgraded = Migrations(new_address);\n upgraded.setCompleted(last_completed_migration);\n }\n}\n", - "sourcePath": "/Users/poma/dev/mixer/contracts/contracts/Migrations.sol", - "ast": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/Migrations.sol", - "exportedSymbols": { - "Migrations": [ - 430 - ] - }, - "id": 431, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 375, - "literals": [ - "solidity", - ">=", - "0.4", - ".21", - "<", - "0.6", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:32:1" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 430, - "linearizedBaseContracts": [ - 430 - ], - "name": "Migrations", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 377, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 430, - "src": "58:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 376, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "58:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 379, - "name": "last_completed_migration", - "nodeType": "VariableDeclaration", - "scope": 430, - "src": "82:36:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 378, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "82:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 387, - "nodeType": "Block", - "src": "144:29:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 385, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 382, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 377, - "src": "150:5:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 383, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "158:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 384, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "158:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "150:18:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 386, - "nodeType": "ExpressionStatement", - "src": "150:18:1" - } - ] - }, - "documentation": null, - "id": 388, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 380, - "nodeType": "ParameterList", - "parameters": [], - "src": "134:2:1" - }, - "returnParameters": { - "id": 381, - "nodeType": "ParameterList", - "parameters": [], - "src": "144:0:1" - }, - "scope": 430, - "src": "123:50:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 396, - "nodeType": "Block", - "src": "199:37:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 393, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 390, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "209:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 391, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "209:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 392, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 377, - "src": "223:5:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "209:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 395, - "nodeType": "IfStatement", - "src": "205:26:1", - "trueBody": { - "id": 394, - "nodeType": "PlaceholderStatement", - "src": "230:1:1" - } - } - ] - }, - "documentation": null, - "id": 397, - "name": "restricted", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 389, - "nodeType": "ParameterList", - "parameters": [], - "src": "196:2:1" - }, - "src": "177:59:1", - "visibility": "internal" - }, - { - "body": { - "id": 408, - "nodeType": "Block", - "src": "296:47:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 406, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 404, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 379, - "src": "302:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 405, - "name": "completed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 399, - "src": "329:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "302:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 407, - "nodeType": "ExpressionStatement", - "src": "302:36:1" - } - ] - }, - "documentation": null, - "id": 409, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 402, - "modifierName": { - "argumentTypes": null, - "id": 401, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "285:10:1", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "285:10:1" - } - ], - "name": "setCompleted", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 400, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 399, - "name": "completed", - "nodeType": "VariableDeclaration", - "scope": 409, - "src": "262:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 398, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "262:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "261:16:1" - }, - "returnParameters": { - "id": 403, - "nodeType": "ParameterList", - "parameters": [], - "src": "296:0:1" - }, - "scope": 430, - "src": "240:103:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 428, - "nodeType": "Block", - "src": "403:109:1", - "statements": [ - { - "assignments": [ - 417 - ], - "declarations": [ - { - "constant": false, - "id": 417, - "name": "upgraded", - "nodeType": "VariableDeclaration", - "scope": 428, - "src": "409:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$430", - "typeString": "contract Migrations" - }, - "typeName": { - "contractScope": null, - "id": 416, - "name": "Migrations", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 430, - "src": "409:10:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$430", - "typeString": "contract Migrations" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 421, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 419, - "name": "new_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 411, - "src": "442:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 418, - "name": "Migrations", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 430, - "src": "431:10:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Migrations_$430_$", - "typeString": "type(contract Migrations)" - } - }, - "id": 420, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "431:23:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$430", - "typeString": "contract Migrations" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "409:45:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 425, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 379, - "src": "482:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 422, - "name": "upgraded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 417, - "src": "460:8:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$430", - "typeString": "contract Migrations" - } - }, - "id": 424, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "setCompleted", - "nodeType": "MemberAccess", - "referencedDeclaration": 409, - "src": "460:21:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256) external" - } - }, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "460:47:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 427, - "nodeType": "ExpressionStatement", - "src": "460:47:1" - } - ] - }, - "documentation": null, - "id": 429, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 414, - "modifierName": { - "argumentTypes": null, - "id": 413, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "392:10:1", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "392:10:1" - } - ], - "name": "upgrade", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 412, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 411, - "name": "new_address", - "nodeType": "VariableDeclaration", - "scope": 429, - "src": "364:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 410, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "364:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "363:21:1" - }, - "returnParameters": { - "id": 415, - "nodeType": "ParameterList", - "parameters": [], - "src": "403:0:1" - }, - "scope": 430, - "src": "347:165:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 431, - "src": "34:480:1" - } - ], - "src": "0:515:1" - }, - "legacyAST": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/Migrations.sol", - "exportedSymbols": { - "Migrations": [ - 430 - ] - }, - "id": 431, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 375, - "literals": [ - "solidity", - ">=", - "0.4", - ".21", - "<", - "0.6", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:32:1" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 430, - "linearizedBaseContracts": [ - 430 - ], - "name": "Migrations", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 377, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 430, - "src": "58:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 376, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "58:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 379, - "name": "last_completed_migration", - "nodeType": "VariableDeclaration", - "scope": 430, - "src": "82:36:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 378, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "82:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 387, - "nodeType": "Block", - "src": "144:29:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 385, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 382, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 377, - "src": "150:5:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 383, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "158:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 384, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "158:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "150:18:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 386, - "nodeType": "ExpressionStatement", - "src": "150:18:1" - } - ] - }, - "documentation": null, - "id": 388, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 380, - "nodeType": "ParameterList", - "parameters": [], - "src": "134:2:1" - }, - "returnParameters": { - "id": 381, - "nodeType": "ParameterList", - "parameters": [], - "src": "144:0:1" - }, - "scope": 430, - "src": "123:50:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 396, - "nodeType": "Block", - "src": "199:37:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 393, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 390, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "209:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 391, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "209:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 392, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 377, - "src": "223:5:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "209:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 395, - "nodeType": "IfStatement", - "src": "205:26:1", - "trueBody": { - "id": 394, - "nodeType": "PlaceholderStatement", - "src": "230:1:1" - } - } - ] - }, - "documentation": null, - "id": 397, - "name": "restricted", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 389, - "nodeType": "ParameterList", - "parameters": [], - "src": "196:2:1" - }, - "src": "177:59:1", - "visibility": "internal" - }, - { - "body": { - "id": 408, - "nodeType": "Block", - "src": "296:47:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 406, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 404, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 379, - "src": "302:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 405, - "name": "completed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 399, - "src": "329:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "302:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 407, - "nodeType": "ExpressionStatement", - "src": "302:36:1" - } - ] - }, - "documentation": null, - "id": 409, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 402, - "modifierName": { - "argumentTypes": null, - "id": 401, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "285:10:1", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "285:10:1" - } - ], - "name": "setCompleted", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 400, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 399, - "name": "completed", - "nodeType": "VariableDeclaration", - "scope": 409, - "src": "262:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 398, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "262:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "261:16:1" - }, - "returnParameters": { - "id": 403, - "nodeType": "ParameterList", - "parameters": [], - "src": "296:0:1" - }, - "scope": 430, - "src": "240:103:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 428, - "nodeType": "Block", - "src": "403:109:1", - "statements": [ - { - "assignments": [ - 417 - ], - "declarations": [ - { - "constant": false, - "id": 417, - "name": "upgraded", - "nodeType": "VariableDeclaration", - "scope": 428, - "src": "409:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$430", - "typeString": "contract Migrations" - }, - "typeName": { - "contractScope": null, - "id": 416, - "name": "Migrations", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 430, - "src": "409:10:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$430", - "typeString": "contract Migrations" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 421, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 419, - "name": "new_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 411, - "src": "442:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 418, - "name": "Migrations", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 430, - "src": "431:10:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Migrations_$430_$", - "typeString": "type(contract Migrations)" - } - }, - "id": 420, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "431:23:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$430", - "typeString": "contract Migrations" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "409:45:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 425, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 379, - "src": "482:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 422, - "name": "upgraded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 417, - "src": "460:8:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Migrations_$430", - "typeString": "contract Migrations" - } - }, - "id": 424, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "setCompleted", - "nodeType": "MemberAccess", - "referencedDeclaration": 409, - "src": "460:21:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256) external" - } - }, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "460:47:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 427, - "nodeType": "ExpressionStatement", - "src": "460:47:1" - } - ] - }, - "documentation": null, - "id": 429, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 414, - "modifierName": { - "argumentTypes": null, - "id": 413, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "392:10:1", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "392:10:1" - } - ], - "name": "upgrade", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 412, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 411, - "name": "new_address", - "nodeType": "VariableDeclaration", - "scope": 429, - "src": "364:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 410, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "364:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "363:21:1" - }, - "returnParameters": { - "id": 415, - "nodeType": "ParameterList", - "parameters": [], - "src": "403:0:1" - }, - "scope": 430, - "src": "347:165:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 431, - "src": "34:480:1" - } - ], - "src": "0:515:1" - }, - "compiler": { - "name": "solc", - "version": "0.5.8+commit.23d335f2.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-07-09T12:37:28.580Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/contracts/build/contracts/Mixer.json b/contracts/build/contracts/Mixer.json deleted file mode 100644 index b669ff8..0000000 --- a/contracts/build/contracts/Mixer.json +++ /dev/null @@ -1,5927 +0,0 @@ -{ - "contractName": "Mixer", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "transferValue", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "left", - "type": "uint256" - }, - { - "name": "right", - "type": "uint256" - } - ], - "name": "HashLeftRight", - "outputs": [ - { - "name": "mimc_hash", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "next_index", - "outputs": [ - { - "name": "", - "type": "uint32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "current_root", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "filled_subtrees", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getLastRoot", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "roots", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "nullifiers", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "zeros", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "_verifier", - "type": "address" - }, - { - "name": "_transferValue", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "from", - "type": "address" - }, - { - "indexed": false, - "name": "commitment", - "type": "uint256" - } - ], - "name": "Deposit", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "name": "fee", - "type": "uint256" - } - ], - "name": "Withdraw", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "leaf", - "type": "uint256" - }, - { - "indexed": false, - "name": "leaf_index", - "type": "uint32" - } - ], - "name": "LeafAdded", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "commitment", - "type": "uint256" - } - ], - "name": "deposit", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "a", - "type": "uint256[2]" - }, - { - "name": "b", - "type": "uint256[2][2]" - }, - { - "name": "c", - "type": "uint256[2]" - }, - { - "name": "input", - "type": "uint256[4]" - } - ], - "name": "withdraw", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"transferValue\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"left\",\"type\":\"uint256\"},{\"name\":\"right\",\"type\":\"uint256\"}],\"name\":\"HashLeftRight\",\"outputs\":[{\"name\":\"mimc_hash\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"a\",\"type\":\"uint256[2]\"},{\"name\":\"b\",\"type\":\"uint256[2][2]\"},{\"name\":\"c\",\"type\":\"uint256[2]\"},{\"name\":\"input\",\"type\":\"uint256[4]\"}],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"next_index\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"current_root\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"filled_subtrees\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"commitment\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getLastRoot\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"roots\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"nullifiers\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"zeros\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_verifier\",\"type\":\"address\"},{\"name\":\"_transferValue\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"commitment\",\"type\":\"uint256\"}],\"name\":\"Deposit\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"fee\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"leaf\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"leaf_index\",\"type\":\"uint32\"}],\"name\":\"LeafAdded\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/poma/dev/mixer/contracts/contracts/Mixer.sol\":\"Mixer\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol\":{\"keccak256\":\"0x642b31dbef7c34b66cd911042cfc6d5a6821cbf631e87c8b8a9fc4f7a2db7280\",\"urls\":[\"bzzr://0b616b34d1ca9c10f095eb402edc09f3f9d6cc1e4ec37da29f67c2c86d2f964a\"]},\"/Users/poma/dev/mixer/contracts/contracts/Mixer.sol\":{\"keccak256\":\"0xf7fa5b07896d32af414cd93b23031f766d9491526456fa1e316b479f239e63e9\",\"urls\":[\"bzzr://407758b01a03c7795de7160b22c8453db22d483a3e52e8f11b1f24f7a3ad28a0\"]},\"/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x4ccf2d7b51873db1ccfd54ca2adae5eac3b184f9699911ed4490438419f1c690\",\"urls\":[\"bzzr://1604f5b6d6e916c154efd8c6720cda069e5ba32dfa0a9dedf2b42e5b02d07f89\"]}},\"version\":1}", - "bytecode": "0x", - "deployedBytecode": "0x", - "sourceMap": "", - "deployedSourceMap": "", - "source": "pragma solidity ^0.5.8;\n\nimport \"./MerkleTreeWithHistory.sol\";\nimport \"../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol\";\n\ncontract IVerifier {\n function verify(uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c, uint256[4] memory input) public returns(bool);\n}\n\ncontract Mixer is MerkleTreeWithHistory {\n using SafeMath for uint256;\n\n uint256 public transferValue;\n mapping(uint256 => bool) public nullifiers;\n IVerifier verifier;\n\n event Deposit(address from, uint256 commitment);\n event Withdraw(address to, uint256 nullifier, uint256 fee);\n\n constructor(address _verifier, uint256 _transferValue) public {\n verifier = IVerifier(_verifier);\n transferValue = _transferValue;\n }\n\n function deposit(uint256 commitment) public payable {\n require(msg.value == transferValue, \"Please send `transferValue` funds alone with transaction\");\n insert(commitment);\n emit Deposit(msg.sender, commitment);\n }\n\n function withdraw(uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c, uint256[4] memory input) public {\n address payable receiver = address(input[0]);\n uint256 nullifier = input[1];\n uint256 fee = input[2];\n uint256 root = input[3];\n\n require(fee < transferValue, \"Fee exceeds transfer value\");\n require(!nullifiers[nullifier], \"The note has been already spent\");\n require(isKnownRoot(root), \"Cannot find your merkle root\"); // Make sure to use a recent one\n require(verifier.verify(a, b, c, input), \"Invalid withdraw proof\");\n\n nullifiers[nullifier] = true;\n receiver.transfer(transferValue - fee);\n if (fee > 0) {\n msg.sender.transfer(fee);\n }\n emit Withdraw(receiver, nullifier, fee);\n }\n}", - "sourcePath": "/Users/poma/dev/mixer/contracts/contracts/Mixer.sol", - "ast": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/Mixer.sol", - "exportedSymbols": { - "IVerifier": [ - 458 - ], - "Mixer": [ - 642 - ] - }, - "id": 643, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 432, - "literals": [ - "solidity", - "^", - "0.5", - ".8" - ], - "nodeType": "PragmaDirective", - "src": "0:23:2" - }, - { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "file": "./MerkleTreeWithHistory.sol", - "id": 433, - "nodeType": "ImportDirective", - "scope": 643, - "sourceUnit": 374, - "src": "25:37:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 434, - "nodeType": "ImportDirective", - "scope": 643, - "sourceUnit": 776, - "src": "63:75:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": false, - "id": 458, - "linearizedBaseContracts": [ - 458 - ], - "name": "IVerifier", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": null, - "id": 457, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "verify", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 453, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 438, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "179:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 435, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "179:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 437, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "187:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "179:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 444, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "200:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2][2]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 439, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "200:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 441, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 440, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "208:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "200:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "id": 443, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 442, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "211:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "200:13:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$2_storage_ptr", - "typeString": "uint256[2][2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 448, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "224:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 445, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "224:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 447, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 446, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "232:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "224:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 452, - "name": "input", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "245:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4]" - }, - "typeName": { - "baseType": { - "id": 449, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "245:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 451, - "length": { - "argumentTypes": null, - "hexValue": "34", - "id": 450, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "253:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "245:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_storage_ptr", - "typeString": "uint256[4]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "178:91:2" - }, - "returnParameters": { - "id": 456, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 455, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "285:4:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 454, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "285:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "284:6:2" - }, - "scope": 458, - "src": "163:128:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 643, - "src": "140:153:2" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 459, - "name": "MerkleTreeWithHistory", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 373, - "src": "313:21:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_MerkleTreeWithHistory_$373", - "typeString": "contract MerkleTreeWithHistory" - } - }, - "id": 460, - "nodeType": "InheritanceSpecifier", - "src": "313:21:2" - } - ], - "contractDependencies": [ - 373 - ], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": false, - "id": 642, - "linearizedBaseContracts": [ - 642, - 373 - ], - "name": "Mixer", - "nodeType": "ContractDefinition", - "nodes": [ - { - "id": 463, - "libraryName": { - "contractScope": null, - "id": 461, - "name": "SafeMath", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 775, - "src": "345:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SafeMath_$775", - "typeString": "library SafeMath" - } - }, - "nodeType": "UsingForDirective", - "src": "339:27:2", - "typeName": { - "id": 462, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "358:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - { - "constant": false, - "id": 465, - "name": "transferValue", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "370:28:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 464, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "370:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 469, - "name": "nullifiers", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "402:42:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - }, - "typeName": { - "id": 468, - "keyType": { - "id": 466, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "410:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "402:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - }, - "valueType": { - "id": 467, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "421:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 471, - "name": "verifier", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "448:18:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - }, - "typeName": { - "contractScope": null, - "id": 470, - "name": "IVerifier", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 458, - "src": "448:9:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "value": null, - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 477, - "name": "Deposit", - "nodeType": "EventDefinition", - "parameters": { - "id": 476, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 473, - "indexed": false, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 477, - "src": "485:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 472, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "485:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 475, - "indexed": false, - "name": "commitment", - "nodeType": "VariableDeclaration", - "scope": 477, - "src": "499:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 474, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "499:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "484:34:2" - }, - "src": "471:48:2" - }, - { - "anonymous": false, - "documentation": null, - "id": 485, - "name": "Withdraw", - "nodeType": "EventDefinition", - "parameters": { - "id": 484, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 479, - "indexed": false, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "537:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 478, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "537:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 481, - "indexed": false, - "name": "nullifier", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "549:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 480, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "549:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 483, - "indexed": false, - "name": "fee", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "568:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 482, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "568:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "536:44:2" - }, - "src": "522:59:2" - }, - { - "body": { - "id": 502, - "nodeType": "Block", - "src": "647:78:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 496, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 492, - "name": "verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 471, - "src": "653:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 494, - "name": "_verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 487, - "src": "674:9:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 493, - "name": "IVerifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 458, - "src": "664:9:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IVerifier_$458_$", - "typeString": "type(contract IVerifier)" - } - }, - "id": 495, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "664:20:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "src": "653:31:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "id": 497, - "nodeType": "ExpressionStatement", - "src": "653:31:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 500, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 498, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "690:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 499, - "name": "_transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 489, - "src": "706:14:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "690:30:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 501, - "nodeType": "ExpressionStatement", - "src": "690:30:2" - } - ] - }, - "documentation": null, - "id": 503, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 490, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 487, - "name": "_verifier", - "nodeType": "VariableDeclaration", - "scope": 503, - "src": "597:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 486, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "597:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 489, - "name": "_transferValue", - "nodeType": "VariableDeclaration", - "scope": 503, - "src": "616:22:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 488, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "616:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "596:43:2" - }, - "returnParameters": { - "id": 491, - "nodeType": "ParameterList", - "parameters": [], - "src": "647:0:2" - }, - "scope": 642, - "src": "585:140:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 526, - "nodeType": "Block", - "src": "781:172:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 512, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 509, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "795:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 510, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "795:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 511, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "808:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "795:26:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "506c656173652073656e6420607472616e7366657256616c7565602066756e647320616c6f6e652077697468207472616e73616374696f6e", - "id": 513, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "823:58:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_30309aa06eb27a30f0f30e53c4b574d416938a818a214b58fc4b0c136c70d5bd", - "typeString": "literal_string \"Please send `transferValue` funds alone with transaction\"" - }, - "value": "Please send `transferValue` funds alone with transaction" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_30309aa06eb27a30f0f30e53c4b574d416938a818a214b58fc4b0c136c70d5bd", - "typeString": "literal_string \"Please send `transferValue` funds alone with transaction\"" - } - ], - "id": 508, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "787:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 514, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "787:95:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 515, - "nodeType": "ExpressionStatement", - "src": "787:95:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 517, - "name": "commitment", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 505, - "src": "895:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 516, - "name": "insert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 298, - "src": "888:6:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 518, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "888:18:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 519, - "nodeType": "ExpressionStatement", - "src": "888:18:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 521, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "925:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 522, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "925:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 523, - "name": "commitment", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 505, - "src": "937:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 520, - "name": "Deposit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 477, - "src": "917:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "917:31:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 525, - "nodeType": "EmitStatement", - "src": "912:36:2" - } - ] - }, - "documentation": null, - "id": 527, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "deposit", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 506, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 505, - "name": "commitment", - "nodeType": "VariableDeclaration", - "scope": 527, - "src": "746:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 504, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "746:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "745:20:2" - }, - "returnParameters": { - "id": 507, - "nodeType": "ParameterList", - "parameters": [], - "src": "781:0:2" - }, - "scope": 642, - "src": "729:224:2", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 640, - "nodeType": "Block", - "src": "1073:633:2", - "statements": [ - { - "assignments": [ - 549 - ], - "declarations": [ - { - "constant": false, - "id": 549, - "name": "receiver", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1079:24:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 548, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1079:15:2", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 555, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 551, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1114:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 553, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 552, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1120:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1114:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 550, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1106:7:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 554, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1106:17:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1079:44:2" - }, - { - "assignments": [ - 557 - ], - "declarations": [ - { - "constant": false, - "id": 557, - "name": "nullifier", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1129:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 556, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1129:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 561, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 558, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1149:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 560, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 559, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1155:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1149:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1129:28:2" - }, - { - "assignments": [ - 563 - ], - "declarations": [ - { - "constant": false, - "id": 563, - "name": "fee", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1163:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 562, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1163:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 567, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 564, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1177:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 566, - "indexExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 565, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1183:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1177:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1163:22:2" - }, - { - "assignments": [ - 569 - ], - "declarations": [ - { - "constant": false, - "id": 569, - "name": "root", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1191:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 568, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1191:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 573, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 570, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1206:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 572, - "indexExpression": { - "argumentTypes": null, - "hexValue": "33", - "id": 571, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1212:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_3_by_1", - "typeString": "int_const 3" - }, - "value": "3" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1206:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1191:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 577, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 575, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1229:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 576, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "1235:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1229:19:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4665652065786365656473207472616e736665722076616c7565", - "id": 578, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1250:28:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2ce218df547d416f80ea8a5deadaf9453d23523ffa5f2e880a48adfdb4053a9c", - "typeString": "literal_string \"Fee exceeds transfer value\"" - }, - "value": "Fee exceeds transfer value" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2ce218df547d416f80ea8a5deadaf9453d23523ffa5f2e880a48adfdb4053a9c", - "typeString": "literal_string \"Fee exceeds transfer value\"" - } - ], - "id": 574, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1221:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1221:58:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 580, - "nodeType": "ExpressionStatement", - "src": "1221:58:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "1293:22:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "nullifiers", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 469, - "src": "1294:10:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - } - }, - "id": 584, - "indexExpression": { - "argumentTypes": null, - "id": 583, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1305:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1294:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "546865206e6f746520686173206265656e20616c7265616479207370656e74", - "id": 586, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1317:33:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_a1bef92d7a18b1c6975dc8de68df6140a52afea05a2c6c91da2b1562c617e896", - "typeString": "literal_string \"The note has been already spent\"" - }, - "value": "The note has been already spent" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_a1bef92d7a18b1c6975dc8de68df6140a52afea05a2c6c91da2b1562c617e896", - "typeString": "literal_string \"The note has been already spent\"" - } - ], - "id": 581, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1285:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 587, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1285:66:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 588, - "nodeType": "ExpressionStatement", - "src": "1285:66:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 591, - "name": "root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 569, - "src": "1377:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 590, - "name": "isKnownRoot", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 362, - "src": "1365:11:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 592, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1365:17:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616e6e6f742066696e6420796f7572206d65726b6c6520726f6f74", - "id": 593, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1384:30:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2a69086763073955418d2fd7dfee3d2f1fbc5b21047a216b7855d3f313d8e204", - "typeString": "literal_string \"Cannot find your merkle root\"" - }, - "value": "Cannot find your merkle root" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2a69086763073955418d2fd7dfee3d2f1fbc5b21047a216b7855d3f313d8e204", - "typeString": "literal_string \"Cannot find your merkle root\"" - } - ], - "id": 589, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1357:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 594, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1357:58:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 595, - "nodeType": "ExpressionStatement", - "src": "1357:58:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 599, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 531, - "src": "1478:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - { - "argumentTypes": null, - "id": 600, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 537, - "src": "1481:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2] memory[2] memory" - } - }, - { - "argumentTypes": null, - "id": 601, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "1484:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - { - "argumentTypes": null, - "id": 602, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1487:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - }, - { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2] memory[2] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - ], - "expression": { - "argumentTypes": null, - "id": 597, - "name": "verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 471, - "src": "1462:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "id": 598, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "verify", - "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "1462:15:2", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_array$_t_uint256_$2_memory_ptr_$_t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr_$_t_array$_t_uint256_$2_memory_ptr_$_t_array$_t_uint256_$4_memory_ptr_$returns$_t_bool_$", - "typeString": "function (uint256[2] memory,uint256[2] memory[2] memory,uint256[2] memory,uint256[4] memory) external returns (bool)" - } - }, - "id": 603, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1462:31:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c69642077697468647261772070726f6f66", - "id": 604, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1495:24:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7021ea58137dba96e572e94936410b0b0e4cbc344e1ab2ee7f47660768b81ff4", - "typeString": "literal_string \"Invalid withdraw proof\"" - }, - "value": "Invalid withdraw proof" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7021ea58137dba96e572e94936410b0b0e4cbc344e1ab2ee7f47660768b81ff4", - "typeString": "literal_string \"Invalid withdraw proof\"" - } - ], - "id": 596, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1454:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 605, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1454:66:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 606, - "nodeType": "ExpressionStatement", - "src": "1454:66:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 611, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 607, - "name": "nullifiers", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 469, - "src": "1527:10:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - } - }, - "id": 609, - "indexExpression": { - "argumentTypes": null, - "id": 608, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1538:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1527:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 610, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1551:4:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "1527:28:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 612, - "nodeType": "ExpressionStatement", - "src": "1527:28:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 616, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "1579:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 617, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1595:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1579:19:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 613, - "name": "receiver", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 549, - "src": "1561:8:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 615, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1561:17:2", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 619, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1561:38:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 620, - "nodeType": "ExpressionStatement", - "src": "1561:38:2" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 623, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 621, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1609:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 622, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1615:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1609:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 633, - "nodeType": "IfStatement", - "src": "1605:52:2", - "trueBody": { - "id": 632, - "nodeType": "Block", - "src": "1618:39:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 629, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1646:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 624, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "1626:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 627, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1626:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1626:19:2", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 630, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1626:24:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 631, - "nodeType": "ExpressionStatement", - "src": "1626:24:2" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 635, - "name": "receiver", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 549, - "src": "1676:8:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 636, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1686:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 637, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1697:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 634, - "name": "Withdraw", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 485, - "src": "1667:8:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256,uint256)" - } - }, - "id": 638, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1667:34:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 639, - "nodeType": "EmitStatement", - "src": "1662:39:2" - } - ] - }, - "documentation": null, - "id": 641, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "withdraw", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 546, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 531, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "975:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 528, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "975:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 530, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 529, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "983:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "975:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 537, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "996:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2][2]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 532, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "996:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 534, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1004:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "996:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "id": 536, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1007:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "996:13:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$2_storage_ptr", - "typeString": "uint256[2][2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 541, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "1020:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 538, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1020:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 540, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 539, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1028:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1020:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 545, - "name": "input", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "1041:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4]" - }, - "typeName": { - "baseType": { - "id": 542, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1041:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 544, - "length": { - "argumentTypes": null, - "hexValue": "34", - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1049:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "1041:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_storage_ptr", - "typeString": "uint256[4]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "974:91:2" - }, - "returnParameters": { - "id": 547, - "nodeType": "ParameterList", - "parameters": [], - "src": "1073:0:2" - }, - "scope": 642, - "src": "957:749:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 643, - "src": "295:1413:2" - } - ], - "src": "0:1708:2" - }, - "legacyAST": { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/Mixer.sol", - "exportedSymbols": { - "IVerifier": [ - 458 - ], - "Mixer": [ - 642 - ] - }, - "id": 643, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 432, - "literals": [ - "solidity", - "^", - "0.5", - ".8" - ], - "nodeType": "PragmaDirective", - "src": "0:23:2" - }, - { - "absolutePath": "/Users/poma/dev/mixer/contracts/contracts/MerkleTreeWithHistory.sol", - "file": "./MerkleTreeWithHistory.sol", - "id": 433, - "nodeType": "ImportDirective", - "scope": 643, - "sourceUnit": 374, - "src": "25:37:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 434, - "nodeType": "ImportDirective", - "scope": 643, - "sourceUnit": 776, - "src": "63:75:2", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": false, - "id": 458, - "linearizedBaseContracts": [ - 458 - ], - "name": "IVerifier", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": null, - "documentation": null, - "id": 457, - "implemented": false, - "kind": "function", - "modifiers": [], - "name": "verify", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 453, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 438, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "179:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 435, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "179:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 437, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "187:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "179:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 444, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "200:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2][2]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 439, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "200:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 441, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 440, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "208:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "200:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "id": 443, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 442, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "211:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "200:13:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$2_storage_ptr", - "typeString": "uint256[2][2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 448, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "224:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 445, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "224:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 447, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 446, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "232:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "224:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 452, - "name": "input", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "245:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4]" - }, - "typeName": { - "baseType": { - "id": 449, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "245:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 451, - "length": { - "argumentTypes": null, - "hexValue": "34", - "id": 450, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "253:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "245:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_storage_ptr", - "typeString": "uint256[4]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "178:91:2" - }, - "returnParameters": { - "id": 456, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 455, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 457, - "src": "285:4:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 454, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "285:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "284:6:2" - }, - "scope": 458, - "src": "163:128:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 643, - "src": "140:153:2" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 459, - "name": "MerkleTreeWithHistory", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 373, - "src": "313:21:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_MerkleTreeWithHistory_$373", - "typeString": "contract MerkleTreeWithHistory" - } - }, - "id": 460, - "nodeType": "InheritanceSpecifier", - "src": "313:21:2" - } - ], - "contractDependencies": [ - 373 - ], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": false, - "id": 642, - "linearizedBaseContracts": [ - 642, - 373 - ], - "name": "Mixer", - "nodeType": "ContractDefinition", - "nodes": [ - { - "id": 463, - "libraryName": { - "contractScope": null, - "id": 461, - "name": "SafeMath", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 775, - "src": "345:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SafeMath_$775", - "typeString": "library SafeMath" - } - }, - "nodeType": "UsingForDirective", - "src": "339:27:2", - "typeName": { - "id": 462, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "358:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - { - "constant": false, - "id": 465, - "name": "transferValue", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "370:28:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 464, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "370:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 469, - "name": "nullifiers", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "402:42:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - }, - "typeName": { - "id": 468, - "keyType": { - "id": 466, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "410:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "402:24:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - }, - "valueType": { - "id": 467, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "421:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 471, - "name": "verifier", - "nodeType": "VariableDeclaration", - "scope": 642, - "src": "448:18:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - }, - "typeName": { - "contractScope": null, - "id": 470, - "name": "IVerifier", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 458, - "src": "448:9:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "value": null, - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 477, - "name": "Deposit", - "nodeType": "EventDefinition", - "parameters": { - "id": 476, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 473, - "indexed": false, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 477, - "src": "485:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 472, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "485:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 475, - "indexed": false, - "name": "commitment", - "nodeType": "VariableDeclaration", - "scope": 477, - "src": "499:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 474, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "499:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "484:34:2" - }, - "src": "471:48:2" - }, - { - "anonymous": false, - "documentation": null, - "id": 485, - "name": "Withdraw", - "nodeType": "EventDefinition", - "parameters": { - "id": 484, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 479, - "indexed": false, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "537:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 478, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "537:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 481, - "indexed": false, - "name": "nullifier", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "549:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 480, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "549:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 483, - "indexed": false, - "name": "fee", - "nodeType": "VariableDeclaration", - "scope": 485, - "src": "568:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 482, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "568:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "536:44:2" - }, - "src": "522:59:2" - }, - { - "body": { - "id": 502, - "nodeType": "Block", - "src": "647:78:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 496, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 492, - "name": "verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 471, - "src": "653:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 494, - "name": "_verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 487, - "src": "674:9:2", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 493, - "name": "IVerifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 458, - "src": "664:9:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IVerifier_$458_$", - "typeString": "type(contract IVerifier)" - } - }, - "id": 495, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "664:20:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "src": "653:31:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "id": 497, - "nodeType": "ExpressionStatement", - "src": "653:31:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 500, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 498, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "690:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 499, - "name": "_transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 489, - "src": "706:14:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "690:30:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 501, - "nodeType": "ExpressionStatement", - "src": "690:30:2" - } - ] - }, - "documentation": null, - "id": 503, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 490, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 487, - "name": "_verifier", - "nodeType": "VariableDeclaration", - "scope": 503, - "src": "597:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 486, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "597:7:2", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 489, - "name": "_transferValue", - "nodeType": "VariableDeclaration", - "scope": 503, - "src": "616:22:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 488, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "616:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "596:43:2" - }, - "returnParameters": { - "id": 491, - "nodeType": "ParameterList", - "parameters": [], - "src": "647:0:2" - }, - "scope": 642, - "src": "585:140:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 526, - "nodeType": "Block", - "src": "781:172:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 512, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 509, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "795:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 510, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "795:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 511, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "808:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "795:26:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "506c656173652073656e6420607472616e7366657256616c7565602066756e647320616c6f6e652077697468207472616e73616374696f6e", - "id": 513, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "823:58:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_30309aa06eb27a30f0f30e53c4b574d416938a818a214b58fc4b0c136c70d5bd", - "typeString": "literal_string \"Please send `transferValue` funds alone with transaction\"" - }, - "value": "Please send `transferValue` funds alone with transaction" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_30309aa06eb27a30f0f30e53c4b574d416938a818a214b58fc4b0c136c70d5bd", - "typeString": "literal_string \"Please send `transferValue` funds alone with transaction\"" - } - ], - "id": 508, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "787:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 514, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "787:95:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 515, - "nodeType": "ExpressionStatement", - "src": "787:95:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 517, - "name": "commitment", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 505, - "src": "895:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 516, - "name": "insert", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 298, - "src": "888:6:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 518, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "888:18:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 519, - "nodeType": "ExpressionStatement", - "src": "888:18:2" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 521, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "925:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 522, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "925:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 523, - "name": "commitment", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 505, - "src": "937:10:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 520, - "name": "Deposit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 477, - "src": "917:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "917:31:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 525, - "nodeType": "EmitStatement", - "src": "912:36:2" - } - ] - }, - "documentation": null, - "id": 527, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "deposit", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 506, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 505, - "name": "commitment", - "nodeType": "VariableDeclaration", - "scope": 527, - "src": "746:18:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 504, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "746:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "745:20:2" - }, - "returnParameters": { - "id": 507, - "nodeType": "ParameterList", - "parameters": [], - "src": "781:0:2" - }, - "scope": 642, - "src": "729:224:2", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 640, - "nodeType": "Block", - "src": "1073:633:2", - "statements": [ - { - "assignments": [ - 549 - ], - "declarations": [ - { - "constant": false, - "id": 549, - "name": "receiver", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1079:24:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 548, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1079:15:2", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 555, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 551, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1114:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 553, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 552, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1120:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1114:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 550, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1106:7:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 554, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1106:17:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1079:44:2" - }, - { - "assignments": [ - 557 - ], - "declarations": [ - { - "constant": false, - "id": 557, - "name": "nullifier", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1129:17:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 556, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1129:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 561, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 558, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1149:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 560, - "indexExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 559, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1155:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1149:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1129:28:2" - }, - { - "assignments": [ - 563 - ], - "declarations": [ - { - "constant": false, - "id": 563, - "name": "fee", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1163:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 562, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1163:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 567, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 564, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1177:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 566, - "indexExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 565, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1183:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1177:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1163:22:2" - }, - { - "assignments": [ - 569 - ], - "declarations": [ - { - "constant": false, - "id": 569, - "name": "root", - "nodeType": "VariableDeclaration", - "scope": 640, - "src": "1191:12:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 568, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1191:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 573, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 570, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1206:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - }, - "id": 572, - "indexExpression": { - "argumentTypes": null, - "hexValue": "33", - "id": 571, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1212:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_3_by_1", - "typeString": "int_const 3" - }, - "value": "3" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1206:8:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1191:23:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 577, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 575, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1229:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 576, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "1235:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1229:19:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4665652065786365656473207472616e736665722076616c7565", - "id": 578, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1250:28:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2ce218df547d416f80ea8a5deadaf9453d23523ffa5f2e880a48adfdb4053a9c", - "typeString": "literal_string \"Fee exceeds transfer value\"" - }, - "value": "Fee exceeds transfer value" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2ce218df547d416f80ea8a5deadaf9453d23523ffa5f2e880a48adfdb4053a9c", - "typeString": "literal_string \"Fee exceeds transfer value\"" - } - ], - "id": 574, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1221:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1221:58:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 580, - "nodeType": "ExpressionStatement", - "src": "1221:58:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "1293:22:2", - "subExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 582, - "name": "nullifiers", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 469, - "src": "1294:10:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - } - }, - "id": 584, - "indexExpression": { - "argumentTypes": null, - "id": 583, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1305:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1294:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "546865206e6f746520686173206265656e20616c7265616479207370656e74", - "id": 586, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1317:33:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_a1bef92d7a18b1c6975dc8de68df6140a52afea05a2c6c91da2b1562c617e896", - "typeString": "literal_string \"The note has been already spent\"" - }, - "value": "The note has been already spent" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_a1bef92d7a18b1c6975dc8de68df6140a52afea05a2c6c91da2b1562c617e896", - "typeString": "literal_string \"The note has been already spent\"" - } - ], - "id": 581, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1285:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 587, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1285:66:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 588, - "nodeType": "ExpressionStatement", - "src": "1285:66:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 591, - "name": "root", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 569, - "src": "1377:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 590, - "name": "isKnownRoot", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 362, - "src": "1365:11:2", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 592, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1365:17:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616e6e6f742066696e6420796f7572206d65726b6c6520726f6f74", - "id": 593, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1384:30:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2a69086763073955418d2fd7dfee3d2f1fbc5b21047a216b7855d3f313d8e204", - "typeString": "literal_string \"Cannot find your merkle root\"" - }, - "value": "Cannot find your merkle root" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2a69086763073955418d2fd7dfee3d2f1fbc5b21047a216b7855d3f313d8e204", - "typeString": "literal_string \"Cannot find your merkle root\"" - } - ], - "id": 589, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1357:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 594, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1357:58:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 595, - "nodeType": "ExpressionStatement", - "src": "1357:58:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 599, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 531, - "src": "1478:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - { - "argumentTypes": null, - "id": 600, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 537, - "src": "1481:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2] memory[2] memory" - } - }, - { - "argumentTypes": null, - "id": 601, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 541, - "src": "1484:1:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - } - }, - { - "argumentTypes": null, - "id": 602, - "name": "input", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 545, - "src": "1487:5:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - }, - { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2] memory[2] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4] memory" - } - ], - "expression": { - "argumentTypes": null, - "id": 597, - "name": "verifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 471, - "src": "1462:8:2", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IVerifier_$458", - "typeString": "contract IVerifier" - } - }, - "id": 598, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "verify", - "nodeType": "MemberAccess", - "referencedDeclaration": 457, - "src": "1462:15:2", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_array$_t_uint256_$2_memory_ptr_$_t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr_$_t_array$_t_uint256_$2_memory_ptr_$_t_array$_t_uint256_$4_memory_ptr_$returns$_t_bool_$", - "typeString": "function (uint256[2] memory,uint256[2] memory[2] memory,uint256[2] memory,uint256[4] memory) external returns (bool)" - } - }, - "id": 603, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1462:31:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c69642077697468647261772070726f6f66", - "id": 604, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1495:24:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7021ea58137dba96e572e94936410b0b0e4cbc344e1ab2ee7f47660768b81ff4", - "typeString": "literal_string \"Invalid withdraw proof\"" - }, - "value": "Invalid withdraw proof" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7021ea58137dba96e572e94936410b0b0e4cbc344e1ab2ee7f47660768b81ff4", - "typeString": "literal_string \"Invalid withdraw proof\"" - } - ], - "id": 596, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1454:7:2", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 605, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1454:66:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 606, - "nodeType": "ExpressionStatement", - "src": "1454:66:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 611, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 607, - "name": "nullifiers", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 469, - "src": "1527:10:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bool_$", - "typeString": "mapping(uint256 => bool)" - } - }, - "id": 609, - "indexExpression": { - "argumentTypes": null, - "id": 608, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1538:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1527:21:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 610, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1551:4:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "1527:28:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 612, - "nodeType": "ExpressionStatement", - "src": "1527:28:2" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 616, - "name": "transferValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 465, - "src": "1579:13:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 617, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1595:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1579:19:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 613, - "name": "receiver", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 549, - "src": "1561:8:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 615, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1561:17:2", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 619, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1561:38:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 620, - "nodeType": "ExpressionStatement", - "src": "1561:38:2" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 623, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 621, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1609:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 622, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1615:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1609:7:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 633, - "nodeType": "IfStatement", - "src": "1605:52:2", - "trueBody": { - "id": 632, - "nodeType": "Block", - "src": "1618:39:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 629, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1646:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 624, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "1626:3:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 627, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1626:10:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1626:19:2", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 630, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1626:24:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 631, - "nodeType": "ExpressionStatement", - "src": "1626:24:2" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 635, - "name": "receiver", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 549, - "src": "1676:8:2", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 636, - "name": "nullifier", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "1686:9:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 637, - "name": "fee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 563, - "src": "1697:3:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 634, - "name": "Withdraw", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 485, - "src": "1667:8:2", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256,uint256)" - } - }, - "id": 638, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1667:34:2", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 639, - "nodeType": "EmitStatement", - "src": "1662:39:2" - } - ] - }, - "documentation": null, - "id": 641, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "withdraw", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 546, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 531, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "975:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 528, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "975:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 530, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 529, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "983:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "975:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 537, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "996:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_memory_$2_memory_ptr", - "typeString": "uint256[2][2]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 532, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "996:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 534, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1004:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "996:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "id": 536, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1007:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "996:13:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_uint256_$2_storage_$2_storage_ptr", - "typeString": "uint256[2][2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 541, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "1020:19:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_memory_ptr", - "typeString": "uint256[2]" - }, - "typeName": { - "baseType": { - "id": 538, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1020:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 540, - "length": { - "argumentTypes": null, - "hexValue": "32", - "id": 539, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1028:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "nodeType": "ArrayTypeName", - "src": "1020:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$2_storage_ptr", - "typeString": "uint256[2]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 545, - "name": "input", - "nodeType": "VariableDeclaration", - "scope": 641, - "src": "1041:23:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_memory_ptr", - "typeString": "uint256[4]" - }, - "typeName": { - "baseType": { - "id": 542, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1041:7:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 544, - "length": { - "argumentTypes": null, - "hexValue": "34", - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1049:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_4_by_1", - "typeString": "int_const 4" - }, - "value": "4" - }, - "nodeType": "ArrayTypeName", - "src": "1041:10:2", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$4_storage_ptr", - "typeString": "uint256[4]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "974:91:2" - }, - "returnParameters": { - "id": 547, - "nodeType": "ParameterList", - "parameters": [], - "src": "1073:0:2" - }, - "scope": 642, - "src": "957:749:2", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 643, - "src": "295:1413:2" - } - ], - "src": "0:1708:2" - }, - "compiler": { - "name": "solc", - "version": "0.5.8+commit.23d335f2.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-07-09T12:37:28.583Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/contracts/build/contracts/SafeMath.json b/contracts/build/contracts/SafeMath.json deleted file mode 100644 index 77dae23..0000000 --- a/contracts/build/contracts/SafeMath.json +++ /dev/null @@ -1,3507 +0,0 @@ -{ - "contractName": "SafeMath", - "abi": [], - "metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Wrappers over Solidity's arithmetic operations with added overflow checks. * Arithmetic operations in Solidity wrap on overflow. This can easily result in bugs, because programmers usually assume that an overflow raises an error, which is the standard behavior in high level programming languages. `SafeMath` restores this intuition by reverting the transaction when an operation overflows. * Using this library instead of the unchecked operations eliminates an entire class of bugs, so it's recommended to use it always.\",\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol\":\"SafeMath\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x4ccf2d7b51873db1ccfd54ca2adae5eac3b184f9699911ed4490438419f1c690\",\"urls\":[\"bzzr://1604f5b6d6e916c154efd8c6720cda069e5ba32dfa0a9dedf2b42e5b02d07f89\"]}},\"version\":1}", - "bytecode": "0x604c6023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a723058206d700a1de22f839bc8ed240d683c022d71f1f30c466866ff432b9002c02080b40029", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a723058206d700a1de22f839bc8ed240d683c022d71f1f30c466866ff432b9002c02080b40029", - "sourceMap": "589:2938:3:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24", - "deployedSourceMap": "589:2938:3:-;;;;;;;;", - "source": "pragma solidity ^0.5.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b > 0, \"SafeMath: division by zero\");\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b != 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n}\n", - "sourcePath": "/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "ast": { - "absolutePath": "/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "exportedSymbols": { - "SafeMath": [ - 775 - ] - }, - "id": 776, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 644, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:3" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "library", - "documentation": "@dev Wrappers over Solidity's arithmetic operations with added overflow\nchecks.\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\nin bugs, because programmers usually assume that an overflow raises an\nerror, which is the standard behavior in high level programming languages.\n`SafeMath` restores this intuition by reverting the transaction when an\noperation overflows.\n * Using this library instead of the unchecked operations eliminates an entire\nclass of bugs, so it's recommended to use it always.", - "fullyImplemented": true, - "id": 775, - "linearizedBaseContracts": [ - 775 - ], - "name": "SafeMath", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": { - "id": 668, - "nodeType": "Block", - "src": "901:109:3", - "statements": [ - { - "assignments": [ - 654 - ], - "declarations": [ - { - "constant": false, - "id": 654, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 668, - "src": "911:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 653, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "911:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 658, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 657, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 655, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 646, - "src": "923:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 656, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 648, - "src": "927:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "923:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "911:17:3" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 662, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 660, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 654, - "src": "946:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 661, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 646, - "src": "951:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "946:6:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a206164646974696f6e206f766572666c6f77", - "id": 663, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "954:29:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_30cc447bcc13b3e22b45cef0dd9b0b514842d836dd9b6eb384e20dedfb47723a", - "typeString": "literal_string \"SafeMath: addition overflow\"" - }, - "value": "SafeMath: addition overflow" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_30cc447bcc13b3e22b45cef0dd9b0b514842d836dd9b6eb384e20dedfb47723a", - "typeString": "literal_string \"SafeMath: addition overflow\"" - } - ], - "id": 659, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "938:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 664, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "938:46:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 665, - "nodeType": "ExpressionStatement", - "src": "938:46:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 666, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 654, - "src": "1002:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 652, - "id": 667, - "nodeType": "Return", - "src": "995:8:3" - } - ] - }, - "documentation": "@dev Returns the addition of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `+` operator.\n * Requirements:\n- Addition cannot overflow.", - "id": 669, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 649, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 646, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 669, - "src": "847:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 645, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "847:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 648, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 669, - "src": "858:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 647, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "858:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "846:22:3" - }, - "returnParameters": { - "id": 652, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 651, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 669, - "src": "892:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 650, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "892:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "891:9:3" - }, - "scope": 775, - "src": "834:176:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 693, - "nodeType": "Block", - "src": "1341:112:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 681, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 679, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 673, - "src": "1359:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 680, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 671, - "src": "1364:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1359:6:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a207375627472616374696f6e206f766572666c6f77", - "id": 682, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1367:32:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_50b058e9b5320e58880d88223c9801cd9eecdcf90323d5c2318bc1b6b916e862", - "typeString": "literal_string \"SafeMath: subtraction overflow\"" - }, - "value": "SafeMath: subtraction overflow" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_50b058e9b5320e58880d88223c9801cd9eecdcf90323d5c2318bc1b6b916e862", - "typeString": "literal_string \"SafeMath: subtraction overflow\"" - } - ], - "id": 678, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1351:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 683, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1351:49:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 684, - "nodeType": "ExpressionStatement", - "src": "1351:49:3" - }, - { - "assignments": [ - 686 - ], - "declarations": [ - { - "constant": false, - "id": 686, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 693, - "src": "1410:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 685, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1410:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 690, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 689, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 687, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 671, - "src": "1422:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 688, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 673, - "src": "1426:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1422:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1410:17:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 691, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 686, - "src": "1445:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 677, - "id": 692, - "nodeType": "Return", - "src": "1438:8:3" - } - ] - }, - "documentation": "@dev Returns the subtraction of two unsigned integers, reverting on\noverflow (when the result is negative).\n * Counterpart to Solidity's `-` operator.\n * Requirements:\n- Subtraction cannot overflow.", - "id": 694, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "sub", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 674, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 671, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 694, - "src": "1287:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 670, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1287:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 673, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 694, - "src": "1298:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 672, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1298:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1286:22:3" - }, - "returnParameters": { - "id": 677, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 676, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 694, - "src": "1332:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 675, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1332:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1331:9:3" - }, - "scope": 775, - "src": "1274:179:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 727, - "nodeType": "Block", - "src": "1760:391:3", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 705, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 703, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 696, - "src": "1991:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 704, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1996:1:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1991:6:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 709, - "nodeType": "IfStatement", - "src": "1987:45:3", - "trueBody": { - "id": 708, - "nodeType": "Block", - "src": "1999:33:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 706, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2020:1:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 702, - "id": 707, - "nodeType": "Return", - "src": "2013:8:3" - } - ] - } - }, - { - "assignments": [ - 711 - ], - "declarations": [ - { - "constant": false, - "id": 711, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 727, - "src": "2042:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 710, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2042:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 715, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 714, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 712, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 696, - "src": "2054:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "argumentTypes": null, - "id": 713, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 698, - "src": "2058:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2054:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2042:17:3" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 721, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 719, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 717, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 711, - "src": "2077:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "id": 718, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 696, - "src": "2081:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2077:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 720, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 698, - "src": "2086:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2077:10:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77", - "id": 722, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2089:35:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9113bb53c2876a3805b2c9242029423fc540a728243ce887ab24c82cf119fba3", - "typeString": "literal_string \"SafeMath: multiplication overflow\"" - }, - "value": "SafeMath: multiplication overflow" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9113bb53c2876a3805b2c9242029423fc540a728243ce887ab24c82cf119fba3", - "typeString": "literal_string \"SafeMath: multiplication overflow\"" - } - ], - "id": 716, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "2069:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 723, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2069:56:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 724, - "nodeType": "ExpressionStatement", - "src": "2069:56:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 725, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 711, - "src": "2143:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 702, - "id": 726, - "nodeType": "Return", - "src": "2136:8:3" - } - ] - }, - "documentation": "@dev Returns the multiplication of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `*` operator.\n * Requirements:\n- Multiplication cannot overflow.", - "id": 728, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mul", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 699, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 696, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "1706:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 695, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1706:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 698, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "1717:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 697, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1717:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1705:22:3" - }, - "returnParameters": { - "id": 702, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 701, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "1751:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 700, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1751:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1750:9:3" - }, - "scope": 775, - "src": "1693:458:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 752, - "nodeType": "Block", - "src": "2673:259:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 740, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 738, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 732, - "src": "2757:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 739, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2761:1:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2757:5:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a206469766973696f6e206279207a65726f", - "id": 741, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2764:28:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_5b7cc70dda4dc2143e5adb63bd5d1f349504f461dbdfd9bc76fac1f8ca6d019f", - "typeString": "literal_string \"SafeMath: division by zero\"" - }, - "value": "SafeMath: division by zero" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_5b7cc70dda4dc2143e5adb63bd5d1f349504f461dbdfd9bc76fac1f8ca6d019f", - "typeString": "literal_string \"SafeMath: division by zero\"" - } - ], - "id": 737, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "2749:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 742, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2749:44:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 743, - "nodeType": "ExpressionStatement", - "src": "2749:44:3" - }, - { - "assignments": [ - 745 - ], - "declarations": [ - { - "constant": false, - "id": 745, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 752, - "src": "2803:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 744, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2803:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 749, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 748, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 746, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "2815:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "id": 747, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 732, - "src": "2819:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2815:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2803:17:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 750, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 745, - "src": "2924:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 736, - "id": 751, - "nodeType": "Return", - "src": "2917:8:3" - } - ] - }, - "documentation": "@dev Returns the integer division of two unsigned integers. Reverts on\ndivision by zero. The result is rounded towards zero.\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n`revert` opcode (which leaves remaining gas untouched) while Solidity\nuses an invalid opcode to revert (consuming all remaining gas).\n * Requirements:\n- The divisor cannot be zero.", - "id": 753, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "div", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 733, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 730, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 753, - "src": "2619:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 729, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2619:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 732, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 753, - "src": "2630:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 731, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2630:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2618:22:3" - }, - "returnParameters": { - "id": 736, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 735, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 753, - "src": "2664:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 734, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2664:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2663:9:3" - }, - "scope": 775, - "src": "2606:326:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 773, - "nodeType": "Block", - "src": "3443:82:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 763, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 757, - "src": "3461:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 764, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3466:1:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3461:6:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a206d6f64756c6f206279207a65726f", - "id": 766, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3469:26:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_726e51f7b81fce0a68f5f214f445e275313b20b1633f08ce954ee39abf8d7832", - "typeString": "literal_string \"SafeMath: modulo by zero\"" - }, - "value": "SafeMath: modulo by zero" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_726e51f7b81fce0a68f5f214f445e275313b20b1633f08ce954ee39abf8d7832", - "typeString": "literal_string \"SafeMath: modulo by zero\"" - } - ], - "id": 762, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "3453:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 767, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3453:43:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 768, - "nodeType": "ExpressionStatement", - "src": "3453:43:3" - }, - { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 771, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 769, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 755, - "src": "3513:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "id": 770, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 757, - "src": "3517:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3513:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 761, - "id": 772, - "nodeType": "Return", - "src": "3506:12:3" - } - ] - }, - "documentation": "@dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\nReverts when dividing by zero.\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\nopcode (which leaves remaining gas untouched) while Solidity uses an\ninvalid opcode to revert (consuming all remaining gas).\n * Requirements:\n- The divisor cannot be zero.", - "id": 774, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mod", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 758, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 755, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 774, - "src": "3389:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 754, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3389:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 757, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 774, - "src": "3400:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 756, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3400:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3388:22:3" - }, - "returnParameters": { - "id": 761, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 760, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 774, - "src": "3434:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 759, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3434:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3433:9:3" - }, - "scope": 775, - "src": "3376:149:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - } - ], - "scope": 776, - "src": "589:2938:3" - } - ], - "src": "0:3528:3" - }, - "legacyAST": { - "absolutePath": "/Users/poma/dev/mixer/contracts/node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol", - "exportedSymbols": { - "SafeMath": [ - 775 - ] - }, - "id": 776, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 644, - "literals": [ - "solidity", - "^", - "0.5", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:23:3" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "library", - "documentation": "@dev Wrappers over Solidity's arithmetic operations with added overflow\nchecks.\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\nin bugs, because programmers usually assume that an overflow raises an\nerror, which is the standard behavior in high level programming languages.\n`SafeMath` restores this intuition by reverting the transaction when an\noperation overflows.\n * Using this library instead of the unchecked operations eliminates an entire\nclass of bugs, so it's recommended to use it always.", - "fullyImplemented": true, - "id": 775, - "linearizedBaseContracts": [ - 775 - ], - "name": "SafeMath", - "nodeType": "ContractDefinition", - "nodes": [ - { - "body": { - "id": 668, - "nodeType": "Block", - "src": "901:109:3", - "statements": [ - { - "assignments": [ - 654 - ], - "declarations": [ - { - "constant": false, - "id": 654, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 668, - "src": "911:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 653, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "911:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 658, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 657, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 655, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 646, - "src": "923:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 656, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 648, - "src": "927:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "923:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "911:17:3" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 662, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 660, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 654, - "src": "946:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 661, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 646, - "src": "951:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "946:6:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a206164646974696f6e206f766572666c6f77", - "id": 663, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "954:29:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_30cc447bcc13b3e22b45cef0dd9b0b514842d836dd9b6eb384e20dedfb47723a", - "typeString": "literal_string \"SafeMath: addition overflow\"" - }, - "value": "SafeMath: addition overflow" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_30cc447bcc13b3e22b45cef0dd9b0b514842d836dd9b6eb384e20dedfb47723a", - "typeString": "literal_string \"SafeMath: addition overflow\"" - } - ], - "id": 659, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "938:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 664, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "938:46:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 665, - "nodeType": "ExpressionStatement", - "src": "938:46:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 666, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 654, - "src": "1002:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 652, - "id": 667, - "nodeType": "Return", - "src": "995:8:3" - } - ] - }, - "documentation": "@dev Returns the addition of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `+` operator.\n * Requirements:\n- Addition cannot overflow.", - "id": 669, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "add", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 649, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 646, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 669, - "src": "847:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 645, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "847:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 648, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 669, - "src": "858:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 647, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "858:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "846:22:3" - }, - "returnParameters": { - "id": 652, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 651, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 669, - "src": "892:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 650, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "892:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "891:9:3" - }, - "scope": 775, - "src": "834:176:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 693, - "nodeType": "Block", - "src": "1341:112:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 681, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 679, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 673, - "src": "1359:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 680, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 671, - "src": "1364:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1359:6:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a207375627472616374696f6e206f766572666c6f77", - "id": 682, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1367:32:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_50b058e9b5320e58880d88223c9801cd9eecdcf90323d5c2318bc1b6b916e862", - "typeString": "literal_string \"SafeMath: subtraction overflow\"" - }, - "value": "SafeMath: subtraction overflow" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_50b058e9b5320e58880d88223c9801cd9eecdcf90323d5c2318bc1b6b916e862", - "typeString": "literal_string \"SafeMath: subtraction overflow\"" - } - ], - "id": 678, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "1351:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 683, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1351:49:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 684, - "nodeType": "ExpressionStatement", - "src": "1351:49:3" - }, - { - "assignments": [ - 686 - ], - "declarations": [ - { - "constant": false, - "id": 686, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 693, - "src": "1410:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 685, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1410:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 690, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 689, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 687, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 671, - "src": "1422:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 688, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 673, - "src": "1426:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1422:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1410:17:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 691, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 686, - "src": "1445:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 677, - "id": 692, - "nodeType": "Return", - "src": "1438:8:3" - } - ] - }, - "documentation": "@dev Returns the subtraction of two unsigned integers, reverting on\noverflow (when the result is negative).\n * Counterpart to Solidity's `-` operator.\n * Requirements:\n- Subtraction cannot overflow.", - "id": 694, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "sub", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 674, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 671, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 694, - "src": "1287:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 670, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1287:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 673, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 694, - "src": "1298:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 672, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1298:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1286:22:3" - }, - "returnParameters": { - "id": 677, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 676, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 694, - "src": "1332:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 675, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1332:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1331:9:3" - }, - "scope": 775, - "src": "1274:179:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 727, - "nodeType": "Block", - "src": "1760:391:3", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 705, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 703, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 696, - "src": "1991:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 704, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1996:1:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1991:6:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 709, - "nodeType": "IfStatement", - "src": "1987:45:3", - "trueBody": { - "id": 708, - "nodeType": "Block", - "src": "1999:33:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "30", - "id": 706, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2020:1:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "functionReturnParameters": 702, - "id": 707, - "nodeType": "Return", - "src": "2013:8:3" - } - ] - } - }, - { - "assignments": [ - 711 - ], - "declarations": [ - { - "constant": false, - "id": 711, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 727, - "src": "2042:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 710, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2042:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 715, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 714, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 712, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 696, - "src": "2054:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "argumentTypes": null, - "id": 713, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 698, - "src": "2058:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2054:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2042:17:3" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 721, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 719, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 717, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 711, - "src": "2077:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "id": 718, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 696, - "src": "2081:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2077:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 720, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 698, - "src": "2086:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2077:10:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77", - "id": 722, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2089:35:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9113bb53c2876a3805b2c9242029423fc540a728243ce887ab24c82cf119fba3", - "typeString": "literal_string \"SafeMath: multiplication overflow\"" - }, - "value": "SafeMath: multiplication overflow" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9113bb53c2876a3805b2c9242029423fc540a728243ce887ab24c82cf119fba3", - "typeString": "literal_string \"SafeMath: multiplication overflow\"" - } - ], - "id": 716, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "2069:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 723, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2069:56:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 724, - "nodeType": "ExpressionStatement", - "src": "2069:56:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 725, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 711, - "src": "2143:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 702, - "id": 726, - "nodeType": "Return", - "src": "2136:8:3" - } - ] - }, - "documentation": "@dev Returns the multiplication of two unsigned integers, reverting on\noverflow.\n * Counterpart to Solidity's `*` operator.\n * Requirements:\n- Multiplication cannot overflow.", - "id": 728, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mul", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 699, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 696, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "1706:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 695, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1706:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 698, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "1717:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 697, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1717:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1705:22:3" - }, - "returnParameters": { - "id": 702, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 701, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 728, - "src": "1751:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 700, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1751:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1750:9:3" - }, - "scope": 775, - "src": "1693:458:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 752, - "nodeType": "Block", - "src": "2673:259:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 740, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 738, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 732, - "src": "2757:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 739, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2761:1:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2757:5:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a206469766973696f6e206279207a65726f", - "id": 741, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2764:28:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_5b7cc70dda4dc2143e5adb63bd5d1f349504f461dbdfd9bc76fac1f8ca6d019f", - "typeString": "literal_string \"SafeMath: division by zero\"" - }, - "value": "SafeMath: division by zero" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_5b7cc70dda4dc2143e5adb63bd5d1f349504f461dbdfd9bc76fac1f8ca6d019f", - "typeString": "literal_string \"SafeMath: division by zero\"" - } - ], - "id": 737, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "2749:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 742, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2749:44:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 743, - "nodeType": "ExpressionStatement", - "src": "2749:44:3" - }, - { - "assignments": [ - 745 - ], - "declarations": [ - { - "constant": false, - "id": 745, - "name": "c", - "nodeType": "VariableDeclaration", - "scope": 752, - "src": "2803:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 744, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2803:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 749, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 748, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 746, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 730, - "src": "2815:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "id": 747, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 732, - "src": "2819:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2815:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2803:17:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 750, - "name": "c", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 745, - "src": "2924:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 736, - "id": 751, - "nodeType": "Return", - "src": "2917:8:3" - } - ] - }, - "documentation": "@dev Returns the integer division of two unsigned integers. Reverts on\ndivision by zero. The result is rounded towards zero.\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n`revert` opcode (which leaves remaining gas untouched) while Solidity\nuses an invalid opcode to revert (consuming all remaining gas).\n * Requirements:\n- The divisor cannot be zero.", - "id": 753, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "div", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 733, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 730, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 753, - "src": "2619:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 729, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2619:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 732, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 753, - "src": "2630:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 731, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2630:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2618:22:3" - }, - "returnParameters": { - "id": 736, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 735, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 753, - "src": "2664:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 734, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2664:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2663:9:3" - }, - "scope": 775, - "src": "2606:326:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 773, - "nodeType": "Block", - "src": "3443:82:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 763, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 757, - "src": "3461:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 764, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3466:1:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3461:6:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "536166654d6174683a206d6f64756c6f206279207a65726f", - "id": 766, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3469:26:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_726e51f7b81fce0a68f5f214f445e275313b20b1633f08ce954ee39abf8d7832", - "typeString": "literal_string \"SafeMath: modulo by zero\"" - }, - "value": "SafeMath: modulo by zero" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_726e51f7b81fce0a68f5f214f445e275313b20b1633f08ce954ee39abf8d7832", - "typeString": "literal_string \"SafeMath: modulo by zero\"" - } - ], - "id": 762, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 793, - 794 - ], - "referencedDeclaration": 794, - "src": "3453:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 767, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3453:43:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 768, - "nodeType": "ExpressionStatement", - "src": "3453:43:3" - }, - { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 771, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 769, - "name": "a", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 755, - "src": "3513:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "id": 770, - "name": "b", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 757, - "src": "3517:1:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3513:5:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 761, - "id": 772, - "nodeType": "Return", - "src": "3506:12:3" - } - ] - }, - "documentation": "@dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\nReverts when dividing by zero.\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\nopcode (which leaves remaining gas untouched) while Solidity uses an\ninvalid opcode to revert (consuming all remaining gas).\n * Requirements:\n- The divisor cannot be zero.", - "id": 774, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "mod", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 758, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 755, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 774, - "src": "3389:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 754, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3389:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 757, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 774, - "src": "3400:9:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 756, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3400:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3388:22:3" - }, - "returnParameters": { - "id": 761, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 760, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 774, - "src": "3434:7:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 759, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3434:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3433:9:3" - }, - "scope": 775, - "src": "3376:149:3", - "stateMutability": "pure", - "superFunction": null, - "visibility": "internal" - } - ], - "scope": 776, - "src": "589:2938:3" - } - ], - "src": "0:3528:3" - }, - "compiler": { - "name": "solc", - "version": "0.5.8+commit.23d335f2.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.0.11", - "updatedAt": "2019-07-09T12:37:28.585Z", - "devdoc": { - "details": "Wrappers over Solidity's arithmetic operations with added overflow checks. * Arithmetic operations in Solidity wrap on overflow. This can easily result in bugs, because programmers usually assume that an overflow raises an error, which is the standard behavior in high level programming languages. `SafeMath` restores this intuition by reverting the transaction when an operation overflows. * Using this library instead of the unchecked operations eliminates an entire class of bugs, so it's recommended to use it always.", - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file