UNPKG

hardlydifficult-ethereum-contracts

Version:
467 lines 18.5 kB
{ "contractName": "SqrtMock", "abi": [ { "constant": true, "inputs": [ { "internalType": "uint256", "name": "x", "type": "uint256" } ], "name": "sqrt", "outputs": [ { "internalType": "uint256", "name": "y", "type": "uint256" } ], "payable": false, "stateMutability": "pure", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"sqrt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{},\"title\":\"Used for testing only.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/circleci/repo/contracts/test-artifacts/SqrtMock.sol\":\"SqrtMock\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":2000000},\"remappings\":[]},\"sources\":{\"/home/circleci/repo/contracts/math/Sqrt.sol\":{\"keccak256\":\"0xec541cc87ee76ff6c6f30adb84c51f085aeab720c3a199d97bb95186fe5dcefc\",\"urls\":[\"bzz-raw://47c4ab660a84cff2748e677649a293b1236ac52dc6f031a77922804171242d78\",\"dweb:/ipfs/QmQaesqchMSGP6YgbHenBoEoeKc8keEfgJRco6sKBZk5AH\"]},\"/home/circleci/repo/contracts/test-artifacts/SqrtMock.sol\":{\"keccak256\":\"0x63cd11f05373ca720d8873ef7ce5eb304dc8b1893403e0af377bb6d16d46c214\",\"urls\":[\"bzz-raw://3000f56376d78dfdba27fd2643500e0308f5a44c1c2e99122ad38f5b7ac2c5f7\",\"dweb:/ipfs/QmRaKBbk6tsczXyA35V6N8NrXhf2FuckRKbG45emtXNzcQ\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5061012b806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063677342ce14602d575b600080fd5b604760048036036020811015604157600080fd5b50356059565b60408051918252519081900360200190f35b6000606282606a565b90505b919050565b6000816077575060006065565b600382116085575060016065565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141560c257506fffffffffffffffffffffffffffffffff6065565b5080600260018201045b8181101560f05780915060028182858160e157fe5b04018160e957fe5b04905060cc565b5091905056fea265627a7a7231582061fc1bad482e94d2d55437e99bf24589fa2ac480dbf13ba956086f37790e5b1764736f6c63430005110032", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063677342ce14602d575b600080fd5b604760048036036020811015604157600080fd5b50356059565b60408051918252519081900360200190f35b6000606282606a565b90505b919050565b6000816077575060006065565b600382116085575060016065565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141560c257506fffffffffffffffffffffffffffffffff6065565b5080600260018201045b8181101560f05780915060028182858160e157fe5b04018160e957fe5b04905060cc565b5091905056fea265627a7a7231582061fc1bad482e94d2d55437e99bf24589fa2ac480dbf13ba956086f37790e5b1764736f6c63430005110032", "sourceMap": "95:119:17:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;95:119:17;;;;;;;", "deployedSourceMap": "95:119:17:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;95:119:17;;;;;;;;;;;;;;;;;;;117:95;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;117:95:17;;:::i;:::-;;;;;;;;;;;;;;;;;172:6;195:12;205:1;195:9;:12::i;:::-;188:19;;117:95;;;;:::o;285:383:5:-;342:6;362;358:198;;-1:-1:-1;389:1:5;382:8;;358:198;416:1;411;:6;407:149;;-1:-1:-1;438:1:5;431:8;;407:149;212:10;460:1;:13;456:100;;;-1:-1:-1;539:10:5;532:17;;456:100;-1:-1:-1;572:5:5;581:1;576;572:5;;571:11;599:65;610:1;606;:5;599:65;;;629:1;625:5;;656:1;651;647;643;:5;;;;;;:9;642:15;;;;;;638:19;;599:65;;;285:383;;;;:::o", "source": "pragma solidity ^0.5.0;\n\n\nimport '../math/Sqrt.sol';\n\n/**\n * @title Used for testing only.\n */\ncontract SqrtMock\n{\n function sqrt(\n uint x\n ) public pure\n returns (uint y)\n {\n return Sqrt.sqrt(x);\n }\n}\n", "sourcePath": "/home/circleci/repo/contracts/test-artifacts/SqrtMock.sol", "ast": { "absolutePath": "/home/circleci/repo/contracts/test-artifacts/SqrtMock.sol", "exportedSymbols": { "SqrtMock": [ 1658 ] }, "id": 1659, "nodeType": "SourceUnit", "nodes": [ { "id": 1643, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:17" }, { "absolutePath": "/home/circleci/repo/contracts/math/Sqrt.sol", "file": "../math/Sqrt.sol", "id": 1644, "nodeType": "ImportDirective", "scope": 1659, "sourceUnit": 1232, "src": "26:26:17", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title Used for testing only.", "fullyImplemented": true, "id": 1658, "linearizedBaseContracts": [ 1658 ], "name": "SqrtMock", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1656, "nodeType": "Block", "src": "182:30:17", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1653, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1646, "src": "205:1:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 1651, "name": "Sqrt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1231, "src": "195:4:17", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Sqrt_$1231_$", "typeString": "type(library Sqrt)" } }, "id": 1652, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sqrt", "nodeType": "MemberAccess", "referencedDeclaration": 1230, "src": "195:9:17", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 1654, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "195:12:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1650, "id": 1655, "nodeType": "Return", "src": "188:19:17" } ] }, "documentation": null, "id": 1657, "implemented": true, "kind": "function", "modifiers": [], "name": "sqrt", "nodeType": "FunctionDefinition", "parameters": { "id": 1647, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1646, "name": "x", "nodeType": "VariableDeclaration", "scope": 1657, "src": "136:6:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1645, "name": "uint", "nodeType": "ElementaryTypeName", "src": "136:4:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "130:16:17" }, "returnParameters": { "id": 1650, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1649, "name": "y", "nodeType": "VariableDeclaration", "scope": 1657, "src": "172:6:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1648, "name": "uint", "nodeType": "ElementaryTypeName", "src": "172:4:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "171:8:17" }, "scope": 1658, "src": "117:95:17", "stateMutability": "pure", "superFunction": null, "visibility": "public" } ], "scope": 1659, "src": "95:119:17" } ], "src": "0:215:17" }, "legacyAST": { "absolutePath": "/home/circleci/repo/contracts/test-artifacts/SqrtMock.sol", "exportedSymbols": { "SqrtMock": [ 1658 ] }, "id": 1659, "nodeType": "SourceUnit", "nodes": [ { "id": 1643, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:17" }, { "absolutePath": "/home/circleci/repo/contracts/math/Sqrt.sol", "file": "../math/Sqrt.sol", "id": 1644, "nodeType": "ImportDirective", "scope": 1659, "sourceUnit": 1232, "src": "26:26:17", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "@title Used for testing only.", "fullyImplemented": true, "id": 1658, "linearizedBaseContracts": [ 1658 ], "name": "SqrtMock", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 1656, "nodeType": "Block", "src": "182:30:17", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1653, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1646, "src": "205:1:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 1651, "name": "Sqrt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1231, "src": "195:4:17", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Sqrt_$1231_$", "typeString": "type(library Sqrt)" } }, "id": 1652, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sqrt", "nodeType": "MemberAccess", "referencedDeclaration": 1230, "src": "195:9:17", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 1654, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "195:12:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 1650, "id": 1655, "nodeType": "Return", "src": "188:19:17" } ] }, "documentation": null, "id": 1657, "implemented": true, "kind": "function", "modifiers": [], "name": "sqrt", "nodeType": "FunctionDefinition", "parameters": { "id": 1647, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1646, "name": "x", "nodeType": "VariableDeclaration", "scope": 1657, "src": "136:6:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1645, "name": "uint", "nodeType": "ElementaryTypeName", "src": "136:4:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "130:16:17" }, "returnParameters": { "id": 1650, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1649, "name": "y", "nodeType": "VariableDeclaration", "scope": 1657, "src": "172:6:17", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 1648, "name": "uint", "nodeType": "ElementaryTypeName", "src": "172:4:17", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "171:8:17" }, "scope": 1658, "src": "117:95:17", "stateMutability": "pure", "superFunction": null, "visibility": "public" } ], "scope": 1659, "src": "95:119:17" } ], "src": "0:215:17" }, "compiler": { "name": "solc", "version": "0.5.17+commit.d19bba13.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.23", "updatedAt": "2020-04-07T20:17:34.956Z", "devdoc": { "methods": {}, "title": "Used for testing only." }, "userdoc": { "methods": {} } }