UNPKG

@gooddollar/goodcontracts

Version:
521 lines 20.5 kB
{ "contractName": "Address", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{},\"notice\":\"Utility library of inline functions on addresses\"}},\"settings\":{\"compilationTarget\":{\"openzeppelin-solidity/contracts/utils/Address.sol\":\"Address\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0x5c731061b804fa256fc8c05150eafe5d20b6bb94541a8f187912bf84f7033f34\",\"urls\":[\"bzz-raw://a3c2d9f046beebab7fb41b1b124a6a124a36f510f7c67365861402ac831bdc71\",\"dweb:/ipfs/QmUtASRgitregbKH83anopLtF9vFQe3BKeAjhUa6F7t9YV\"]}},\"version\":1}", "bytecode": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820cacf90338cadf9043225e78d0a6347eddb8e61cab8589dde79e4546262969b4664736f6c63430005100032", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820cacf90338cadf9043225e78d0a6347eddb8e61cab8589dde79e4546262969b4664736f6c63430005100032", "sourceMap": "85:996:84:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24", "deployedSourceMap": "85:996:84:-;;;;;;;;", "source": "pragma solidity ^0.5.0;\n\n/**\n * Utility library of inline functions on addresses\n */\nlibrary Address {\n /**\n * Returns whether the target address is a contract\n * @dev This function will return false if invoked during the constructor of a contract,\n * as the code is not actually created until after the constructor finishes.\n * @param account address of the account to check\n * @return whether the target address is a contract\n */\n function isContract(address account) internal view returns (bool) {\n uint256 size;\n // XXX Currently there is no better way to check if there is a contract in an address\n // than to check the size of the code at that address.\n // See https://ethereum.stackexchange.com/a/14016/36603\n // for more details about how this works.\n // TODO Check this again before the Serenity release, because all addresses will be\n // contracts then.\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n}\n", "sourcePath": "openzeppelin-solidity/contracts/utils/Address.sol", "ast": { "absolutePath": "openzeppelin-solidity/contracts/utils/Address.sol", "exportedSymbols": { "Address": [ 22156 ] }, "id": 22157, "nodeType": "SourceUnit", "nodes": [ { "id": 22139, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:84" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "Utility library of inline functions on addresses", "fullyImplemented": true, "id": 22156, "linearizedBaseContracts": [ 22156 ], "name": "Address", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 22154, "nodeType": "Block", "src": "529:550:84", "statements": [ { "assignments": [ 22147 ], "declarations": [ { "constant": false, "id": 22147, "name": "size", "nodeType": "VariableDeclaration", "scope": 22154, "src": "539:12:84", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 22146, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "539:7:84", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 22148, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "539:12:84" }, { "externalReferences": [ { "size": { "declaration": 22147, "isOffset": false, "isSlot": false, "src": "1018:4:84", "valueSize": 1 } }, { "account": { "declaration": 22141, "isOffset": false, "isSlot": false, "src": "1038:7:84", "valueSize": 1 } } ], "id": 22149, "nodeType": "InlineAssembly", "operations": "{ size := extcodesize(account) }", "src": "1007:41:84" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 22152, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 22150, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22147, "src": "1064:4:84", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 22151, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1071:1:84", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1064:8:84", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 22145, "id": 22153, "nodeType": "Return", "src": "1057:15:84" } ] }, "documentation": "Returns whether the target address is a contract\n@dev This function will return false if invoked during the constructor of a contract,\nas the code is not actually created until after the constructor finishes.\n@param account address of the account to check\n@return whether the target address is a contract", "id": 22155, "implemented": true, "kind": "function", "modifiers": [], "name": "isContract", "nodeType": "FunctionDefinition", "parameters": { "id": 22142, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 22141, "name": "account", "nodeType": "VariableDeclaration", "scope": 22155, "src": "483:15:84", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 22140, "name": "address", "nodeType": "ElementaryTypeName", "src": "483:7:84", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "482:17:84" }, "returnParameters": { "id": 22145, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 22144, "name": "", "nodeType": "VariableDeclaration", "scope": 22155, "src": "523:4:84", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 22143, "name": "bool", "nodeType": "ElementaryTypeName", "src": "523:4:84", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "522:6:84" }, "scope": 22156, "src": "463:616:84", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], "scope": 22157, "src": "85:996:84" } ], "src": "0:1082:84" }, "legacyAST": { "absolutePath": "openzeppelin-solidity/contracts/utils/Address.sol", "exportedSymbols": { "Address": [ 22156 ] }, "id": 22157, "nodeType": "SourceUnit", "nodes": [ { "id": 22139, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:84" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "Utility library of inline functions on addresses", "fullyImplemented": true, "id": 22156, "linearizedBaseContracts": [ 22156 ], "name": "Address", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 22154, "nodeType": "Block", "src": "529:550:84", "statements": [ { "assignments": [ 22147 ], "declarations": [ { "constant": false, "id": 22147, "name": "size", "nodeType": "VariableDeclaration", "scope": 22154, "src": "539:12:84", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 22146, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "539:7:84", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 22148, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "539:12:84" }, { "externalReferences": [ { "size": { "declaration": 22147, "isOffset": false, "isSlot": false, "src": "1018:4:84", "valueSize": 1 } }, { "account": { "declaration": 22141, "isOffset": false, "isSlot": false, "src": "1038:7:84", "valueSize": 1 } } ], "id": 22149, "nodeType": "InlineAssembly", "operations": "{ size := extcodesize(account) }", "src": "1007:41:84" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 22152, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 22150, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22147, "src": "1064:4:84", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 22151, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1071:1:84", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1064:8:84", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 22145, "id": 22153, "nodeType": "Return", "src": "1057:15:84" } ] }, "documentation": "Returns whether the target address is a contract\n@dev This function will return false if invoked during the constructor of a contract,\nas the code is not actually created until after the constructor finishes.\n@param account address of the account to check\n@return whether the target address is a contract", "id": 22155, "implemented": true, "kind": "function", "modifiers": [], "name": "isContract", "nodeType": "FunctionDefinition", "parameters": { "id": 22142, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 22141, "name": "account", "nodeType": "VariableDeclaration", "scope": 22155, "src": "483:15:84", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 22140, "name": "address", "nodeType": "ElementaryTypeName", "src": "483:7:84", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "482:17:84" }, "returnParameters": { "id": 22145, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 22144, "name": "", "nodeType": "VariableDeclaration", "scope": 22155, "src": "523:4:84", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 22143, "name": "bool", "nodeType": "ElementaryTypeName", "src": "523:4:84", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "522:6:84" }, "scope": 22156, "src": "463:616:84", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], "scope": 22157, "src": "85:996:84" } ], "src": "0:1082:84" }, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.2.2", "updatedAt": "2021-08-23T07:33:52.708Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {}, "notice": "Utility library of inline functions on addresses" } }