Cipher-Zero/contracts/bridges/bridge/common/libraries/artifacts/build-info/03019d8a4b7dcc7df26cdda3e5145714.json
2024-09-01 23:29:11 +03:00

3464 lines
118 KiB
JSON

{
"id": "03019d8a4b7dcc7df26cdda3e5145714",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.26",
"solcLongVersion": "0.8.26+commit.8a97fa7a",
"input": {
"language": "Solidity",
"sources": {
"contracts/bridges/bridge/common/libraries/L2ContractHelper.sol": {
"content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.13;\r\n\r\n/**\r\n * @author Matter Labs\r\n * @custom:security-contact security@matterlabs.dev\r\n * @notice Helper library for working with L2 contracts on L1.\r\n */\r\nlibrary L2ContractHelper {\r\n /// @dev The prefix used to create CREATE2 addresses.\r\n bytes32 constant CREATE2_PREFIX = keccak256(\"zksyncCreate2\");\r\n\r\n /// @notice Validate the bytecode format and calculate its hash.\r\n /// @param _bytecode The bytecode to hash.\r\n /// @return hashedBytecode The 32-byte hash of the bytecode.\r\n /// Note: The function reverts the execution if the bytecode has non expected format:\r\n /// - Bytecode bytes length is not a multiple of 32\r\n /// - Bytecode bytes length is not less than 2^21 bytes (2^16 words)\r\n /// - Bytecode words length is not odd\r\n function hashL2Bytecode(bytes memory _bytecode) internal pure returns (bytes32 hashedBytecode) {\r\n // Note that the length of the bytecode must be provided in 32-byte words.\r\n require(_bytecode.length % 32 == 0, \"pq\");\r\n\r\n uint256 bytecodeLenInWords = _bytecode.length / 32;\r\n require(bytecodeLenInWords < 2**16, \"pp\"); // bytecode length must be less than 2^16 words\r\n require(bytecodeLenInWords % 2 == 1, \"ps\"); // bytecode length in words must be odd\r\n hashedBytecode = sha256(_bytecode) & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;\r\n // Setting the version of the hash\r\n hashedBytecode = (hashedBytecode | bytes32(uint256(1 << 248)));\r\n // Setting the length\r\n hashedBytecode = hashedBytecode | bytes32(bytecodeLenInWords << 224);\r\n }\r\n\r\n /// @notice Validates the format of the given bytecode hash.\r\n /// @dev Due to the specification of the L2 bytecode hash, not every 32 bytes could be a legit bytecode hash.\r\n /// @dev The function reverts on invalid bytecode hash formam.\r\n /// @param _bytecodeHash The hash of the bytecode to validate.\r\n function validateBytecodeHash(bytes32 _bytecodeHash) internal pure {\r\n uint8 version = uint8(_bytecodeHash[0]);\r\n require(version == 1 && _bytecodeHash[1] == bytes1(0), \"zf\"); // Incorrectly formatted bytecodeHash\r\n\r\n require(_bytecodeLen(_bytecodeHash) % 2 == 1, \"uy\"); // Code length in words must be odd\r\n }\r\n\r\n /// @notice Returns the length of the bytecode associated with the given hash.\r\n /// @param _bytecodeHash The hash of the bytecode.\r\n /// @return codeLengthInWords The length of the bytecode in words.\r\n function _bytecodeLen(bytes32 _bytecodeHash) private pure returns (uint256 codeLengthInWords) {\r\n codeLengthInWords = uint256(uint8(_bytecodeHash[2])) * 256 + uint256(uint8(_bytecodeHash[3]));\r\n }\r\n\r\n /// @notice Computes the create2 address for a Layer 2 contract.\r\n /// @param _sender The address of the sender.\r\n /// @param _salt The salt value to use in the create2 address computation.\r\n /// @param _bytecodeHash The contract bytecode hash.\r\n /// @param _constructorInputHash The hash of the constructor input data.\r\n /// @return The create2 address of the contract.\r\n /// NOTE: L2 create2 derivation is different from L1 derivation!\r\n function computeCreate2Address(\r\n address _sender,\r\n bytes32 _salt,\r\n bytes32 _bytecodeHash,\r\n bytes32 _constructorInputHash\r\n ) internal pure returns (address) {\r\n bytes32 senderBytes = bytes32(uint256(uint160(_sender)));\r\n bytes32 data = keccak256(\r\n bytes.concat(CREATE2_PREFIX, senderBytes, _salt, _bytecodeHash, _constructorInputHash)\r\n );\r\n\r\n return address(uint160(uint256(data)));\r\n }\r\n}\r\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.legacyAssembly",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"evm.gasEstimates",
"evm.assembly"
]
}
},
"remappings": []
}
},
"output": {
"contracts": {
"contracts/bridges/bridge/common/libraries/L2ContractHelper.sol": {
"L2ContractHelper": {
"abi": [],
"devdoc": {
"author": "Matter Labs",
"custom:security-contact": "security@matterlabs.dev",
"kind": "dev",
"methods": {},
"stateVariables": {
"CREATE2_PREFIX": {
"details": "The prefix used to create CREATE2 addresses."
}
},
"version": 1
},
"evm": {
"assembly": " /* \"contracts/bridges/bridge/common/libraries/L2ContractHelper.sol\":214:3682 library L2ContractHelper {... */\n dataSize(sub_0)\n dataOffset(sub_0)\n 0x0b\n dup3\n dup3\n dup3\n codecopy\n dup1\n mload\n 0x00\n byte\n 0x73\n eq\n tag_1\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x00)\n revert(0x00, 0x24)\ntag_1:\n mstore(0x00, address)\n 0x73\n dup2\n mstore8\n dup3\n dup2\n return\nstop\n\nsub_0: assembly {\n /* \"contracts/bridges/bridge/common/libraries/L2ContractHelper.sol\":214:3682 library L2ContractHelper {... */\n eq(address, deployTimeAddress())\n mstore(0x40, 0x80)\n 0x00\n dup1\n revert\n\n auxdata: 0xa26469706673582212205edbf444863cab49de19fcda0d9b3ca86c23eee605b747579134a6893f91f5a864736f6c634300081a0033\n}\n",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "6055604b600b8282823980515f1a607314603f577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f80fdfea26469706673582212205edbf444863cab49de19fcda0d9b3ca86c23eee605b747579134a6893f91f5a864736f6c634300081a0033",
"opcodes": "PUSH1 0x55 PUSH1 0x4B PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH0 BYTE PUSH1 0x73 EQ PUSH1 0x3F JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH0 MSTORE PUSH0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH0 REVERT JUMPDEST ADDRESS PUSH0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 MCOPY 0xDB DELEGATECALL PREVRANDAO DUP7 EXTCODECOPY 0xAB BLOBHASH 0xDE NOT 0xFC 0xDA 0xD SWAP12 EXTCODECOPY 0xA8 PUSH13 0x23EEE605B747579134A6893F91 CREATE2 0xA8 PUSH5 0x736F6C6343 STOP ADDMOD BYTE STOP CALLER ",
"sourceMap": "214:3468:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "730000000000000000000000000000000000000000301460806040525f80fdfea26469706673582212205edbf444863cab49de19fcda0d9b3ca86c23eee605b747579134a6893f91f5a864736f6c634300081a0033",
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 MCOPY 0xDB DELEGATECALL PREVRANDAO DUP7 EXTCODECOPY 0xAB BLOBHASH 0xDE NOT 0xFC 0xDA 0xD SWAP12 EXTCODECOPY 0xA8 PUSH13 0x23EEE605B747579134A6893F91 CREATE2 0xA8 PUSH5 0x736F6C6343 STOP ADDMOD BYTE STOP CALLER ",
"sourceMap": "214:3468:0:-:0;;;;;;;;"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "17000",
"executionCost": "92",
"totalCost": "17092"
},
"internal": {
"_bytecodeLen(bytes32)": "infinite",
"computeCreate2Address(address,bytes32,bytes32,bytes32)": "infinite",
"hashL2Bytecode(bytes memory)": "infinite",
"validateBytecodeHash(bytes32)": "infinite"
}
},
"legacyAssembly": {
".code": [
{
"begin": 214,
"end": 3682,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 214,
"end": 3682,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "B"
},
{
"begin": 214,
"end": 3682,
"name": "DUP3",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "DUP3",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "DUP3",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "CODECOPY",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "DUP1",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "MLOAD",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 214,
"end": 3682,
"name": "BYTE",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "73"
},
{
"begin": 214,
"end": 3682,
"name": "EQ",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH [tag]",
"source": 0,
"value": "1"
},
{
"begin": 214,
"end": 3682,
"name": "JUMPI",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "4E487B7100000000000000000000000000000000000000000000000000000000"
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 214,
"end": 3682,
"name": "MSTORE",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "4"
},
{
"begin": 214,
"end": 3682,
"name": "MSTORE",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "24"
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 214,
"end": 3682,
"name": "REVERT",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "tag",
"source": 0,
"value": "1"
},
{
"begin": 214,
"end": 3682,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "ADDRESS",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 214,
"end": 3682,
"name": "MSTORE",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "73"
},
{
"begin": 214,
"end": 3682,
"name": "DUP2",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "MSTORE8",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "DUP3",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "DUP2",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "RETURN",
"source": 0
}
],
".data": {
"0": {
".auxdata": "a26469706673582212205edbf444863cab49de19fcda0d9b3ca86c23eee605b747579134a6893f91f5a864736f6c634300081a0033",
".code": [
{
"begin": 214,
"end": 3682,
"name": "PUSHDEPLOYADDRESS",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "ADDRESS",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "EQ",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "80"
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 214,
"end": 3682,
"name": "MSTORE",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 214,
"end": 3682,
"name": "DUP1",
"source": 0
},
{
"begin": 214,
"end": 3682,
"name": "REVERT",
"source": 0
}
]
}
},
"sourceList": [
"contracts/bridges/bridge/common/libraries/L2ContractHelper.sol",
"#utility.yul"
]
},
"methodIdentifiers": {}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"Matter Labs\",\"custom:security-contact\":\"security@matterlabs.dev\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"CREATE2_PREFIX\":{\"details\":\"The prefix used to create CREATE2 addresses.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Helper library for working with L2 contracts on L1.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/bridges/bridge/common/libraries/L2ContractHelper.sol\":\"L2ContractHelper\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/bridges/bridge/common/libraries/L2ContractHelper.sol\":{\"keccak256\":\"0xd453116305de377558bd321c96ea15376f36371aefc5e764f4d8ee0d038b9e22\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a1f7457d7e60cf9d7b733e8a0e3affd5770c531b4e27c461a0d9bf452c8fd52a\",\"dweb:/ipfs/QmSyHD1HXZb2QHDLsSi3cCFfBGs93zpUsTQ3BBeRegPLqV\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"notice": "Helper library for working with L2 contracts on L1.",
"version": 1
}
}
}
},
"sources": {
"contracts/bridges/bridge/common/libraries/L2ContractHelper.sol": {
"ast": {
"absolutePath": "contracts/bridges/bridge/common/libraries/L2ContractHelper.sol",
"exportedSymbols": {
"L2ContractHelper": [
216
]
},
"id": 217,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.8",
".13"
],
"nodeType": "PragmaDirective",
"src": "35:24:0"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "L2ContractHelper",
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 2,
"nodeType": "StructuredDocumentation",
"src": "63:149:0",
"text": " @author Matter Labs\n @custom:security-contact security@matterlabs.dev\n @notice Helper library for working with L2 contracts on L1."
},
"fullyImplemented": true,
"id": 216,
"linearizedBaseContracts": [
216
],
"name": "L2ContractHelper",
"nameLocation": "222:16:0",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": true,
"documentation": {
"id": 3,
"nodeType": "StructuredDocumentation",
"src": "246:53:0",
"text": "@dev The prefix used to create CREATE2 addresses."
},
"id": 8,
"mutability": "constant",
"name": "CREATE2_PREFIX",
"nameLocation": "322:14:0",
"nodeType": "VariableDeclaration",
"scope": 216,
"src": "305:60:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 4,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "305:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": {
"arguments": [
{
"hexValue": "7a6b73796e6343726561746532",
"id": 6,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "349:15:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_2020dba91b30cc0006188af794c2fb30dd8520db7e2c088b7fc7c103c00ca494",
"typeString": "literal_string \"zksyncCreate2\""
},
"value": "zksyncCreate2"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_2020dba91b30cc0006188af794c2fb30dd8520db7e2c088b7fc7c103c00ca494",
"typeString": "literal_string \"zksyncCreate2\""
}
],
"id": 5,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967288,
"src": "339:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 7,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "339:26:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
},
{
"body": {
"id": 85,
"nodeType": "Block",
"src": "919:741:0",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 22,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 20,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 17,
"name": "_bytecode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1022:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 18,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "1032:6:0",
"memberName": "length",
"nodeType": "MemberAccess",
"src": "1022:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"hexValue": "3332",
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1041:2:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "1022:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "30",
"id": 21,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1047:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1022:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "7071",
"id": 23,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1050:4:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_db9343eb3e0ee4691fab06568d3b2ec8f6c828b6a1f60e7cb31ff6f7a8511b43",
"typeString": "literal_string \"pq\""
},
"value": "pq"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_db9343eb3e0ee4691fab06568d3b2ec8f6c828b6a1f60e7cb31ff6f7a8511b43",
"typeString": "literal_string \"pq\""
}
],
"id": 16,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "1014:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 24,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1014:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 25,
"nodeType": "ExpressionStatement",
"src": "1014:41:0"
},
{
"assignments": [
27
],
"declarations": [
{
"constant": false,
"id": 27,
"mutability": "mutable",
"name": "bytecodeLenInWords",
"nameLocation": "1076:18:0",
"nodeType": "VariableDeclaration",
"scope": 85,
"src": "1068:26:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 26,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1068:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 32,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 31,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"id": 28,
"name": "_bytecode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1097:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 29,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "1107:6:0",
"memberName": "length",
"nodeType": "MemberAccess",
"src": "1097:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"hexValue": "3332",
"id": 30,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1116:2:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_32_by_1",
"typeString": "int_const 32"
},
"value": "32"
},
"src": "1097:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1068:50:0"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 38,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 34,
"name": "bytecodeLenInWords",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "1137:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_rational_65536_by_1",
"typeString": "int_const 65536"
},
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"hexValue": "32",
"id": 35,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1158:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"hexValue": "3136",
"id": 36,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1161:2:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_16_by_1",
"typeString": "int_const 16"
},
"value": "16"
},
"src": "1158:5:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_65536_by_1",
"typeString": "int_const 65536"
}
},
"src": "1137:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "7070",
"id": 39,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1165:4:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_031d893578c7508e824ef3fed9fe58eb1338724b0459ae1e532b7d98d7568c02",
"typeString": "literal_string \"pp\""
},
"value": "pp"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_031d893578c7508e824ef3fed9fe58eb1338724b0459ae1e532b7d98d7568c02",
"typeString": "literal_string \"pp\""
}
],
"id": 33,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "1129:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 40,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1129:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 41,
"nodeType": "ExpressionStatement",
"src": "1129:41:0"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 47,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 45,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 43,
"name": "bytecodeLenInWords",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "1237:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"hexValue": "32",
"id": 44,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1258:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "1237:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "31",
"id": 46,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1263:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1237:27:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "7073",
"id": 48,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1266:4:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_946bfd07179d973f4eac7f09cf778d3b49f858d586bca295df0543305ff119e7",
"typeString": "literal_string \"ps\""
},
"value": "ps"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_946bfd07179d973f4eac7f09cf778d3b49f858d586bca295df0543305ff119e7",
"typeString": "literal_string \"ps\""
}
],
"id": 42,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "1229:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 49,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1229:42:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 50,
"nodeType": "ExpressionStatement",
"src": "1229:42:0"
},
{
"expression": {
"id": 57,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 51,
"name": "hashedBytecode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1322:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 56,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 53,
"name": "_bytecode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1346:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 52,
"name": "sha256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967274,
"src": "1339:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 54,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1339:17:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "&",
"rightExpression": {
"hexValue": "307830303030303030304646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646",
"id": 55,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1359:66:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_26959946667150639794667015087019630673637144422540572481103610249215_by_1",
"typeString": "int_const 2695...(60 digits omitted)...9215"
},
"value": "0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
},
"src": "1339:86:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1322:103:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 58,
"nodeType": "ExpressionStatement",
"src": "1322:103:0"
},
{
"expression": {
"id": 72,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 59,
"name": "hashedBytecode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1480:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"components": [
{
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 70,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 60,
"name": "hashedBytecode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1498:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "|",
"rightExpression": {
"arguments": [
{
"arguments": [
{
"commonType": {
"typeIdentifier": "t_rational_452312848583266388373324160190187140051835877600158453279131187530910662656_by_1",
"typeString": "int_const 4523...(67 digits omitted)...2656"
},
"id": 67,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"hexValue": "31",
"id": 65,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1531:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"nodeType": "BinaryOperation",
"operator": "<<",
"rightExpression": {
"hexValue": "323438",
"id": 66,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1536:3:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_248_by_1",
"typeString": "int_const 248"
},
"value": "248"
},
"src": "1531:8:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_452312848583266388373324160190187140051835877600158453279131187530910662656_by_1",
"typeString": "int_const 4523...(67 digits omitted)...2656"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_452312848583266388373324160190187140051835877600158453279131187530910662656_by_1",
"typeString": "int_const 4523...(67 digits omitted)...2656"
}
],
"id": 64,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1523:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 63,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1523:7:0",
"typeDescriptions": {}
}
},
"id": 68,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1523:17:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 62,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1515:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes32_$",
"typeString": "type(bytes32)"
},
"typeName": {
"id": 61,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1515:7:0",
"typeDescriptions": {}
}
},
"id": 69,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1515:26:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1498:43:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"id": 71,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1497:45:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1480:62:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 73,
"nodeType": "ExpressionStatement",
"src": "1480:62:0"
},
{
"expression": {
"id": 83,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 74,
"name": "hashedBytecode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1584:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 82,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 75,
"name": "hashedBytecode",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 14,
"src": "1601:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "|",
"rightExpression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 80,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 78,
"name": "bytecodeLenInWords",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 27,
"src": "1626:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<<",
"rightExpression": {
"hexValue": "323234",
"id": 79,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1648:3:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_224_by_1",
"typeString": "int_const 224"
},
"value": "224"
},
"src": "1626:25:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 77,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1618:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes32_$",
"typeString": "type(bytes32)"
},
"typeName": {
"id": 76,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1618:7:0",
"typeDescriptions": {}
}
},
"id": 81,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1618:34:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1601:51:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1584:68:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 84,
"nodeType": "ExpressionStatement",
"src": "1584:68:0"
}
]
},
"documentation": {
"id": 9,
"nodeType": "StructuredDocumentation",
"src": "374:444:0",
"text": "@notice Validate the bytecode format and calculate its hash.\n @param _bytecode The bytecode to hash.\n @return hashedBytecode The 32-byte hash of the bytecode.\n Note: The function reverts the execution if the bytecode has non expected format:\n - Bytecode bytes length is not a multiple of 32\n - Bytecode bytes length is not less than 2^21 bytes (2^16 words)\n - Bytecode words length is not odd"
},
"id": 86,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "hashL2Bytecode",
"nameLocation": "833:14:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 12,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11,
"mutability": "mutable",
"name": "_bytecode",
"nameLocation": "861:9:0",
"nodeType": "VariableDeclaration",
"scope": 86,
"src": "848:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 10,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "848:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "847:24:0"
},
"returnParameters": {
"id": 15,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"mutability": "mutable",
"name": "hashedBytecode",
"nameLocation": "903:14:0",
"nodeType": "VariableDeclaration",
"scope": 86,
"src": "895:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 13,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "895:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"src": "894:24:0"
},
"scope": 216,
"src": "824:836:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 128,
"nodeType": "Block",
"src": "2052:267:0",
"statements": [
{
"assignments": [
93
],
"declarations": [
{
"constant": false,
"id": 93,
"mutability": "mutable",
"name": "version",
"nameLocation": "2069:7:0",
"nodeType": "VariableDeclaration",
"scope": 128,
"src": "2063:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 92,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "2063:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"visibility": "internal"
}
],
"id": 100,
"initialValue": {
"arguments": [
{
"baseExpression": {
"id": 96,
"name": "_bytecodeHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 89,
"src": "2085:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 98,
"indexExpression": {
"hexValue": "30",
"id": 97,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2099:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2085:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
],
"id": 95,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2079:5:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint8_$",
"typeString": "type(uint8)"
},
"typeName": {
"id": 94,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "2079:5:0",
"typeDescriptions": {}
}
},
"id": 99,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2079:23:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2063:39:0"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 113,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"id": 104,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 102,
"name": "version",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 93,
"src": "2121:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "31",
"id": 103,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2132:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2121:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
},
"id": 112,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"baseExpression": {
"id": 105,
"name": "_bytecodeHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 89,
"src": "2137:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 107,
"indexExpression": {
"hexValue": "31",
"id": 106,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2151:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2137:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"arguments": [
{
"hexValue": "30",
"id": 110,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2164:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 109,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2157:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes1_$",
"typeString": "type(bytes1)"
},
"typeName": {
"id": 108,
"name": "bytes1",
"nodeType": "ElementaryTypeName",
"src": "2157:6:0",
"typeDescriptions": {}
}
},
"id": 111,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2157:9:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
},
"src": "2137:29:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "2121:45:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "7a66",
"id": 114,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2168:4:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e45065c33f0767227d2fdc82a8cc934fbf5b330898d6ca600d77ca3bbd4b2caa",
"typeString": "literal_string \"zf\""
},
"value": "zf"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e45065c33f0767227d2fdc82a8cc934fbf5b330898d6ca600d77ca3bbd4b2caa",
"typeString": "literal_string \"zf\""
}
],
"id": 101,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "2113:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 115,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2113:60:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 116,
"nodeType": "ExpressionStatement",
"src": "2113:60:0"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 124,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 122,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 119,
"name": "_bytecodeHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 89,
"src": "2245:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 118,
"name": "_bytecodeLen",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 162,
"src": "2232:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_bytes32_$returns$_t_uint256_$",
"typeString": "function (bytes32) pure returns (uint256)"
}
},
"id": 120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2232:27:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "%",
"rightExpression": {
"hexValue": "32",
"id": 121,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2262:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "2232:31:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "31",
"id": 123,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2267:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "2232:36:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "7579",
"id": 125,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2270:4:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5697b1e8bf8430d9818757f5686c6fe3e6a9ede874c445538a820f7d358ef250",
"typeString": "literal_string \"uy\""
},
"value": "uy"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_5697b1e8bf8430d9818757f5686c6fe3e6a9ede874c445538a820f7d358ef250",
"typeString": "literal_string \"uy\""
}
],
"id": 117,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "2224:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 126,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2224:51:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 127,
"nodeType": "ExpressionStatement",
"src": "2224:51:0"
}
]
},
"documentation": {
"id": 87,
"nodeType": "StructuredDocumentation",
"src": "1668:311:0",
"text": "@notice Validates the format of the given bytecode hash.\n @dev Due to the specification of the L2 bytecode hash, not every 32 bytes could be a legit bytecode hash.\n @dev The function reverts on invalid bytecode hash formam.\n @param _bytecodeHash The hash of the bytecode to validate."
},
"id": 129,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "validateBytecodeHash",
"nameLocation": "1994:20:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 90,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 89,
"mutability": "mutable",
"name": "_bytecodeHash",
"nameLocation": "2023:13:0",
"nodeType": "VariableDeclaration",
"scope": 129,
"src": "2015:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 88,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "2015:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"src": "2014:23:0"
},
"returnParameters": {
"id": 91,
"nodeType": "ParameterList",
"parameters": [],
"src": "2052:0:0"
},
"scope": 216,
"src": "1985:334:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 161,
"nodeType": "Block",
"src": "2633:112:0",
"statements": [
{
"expression": {
"id": 159,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 137,
"name": "codeLengthInWords",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 135,
"src": "2644:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 158,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 148,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"arguments": [
{
"baseExpression": {
"id": 142,
"name": "_bytecodeHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 132,
"src": "2678:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 144,
"indexExpression": {
"hexValue": "32",
"id": 143,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2692:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2678:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
],
"id": 141,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2672:5:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint8_$",
"typeString": "type(uint8)"
},
"typeName": {
"id": 140,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "2672:5:0",
"typeDescriptions": {}
}
},
"id": 145,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2672:23:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
],
"id": 139,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2664:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 138,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2664:7:0",
"typeDescriptions": {}
}
},
"id": 146,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2664:32:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"hexValue": "323536",
"id": 147,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2699:3:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_256_by_1",
"typeString": "int_const 256"
},
"value": "256"
},
"src": "2664:38:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"arguments": [
{
"arguments": [
{
"baseExpression": {
"id": 153,
"name": "_bytecodeHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 132,
"src": "2719:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 155,
"indexExpression": {
"hexValue": "33",
"id": 154,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2733:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2719:16:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes1",
"typeString": "bytes1"
}
],
"id": 152,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2713:5:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint8_$",
"typeString": "type(uint8)"
},
"typeName": {
"id": 151,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "2713:5:0",
"typeDescriptions": {}
}
},
"id": 156,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2713:23:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
],
"id": 150,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2705:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 149,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2705:7:0",
"typeDescriptions": {}
}
},
"id": 157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2705:32:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2664:73:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2644:93:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 160,
"nodeType": "ExpressionStatement",
"src": "2644:93:0"
}
]
},
"documentation": {
"id": 130,
"nodeType": "StructuredDocumentation",
"src": "2327:206:0",
"text": "@notice Returns the length of the bytecode associated with the given hash.\n @param _bytecodeHash The hash of the bytecode.\n @return codeLengthInWords The length of the bytecode in words."
},
"id": 162,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_bytecodeLen",
"nameLocation": "2548:12:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 133,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 132,
"mutability": "mutable",
"name": "_bytecodeHash",
"nameLocation": "2569:13:0",
"nodeType": "VariableDeclaration",
"scope": 162,
"src": "2561:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 131,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "2561:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"src": "2560:23:0"
},
"returnParameters": {
"id": 136,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 135,
"mutability": "mutable",
"name": "codeLengthInWords",
"nameLocation": "2614:17:0",
"nodeType": "VariableDeclaration",
"scope": 162,
"src": "2606:25:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 134,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2606:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "2605:27:0"
},
"scope": 216,
"src": "2539:206:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "private"
},
{
"body": {
"id": 214,
"nodeType": "Block",
"src": "3406:273:0",
"statements": [
{
"assignments": [
177
],
"declarations": [
{
"constant": false,
"id": 177,
"mutability": "mutable",
"name": "senderBytes",
"nameLocation": "3425:11:0",
"nodeType": "VariableDeclaration",
"scope": 214,
"src": "3417:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 176,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "3417:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"id": 188,
"initialValue": {
"arguments": [
{
"arguments": [
{
"arguments": [
{
"id": 184,
"name": "_sender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 165,
"src": "3463:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 183,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3455:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint160_$",
"typeString": "type(uint160)"
},
"typeName": {
"id": 182,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "3455:7:0",
"typeDescriptions": {}
}
},
"id": 185,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3455:16:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
],
"id": 181,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3447:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 180,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3447:7:0",
"typeDescriptions": {}
}
},
"id": 186,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3447:25:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 179,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3439:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes32_$",
"typeString": "type(bytes32)"
},
"typeName": {
"id": 178,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "3439:7:0",
"typeDescriptions": {}
}
},
"id": 187,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3439:34:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3417:56:0"
},
{
"assignments": [
190
],
"declarations": [
{
"constant": false,
"id": 190,
"mutability": "mutable",
"name": "data",
"nameLocation": "3492:4:0",
"nodeType": "VariableDeclaration",
"scope": 214,
"src": "3484:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 189,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "3484:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"id": 202,
"initialValue": {
"arguments": [
{
"arguments": [
{
"id": 195,
"name": "CREATE2_PREFIX",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "3536:14:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"id": 196,
"name": "senderBytes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 177,
"src": "3552:11:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"id": 197,
"name": "_salt",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 167,
"src": "3565:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"id": 198,
"name": "_bytecodeHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 169,
"src": "3572:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
{
"id": 199,
"name": "_constructorInputHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 171,
"src": "3587:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"expression": {
"id": 193,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3523:5:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes_storage_ptr_$",
"typeString": "type(bytes storage pointer)"
},
"typeName": {
"id": 192,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "3523:5:0",
"typeDescriptions": {}
}
},
"id": 194,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "3529:6:0",
"memberName": "concat",
"nodeType": "MemberAccess",
"src": "3523:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_bytesconcat_pure$__$returns$_t_bytes_memory_ptr_$",
"typeString": "function () pure returns (bytes memory)"
}
},
"id": 200,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3523:86:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 191,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967288,
"src": "3499:9:0",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 201,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3499:121:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "3484:136:0"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"arguments": [
{
"id": 209,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 190,
"src": "3664:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 208,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3656:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 207,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3656:7:0",
"typeDescriptions": {}
}
},
"id": 210,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3656:13:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 206,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3648:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint160_$",
"typeString": "type(uint160)"
},
"typeName": {
"id": 205,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "3648:7:0",
"typeDescriptions": {}
}
},
"id": 211,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3648:22:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
],
"id": 204,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3640:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 203,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3640:7:0",
"typeDescriptions": {}
}
},
"id": 212,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "3640:31:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 175,
"id": 213,
"nodeType": "Return",
"src": "3633:38:0"
}
]
},
"documentation": {
"id": 163,
"nodeType": "StructuredDocumentation",
"src": "2753:455:0",
"text": "@notice Computes the create2 address for a Layer 2 contract.\n @param _sender The address of the sender.\n @param _salt The salt value to use in the create2 address computation.\n @param _bytecodeHash The contract bytecode hash.\n @param _constructorInputHash The hash of the constructor input data.\n @return The create2 address of the contract.\n NOTE: L2 create2 derivation is different from L1 derivation!"
},
"id": 215,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "computeCreate2Address",
"nameLocation": "3223:21:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 172,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 165,
"mutability": "mutable",
"name": "_sender",
"nameLocation": "3263:7:0",
"nodeType": "VariableDeclaration",
"scope": 215,
"src": "3255:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 164,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3255:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 167,
"mutability": "mutable",
"name": "_salt",
"nameLocation": "3289:5:0",
"nodeType": "VariableDeclaration",
"scope": 215,
"src": "3281:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 166,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "3281:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 169,
"mutability": "mutable",
"name": "_bytecodeHash",
"nameLocation": "3313:13:0",
"nodeType": "VariableDeclaration",
"scope": 215,
"src": "3305:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 168,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "3305:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 171,
"mutability": "mutable",
"name": "_constructorInputHash",
"nameLocation": "3345:21:0",
"nodeType": "VariableDeclaration",
"scope": 215,
"src": "3337:29:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 170,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "3337:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"visibility": "internal"
}
],
"src": "3244:129:0"
},
"returnParameters": {
"id": 175,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 174,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 215,
"src": "3397:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 173,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3397:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "3396:9:0"
},
"scope": 216,
"src": "3214:465:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 217,
"src": "214:3468:0",
"usedErrors": [],
"usedEvents": []
}
],
"src": "35:3649:0"
},
"id": 0
}
}
}
}