@alpsfinance/core
Version:
This is the official Alps Finance smart contract repository.
1,082 lines • 107 kB
JSON
{
"contractName": "MerkleProof",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"These functions deal with verification of Merkle Trees proofs. The proofs can be generated using the JavaScript library https://github.com/miguelmota/merkletreejs[merkletreejs]. Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. See `test/utils/cryptography/MerkleProof.test.js` for some examples.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\":\"MerkleProof\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/cryptography/MerkleProof.sol\":{\"keccak256\":\"0xea64fbaccbf9d8c235cf6838240ddcebb97f9fc383660289e9dff32e4fb85f7a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1e8a1dd0eac2fa865dc9a052bee01eec31677d7bc01b5b5aa825d820f3f1b343\",\"dweb:/ipfs/QmR8WuNeoAvJhnL7msQfQwaZEkwVnNyNDUNBL3Y616ohYa\"]}},\"version\":1}",
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b2f882e55445287e5e7248e6539ac6c5c92268092c5c128738e85dd2807f6b2664736f6c634300080b0033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220b2f882e55445287e5e7248e6539ac6c5c92268092c5c128738e85dd2807f6b2664736f6c634300080b0033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "508:1778:31:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;508:1778:31;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "508:1778:31:-:0;;;;;;;;",
"source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Trees proofs.\n *\n * The proofs can be generated using the JavaScript library\n * https://github.com/miguelmota/merkletreejs[merkletreejs].\n * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.\n *\n * See `test/utils/cryptography/MerkleProof.test.js` for some examples.\n */\nlibrary MerkleProof {\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(\n bytes32[] memory proof,\n bytes32 root,\n bytes32 leaf\n ) internal pure returns (bool) {\n return processProof(proof, leaf) == root;\n }\n\n /**\n * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up\n * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n * hash matches the root of the tree. When processing the proof, the pairs\n * of leafs & pre-images are assumed to be sorted.\n *\n * _Available since v4.4._\n */\n function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n bytes32 proofElement = proof[i];\n if (computedHash <= proofElement) {\n // Hash(current computed hash + current element of the proof)\n computedHash = _efficientHash(computedHash, proofElement);\n } else {\n // Hash(current element of the proof + current computed hash)\n computedHash = _efficientHash(proofElement, computedHash);\n }\n }\n return computedHash;\n }\n\n function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\n assembly {\n mstore(0x00, a)\n mstore(0x20, b)\n value := keccak256(0x00, 0x40)\n }\n }\n}\n",
"sourcePath": "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol",
"ast": {
"absolutePath": "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol",
"exportedSymbols": {
"MerkleProof": [
6074
]
},
"id": 6075,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 5983,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "118:23:31"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "MerkleProof",
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 5984,
"nodeType": "StructuredDocumentation",
"src": "143:364:31",
"text": " @dev These functions deal with verification of Merkle Trees proofs.\n The proofs can be generated using the JavaScript library\n https://github.com/miguelmota/merkletreejs[merkletreejs].\n Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.\n See `test/utils/cryptography/MerkleProof.test.js` for some examples."
},
"fullyImplemented": true,
"id": 6074,
"linearizedBaseContracts": [
6074
],
"name": "MerkleProof",
"nameLocation": "516:11:31",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 6004,
"nodeType": "Block",
"src": "989:57:31",
"statements": [
{
"expression": {
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 6002,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 5998,
"name": "proof",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5988,
"src": "1019:5:31",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[] memory"
}
},
{
"id": 5999,
"name": "leaf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5992,
"src": "1026:4:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[] memory"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 5997,
"name": "processProof",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6062,
"src": "1006:12:31",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_array$_t_bytes32_$dyn_memory_ptr_$_t_bytes32_$returns$_t_bytes32_$",
"typeString": "function (bytes32[] memory,bytes32) pure returns (bytes32)"
}
},
"id": 6000,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1006:25:31",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 6001,
"name": "root",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5990,
"src": "1035:4:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1006:33:31",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 5996,
"id": 6003,
"nodeType": "Return",
"src": "999:40:31"
}
]
},
"documentation": {
"id": 5985,
"nodeType": "StructuredDocumentation",
"src": "534:323:31",
"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": 6005,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "verify",
"nameLocation": "871:6:31",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5993,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5988,
"mutability": "mutable",
"name": "proof",
"nameLocation": "904:5:31",
"nodeType": "VariableDeclaration",
"scope": 6005,
"src": "887:22:31",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[]"
},
"typeName": {
"baseType": {
"id": 5986,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "887:7:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 5987,
"nodeType": "ArrayTypeName",
"src": "887:9:31",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr",
"typeString": "bytes32[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 5990,
"mutability": "mutable",
"name": "root",
"nameLocation": "927:4:31",
"nodeType": "VariableDeclaration",
"scope": 6005,
"src": "919:12:31",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 5989,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "919:7:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 5992,
"mutability": "mutable",
"name": "leaf",
"nameLocation": "949:4:31",
"nodeType": "VariableDeclaration",
"scope": 6005,
"src": "941:12:31",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 5991,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "941:7:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"src": "877:82:31"
},
"returnParameters": {
"id": 5996,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5995,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 6005,
"src": "983:4:31",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 5994,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "983:4:31",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "982:6:31"
},
"scope": 6074,
"src": "862:184:31",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 6061,
"nodeType": "Block",
"src": "1490:570:31",
"statements": [
{
"assignments": [
6017
],
"declarations": [
{
"constant": false,
"id": 6017,
"mutability": "mutable",
"name": "computedHash",
"nameLocation": "1508:12:31",
"nodeType": "VariableDeclaration",
"scope": 6061,
"src": "1500:20:31",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6016,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1500:7:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"id": 6019,
"initialValue": {
"id": 6018,
"name": "leaf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6011,
"src": "1523:4:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1500:27:31"
},
{
"body": {
"id": 6057,
"nodeType": "Block",
"src": "1580:445:31",
"statements": [
{
"assignments": [
6032
],
"declarations": [
{
"constant": false,
"id": 6032,
"mutability": "mutable",
"name": "proofElement",
"nameLocation": "1602:12:31",
"nodeType": "VariableDeclaration",
"scope": 6057,
"src": "1594:20:31",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6031,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1594:7:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"id": 6036,
"initialValue": {
"baseExpression": {
"id": 6033,
"name": "proof",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6009,
"src": "1617:5:31",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[] memory"
}
},
"id": 6035,
"indexExpression": {
"id": 6034,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6021,
"src": "1623:1:31",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1617:8:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1594:31:31"
},
{
"condition": {
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 6039,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 6037,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6017,
"src": "1643:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 6038,
"name": "proofElement",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6032,
"src": "1659:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1643:28:31",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 6055,
"nodeType": "Block",
"src": "1847:168:31",
"statements": [
{
"expression": {
"id": 6053,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 6048,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6017,
"src": "1943:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 6050,
"name": "proofElement",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6032,
"src": "1973:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"id": 6051,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6017,
"src": "1987:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 6049,
"name": "_efficientHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6073,
"src": "1958:14:31",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes32_$returns$_t_bytes32_$",
"typeString": "function (bytes32,bytes32) pure returns (bytes32)"
}
},
"id": 6052,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1958:42:31",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1943:57:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 6054,
"nodeType": "ExpressionStatement",
"src": "1943:57:31"
}
]
},
"id": 6056,
"nodeType": "IfStatement",
"src": "1639:376:31",
"trueBody": {
"id": 6047,
"nodeType": "Block",
"src": "1673:168:31",
"statements": [
{
"expression": {
"id": 6045,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 6040,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6017,
"src": "1769:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 6042,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6017,
"src": "1799:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"id": 6043,
"name": "proofElement",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6032,
"src": "1813:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 6041,
"name": "_efficientHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6073,
"src": "1784:14:31",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$_t_bytes32_$returns$_t_bytes32_$",
"typeString": "function (bytes32,bytes32) pure returns (bytes32)"
}
},
"id": 6044,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1784:42:31",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1769:57:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 6046,
"nodeType": "ExpressionStatement",
"src": "1769:57:31"
}
]
}
}
]
},
"condition": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6027,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 6024,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6021,
"src": "1557:1:31",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"expression": {
"id": 6025,
"name": "proof",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6009,
"src": "1561:5:31",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[] memory"
}
},
"id": 6026,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"src": "1561:12:31",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1557:16:31",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 6058,
"initializationExpression": {
"assignments": [
6021
],
"declarations": [
{
"constant": false,
"id": 6021,
"mutability": "mutable",
"name": "i",
"nameLocation": "1550:1:31",
"nodeType": "VariableDeclaration",
"scope": 6058,
"src": "1542:9:31",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6020,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1542:7:31",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 6023,
"initialValue": {
"hexValue": "30",
"id": 6022,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1554:1:31",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "1542:13:31"
},
"loopExpression": {
"expression": {
"id": 6029,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1575:3:31",
"subExpression": {
"id": 6028,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6021,
"src": "1575:1:31",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 6030,
"nodeType": "ExpressionStatement",
"src": "1575:3:31"
},
"nodeType": "ForStatement",
"src": "1537:488:31"
},
{
"expression": {
"id": 6059,
"name": "computedHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6017,
"src": "2041:12:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"functionReturnParameters": 6015,
"id": 6060,
"nodeType": "Return",
"src": "2034:19:31"
}
]
},
"documentation": {
"id": 6006,
"nodeType": "StructuredDocumentation",
"src": "1052:341:31",
"text": " @dev Returns the rebuilt hash obtained by traversing a Merklee tree up\n from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n hash matches the root of the tree. When processing the proof, the pairs\n of leafs & pre-images are assumed to be sorted.\n _Available since v4.4._"
},
"id": 6062,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "processProof",
"nameLocation": "1407:12:31",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6012,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6009,
"mutability": "mutable",
"name": "proof",
"nameLocation": "1437:5:31",
"nodeType": "VariableDeclaration",
"scope": 6062,
"src": "1420:22:31",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr",
"typeString": "bytes32[]"
},
"typeName": {
"baseType": {
"id": 6007,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1420:7:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 6008,
"nodeType": "ArrayTypeName",
"src": "1420:9:31",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr",
"typeString": "bytes32[]"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6011,
"mutability": "mutable",
"name": "leaf",
"nameLocation": "1452:4:31",
"nodeType": "VariableDeclaration",
"scope": 6062,
"src": "1444:12:31",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6010,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1444:7:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"src": "1419:38:31"
},
"returnParameters": {
"id": 6015,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6014,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 6062,
"src": "1481:7:31",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6013,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1481:7:31",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"src": "1480:9:31"
},
"scope": 6074,
"src": "1398:662:31",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 6072,
"nodeType": "Block",
"src": "2149:135:31",
"statements": [
{
"AST": {
"nodeType": "YulBlock",
"src": "2168:110:31",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2189:4:31",
"type": "",
"value": "0x00"
},
{
"name": "a",
"nodeType": "YulIdentifier",
"src": "2195:1:31"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2182:6:31"
},
"nodeType": "YulFunctionCall",
"src": "2182:15:31"
},
"nodeType": "YulExpressionStatement",
"src": "2182:15:31"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2217:4:31",
"type": "",
"value": "0x20"
},
{
"name": "b",
"nodeType": "YulIdentifier",
"src": "2223:1:31"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2210:6:31"
},
"nodeType": "YulFunctionCall",
"src": "2210:15:31"
},
"nodeType": "YulExpressionStatement",
"src": "2210:15:31"
},
{
"nodeType": "YulAssignment",
"src": "2238:30:31",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2257:4:31",
"type": "",
"value": "0x00"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2263:4:31",
"type": "",
"value": "0x40"
}
],
"functionName": {
"name": "keccak256",
"nodeType": "YulIdentifier",
"src": "2247:9:31"
},
"nodeType": "YulFunctionCall",
"src"