UNPKG

@gooddollar/goodcontracts

Version:
521 lines 20.5 kB
{ "contractName": "Address", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.4+commit.9549d8ff\"},\"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\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0x5c731061b804fa256fc8c05150eafe5d20b6bb94541a8f187912bf84f7033f34\",\"urls\":[\"bzzr://63fc4af0d7a99a770925b96a6cf48f25fc00d30274266f82db05f30baa238267\"]}},\"version\":1}", "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820bc55a4e315d43748ae25d9b8a77f8797effac23dd17b86e7e7dcf761357b8be80029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820bc55a4e315d43748ae25d9b8a77f8797effac23dd17b86e7e7dcf761357b8be80029", "sourceMap": "85:996:75:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24", "deployedSourceMap": "85:996:75:-;;;;;;;;", "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": [ 16767 ] }, "id": 16768, "nodeType": "SourceUnit", "nodes": [ { "id": 16750, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:75" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "Utility library of inline functions on addresses", "fullyImplemented": true, "id": 16767, "linearizedBaseContracts": [ 16767 ], "name": "Address", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 16765, "nodeType": "Block", "src": "529:550:75", "statements": [ { "assignments": [ 16758 ], "declarations": [ { "constant": false, "id": 16758, "name": "size", "nodeType": "VariableDeclaration", "scope": 16765, "src": "539:12:75", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 16757, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "539:7:75", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 16759, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "539:12:75" }, { "externalReferences": [ { "size": { "declaration": 16758, "isOffset": false, "isSlot": false, "src": "1018:4:75", "valueSize": 1 } }, { "account": { "declaration": 16752, "isOffset": false, "isSlot": false, "src": "1038:7:75", "valueSize": 1 } } ], "id": 16760, "nodeType": "InlineAssembly", "operations": "{\n size := extcodesize(account)\n}", "src": "1007:56:75" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 16763, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 16761, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16758, "src": "1064:4:75", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 16762, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1071:1:75", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1064:8:75", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 16756, "id": 16764, "nodeType": "Return", "src": "1057:15:75" } ] }, "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": 16766, "implemented": true, "kind": "function", "modifiers": [], "name": "isContract", "nodeType": "FunctionDefinition", "parameters": { "id": 16753, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 16752, "name": "account", "nodeType": "VariableDeclaration", "scope": 16766, "src": "483:15:75", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 16751, "name": "address", "nodeType": "ElementaryTypeName", "src": "483:7:75", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "482:17:75" }, "returnParameters": { "id": 16756, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 16755, "name": "", "nodeType": "VariableDeclaration", "scope": 16766, "src": "523:4:75", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 16754, "name": "bool", "nodeType": "ElementaryTypeName", "src": "523:4:75", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "522:6:75" }, "scope": 16767, "src": "463:616:75", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], "scope": 16768, "src": "85:996:75" } ], "src": "0:1082:75" }, "legacyAST": { "absolutePath": "openzeppelin-solidity/contracts/utils/Address.sol", "exportedSymbols": { "Address": [ 16767 ] }, "id": 16768, "nodeType": "SourceUnit", "nodes": [ { "id": 16750, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:75" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "Utility library of inline functions on addresses", "fullyImplemented": true, "id": 16767, "linearizedBaseContracts": [ 16767 ], "name": "Address", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 16765, "nodeType": "Block", "src": "529:550:75", "statements": [ { "assignments": [ 16758 ], "declarations": [ { "constant": false, "id": 16758, "name": "size", "nodeType": "VariableDeclaration", "scope": 16765, "src": "539:12:75", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 16757, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "539:7:75", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 16759, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "539:12:75" }, { "externalReferences": [ { "size": { "declaration": 16758, "isOffset": false, "isSlot": false, "src": "1018:4:75", "valueSize": 1 } }, { "account": { "declaration": 16752, "isOffset": false, "isSlot": false, "src": "1038:7:75", "valueSize": 1 } } ], "id": 16760, "nodeType": "InlineAssembly", "operations": "{\n size := extcodesize(account)\n}", "src": "1007:56:75" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 16763, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 16761, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16758, "src": "1064:4:75", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 16762, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1071:1:75", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1064:8:75", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 16756, "id": 16764, "nodeType": "Return", "src": "1057:15:75" } ] }, "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": 16766, "implemented": true, "kind": "function", "modifiers": [], "name": "isContract", "nodeType": "FunctionDefinition", "parameters": { "id": 16753, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 16752, "name": "account", "nodeType": "VariableDeclaration", "scope": 16766, "src": "483:15:75", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 16751, "name": "address", "nodeType": "ElementaryTypeName", "src": "483:7:75", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "482:17:75" }, "returnParameters": { "id": 16756, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 16755, "name": "", "nodeType": "VariableDeclaration", "scope": 16766, "src": "523:4:75", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 16754, "name": "bool", "nodeType": "ElementaryTypeName", "src": "523:4:75", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "522:6:75" }, "scope": 16767, "src": "463:616:75", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], "scope": 16768, "src": "85:996:75" } ], "src": "0:1082:75" }, "compiler": { "name": "solc", "version": "0.5.4+commit.9549d8ff.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.16", "updatedAt": "2020-07-07T14:28:02.485Z", "devdoc": { "methods": {} }, "userdoc": { "methods": {}, "notice": "Utility library of inline functions on addresses" } }