UNPKG

hardlydifficult-eth

Version:

A collection of reusable contracts and Javascript helpers for Ethereum.

526 lines 20.3 kB
{ "contractName": "SqrtMock", "abi": [ { "inputs": [ { "internalType": "uint256", "name": "x", "type": "uint256" } ], "name": "sqrt", "outputs": [ { "internalType": "uint256", "name": "y", "type": "uint256" } ], "stateMutability": "pure", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.6.10+commit.00c0fcaf\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"}],\"name\":\"sqrt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{},\"title\":\"Used for testing only.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"project:/contracts/test-artifacts/SqrtMock.sol\":\"SqrtMock\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":2000000},\"remappings\":[]},\"sources\":{\"project:/contracts/math/Sqrt.sol\":{\"keccak256\":\"0x2ad6b44c68238793f920c7ee78b9b4dba44c30734528588faf875499326e0b14\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6f4be8177a8bc12074ba928b783f7dcabe84d6e75632de3a0024849a18d74f52\",\"dweb:/ipfs/QmWK9eicxyqJpUdc9qN23vAv4YdyiAsdVg3Qev9Jxbtcm6\"]},\"project:/contracts/test-artifacts/SqrtMock.sol\":{\"keccak256\":\"0xfc08052e488ccbcab65c57f1d21d09d838f20a7ad31d6c3a0848aecd273ff9cc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://61004eb344c59f00fd20b755f0035b54ec201f764618cdd26c6198cf41fb524e\",\"dweb:/ipfs/QmaTQHqWVRxtPs5hvsS53QGZB5ra6aHp7S7rAKXAnMBMwv\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5061012c806100206000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063677342ce14602d575b600080fd5b604760048036036020811015604157600080fd5b50356059565b60408051918252519081900360200190f35b6000606282606a565b90505b919050565b6000816077575060006065565b600382116085575060016065565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141560c257506fffffffffffffffffffffffffffffffff6065565b5080600260018201045b8181101560f05780915060028182858160e157fe5b04018160e957fe5b04905060cc565b5091905056fea26469706673582212207a6426ab6cfbbbfa0b0825ed041d0e3f618085659662ad8c0d0c5a917e9a241264736f6c634300060a0033", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063677342ce14602d575b600080fd5b604760048036036020811015604157600080fd5b50356059565b60408051918252519081900360200190f35b6000606282606a565b90505b919050565b6000816077575060006065565b600382116085575060016065565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141560c257506fffffffffffffffffffffffffffffffff6065565b5080600260018201045b8181101560f05780915060028182858160e157fe5b04018160e957fe5b04905060cc565b5091905056fea26469706673582212207a6426ab6cfbbbfa0b0825ed041d0e3f618085659662ad8c0d0c5a917e9a241264736f6c634300060a0033", "immutableReferences": {}, "sourceMap": "127:119:27:-:0;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "127:119:27:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;149:95;;;;;;;;;;;;;;;;-1:-1:-1;149:95:27;;:::i;:::-;;;;;;;;;;;;;;;;;204:6;227:12;237:1;227:9;:12::i;:::-;220:19;;149:95;;;;:::o;314:383:12:-;371:6;391;387:198;;-1:-1:-1;418:1:12;411:8;;387:198;445:1;440;:6;436:149;;-1:-1:-1;467:1:12;460:8;;436:149;241:10;489:1;:13;485:100;;;-1:-1:-1;568:10:12;561:17;;485:100;-1:-1:-1;601:5:12;610:1;605;601:5;;600:11;628:65;639:1;635;:5;628:65;;;658:1;654:5;;685:1;680;676;672;:5;;;;;;:9;671:15;;;;;;667:19;;628:65;;;314:383;;;;:::o", "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.6.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": "project:/contracts/test-artifacts/SqrtMock.sol", "exportedSymbols": { "SqrtMock": [ 4067 ] }, "id": 4068, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 4051, "literals": [ "solidity", "^", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "32:23:27" }, { "absolutePath": "project:/contracts/math/Sqrt.sol", "file": "../math/Sqrt.sol", "id": 4052, "nodeType": "ImportDirective", "scope": 4068, "sourceUnit": 2868, "src": "58:26:27", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 4053, "nodeType": "StructuredDocumentation", "src": "86:40:27", "text": " @title Used for testing only." }, "fullyImplemented": true, "id": 4067, "linearizedBaseContracts": [ 4067 ], "name": "SqrtMock", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 4065, "nodeType": "Block", "src": "214:30:27", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 4062, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4055, "src": "237:1:27", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "argumentTypes": null, "id": 4060, "name": "Sqrt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2867, "src": "227:4:27", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Sqrt_$2867_$", "typeString": "type(library Sqrt)" } }, "id": 4061, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sqrt", "nodeType": "MemberAccess", "referencedDeclaration": 2866, "src": "227:9:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 4063, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "227:12:27", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 4059, "id": 4064, "nodeType": "Return", "src": "220:19:27" } ] }, "documentation": null, "functionSelector": "677342ce", "id": 4066, "implemented": true, "kind": "function", "modifiers": [], "name": "sqrt", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 4056, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4055, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4066, "src": "168:6:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4054, "name": "uint", "nodeType": "ElementaryTypeName", "src": "168:4:27", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "162:16:27" }, "returnParameters": { "id": 4059, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 4058, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "overrides": null, "scope": 4066, "src": "204:6:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4057, "name": "uint", "nodeType": "ElementaryTypeName", "src": "204:4:27", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "203:8:27" }, "scope": 4067, "src": "149:95:27", "stateMutability": "pure", "virtual": false, "visibility": "public" } ], "scope": 4068, "src": "127:119:27" } ], "src": "32:215:27" }, "legacyAST": { "attributes": { "absolutePath": "project:/contracts/test-artifacts/SqrtMock.sol", "exportedSymbols": { "SqrtMock": [ 4067 ] }, "license": "MIT" }, "children": [ { "attributes": { "literals": [ "solidity", "^", "0.6", ".0" ] }, "id": 4051, "name": "PragmaDirective", "src": "32:23:27" }, { "attributes": { "SourceUnit": 2868, "absolutePath": "project:/contracts/math/Sqrt.sol", "file": "../math/Sqrt.sol", "scope": 4068, "symbolAliases": [ null ], "unitAlias": "" }, "id": 4052, "name": "ImportDirective", "src": "58:26:27" }, { "attributes": { "abstract": false, "baseContracts": [ null ], "contractDependencies": [ null ], "contractKind": "contract", "fullyImplemented": true, "linearizedBaseContracts": [ 4067 ], "name": "SqrtMock", "scope": 4068 }, "children": [ { "attributes": { "text": " @title Used for testing only." }, "id": 4053, "name": "StructuredDocumentation", "src": "86:40:27" }, { "attributes": { "documentation": null, "functionSelector": "677342ce", "implemented": true, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "sqrt", "overrides": null, "scope": 4067, "stateMutability": "pure", "virtual": false, "visibility": "public" }, "children": [ { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "x", "overrides": null, "scope": 4066, "stateVariable": false, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 4054, "name": "ElementaryTypeName", "src": "168:4:27" } ], "id": 4055, "name": "VariableDeclaration", "src": "168:6:27" } ], "id": 4056, "name": "ParameterList", "src": "162:16:27" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "y", "overrides": null, "scope": 4066, "stateVariable": false, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 4057, "name": "ElementaryTypeName", "src": "204:4:27" } ], "id": 4058, "name": "VariableDeclaration", "src": "204:6:27" } ], "id": 4059, "name": "ParameterList", "src": "203:8:27" }, { "children": [ { "attributes": { "functionReturnParameters": 4059 }, "children": [ { "attributes": { "argumentTypes": null, "isConstant": false, "isLValue": false, "isPure": false, "isStructConstructorCall": false, "lValueRequested": false, "names": [ null ], "tryCall": false, "type": "uint256", "type_conversion": false }, "children": [ { "attributes": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "member_name": "sqrt", "referencedDeclaration": 2866, "type": "function (uint256) pure returns (uint256)" }, "children": [ { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 2867, "type": "type(library Sqrt)", "value": "Sqrt" }, "id": 4060, "name": "Identifier", "src": "227:4:27" } ], "id": 4061, "name": "MemberAccess", "src": "227:9:27" }, { "attributes": { "argumentTypes": null, "overloadedDeclarations": [ null ], "referencedDeclaration": 4055, "type": "uint256", "value": "x" }, "id": 4062, "name": "Identifier", "src": "237:1:27" } ], "id": 4063, "name": "FunctionCall", "src": "227:12:27" } ], "id": 4064, "name": "Return", "src": "220:19:27" } ], "id": 4065, "name": "Block", "src": "214:30:27" } ], "id": 4066, "name": "FunctionDefinition", "src": "149:95:27" } ], "id": 4067, "name": "ContractDefinition", "src": "127:119:27" } ], "id": 4068, "name": "SourceUnit", "src": "32:215:27" }, "compiler": { "name": "solc", "version": "0.6.10+commit.00c0fcaf.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.1", "updatedAt": "2021-07-08T17:04:13.907Z", "devdoc": { "methods": {}, "title": "Used for testing only." }, "userdoc": { "methods": {} } }