@gooddollar/goodcontracts
Version:
GoodDollar Contracts
1,080 lines • 87.3 kB
JSON
{
"contractName": "MerkleProofUpgradeable",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"These functions deal with verification of Merkle trees (hash trees),\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts-upgradeable/cryptography/MerkleProofUpgradeable.sol\":\"MerkleProofUpgradeable\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/cryptography/MerkleProofUpgradeable.sol\":{\"keccak256\":\"0x4806316f4167dd87deca0a884bc0e6ed41d9e4926ce10862fead08aa42ebe8da\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1b862973de986634686a1b026ed3ee7418736efb6e0aa8ba22886400065201ef\",\"dweb:/ipfs/QmUPSZrxKKw6Kj9vW1DS1ZM7AuXCV6JYxPPkgbp9XyDEEb\"]}},\"version\":1}",
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122045e76e031c64705eb096a7fee38f60df219a7fc82acdea317d8d74d4fbcea49f64736f6c634300060c0033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122045e76e031c64705eb096a7fee38f60df219a7fc82acdea317d8d74d4fbcea49f64736f6c634300060c0033",
"immutableReferences": {},
"sourceMap": "151:1146:14:-:0;;;;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "151:1146:14:-:0;;;;;;;;",
"source": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle trees (hash trees),\n */\nlibrary MerkleProofUpgradeable {\n /**\n * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n * defined by `root`. For this, a `proof` must be provided, containing\n * sibling hashes on the branch from the leaf to the root of the tree. Each\n * pair of leaves and each pair of pre-images are assumed to be sorted.\n */\n function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n bytes32 computedHash = leaf;\n\n for (uint256 i = 0; i < proof.length; i++) {\n bytes32 proofElement = proof[i];\n\n if (computedHash <= proofElement) {\n // Hash(current computed hash + current element of the proof)\n computedHash = keccak256(abi.encodePacked(computedHash, proofElement));\n } else {\n // Hash(current element of the proof + current computed hash)\n computedHash = keccak256(abi.encodePacked(proofElement, computedHash));\n }\n }\n\n // Check if the computed hash (root) is equal to the provided root\n return computedHash == root;\n }\n}\n",
"sourcePath": "@openzeppelin/contracts-upgradeable/cryptography/MerkleProofUpgradeable.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts-upgradeable/cryptography/MerkleProofUpgradeable.sol",
"exportedSymbols": {
"MerkleProofUpgradeable": [
7944
]
},
"id": 7945,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 7875,
"literals": [
"solidity",
">=",
"0.6",
".0",
"<",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:31:14"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 7876,
"nodeType": "StructuredDocumentation",
"src": "66:84:14",
"text": " @dev These functions deal with verification of Merkle trees (hash trees),"
},
"fullyImplemented": true,
"id": 7944,
"linearizedBaseContracts": [
7944
],
"name": "MerkleProofUpgradeable",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 7942,
"nodeType": "Block",
"src": "613:682:14",
"statements": [
{
"assignments": [
7890
],
"declarations": [
{
"constant": false,
"id": 7890,
"mutability": "mutable",
"name": "computedHash",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7942,
"src": "623:20:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 7889,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "623:7:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7892,
"initialValue": {
"argumentTypes": null,
"id": 7891,
"name": "leaf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7884,
"src": "646:4:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "623:27:14"
},
{
"body": {
"id": 7936,
"nodeType": "Block",
"src": "704:472:14",
"statements": [
{
"assignments": [
7905
],
"declarations": [
{
"constant": false,
"id": 7905,
"mutability": "mutable",
"name": "proofElement",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7936,
"src": "718:20:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 7904,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "718:7:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7909,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 7906,
"name": "proof",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7880,
"src": "741:5:14",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[] memory"
}
},
"id": 7908,
"indexExpression": {
"argumentTypes": null,
"id": 7907,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7894,
"src": "747:1:14",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "741:8:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "718:31:14"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 7912,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7910,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7890,
"src": "768:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 7911,
"name": "proofElement",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7905,
"src": "784:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "768:28:14",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 7934,
"nodeType": "Block",
"src": "985:181:14",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7932,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7924,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7890,
"src": "1081:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 7928,
"name": "proofElement",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7905,
"src": "1123:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 7929,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7890,
"src": "1137:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"expression": {
"argumentTypes": null,
"id": 7926,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1106:3:14",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 7927,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodePacked",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1106:16:14",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 7930,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1106:44:14",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 7925,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "1096:9:14",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 7931,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1096:55:14",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1081:70:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 7933,
"nodeType": "ExpressionStatement",
"src": "1081:70:14"
}
]
},
"id": 7935,
"nodeType": "IfStatement",
"src": "764:402:14",
"trueBody": {
"id": 7923,
"nodeType": "Block",
"src": "798:181:14",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 7921,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 7913,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7890,
"src": "894:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 7917,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7890,
"src": "936:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"argumentTypes": null,
"id": 7918,
"name": "proofElement",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7905,
"src": "950:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"expression": {
"argumentTypes": null,
"id": 7915,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "919:3:14",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 7916,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "encodePacked",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "919:16:14",
"typeDescriptions": {
"typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 7919,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "919:44:14",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 7914,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "909:9:14",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 7920,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "909:55:14",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "894:70:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 7922,
"nodeType": "ExpressionStatement",
"src": "894:70:14"
}
]
}
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7900,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7897,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7894,
"src": "681:1:14",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 7898,
"name": "proof",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7880,
"src": "685:5:14",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[] memory"
}
},
"id": 7899,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "685:12:14",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "681:16:14",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 7937,
"initializationExpression": {
"assignments": [
7894
],
"declarations": [
{
"constant": false,
"id": 7894,
"mutability": "mutable",
"name": "i",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7937,
"src": "666:9:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7893,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "666:7:14",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7896,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 7895,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "678:1:14",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "666:13:14"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 7902,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "699:3:14",
"subExpression": {
"argumentTypes": null,
"id": 7901,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7894,
"src": "699:1:14",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 7903,
"nodeType": "ExpressionStatement",
"src": "699:3:14"
},
"nodeType": "ForStatement",
"src": "661:515:14"
},
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 7940,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7938,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7890,
"src": "1268:12:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 7939,
"name": "root",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7882,
"src": "1284:4:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1268:20:14",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 7888,
"id": 7941,
"nodeType": "Return",
"src": "1261:27:14"
}
]
},
"documentation": {
"id": 7877,
"nodeType": "StructuredDocumentation",
"src": "188:323:14",
"text": " @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n defined by `root`. For this, a `proof` must be provided, containing\n sibling hashes on the branch from the leaf to the root of the tree. Each\n pair of leaves and each pair of pre-images are assumed to be sorted."
},
"id": 7943,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "verify",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 7885,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7880,
"mutability": "mutable",
"name": "proof",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7943,
"src": "532:22:14",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[]"
},
"typeName": {
"baseType": {
"id": 7878,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "532:7:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 7879,
"length": null,
"nodeType": "ArrayTypeName",
"src": "532:9:14",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr",
"typeString": "bytes32[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 7882,
"mutability": "mutable",
"name": "root",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7943,
"src": "556:12:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 7881,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "556:7:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 7884,
"mutability": "mutable",
"name": "leaf",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7943,
"src": "570:12:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 7883,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "570:7:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "531:52:14"
},
"returnParameters": {
"id": 7888,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7887,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7943,
"src": "607:4:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 7886,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "607:4:14",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "606:6:14"
},
"scope": 7944,
"src": "516:779:14",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 7945,
"src": "151:1146:14"
}
],
"src": "33:1265:14"
},
"legacyAST": {
"absolutePath": "@openzeppelin/contracts-upgradeable/cryptography/MerkleProofUpgradeable.sol",
"exportedSymbols": {
"MerkleProofUpgradeable": [
7944
]
},
"id": 7945,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 7875,
"literals": [
"solidity",
">=",
"0.6",
".0",
"<",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:31:14"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 7876,
"nodeType": "StructuredDocumentation",
"src": "66:84:14",
"text": " @dev These functions deal with verification of Merkle trees (hash trees),"
},
"fullyImplemented": true,
"id": 7944,
"linearizedBaseContracts": [
7944
],
"name": "MerkleProofUpgradeable",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 7942,
"nodeType": "Block",
"src": "613:682:14",
"statements": [
{
"assignments": [
7890
],
"declarations": [
{
"constant": false,
"id": 7890,
"mutability": "mutable",
"name": "computedHash",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7942,
"src": "623:20:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 7889,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "623:7:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7892,
"initialValue": {
"argumentTypes": null,
"id": 7891,
"name": "leaf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7884,
"src": "646:4:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "623:27:14"
},
{
"body": {
"id": 7936,
"nodeType": "Block",
"src": "704:472:14",
"statements": [
{
"assignments": [
7905
],
"declarations": [
{
"constant": false,
"id": 7905,
"mutability": "mutable",
"name": "proofElement",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 7936,
"src": "718:20:14",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 7904,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "718:7:14",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 79