hardlydifficult-ethereum-contracts
Version:
A collection of reusable contracts and Javascript helpers for Ethereum.
770 lines • 29.5 kB
JSON
{
"contractName": "Create2Probe",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/circleci/repo/contracts/proxies/Create2Probe.sol\":\"Create2Probe\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":2000000},\"remappings\":[]},\"sources\":{\"/home/circleci/repo/contracts/proxies/Create2Probe.sol\":{\"keccak256\":\"0xe15113008fd3548e20228b0f1f33d51650a3e92e3c83423c4511525a926fc053\",\"urls\":[\"bzz-raw://0a49c2e5cd0aa4fdc4a07a89ba400108fa44d9a2f8689a8d2d9ec39a42ede36f\",\"dweb:/ipfs/QmeZywNZFB8b56ycbdqYJgMdYgg6bKbS2f4AwcSUjif3TX\"]}},\"version\":1}",
"bytecode": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820c01dcd7e1f1669167bfcdd37dc1e93610e9bb2a2702603e22020891043bca9b264736f6c63430005110032",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a72315820c01dcd7e1f1669167bfcdd37dc1e93610e9bb2a2702603e22020891043bca9b264736f6c63430005110032",
"sourceMap": "145:336:11:-;;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": "145:336:11:-;;;;;;;;",
"source": "pragma solidity ^0.5.0;\n\n\n// https://github.com/OpenZeppelin/openzeppelin-sdk/blob/master/packages/lib/contracts/upgradeability/ProxyFactory.sol\nlibrary Create2Probe\n{\n function isAddressAvailable(\n address contractAddress\n ) internal view\n returns (bool)\n {\n if(contractAddress == address(0))\n {\n return false;\n }\n uint size;\n // solium-disable-next-line\n assembly\n {\n size := extcodesize(contractAddress)\n }\n\n return size == 0;\n }\n}\n",
"sourcePath": "/home/circleci/repo/contracts/proxies/Create2Probe.sol",
"ast": {
"absolutePath": "/home/circleci/repo/contracts/proxies/Create2Probe.sol",
"exportedSymbols": {
"Create2Probe": [
1406
]
},
"id": 1407,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1380,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:11"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 1406,
"linearizedBaseContracts": [
1406
],
"name": "Create2Probe",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 1404,
"nodeType": "Block",
"src": "266:213:11",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1387,
"name": "contractAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1382,
"src": "275:15:11",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1389,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "302:1:11",
"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": 1388,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "294:7:11",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 1390,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "294:10:11",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "275:29:11",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1395,
"nodeType": "IfStatement",
"src": "272:65:11",
"trueBody": {
"id": 1394,
"nodeType": "Block",
"src": "310:27:11",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1392,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "325:5:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"functionReturnParameters": 1386,
"id": 1393,
"nodeType": "Return",
"src": "318:12:11"
}
]
}
},
{
"assignments": [
1397
],
"declarations": [
{
"constant": false,
"id": 1397,
"name": "size",
"nodeType": "VariableDeclaration",
"scope": 1404,
"src": "342:9:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1396,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "342:4:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1398,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "342:9:11"
},
{
"externalReferences": [
{
"size": {
"declaration": 1397,
"isOffset": false,
"isSlot": false,
"src": "410:4:11",
"valueSize": 1
}
},
{
"contractAddress": {
"declaration": 1382,
"isOffset": false,
"isSlot": false,
"src": "430:15:11",
"valueSize": 1
}
}
],
"id": 1399,
"nodeType": "InlineAssembly",
"operations": "{\n size := extcodesize(contractAddress)\n}",
"src": "389:63:11"
},
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1402,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1400,
"name": "size",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1397,
"src": "465:4:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1401,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "473:1:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "465:9:11",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1386,
"id": 1403,
"nodeType": "Return",
"src": "458:16:11"
}
]
},
"documentation": null,
"id": 1405,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isAddressAvailable",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1383,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1382,
"name": "contractAddress",
"nodeType": "VariableDeclaration",
"scope": 1405,
"src": "203:23:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1381,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "203:7:11",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "197:33:11"
},
"returnParameters": {
"id": 1386,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1385,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1405,
"src": "258:4:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1384,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "258:4:11",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "257:6:11"
},
"scope": 1406,
"src": "170:309:11",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 1407,
"src": "145:336:11"
}
],
"src": "0:482:11"
},
"legacyAST": {
"absolutePath": "/home/circleci/repo/contracts/proxies/Create2Probe.sol",
"exportedSymbols": {
"Create2Probe": [
1406
]
},
"id": 1407,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1380,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:11"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 1406,
"linearizedBaseContracts": [
1406
],
"name": "Create2Probe",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 1404,
"nodeType": "Block",
"src": "266:213:11",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 1391,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1387,
"name": "contractAddress",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1382,
"src": "275:15:11",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 1389,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "302:1:11",
"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": 1388,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "294:7:11",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 1390,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "294:10:11",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "275:29:11",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1395,
"nodeType": "IfStatement",
"src": "272:65:11",
"trueBody": {
"id": 1394,
"nodeType": "Block",
"src": "310:27:11",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1392,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "325:5:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"functionReturnParameters": 1386,
"id": 1393,
"nodeType": "Return",
"src": "318:12:11"
}
]
}
},
{
"assignments": [
1397
],
"declarations": [
{
"constant": false,
"id": 1397,
"name": "size",
"nodeType": "VariableDeclaration",
"scope": 1404,
"src": "342:9:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1396,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "342:4:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 1398,
"initialValue": null,
"nodeType": "VariableDeclarationStatement",
"src": "342:9:11"
},
{
"externalReferences": [
{
"size": {
"declaration": 1397,
"isOffset": false,
"isSlot": false,
"src": "410:4:11",
"valueSize": 1
}
},
{
"contractAddress": {
"declaration": 1382,
"isOffset": false,
"isSlot": false,
"src": "430:15:11",
"valueSize": 1
}
}
],
"id": 1399,
"nodeType": "InlineAssembly",
"operations": "{\n size := extcodesize(contractAddress)\n}",
"src": "389:63:11"
},
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1402,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1400,
"name": "size",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1397,
"src": "465:4:11",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1401,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "473:1:11",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "465:9:11",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1386,
"id": 1403,
"nodeType": "Return",
"src": "458:16:11"
}
]
},
"documentation": null,
"id": 1405,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "isAddressAvailable",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1383,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1382,
"name": "contractAddress",
"nodeType": "VariableDeclaration",
"scope": 1405,
"src": "203:23:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1381,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "203:7:11",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "197:33:11"
},
"returnParameters": {
"id": 1386,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1385,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1405,
"src": "258:4:11",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1384,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "258:4:11",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "257:6:11"
},
"scope": 1406,
"src": "170:309:11",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 1407,
"src": "145:336:11"
}
],
"src": "0:482:11"
},
"compiler": {
"name": "solc",
"version": "0.5.17+commit.d19bba13.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.23",
"updatedAt": "2020-04-07T20:17:34.947Z",
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
}