UNPKG

@aragon/apps-payroll

Version:

_**Code in Github:**_ [aragon-apps/apps/payroll](https://github.com/aragon/aragon-apps/tree/master/future-apps/payroll)

761 lines 28.5 kB
{ "contractName": "IsContract", "abi": [], "bytecode": "0x6080604052348015600f57600080fd5b50603580601d6000396000f3006080604052600080fd00a165627a7a723058207e3915f8ef11fda157b2040b87df112745d09a818078627240e5f75b2eb72f020029", "deployedBytecode": "0x6080604052600080fd00a165627a7a723058207e3915f8ef11fda157b2040b87df112745d09a818078627240e5f75b2eb72f020029", "sourceMap": "71:601:33:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;71:601:33;;;;;;;", "deployedSourceMap": "71:601:33:-;;;;;", "source": "/*\n * SPDX-License-Identitifer: MIT\n */\n\npragma solidity ^0.4.24;\n\n\ncontract IsContract {\n /*\n * NOTE: this should NEVER be used for authentication\n * (see pitfalls: https://github.com/fergarrui/ethereum-security/tree/master/contracts/extcodesize).\n *\n * This is only intended to be used as a sanity check that an address is actually a contract,\n * RATHER THAN an address not being a contract.\n */\n function isContract(address _target) internal view returns (bool) {\n if (_target == address(0)) {\n return false;\n }\n\n uint256 size;\n assembly { size := extcodesize(_target) }\n return size > 0;\n }\n}\n", "sourcePath": "@aragon/os/contracts/common/IsContract.sol", "ast": { "absolutePath": "@aragon/os/contracts/common/IsContract.sol", "exportedSymbols": { "IsContract": [ 10838 ] }, "id": 10839, "nodeType": "SourceUnit", "nodes": [ { "id": 10812, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "44:24:33" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 10838, "linearizedBaseContracts": [ 10838 ], "name": "IsContract", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 10836, "nodeType": "Block", "src": "492:178:33", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 10823, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 10819, "name": "_target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 10814, "src": "506:7:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 10821, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "525:1:33", "subdenomination": null, "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": 10820, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "517:7:33", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 10822, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "517:10:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "506:21:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 10827, "nodeType": "IfStatement", "src": "502:64:33", "trueBody": { "id": 10826, "nodeType": "Block", "src": "529:37:33", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 10824, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "550:5:33", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 10818, "id": 10825, "nodeType": "Return", "src": "543:12:33" } ] } }, { "assignments": [], "declarations": [ { "constant": false, "id": 10829, "name": "size", "nodeType": "VariableDeclaration", "scope": 10837, "src": "576:12:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 10828, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "576:7:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 10830, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "576:12:33" }, { "externalReferences": [ { "size": { "declaration": 10829, "isOffset": false, "isSlot": false, "src": "609:4:33", "valueSize": 1 } }, { "_target": { "declaration": 10814, "isOffset": false, "isSlot": false, "src": "629:7:33", "valueSize": 1 } } ], "id": 10831, "nodeType": "InlineAssembly", "operations": "{\n size := extcodesize(_target)\n}", "src": "598:56:33" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 10834, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 10832, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 10829, "src": "655:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 10833, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "662:1:33", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "655:8:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 10818, "id": 10835, "nodeType": "Return", "src": "648:15:33" } ] }, "documentation": null, "id": 10837, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "isContract", "nodeType": "FunctionDefinition", "parameters": { "id": 10815, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 10814, "name": "_target", "nodeType": "VariableDeclaration", "scope": 10837, "src": "446:15:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 10813, "name": "address", "nodeType": "ElementaryTypeName", "src": "446:7:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "445:17:33" }, "payable": false, "returnParameters": { "id": 10818, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 10817, "name": "", "nodeType": "VariableDeclaration", "scope": 10837, "src": "486:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 10816, "name": "bool", "nodeType": "ElementaryTypeName", "src": "486:4:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "485:6:33" }, "scope": 10838, "src": "426:244:33", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], "scope": 10839, "src": "71:601:33" } ], "src": "44:629:33" }, "legacyAST": { "absolutePath": "@aragon/os/contracts/common/IsContract.sol", "exportedSymbols": { "IsContract": [ 10838 ] }, "id": 10839, "nodeType": "SourceUnit", "nodes": [ { "id": 10812, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "44:24:33" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 10838, "linearizedBaseContracts": [ 10838 ], "name": "IsContract", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 10836, "nodeType": "Block", "src": "492:178:33", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 10823, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 10819, "name": "_target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 10814, "src": "506:7:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 10821, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "525:1:33", "subdenomination": null, "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": 10820, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "517:7:33", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 10822, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "517:10:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "506:21:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 10827, "nodeType": "IfStatement", "src": "502:64:33", "trueBody": { "id": 10826, "nodeType": "Block", "src": "529:37:33", "statements": [ { "expression": { "argumentTypes": null, "hexValue": "66616c7365", "id": 10824, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "550:5:33", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "functionReturnParameters": 10818, "id": 10825, "nodeType": "Return", "src": "543:12:33" } ] } }, { "assignments": [], "declarations": [ { "constant": false, "id": 10829, "name": "size", "nodeType": "VariableDeclaration", "scope": 10837, "src": "576:12:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 10828, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "576:7:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 10830, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "576:12:33" }, { "externalReferences": [ { "size": { "declaration": 10829, "isOffset": false, "isSlot": false, "src": "609:4:33", "valueSize": 1 } }, { "_target": { "declaration": 10814, "isOffset": false, "isSlot": false, "src": "629:7:33", "valueSize": 1 } } ], "id": 10831, "nodeType": "InlineAssembly", "operations": "{\n size := extcodesize(_target)\n}", "src": "598:56:33" }, { "expression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 10834, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 10832, "name": "size", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 10829, "src": "655:4:33", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 10833, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "662:1:33", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "655:8:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 10818, "id": 10835, "nodeType": "Return", "src": "648:15:33" } ] }, "documentation": null, "id": 10837, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "isContract", "nodeType": "FunctionDefinition", "parameters": { "id": 10815, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 10814, "name": "_target", "nodeType": "VariableDeclaration", "scope": 10837, "src": "446:15:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 10813, "name": "address", "nodeType": "ElementaryTypeName", "src": "446:7:33", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "445:17:33" }, "payable": false, "returnParameters": { "id": 10818, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 10817, "name": "", "nodeType": "VariableDeclaration", "scope": 10837, "src": "486:4:33", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 10816, "name": "bool", "nodeType": "ElementaryTypeName", "src": "486:4:33", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "485:6:33" }, "scope": 10838, "src": "426:244:33", "stateMutability": "view", "superFunction": null, "visibility": "internal" } ], "scope": 10839, "src": "71:601:33" } ], "src": "44:629:33" }, "compiler": { "name": "solc", "version": "0.4.24+commit.e67f0147.Emscripten.clang" }, "networks": {}, "schemaVersion": "2.0.1", "updatedAt": "2019-09-04T11:02:55.762Z" }