UNPKG

aibc

Version:
973 lines (972 loc) 339 kB
{ "contractName": "Address", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.8.0+commit.c7dfd78e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Collection of functions related to the address type\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Address.sol\":\"Address\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x069b2631bb5b5193a58ccf7a06266c7361bd2c20095667af4402817605627f45\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6a4c96fafff76deda5697c3c5c98cade6e6e1b178254544c106bf360c079ce4e\",\"dweb:/ipfs/QmXmxubE3jnatFgZuN8ay1VV6hZ8WRmhvUjNpeVjki15HX\"]}},\"version\":1}", "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212209a3f5d115025f00125c299dc043ec50be7fc6ea89029d27b16d3f67d1e9b81ff64736f6c63430008000033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212209a3f5d115025f00125c299dc043ec50be7fc6ea89029d27b16d3f67d1e9b81ff64736f6c63430008000033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "126:7684:11:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "126:7684:11:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n (bool success, ) = recipient.call{ value: amount }(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain`call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.call{ value: value }(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.staticcall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return _verifyCallResult(success, returndata, errorMessage);\n }\n\n function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n", "sourcePath": "@openzeppelin\\contracts\\utils\\Address.sol", "ast": { "absolutePath": "@openzeppelin/contracts/utils/Address.sol", "exportedSymbols": { "Address": [ 3997 ] }, "id": 3998, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 3703, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "33:23:11" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 3704, "nodeType": "StructuredDocumentation", "src": "58:67:11", "text": " @dev Collection of functions related to the address type" }, "fullyImplemented": true, "id": 3997, "linearizedBaseContracts": [ 3997 ], "name": "Address", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 3720, "nodeType": "Block", "src": "784:347:11", "statements": [ { "assignments": [ 3713 ], "declarations": [ { "constant": false, "id": 3713, "mutability": "mutable", "name": "size", "nodeType": "VariableDeclaration", "scope": 3720, "src": "981:12:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3712, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "981:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 3714, "nodeType": "VariableDeclarationStatement", "src": "981:12:11" }, { "AST": { "nodeType": "YulBlock", "src": "1068:32:11", "statements": [ { "nodeType": "YulAssignment", "src": "1070:28:11", "value": { "arguments": [ { "name": "account", "nodeType": "YulIdentifier", "src": "1090:7:11" } ], "functionName": { "name": "extcodesize", "nodeType": "YulIdentifier", "src": "1078:11:11" }, "nodeType": "YulFunctionCall", "src": "1078:20:11" }, "variableNames": [ { "name": "size", "nodeType": "YulIdentifier", "src": "1070:4:11" } ] } ] }, "evmVersion": "istanbul", "externalReferences": [ { "declaration": 3707, "isOffset": false, "isSlot": false, "src": "1090:7:11", "valueSize": 1 }, { "declaration": 3713, "isOffset": false, "isSlot": false, "src": "1070:4:11", "valueSize": 1 } ], "id": 3715, "nodeType": "InlineAssembly", "src": "1059:41:11" }, { "expression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 3718, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 3716, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3713, "src": "1116:4:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "hexValue": "30", "id": 3717, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1123:1:11", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1116:8:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 3711, "id": 3719, "nodeType": "Return", "src": "1109:15:11" } ] }, "documentation": { "id": 3705, "nodeType": "StructuredDocumentation", "src": "148:565:11", "text": " @dev Returns true if `account` is a contract.\n [IMPORTANT]\n ====\n It is unsafe to assume that an address for which this function returns\n false is an externally-owned account (EOA) and not a contract.\n Among others, `isContract` will return false for the following\n types of addresses:\n - an externally-owned account\n - a contract in construction\n - an address where a contract will be created\n - an address where a contract lived, but was destroyed\n ====" }, "id": 3721, "implemented": true, "kind": "function", "modifiers": [], "name": "isContract", "nodeType": "FunctionDefinition", "parameters": { "id": 3708, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3707, "mutability": "mutable", "name": "account", "nodeType": "VariableDeclaration", "scope": 3721, "src": "738:15:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3706, "name": "address", "nodeType": "ElementaryTypeName", "src": "738:7:11", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "737:17:11" }, "returnParameters": { "id": 3711, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3710, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 3721, "src": "778:4:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 3709, "name": "bool", "nodeType": "ElementaryTypeName", "src": "778:4:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "777:6:11" }, "scope": 3997, "src": "718:413:11", "stateMutability": "view", "virtual": false, "visibility": "internal" }, { "body": { "id": 3754, "nodeType": "Block", "src": "2119:320:11", "statements": [ { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 3736, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "arguments": [ { "id": 3732, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "2145:4:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Address_$3997", "typeString": "library Address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Address_$3997", "typeString": "library Address" } ], "id": 3731, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "2137:7:11", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 3730, "name": "address", "nodeType": "ElementaryTypeName", "src": "2137:7:11", "typeDescriptions": {} } }, "id": 3733, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2137:13:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 3734, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "balance", "nodeType": "MemberAccess", "src": "2137:21:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "id": 3735, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3726, "src": "2162:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "2137:31:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "416464726573733a20696e73756666696369656e742062616c616e6365", "id": 3737, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2170:31:11", "typeDescriptions": { "typeIdentifier": "t_stringliteral_5597a22abd0ef5332f8053862eb236db7590f17e2b93a53f63a103becfb561f9", "typeString": "literal_string \"Address: insufficient balance\"" }, "value": "Address: insufficient balance" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_5597a22abd0ef5332f8053862eb236db7590f17e2b93a53f63a103becfb561f9", "typeString": "literal_string \"Address: insufficient balance\"" } ], "id": 3729, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "2129:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 3738, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2129:73:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3739, "nodeType": "ExpressionStatement", "src": "2129:73:11" }, { "assignments": [ 3741, null ], "declarations": [ { "constant": false, "id": 3741, "mutability": "mutable", "name": "success", "nodeType": "VariableDeclaration", "scope": 3754, "src": "2291:12:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 3740, "name": "bool", "nodeType": "ElementaryTypeName", "src": "2291:4:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" }, null ], "id": 3748, "initialValue": { "arguments": [ { "hexValue": "", "id": 3746, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2341:2:11", "typeDescriptions": { "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "typeString": "literal_string \"\"" }, "value": "" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "typeString": "literal_string \"\"" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_stringliteral_c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "typeString": "literal_string \"\"" } ], "expression": { "id": 3742, "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3724, "src": "2309:9:11", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "id": 3743, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "call", "nodeType": "MemberAccess", "src": "2309:14:11", "typeDescriptions": { "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", "typeString": "function (bytes memory) payable returns (bool,bytes memory)" } }, "id": 3745, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "names": [ "value" ], "nodeType": "FunctionCallOptions", "options": [ { "id": 3744, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3726, "src": "2332:6:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "src": "2309:31:11", "typeDescriptions": { "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$value", "typeString": "function (bytes memory) payable returns (bool,bytes memory)" } }, "id": 3747, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2309:35:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", "typeString": "tuple(bool,bytes memory)" } }, "nodeType": "VariableDeclarationStatement", "src": "2290:54:11" }, { "expression": { "arguments": [ { "id": 3750, "name": "success", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3741, "src": "2362:7:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564", "id": 3751, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2371:60:11", "typeDescriptions": { "typeIdentifier": "t_stringliteral_51ddaa38748c0a1144620fb5bfe8edab31ea437571ad591a7734bbfd0429aeae", "typeString": "literal_string \"Address: unable to send value, recipient may have reverted\"" }, "value": "Address: unable to send value, recipient may have reverted" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_51ddaa38748c0a1144620fb5bfe8edab31ea437571ad591a7734bbfd0429aeae", "typeString": "literal_string \"Address: unable to send value, recipient may have reverted\"" } ], "id": 3749, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "2354:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 3752, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2354:78:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 3753, "nodeType": "ExpressionStatement", "src": "2354:78:11" } ] }, "documentation": { "id": 3722, "nodeType": "StructuredDocumentation", "src": "1137:906:11", "text": " @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n `recipient`, forwarding all available gas and reverting on errors.\n https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n of certain opcodes, possibly making contracts go over the 2300 gas limit\n imposed by `transfer`, making them unable to receive funds via\n `transfer`. {sendValue} removes this limitation.\n https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n IMPORTANT: because control is transferred to `recipient`, care must be\n taken to not create reentrancy vulnerabilities. Consider using\n {ReentrancyGuard} or the\n https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]." }, "id": 3755, "implemented": true, "kind": "function", "modifiers": [], "name": "sendValue", "nodeType": "FunctionDefinition", "parameters": { "id": 3727, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3724, "mutability": "mutable", "name": "recipient", "nodeType": "VariableDeclaration", "scope": 3755, "src": "2067:25:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" }, "typeName": { "id": 3723, "name": "address", "nodeType": "ElementaryTypeName", "src": "2067:15:11", "stateMutability": "payable", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "visibility": "internal" }, { "constant": false, "id": 3726, "mutability": "mutable", "name": "amount", "nodeType": "VariableDeclaration", "scope": 3755, "src": "2094:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 3725, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "2094:7:11", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "2066:43:11" }, "returnParameters": { "id": 3728, "nodeType": "ParameterList", "parameters": [], "src": "2119:0:11" }, "scope": 3997, "src": "2048:391:11", "stateMutability": "nonpayable", "virtual": false, "visibility": "internal" }, { "body": { "id": 3771, "nodeType": "Block", "src": "3269:82:11", "statements": [ { "expression": { "arguments": [ { "id": 3766, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3758, "src": "3297:6:11", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "id": 3767, "name": "data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3760, "src": "3305:4:11", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, { "hexValue": "416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564", "id": 3768, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "3311:32:11", "typeDescriptions": { "typeIdentifier": "t_stringliteral_24d7ab5d382116e64324f19950ca9340b8af1ddeb09a8d026e0a3c6a01dcc9df", "typeString": "literal_string \"Address: low-level call failed\"" }, "value": "Address: low-level call failed" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" }, { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" }, { "typeIdentifier": "t_stringliteral_24d7ab5d382116e64324f19950ca9340b8af1ddeb09a8d026e0a3c6a01dcc9df", "typeString": "literal_string \"Address: low-level call failed\"" } ], "id": 3765, "name": "functionCall", "nodeType": "Identifier", "overloadedDeclarations": [ 3772, 3792 ], "referencedDeclaration": 3792, "src": "3284:12:11", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$_t_string_memory_ptr_$returns$_t_bytes_memory_ptr_$", "typeString": "function (address,bytes memory,string memory) returns (bytes memory)" } }, "id": 3769, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3284:60:11", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "functionReturnParameters": 3764, "id": 3770, "nodeType": "Return", "src": "3277:67:11" } ] }, "documentation": { "id": 3756, "nodeType": "StructuredDocumentation", "src": "2445:730:11", "text": " @dev Performs a Solidity function call using a low level `call`. A\n plain`call` is an unsafe replacement for a function call: use this\n function instead.\n If `target` reverts with a revert reason, it is bubbled up by this\n function (like regular Solidity function calls).\n Returns the raw returned data. To convert to the expected return value,\n use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n Requirements:\n - `target` must be a contract.\n - calling `target` with `data` must not revert.\n _Available since v3.1._" }, "id": 3772, "implemented": true, "kind": "function", "modifiers": [], "name": "functionCall", "nodeType": "FunctionDefinition", "parameters": { "id": 3761, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3758, "mutability": "mutable", "name": "target", "nodeType": "VariableDeclaration", "scope": 3772, "src": "3202:14:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 3757, "name": "address", "nodeType": "ElementaryTypeName", "src": "3202:7:11", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 3760, "mutability": "mutable", "name": "data", "nodeType": "VariableDeclaration", "scope": 3772, "src": "3218:17:11", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 3759, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "3218:5:11", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "src": "3201:35:11" }, "returnParameters": { "id": 3764, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3763, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 3772, "src": "3255:12:11", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 3762, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "3255:5:11", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "src": "3254:14:11" }, "scope": 3997, "src": "3180:171:11", "stateMutability": "nonpayable", "virtual": false,