@vporton/future-contracts
Version:
Ethereum accounts bid on future financing (essentially, transfer money from the future) - smart contracts
1,004 lines • 287 kB
JSON
{
"contractName": "Address",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"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\":true,\"runs\":1000000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0xa6a15ddddcbf29d2922a1e0d4151b5d2d33da24b93cc9ebc12390e0d855532f8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7c119bcaecfa853d564ac88d312777f75fa1126a3bca88a3371adb0ad9f35cb0\",\"dweb:/ipfs/QmY9UPuXeSKq86Zh38fE43VGQPhKMN34mkuFSFqPcr6nvZ\"]}},\"version\":1}",
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220264b8a08c3499e715dd5d12ff20a404cc7582150b3707fb8bcc895ca5782032764736f6c63430007060033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220264b8a08c3499e715dd5d12ff20a404cc7582150b3707fb8bcc895ca5782032764736f6c63430007060033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "134:6704:34:-:0;;;;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "134:6704:34:-:0;;;;;;;;",
"source": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <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 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": [
6821
]
},
"id": 6822,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6579,
"literals": [
"solidity",
">=",
"0.6",
".2",
"<",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "33:31:34"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 6580,
"nodeType": "StructuredDocumentation",
"src": "66:67:34",
"text": " @dev Collection of functions related to the address type"
},
"fullyImplemented": true,
"id": 6821,
"linearizedBaseContracts": [
6821
],
"name": "Address",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 6596,
"nodeType": "Block",
"src": "792:347:34",
"statements": [
{
"assignments": [
6589
],
"declarations": [
{
"constant": false,
"id": 6589,
"mutability": "mutable",
"name": "size",
"nodeType": "VariableDeclaration",
"scope": 6596,
"src": "989:12:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6588,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "989:7:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 6590,
"nodeType": "VariableDeclarationStatement",
"src": "989:12:34"
},
{
"AST": {
"nodeType": "YulBlock",
"src": "1076:32:34",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1078:28:34",
"value": {
"arguments": [
{
"name": "account",
"nodeType": "YulIdentifier",
"src": "1098:7:34"
}
],
"functionName": {
"name": "extcodesize",
"nodeType": "YulIdentifier",
"src": "1086:11:34"
},
"nodeType": "YulFunctionCall",
"src": "1086:20:34"
},
"variableNames": [
{
"name": "size",
"nodeType": "YulIdentifier",
"src": "1078:4:34"
}
]
}
]
},
"evmVersion": "istanbul",
"externalReferences": [
{
"declaration": 6583,
"isOffset": false,
"isSlot": false,
"src": "1098:7:34",
"valueSize": 1
},
{
"declaration": 6589,
"isOffset": false,
"isSlot": false,
"src": "1078:4:34",
"valueSize": 1
}
],
"id": 6591,
"nodeType": "InlineAssembly",
"src": "1067:41:34"
},
{
"expression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6594,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 6592,
"name": "size",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6589,
"src": "1124:4:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"hexValue": "30",
"id": 6593,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1131:1:34",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1124:8:34",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 6587,
"id": 6595,
"nodeType": "Return",
"src": "1117:15:34"
}
]
},
"documentation": {
"id": 6581,
"nodeType": "StructuredDocumentation",
"src": "156:565:34",
"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": 6597,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isContract",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6584,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6583,
"mutability": "mutable",
"name": "account",
"nodeType": "VariableDeclaration",
"scope": 6597,
"src": "746:15:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6582,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "746:7:34",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "745:17:34"
},
"returnParameters": {
"id": 6587,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6586,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 6597,
"src": "786:4:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6585,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "786:4:34",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "785:6:34"
},
"scope": 6821,
"src": "726:413:34",
"stateMutability": "view",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 6630,
"nodeType": "Block",
"src": "2127:320:34",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6612,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"expression": {
"arguments": [
{
"id": 6608,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967268,
"src": "2153:4:34",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Address_$6821",
"typeString": "library Address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_Address_$6821",
"typeString": "library Address"
}
],
"id": 6607,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2145:7:34",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 6606,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2145:7:34",
"typeDescriptions": {}
}
},
"id": 6609,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2145:13:34",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 6610,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"src": "2145:21:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"id": 6611,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6602,
"src": "2170:6:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2145:31:34",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "416464726573733a20696e73756666696369656e742062616c616e6365",
"id": 6613,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2178:31:34",
"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": 6605,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "2137:7:34",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 6614,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2137:73:34",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6615,
"nodeType": "ExpressionStatement",
"src": "2137:73:34"
},
{
"assignments": [
6617,
null
],
"declarations": [
{
"constant": false,
"id": 6617,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"scope": 6630,
"src": "2299:12:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6616,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2299:4:34",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
},
null
],
"id": 6624,
"initialValue": {
"arguments": [
{
"hexValue": "",
"id": 6622,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2349:2:34",
"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": 6618,
"name": "recipient",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6600,
"src": "2317:9:34",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 6619,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"src": "2317:14:34",
"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": 6621,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"names": [
"value"
],
"nodeType": "FunctionCallOptions",
"options": [
{
"id": 6620,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6602,
"src": "2340:6:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"src": "2317:31:34",
"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": 6623,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2317:35:34",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2298:54:34"
},
{
"expression": {
"arguments": [
{
"id": 6626,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6617,
"src": "2370:7:34",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "416464726573733a20756e61626c6520746f2073656e642076616c75652c20726563697069656e74206d61792068617665207265766572746564",
"id": 6627,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2379:60:34",
"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": 6625,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "2362:7:34",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 6628,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2362:78:34",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6629,
"nodeType": "ExpressionStatement",
"src": "2362:78:34"
}
]
},
"documentation": {
"id": 6598,
"nodeType": "StructuredDocumentation",
"src": "1145:906:34",
"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": 6631,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "sendValue",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6603,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6600,
"mutability": "mutable",
"name": "recipient",
"nodeType": "VariableDeclaration",
"scope": 6631,
"src": "2075:25:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 6599,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2075:15:34",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6602,
"mutability": "mutable",
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 6631,
"src": "2102:14:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6601,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2102:7:34",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "2074:43:34"
},
"returnParameters": {
"id": 6604,
"nodeType": "ParameterList",
"parameters": [],
"src": "2127:0:34"
},
"scope": 6821,
"src": "2056:391:34",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 6647,
"nodeType": "Block",
"src": "3277:82:34",
"statements": [
{
"expression": {
"arguments": [
{
"id": 6642,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6634,
"src": "3305:6:34",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"id": 6643,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6636,
"src": "3313:4:34",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"hexValue": "416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564",
"id": 6644,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3319:32:34",
"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": 6641,
"name": "functionCall",
"nodeType": "Identifier",
"overloadedDeclarations": [
6648,
6668
],
"referencedDeclaration": 6668,
"src": "3292:12:34",
"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": 6645,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3292:60:34",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"functionReturnParameters": 6640,
"id": 6646,
"nodeType": "Return",
"src": "3285:67:34"
}
]
},
"documentation": {
"id": 6632,
"nodeType": "StructuredDocumentation",
"src": "2453:730:34",
"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": 6648,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "functionCall",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6637,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6634,
"mutability": "mutable",
"name": "target",
"nodeType": "VariableDeclaration",
"scope": 6648,
"src": "3210:14:34",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6633,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3210:7:34",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 6636,
"mutability": "mutable",
"name": "data",
"nodeType": "VariableDeclaration",
"scope": 6648,
"src": "3226:17:34",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 6635,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "3226:5:34",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "3209:35:34"
},
"returnParameters": {
"id": 6640,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6639,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 6648,
"src": "3263:12:34",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 6638,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "3263:5:34",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "3262:14:34"
},
"scope": 6821,
"src": "3188:171:34",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 6667,
"nodeType": "Block",
"src": "3698:76:34",
"statements": [
{
"expression": {
"arguments": [
{
"id": 6661,
"name": "target",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6651,
"src": "3737:6:34",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"id": 6662,
"name": "data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDecla