UNPKG

jcc-solidity-utils

Version:
1,138 lines (1,137 loc) 57.3 kB
{ "contractName": "MockStringUtils", "abi": [ { "constant": true, "inputs": [ { "name": "_str", "type": "string" } ], "name": "toSlice", "outputs": [ { "components": [ { "name": "_len", "type": "uint256" }, { "name": "_ptr", "type": "uint256" } ], "name": "", "type": "tuple" } ], "payable": false, "stateMutability": "pure", "type": "function" }, { "constant": true, "inputs": [ { "name": "_str", "type": "string" } ], "name": "len", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "pure", "type": "function" }, { "constant": true, "inputs": [ { "name": "_str", "type": "string" } ], "name": "copy", "outputs": [ { "components": [ { "name": "_len", "type": "uint256" }, { "name": "_ptr", "type": "uint256" } ], "name": "", "type": "tuple" } ], "payable": false, "stateMutability": "pure", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.4.24+commit.e67f0147\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"_str\",\"type\":\"string\"}],\"name\":\"len\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_str\",\"type\":\"string\"}],\"name\":\"copy\",\"outputs\":[{\"components\":[{\"name\":\"_len\",\"type\":\"uint256\"},{\"name\":\"_ptr\",\"type\":\"uint256\"}],\"name\":\"\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_str\",\"type\":\"string\"}],\"name\":\"toSlice\",\"outputs\":[{\"components\":[{\"name\":\"_len\",\"type\":\"uint256\"},{\"name\":\"_ptr\",\"type\":\"uint256\"}],\"name\":\"\",\"type\":\"tuple\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockStringUtils.sol\":\"MockStringUtils\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockStringUtils.sol\":{\"keccak256\":\"0x521085224e0e06ed77d0feae68f42f7677b64f1202afbd549dbdfd4f544509f7\",\"urls\":[\"bzzr://a5cdb0a5d004bbac59bab01f9c9dc98db9862307c7a3a09be211d25b062f1c3e\"]},\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/StringUtils.sol\":{\"keccak256\":\"0xc19208b7c3ff461890e9fd7ff239c8117091c6a09dda4fc3a24131abc49f0a22\",\"urls\":[\"bzzr://1e827a43f7437be23fca88c994e91a20f80f613043089aeacc54ddd2d92910ed\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506103ad806100206000396000f3006080604052600436106100565763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663026294a7811461005b57806357c82cc114610091578063afed762b146100be575b600080fd5b34801561006757600080fd5b5061007b610076366004610283565b6100de565b6040516100889190610307565b60405180910390f35b34801561009d57600080fd5b506100b16100ac366004610283565b6100f7565b60405161008891906102f9565b3480156100ca57600080fd5b506100b16100d9366004610283565b610110565b60006100f16100ec8361011d565b610143565b92915050565b6100ff610218565b6100f161010b8361011d565b6101f2565b610118610218565b6100f1825b610125610218565b50604080518082019091528151815260209182019181019190915290565b60208101518151600091601e198082019290910101825b818310156101ea5750815160ff16608081101561017c576001830192506101df565b60e08160ff161015610193576002830192506101df565b60f08160ff1610156101aa576003830192506101df565b60f88160ff1610156101c1576004830192506101df565b60fc8160ff1610156101d8576005830192506101df565b6006830192505b60019093019261015a565b505050919050565b6101fa610218565b50604080518082019091528151815260208083015190820152919050565b604080518082019091526000808252602082015290565b6000601f8201831361024057600080fd5b813561025361024e8261033c565b610315565b9150808252602083016020830185838301111561026f57600080fd5b61027a838284610367565b50505092915050565b60006020828403121561029557600080fd5b813567ffffffffffffffff8111156102ac57600080fd5b6102b88482850161022f565b949350505050565b805160408301906102d184826102ea565b5060208201516102e460208501826102ea565b50505050565b6102f381610364565b82525050565b604081016100f182846102c0565b602081016100f182846102ea565b60405181810167ffffffffffffffff8111828210171561033457600080fd5b604052919050565b600067ffffffffffffffff82111561035357600080fd5b506020601f91909101601f19160190565b90565b828183375060009101525600a265627a7a72305820cebe3f03c7b4238953dd6e39593d0184a8dcb9a0141a36031e86c07548b5cf326c6578706572696d656e74616cf50037", "deployedBytecode": "0x6080604052600436106100565763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663026294a7811461005b57806357c82cc114610091578063afed762b146100be575b600080fd5b34801561006757600080fd5b5061007b610076366004610283565b6100de565b6040516100889190610307565b60405180910390f35b34801561009d57600080fd5b506100b16100ac366004610283565b6100f7565b60405161008891906102f9565b3480156100ca57600080fd5b506100b16100d9366004610283565b610110565b60006100f16100ec8361011d565b610143565b92915050565b6100ff610218565b6100f161010b8361011d565b6101f2565b610118610218565b6100f1825b610125610218565b50604080518082019091528151815260209182019181019190915290565b60208101518151600091601e198082019290910101825b818310156101ea5750815160ff16608081101561017c576001830192506101df565b60e08160ff161015610193576002830192506101df565b60f08160ff1610156101aa576003830192506101df565b60f88160ff1610156101c1576004830192506101df565b60fc8160ff1610156101d8576005830192506101df565b6006830192505b60019093019261015a565b505050919050565b6101fa610218565b50604080518082019091528151815260208083015190820152919050565b604080518082019091526000808252602082015290565b6000601f8201831361024057600080fd5b813561025361024e8261033c565b610315565b9150808252602083016020830185838301111561026f57600080fd5b61027a838284610367565b50505092915050565b60006020828403121561029557600080fd5b813567ffffffffffffffff8111156102ac57600080fd5b6102b88482850161022f565b949350505050565b805160408301906102d184826102ea565b5060208201516102e460208501826102ea565b50505050565b6102f381610364565b82525050565b604081016100f182846102c0565b602081016100f182846102ea565b60405181810167ffffffffffffffff8111828210171561033457600080fd5b604052919050565b600067ffffffffffffffff82111561035357600080fd5b506020601f91909101601f19160190565b90565b828183375060009101525600a265627a7a72305820cebe3f03c7b4238953dd6e39593d0184a8dcb9a0141a36031e86c07548b5cf326c6578706572696d656e74616cf50037", "sourceMap": "139:431:27:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;139:431:27;;;;;;;", "deployedSourceMap": "139:431:27:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;357:94;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;357:94:27;;;;;;;;;;;;;;;;;;;;;;;;;455:113;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;455:113:27;;;;;;;;;;;;;;;;;244:109;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;244:109:27;;;;;;;;;357:94;404:7;426:20;:14;:4;:12;:14::i;:::-;:18;:20::i;:::-;419:27;357:94;-1:-1:-1;;357:94:27:o;455:113::-;503:17;;:::i;:::-;542:21;:14;:4;:12;:14::i;:::-;:19;:21::i;244:109::-;295:17;;:::i;:::-;334:14;:4;2874:189:35;2934:5;;:::i;:::-;-1:-1:-1;3028:30:35;;;;;;;;;3034:18;;3028:30;;3005:4;2995:15;;;3028:30;;;;;;;;2874:189::o;5624:595::-;5781:9;;;;5821;;5679;;-1:-1:-1;;5781:14:35;;;;5815:15;;;;5679:9;5836:379;5854:3;5848;:9;5836:379;;;-1:-1:-1;5915:10:35;;5927:4;5911:21;5955:4;5951:8;;5947:262;;;5978:1;5971:8;;;;5947:262;;;6002:4;5998:1;:8;;;5994:215;;;6025:1;6018:8;;;;5994:215;;;6049:4;6045:1;:8;;;6041:168;;;6072:1;6065:8;;;;6041:168;;;6096:4;6092:1;:8;;;6088:121;;;6119:1;6112:8;;;;6088:121;;;6143:4;6139:1;:8;;;6135:74;;;6166:1;6159:8;;;;6135:74;;;6199:1;6192:8;;;;6135:74;5859:3;;;;;5836:379;;;5624:595;;;;;;:::o;4720:115::-;4776:5;;:::i;:::-;-1:-1:-1;4803:27:35;;;;;;;;;4809:9;;4803:27;;;4820:9;;;;4803:27;;;;4720:115;;;:::o;139:431:27:-;;;;;;;;;;-1:-1:-1;139:431:27;;;;;;;;:::o;6:442:-1:-;;101:4;89:17;;85:27;-1:-1;75:2;;126:1;123;116:12;75:2;163:6;150:20;185:65;200:49;242:6;200:49;;;185:65;;;176:74;;270:6;263:5;256:21;306:4;298:6;294:17;339:4;332:5;328:16;374:3;365:6;360:3;356:16;353:25;350:2;;;391:1;388;381:12;350:2;401:41;435:6;430:3;425;401:41;;;68:380;;;;;;;;456:347;;570:2;558:9;549:7;545:23;541:32;538:2;;;586:1;583;576:12;538:2;621:31;;672:18;661:30;;658:2;;;704:1;701;694:12;658:2;724:63;779:7;770:6;759:9;755:22;724:63;;;714:73;532:271;-1:-1;;;;532:271;869:488;1067:22;;998:4;989:14;;;1101:61;993:3;1067:22;1101:61;;;1018:156;1250:4;1243:5;1239:16;1233:23;1268:62;1324:4;1319:3;1315:14;1302:11;1268:62;;;1184:158;971:386;;;;1364:110;1437:31;1462:5;1437:31;;;1432:3;1425:44;1419:55;;;1481:285;1635:2;1620:18;;1649:107;1624:9;1729:6;1649:107;;1773:193;1881:2;1866:18;;1895:61;1870:9;1929:6;1895:61;;1973:256;2035:2;2029:9;2061:17;;;2136:18;2121:34;;2157:22;;;2118:62;2115:2;;;2193:1;2190;2183:12;2115:2;2209;2202:22;2013:216;;-1:-1;2013:216;2236:259;;2380:18;2372:6;2369:30;2366:2;;;2412:1;2409;2402:12;2366:2;-1:-1;2485:4;2456;2433:17;;;;-1:-1;;2429:33;2475:15;;2303:192;2502:79;2571:5;2554:27;2589:145;2670:6;2665:3;2660;2647:30;-1:-1;2726:1;2708:16;;2701:27;2640:94", "source": "pragma solidity >=0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../utils/StringUtils.sol\";\n\n// 定义一个调用AddressList的合约\ncontract MockStringUtils {\n using StringUtils for string;\n using StringUtils for StringUtils.slice;\n\n function toSlice(string _str) public pure returns (StringUtils.slice memory) {\n return _str.toSlice();\n }\n\n function len(string _str) public pure returns (uint256) {\n return _str.toSlice().len();\n }\n\n function copy(string _str) public pure returns (StringUtils.slice memory) {\n return _str.toSlice().copy();\n }\n}\n", "sourcePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockStringUtils.sol", "ast": { "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockStringUtils.sol", "exportedSymbols": { "MockStringUtils": [ 6393 ] }, "id": 6394, "nodeType": "SourceUnit", "nodes": [ { "id": 6344, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:27" }, { "id": 6345, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "26:33:27" }, { "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/StringUtils.sol", "file": "../utils/StringUtils.sol", "id": 6346, "nodeType": "ImportDirective", "scope": 6394, "sourceUnit": 9027, "src": "61:34:27", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 6393, "linearizedBaseContracts": [ 6393 ], "name": "MockStringUtils", "nodeType": "ContractDefinition", "nodes": [ { "id": 6349, "libraryName": { "contractScope": null, "id": 6347, "name": "StringUtils", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 9026, "src": "174:11:27", "typeDescriptions": { "typeIdentifier": "t_contract$_StringUtils_$9026", "typeString": "library StringUtils" } }, "nodeType": "UsingForDirective", "src": "168:29:27", "typeName": { "id": 6348, "name": "string", "nodeType": "ElementaryTypeName", "src": "190:6:27", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } } }, { "id": 6352, "libraryName": { "contractScope": null, "id": 6350, "name": "StringUtils", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 9026, "src": "206:11:27", "typeDescriptions": { "typeIdentifier": "t_contract$_StringUtils_$9026", "typeString": "library StringUtils" } }, "nodeType": "UsingForDirective", "src": "200:40:27", "typeName": { "contractScope": null, "id": 6351, "name": "StringUtils.slice", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 7338, "src": "222:17:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_storage_ptr", "typeString": "struct StringUtils.slice" } } }, { "body": { "id": 6363, "nodeType": "Block", "src": "321:32:27", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 6359, "name": "_str", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6354, "src": "334:4:27", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "id": 6360, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "toSlice", "nodeType": "MemberAccess", "referencedDeclaration": 7398, "src": "334:12:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$returns$_t_struct$_slice_$7338_memory_ptr_$bound_to$_t_string_memory_ptr_$", "typeString": "function (string memory) pure returns (struct StringUtils.slice memory)" } }, "id": 6361, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "334:14:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice memory" } }, "functionReturnParameters": 6358, "id": 6362, "nodeType": "Return", "src": "327:21:27" } ] }, "documentation": null, "id": 6364, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "toSlice", "nodeType": "FunctionDefinition", "parameters": { "id": 6355, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6354, "name": "_str", "nodeType": "VariableDeclaration", "scope": 6364, "src": "261:11:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 6353, "name": "string", "nodeType": "ElementaryTypeName", "src": "261:6:27", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "260:13:27" }, "payable": false, "returnParameters": { "id": 6358, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6357, "name": "", "nodeType": "VariableDeclaration", "scope": 6364, "src": "295:17:27", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice" }, "typeName": { "contractScope": null, "id": 6356, "name": "StringUtils.slice", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 7338, "src": "295:17:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_storage_ptr", "typeString": "struct StringUtils.slice" } }, "value": null, "visibility": "internal" } ], "src": "294:26:27" }, "scope": 6393, "src": "244:109:27", "stateMutability": "pure", "superFunction": null, "visibility": "public" }, { "body": { "id": 6377, "nodeType": "Block", "src": "413:38:27", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 6371, "name": "_str", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6366, "src": "426:4:27", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "id": 6372, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "toSlice", "nodeType": "MemberAccess", "referencedDeclaration": 7398, "src": "426:12:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$returns$_t_struct$_slice_$7338_memory_ptr_$bound_to$_t_string_memory_ptr_$", "typeString": "function (string memory) pure returns (struct StringUtils.slice memory)" } }, "id": 6373, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "426:14:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice memory" } }, "id": 6374, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "len", "nodeType": "MemberAccess", "referencedDeclaration": 7664, "src": "426:18:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_struct$_slice_$7338_memory_ptr_$returns$_t_uint256_$bound_to$_t_struct$_slice_$7338_memory_ptr_$", "typeString": "function (struct StringUtils.slice memory) pure returns (uint256)" } }, "id": 6375, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "426:20:27", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 6370, "id": 6376, "nodeType": "Return", "src": "419:27:27" } ] }, "documentation": null, "id": 6378, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "len", "nodeType": "FunctionDefinition", "parameters": { "id": 6367, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6366, "name": "_str", "nodeType": "VariableDeclaration", "scope": 6378, "src": "370:11:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 6365, "name": "string", "nodeType": "ElementaryTypeName", "src": "370:6:27", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "369:13:27" }, "payable": false, "returnParameters": { "id": 6370, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6369, "name": "", "nodeType": "VariableDeclaration", "scope": 6378, "src": "404:7:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6368, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "404:7:27", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "403:9:27" }, "scope": 6393, "src": "357:94:27", "stateMutability": "pure", "superFunction": null, "visibility": "public" }, { "body": { "id": 6391, "nodeType": "Block", "src": "529:39:27", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 6385, "name": "_str", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6380, "src": "542:4:27", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "id": 6386, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "toSlice", "nodeType": "MemberAccess", "referencedDeclaration": 7398, "src": "542:12:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$returns$_t_struct$_slice_$7338_memory_ptr_$bound_to$_t_string_memory_ptr_$", "typeString": "function (string memory) pure returns (struct StringUtils.slice memory)" } }, "id": 6387, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "542:14:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice memory" } }, "id": 6388, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "copy", "nodeType": "MemberAccess", "referencedDeclaration": 7546, "src": "542:19:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_struct$_slice_$7338_memory_ptr_$returns$_t_struct$_slice_$7338_memory_ptr_$bound_to$_t_struct$_slice_$7338_memory_ptr_$", "typeString": "function (struct StringUtils.slice memory) pure returns (struct StringUtils.slice memory)" } }, "id": 6389, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "542:21:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice memory" } }, "functionReturnParameters": 6384, "id": 6390, "nodeType": "Return", "src": "535:28:27" } ] }, "documentation": null, "id": 6392, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "copy", "nodeType": "FunctionDefinition", "parameters": { "id": 6381, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6380, "name": "_str", "nodeType": "VariableDeclaration", "scope": 6392, "src": "469:11:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 6379, "name": "string", "nodeType": "ElementaryTypeName", "src": "469:6:27", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "468:13:27" }, "payable": false, "returnParameters": { "id": 6384, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6383, "name": "", "nodeType": "VariableDeclaration", "scope": 6392, "src": "503:17:27", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice" }, "typeName": { "contractScope": null, "id": 6382, "name": "StringUtils.slice", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 7338, "src": "503:17:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_storage_ptr", "typeString": "struct StringUtils.slice" } }, "value": null, "visibility": "internal" } ], "src": "502:26:27" }, "scope": 6393, "src": "455:113:27", "stateMutability": "pure", "superFunction": null, "visibility": "public" } ], "scope": 6394, "src": "139:431:27" } ], "src": "0:571:27" }, "legacyAST": { "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockStringUtils.sol", "exportedSymbols": { "MockStringUtils": [ 6393 ] }, "id": 6394, "nodeType": "SourceUnit", "nodes": [ { "id": 6344, "literals": [ "solidity", ">=", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:25:27" }, { "id": 6345, "literals": [ "experimental", "ABIEncoderV2" ], "nodeType": "PragmaDirective", "src": "26:33:27" }, { "absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/StringUtils.sol", "file": "../utils/StringUtils.sol", "id": 6346, "nodeType": "ImportDirective", "scope": 6394, "sourceUnit": 9027, "src": "61:34:27", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 6393, "linearizedBaseContracts": [ 6393 ], "name": "MockStringUtils", "nodeType": "ContractDefinition", "nodes": [ { "id": 6349, "libraryName": { "contractScope": null, "id": 6347, "name": "StringUtils", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 9026, "src": "174:11:27", "typeDescriptions": { "typeIdentifier": "t_contract$_StringUtils_$9026", "typeString": "library StringUtils" } }, "nodeType": "UsingForDirective", "src": "168:29:27", "typeName": { "id": 6348, "name": "string", "nodeType": "ElementaryTypeName", "src": "190:6:27", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } } }, { "id": 6352, "libraryName": { "contractScope": null, "id": 6350, "name": "StringUtils", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 9026, "src": "206:11:27", "typeDescriptions": { "typeIdentifier": "t_contract$_StringUtils_$9026", "typeString": "library StringUtils" } }, "nodeType": "UsingForDirective", "src": "200:40:27", "typeName": { "contractScope": null, "id": 6351, "name": "StringUtils.slice", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 7338, "src": "222:17:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_storage_ptr", "typeString": "struct StringUtils.slice" } } }, { "body": { "id": 6363, "nodeType": "Block", "src": "321:32:27", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 6359, "name": "_str", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6354, "src": "334:4:27", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "id": 6360, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "toSlice", "nodeType": "MemberAccess", "referencedDeclaration": 7398, "src": "334:12:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$returns$_t_struct$_slice_$7338_memory_ptr_$bound_to$_t_string_memory_ptr_$", "typeString": "function (string memory) pure returns (struct StringUtils.slice memory)" } }, "id": 6361, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "334:14:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice memory" } }, "functionReturnParameters": 6358, "id": 6362, "nodeType": "Return", "src": "327:21:27" } ] }, "documentation": null, "id": 6364, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "toSlice", "nodeType": "FunctionDefinition", "parameters": { "id": 6355, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6354, "name": "_str", "nodeType": "VariableDeclaration", "scope": 6364, "src": "261:11:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 6353, "name": "string", "nodeType": "ElementaryTypeName", "src": "261:6:27", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "260:13:27" }, "payable": false, "returnParameters": { "id": 6358, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6357, "name": "", "nodeType": "VariableDeclaration", "scope": 6364, "src": "295:17:27", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice" }, "typeName": { "contractScope": null, "id": 6356, "name": "StringUtils.slice", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 7338, "src": "295:17:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_storage_ptr", "typeString": "struct StringUtils.slice" } }, "value": null, "visibility": "internal" } ], "src": "294:26:27" }, "scope": 6393, "src": "244:109:27", "stateMutability": "pure", "superFunction": null, "visibility": "public" }, { "body": { "id": 6377, "nodeType": "Block", "src": "413:38:27", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 6371, "name": "_str", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6366, "src": "426:4:27", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "id": 6372, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "toSlice", "nodeType": "MemberAccess", "referencedDeclaration": 7398, "src": "426:12:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_string_memory_ptr_$returns$_t_struct$_slice_$7338_memory_ptr_$bound_to$_t_string_memory_ptr_$", "typeString": "function (string memory) pure returns (struct StringUtils.slice memory)" } }, "id": 6373, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "426:14:27", "typeDescriptions": { "typeIdentifier": "t_struct$_slice_$7338_memory_ptr", "typeString": "struct StringUtils.slice memory" } }, "id": 6374, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "len", "nodeType": "MemberAccess", "referencedDeclaration": 7664, "src": "426:18:27", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_struct$_slice_$7338_memory_ptr_$returns$_t_uint256_$bound_to$_t_struct$_slice_$7338_memory_ptr_$", "typeString": "function (struct StringUtils.slice memory) pure returns (uint256)" } }, "id": 6375, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "426:20:27", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 6370, "id": 6376, "nodeType": "Return", "src": "419:27:27" } ] }, "documentation": null, "id": 6378, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "len", "nodeType": "FunctionDefinition", "parameters": { "id": 6367, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6366, "name": "_str", "nodeType": "VariableDeclaration", "scope": 6378, "src": "370:11:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 6365, "name": "string", "nodeType": "ElementaryTypeName", "src": "370:6:27", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" } ], "src": "369:13:27" }, "payable": false, "returnParameters": { "id": 6370, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6369, "name": "", "nodeType": "VariableDeclaration", "scope": 6378, "src": "404:7:27", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 6368, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "404:7:27", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "403:9:27" }, "scope": 6393, "src": "357:94:27", "stateMutability": "pure", "superFunction": null, "visibility": "public" }, { "body": { "id": 6391, "nodeType": "Block", "src": "529:39:27", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [],