jcc-solidity-utils
Version:
jcc solidity utils
1,063 lines (1,062 loc) • 56 kB
JSON
{
"contractName": "MockAddressUtils",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "_addr",
"type": "address"
}
],
"name": "isContract",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_addr",
"type": "address"
}
],
"name": "getString",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_str",
"type": "string"
}
],
"name": "fromString",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.4.24+commit.e67f0147\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"isContract\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_addr\",\"type\":\"address\"}],\"name\":\"getString\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_str\",\"type\":\"string\"}],\"name\":\"fromString\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"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/MockAddressUtils.sol\":\"MockAddressUtils\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockAddressUtils.sol\":{\"keccak256\":\"0x34fa7519e50b46d2024e6e502b05259c56f9d92855c3baec3d66916ea068ab06\",\"urls\":[\"bzzr://e5e73ae68391e09713bc8a8db55443e6f297048c873eaa62deedfbd3394e7da1\"]},\"/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/AddressUtils.sol\":{\"keccak256\":\"0xe78f03563026c72cf447b8ce7839eb34f512b4698e52253da52d568094f20c89\",\"urls\":[\"bzzr://15282c513ef8c6bb7000a0abf864675306e22ec0425639eb0f0c1f91bb2a4b92\"]}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b5061064b806100206000396000f3006080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166316279055811461005b5780637d434425146100915780639c53ac5a146100be575b600080fd5b34801561006757600080fd5b5061007b610076366004610485565b6100eb565b604051610088919061053b565b60405180910390f35b34801561009d57600080fd5b506100b16100ac366004610485565b610112565b6040516100889190610549565b3480156100ca57600080fd5b506100de6100d93660046104ab565b610133565b604051610088919061052d565b600061010c8273ffffffffffffffffffffffffffffffffffffffff16610145565b92915050565b606061010c8273ffffffffffffffffffffffffffffffffffffffff1661014d565b600061010c818363ffffffff61036216565b6000903b1190565b604080518082018252601081527f303132333435363738396162636465660000000000000000000000000000000060208201528151602a808252606082810190945273ffffffffffffffffffffffffffffffffffffffff851692918491600091908160200160208202803883390190505091507f30000000000000000000000000000000000000000000000000000000000000008260008151811015156101f057fe5b906020010190600160f860020a031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000082600181518110151561023857fe5b906020010190600160f860020a031916908160001a905350600090505b60148110156103595782600485600c84016020811061027057fe5b1a60f860020a02600160f860020a0319169060020a900460f860020a900460ff1681518110151561029d57fe5b90602001015160f860020a900460f860020a0282826002026002018151811015156102c457fe5b906020010190600160f860020a031916908160001a9053508284600c8301602081106102ec57fe5b1a60f860020a02600f60f860020a021660f860020a900460ff1681518110151561031257fe5b90602001015160f860020a900460f860020a02828260020260030181518110151561033957fe5b906020010190600160f860020a031916908160001a905350600101610255565b50949350505050565b6000818180805b835182101561041357838281518110151561038057fe5b90602001015160f860020a900460f860020a0260f860020a900460ff169050603081101580156103b1575060398111155b156103c25760308103836010020192505b604181101580156103d45750605a8111155b156103e55760378103836010020192505b606181101580156103f75750607a8111155b156104085760578103836010020192505b600190910190610369565b509095945050505050565b600061042a82356105ad565b9392505050565b6000601f8201831361044257600080fd5b813561045561045082610581565b61055a565b9150808252602083016020830185838301111561047157600080fd5b61047c8382846105cb565b50505092915050565b60006020828403121561049757600080fd5b60006104a3848461041e565b949350505050565b6000602082840312156104bd57600080fd5b813567ffffffffffffffff8111156104d457600080fd5b6104a384828501610431565b6104e9816105ad565b82525050565b6104e9816105c6565b6000610503826105a9565b8084526105178160208601602086016105d7565b61052081610607565b9093016020019392505050565b6020810161010c82846104e0565b6020810161010c82846104ef565b6020808252810161042a81846104f8565b60405181810167ffffffffffffffff8111828210171561057957600080fd5b604052919050565b600067ffffffffffffffff82111561059857600080fd5b506020601f91909101601f19160190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b82818337506000910152565b60005b838110156105f25781810151838201526020016105da565b83811115610601576000848401525b50505050565b601f01601f1916905600a265627a7a72305820f5e82f0b404dcc2cb2f57070ad0a130acc4718cf9cac2cdb7e0597674178bf3c6c6578706572696d656e74616cf50037",
"deployedBytecode": "0x6080604052600436106100565763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166316279055811461005b5780637d434425146100915780639c53ac5a146100be575b600080fd5b34801561006757600080fd5b5061007b610076366004610485565b6100eb565b604051610088919061053b565b60405180910390f35b34801561009d57600080fd5b506100b16100ac366004610485565b610112565b6040516100889190610549565b3480156100ca57600080fd5b506100de6100d93660046104ab565b610133565b604051610088919061052d565b600061010c8273ffffffffffffffffffffffffffffffffffffffff16610145565b92915050565b606061010c8273ffffffffffffffffffffffffffffffffffffffff1661014d565b600061010c818363ffffffff61036216565b6000903b1190565b604080518082018252601081527f303132333435363738396162636465660000000000000000000000000000000060208201528151602a808252606082810190945273ffffffffffffffffffffffffffffffffffffffff851692918491600091908160200160208202803883390190505091507f30000000000000000000000000000000000000000000000000000000000000008260008151811015156101f057fe5b906020010190600160f860020a031916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000082600181518110151561023857fe5b906020010190600160f860020a031916908160001a905350600090505b60148110156103595782600485600c84016020811061027057fe5b1a60f860020a02600160f860020a0319169060020a900460f860020a900460ff1681518110151561029d57fe5b90602001015160f860020a900460f860020a0282826002026002018151811015156102c457fe5b906020010190600160f860020a031916908160001a9053508284600c8301602081106102ec57fe5b1a60f860020a02600f60f860020a021660f860020a900460ff1681518110151561031257fe5b90602001015160f860020a900460f860020a02828260020260030181518110151561033957fe5b906020010190600160f860020a031916908160001a905350600101610255565b50949350505050565b6000818180805b835182101561041357838281518110151561038057fe5b90602001015160f860020a900460f860020a0260f860020a900460ff169050603081101580156103b1575060398111155b156103c25760308103836010020192505b604181101580156103d45750605a8111155b156103e55760378103836010020192505b606181101580156103f75750607a8111155b156104085760578103836010020192505b600190910190610369565b509095945050505050565b600061042a82356105ad565b9392505050565b6000601f8201831361044257600080fd5b813561045561045082610581565b61055a565b9150808252602083016020830185838301111561047157600080fd5b61047c8382846105cb565b50505092915050565b60006020828403121561049757600080fd5b60006104a3848461041e565b949350505050565b6000602082840312156104bd57600080fd5b813567ffffffffffffffff8111156104d457600080fd5b6104a384828501610431565b6104e9816105ad565b82525050565b6104e9816105c6565b6000610503826105a9565b8084526105178160208601602086016105d7565b61052081610607565b9093016020019392505050565b6020810161010c82846104e0565b6020810161010c82846104ef565b6020808252810161042a81846104f8565b60405181810167ffffffffffffffff8111828210171561057957600080fd5b604052919050565b600067ffffffffffffffff82111561059857600080fd5b506020601f91909101601f19160190565b5190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b82818337506000910152565b60005b838110156105f25781810151838201526020016105da565b83811115610601576000848401525b50505050565b601f01601f1916905600a265627a7a72305820f5e82f0b404dcc2cb2f57070ad0a130acc4718cf9cac2cdb7e0597674178bf3c6c6578706572696d656e74616cf50037",
"sourceMap": "140:447:22:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;140:447:22;;;;;;;",
"deployedSourceMap": "140:447:22:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;205:98;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;205:98:22;;;;;;;;;;;;;;;;;;;;;;;;;368:105;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;368:105:22;;;;;;;;;;;;;;;;;477:108;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;477:108:22;;;;;;;;;;;;;;;;;205:98;261:4;280:18;:5;:16;;;:18::i;:::-;273:25;205:98;-1:-1:-1;;205:98:22:o;368:105::-;423:6;451:17;:5;:15;;;:17::i;477:108::-;531:7;553:27;531:7;575:4;553:27;:21;:27;:::i;226:590:31:-;284:4;716:18;;803:8;;226:590::o;989:455::-;1112:42;;;;;;;;;;;;;;;;1180:13;;1190:2;1180:13;;;1046:6;1180:13;;;;;;1091:14;;;;1112:42;1046:6;;1067:13;;1180;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;136:17;;-1:-1;1180:13:31;1161:32;;1199:12;:3;1203:1;1199:6;;;;;;;;;;;;;;:12;-1:-1:-1;;;;;1199:12:31;;;;;;;;;1217;:3;1221:1;1217:6;;;;;;;;;;;;;;:12;-1:-1:-1;;;;;1217:12:31;;;;;;;;;1252:1;1240:13;;1235:180;1259:2;1255:1;:6;1235:180;;;1293:8;1333:1;1316:5;1326:2;1322:6;;1316:13;;;;;;;;-1:-1:-1;;;1316:13:31;-1:-1:-1;;;;;1316:18:31;;;;;;;-1:-1:-1;;;1310:25:31;;1302:34;;1293:44;;;;;;;;;;;;;;;-1:-1:-1;;;1293:44:31;;-1:-1:-1;;;1293:44:31;1276:3;1284:1;1288;1284:5;1280:1;:9;1276:14;;;;;;;;;;;;;;:61;-1:-1:-1;;;;;1276:61:31;;;;;;;;-1:-1:-1;1362:8:31;1385:5;1395:2;1391:6;;1385:13;;;;;;;;-1:-1:-1;;;1385:13:31;1401:4;-1:-1:-1;;;1385:20:31;;-1:-1:-1;;;1379:27:31;;1371:36;;1362:46;;;;;;;;;;;;;;;-1:-1:-1;;;1362:46:31;;-1:-1:-1;;;1362:46:31;1345:3;1353:1;1357;1353:5;1349:1;:9;1345:14;;;;;;;;;;;;;;:63;-1:-1:-1;;;;;1345:63:31;;;;;;;;-1:-1:-1;1263:3:31;;1235:180;;;-1:-1:-1;1435:3:31;989:455;-1:-1:-1;;;;989:455:31:o;1448:529::-;1538:7;1578:4;1538:7;;;1614:330;1638:1;:8;1634:1;:12;1614:330;;;1687:1;1689;1687:4;;;;;;;;;;;;;;;-1:-1:-1;;;1687:4:31;;-1:-1:-1;;;1687:4:31;-1:-1:-1;;;1681:11:31;;1673:20;;1661:32;;1710:2;1705:1;:7;;:18;;;;;1721:2;1716:1;:7;;1705:18;1701:74;;;1763:2;1759:1;:6;1744;1753:2;1744:11;:22;1735:31;;1701:74;1791:2;1786:1;:7;;:18;;;;;1802:2;1797:1;:7;;1786:18;1782:74;;;1844:2;1840:1;:6;1825;1834:2;1825:11;:22;1816:31;;1782:74;1872:2;1867:1;:7;;:19;;;;;1883:3;1878:1;:8;;1867:19;1863:75;;;1926:2;1922:1;:6;1907;1916:2;1907:11;:22;1898:31;;1863:75;1648:3;;;;;1614:330;;;-1:-1:-1;1965:6:31;;1448:529;-1:-1:-1;;;;;1448:529:31:o;5:118:-1:-;;72:46;110:6;97:20;72:46;;;63:55;57:66;-1:-1;;;57:66;131:442;;226:4;214:17;;210:27;-1:-1;200:2;;251:1;248;241:12;200:2;288:6;275:20;310:65;325:49;367:6;325:49;;;310:65;;;301:74;;395:6;388:5;381:21;431:4;423:6;419:17;464:4;457:5;453:16;499:3;490:6;485:3;481:16;478:25;475:2;;;516:1;513;506:12;475:2;526:41;560:6;555:3;550;526:41;;;193:380;;;;;;;;581:241;;685:2;673:9;664:7;660:23;656:32;653:2;;;701:1;698;691:12;653:2;736:1;753:53;798:7;778:9;753:53;;;743:63;647:175;-1:-1;;;;647:175;829:347;;943:2;931:9;922:7;918:23;914:32;911:2;;;959:1;956;949:12;911:2;994:31;;1045:18;1034:30;;1031:2;;;1077:1;1074;1067:12;1031:2;1097:63;1152:7;1143:6;1132:9;1128:22;1097:63;;1183:110;1256:31;1281:5;1256:31;;;1251:3;1244:44;1238:55;;;1300:101;1367:28;1389:5;1367:28;;1408:300;;1510:39;1543:5;1510:39;;;1566:6;1561:3;1554:19;1578:63;1634:6;1627:4;1622:3;1618:14;1611:4;1604:5;1600:16;1578:63;;;1673:29;1695:6;1673:29;;;1653:50;;;1666:4;1653:50;;1490:218;-1:-1;;;1490:218;1715:193;1823:2;1808:18;;1837:61;1812:9;1871:6;1837:61;;1915:181;2017:2;2002:18;;2031:55;2006:9;2059:6;2031:55;;2103:281;2231:2;2245:47;;;2216:18;;2306:68;2216:18;2360:6;2306:68;;2391:256;2453:2;2447:9;2479:17;;;2554:18;2539:34;;2575:22;;;2536:62;2533:2;;;2611:1;2608;2601:12;2533:2;2627;2620:22;2431:216;;-1:-1;2431:216;2654:259;;2798:18;2790:6;2787:30;2784:2;;;2830:1;2827;2820:12;2784:2;-1:-1;2903:4;2874;2851:17;;;;-1:-1;;2847:33;2893:15;;2721:192;2920:92;2995:12;;2979:33;3019:128;3099:42;3088:54;;3071:76;3154:92;3227:13;3220:21;;3203:43;3389:145;3470:6;3465:3;3460;3447:30;-1:-1;3526:1;3508:16;;3501:27;3440:94;3543:268;3608:1;3615:101;3629:6;3626:1;3623:13;3615:101;;;3696:11;;;3690:18;3677:11;;;3670:39;3651:2;3644:10;3615:101;;;3731:6;3728:1;3725:13;3722:2;;;3796:1;3787:6;3782:3;3778:16;3771:27;3722:2;3592:219;;;;;3819:97;3907:2;3887:14;-1:-1;;3883:28;;3867:49",
"source": "pragma solidity >=0.4.24;\npragma experimental ABIEncoderV2;\n\nimport \"../utils/AddressUtils.sol\";\n\n// 定义一个调用AddressList的合约\ncontract MockAddressUtils {\n using AddressUtils for address;\n\n function isContract(address _addr) public view returns (bool) {\n return _addr.isContract();\n }\n\n // 使用toString,因为js重载导致无法正常执行\n function getString(address _addr) public pure returns (string memory) {\n return _addr.getString();\n }\n\n function fromString(string _str) public pure returns (address) {\n return address(0).fromString(_str);\n }\n}\n",
"sourcePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockAddressUtils.sol",
"ast": {
"absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockAddressUtils.sol",
"exportedSymbols": {
"MockAddressUtils": [
5779
]
},
"id": 5780,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 5734,
"literals": [
"solidity",
">=",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:25:22"
},
{
"id": 5735,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "26:33:22"
},
{
"absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/AddressUtils.sol",
"file": "../utils/AddressUtils.sol",
"id": 5736,
"nodeType": "ImportDirective",
"scope": 5780,
"sourceUnit": 6970,
"src": "61:35:22",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 5779,
"linearizedBaseContracts": [
5779
],
"name": "MockAddressUtils",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 5739,
"libraryName": {
"contractScope": null,
"id": 5737,
"name": "AddressUtils",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6969,
"src": "176:12:22",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AddressUtils_$6969",
"typeString": "library AddressUtils"
}
},
"nodeType": "UsingForDirective",
"src": "170:31:22",
"typeName": {
"id": 5738,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "193:7:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
{
"body": {
"id": 5750,
"nodeType": "Block",
"src": "267:36:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 5746,
"name": "_addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5741,
"src": "280:5:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 5747,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "isContract",
"nodeType": "MemberAccess",
"referencedDeclaration": 6748,
"src": "280:16:22",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$bound_to$_t_address_$",
"typeString": "function (address) view returns (bool)"
}
},
"id": 5748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "280:18:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 5745,
"id": 5749,
"nodeType": "Return",
"src": "273:25:22"
}
]
},
"documentation": null,
"id": 5751,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "isContract",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5742,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5741,
"name": "_addr",
"nodeType": "VariableDeclaration",
"scope": 5751,
"src": "225:13:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5740,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "225:7:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "224:15:22"
},
"payable": false,
"returnParameters": {
"id": 5745,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5744,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 5751,
"src": "261:4:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 5743,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "261:4:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "260:6:22"
},
"scope": 5779,
"src": "205:98:22",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 5762,
"nodeType": "Block",
"src": "438:35:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 5758,
"name": "_addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5753,
"src": "451:5:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 5759,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getString",
"nodeType": "MemberAccess",
"referencedDeclaration": 6861,
"src": "451:15:22",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_string_memory_ptr_$bound_to$_t_address_$",
"typeString": "function (address) pure returns (string memory)"
}
},
"id": 5760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "451:17:22",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"functionReturnParameters": 5757,
"id": 5761,
"nodeType": "Return",
"src": "444:24:22"
}
]
},
"documentation": null,
"id": 5763,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getString",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5754,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5753,
"name": "_addr",
"nodeType": "VariableDeclaration",
"scope": 5763,
"src": "387:13:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5752,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "387:7:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "386:15:22"
},
"payable": false,
"returnParameters": {
"id": 5757,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5756,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 5763,
"src": "423:6:22",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 5755,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "423:6:22",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "422:15:22"
},
"scope": 5779,
"src": "368:105:22",
"stateMutability": "pure",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 5777,
"nodeType": "Block",
"src": "540:45:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 5774,
"name": "_str",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5765,
"src": "575:4:22",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 5771,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "561:1:22",
"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": 5770,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "553:7:22",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 5772,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "553:10:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 5773,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "fromString",
"nodeType": "MemberAccess",
"referencedDeclaration": 6968,
"src": "553:21:22",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_address_$_t_string_memory_ptr_$returns$_t_address_$bound_to$_t_address_$",
"typeString": "function (address,string memory) pure returns (address)"
}
},
"id": 5775,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "553:27:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 5769,
"id": 5776,
"nodeType": "Return",
"src": "546:34:22"
}
]
},
"documentation": null,
"id": 5778,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "fromString",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5766,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5765,
"name": "_str",
"nodeType": "VariableDeclaration",
"scope": 5778,
"src": "497:11:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 5764,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "497:6:22",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "496:13:22"
},
"payable": false,
"returnParameters": {
"id": 5769,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5768,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 5778,
"src": "531:7:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5767,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "531:7:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "530:9:22"
},
"scope": 5779,
"src": "477:108:22",
"stateMutability": "pure",
"superFunction": null,
"visibility": "public"
}
],
"scope": 5780,
"src": "140:447:22"
}
],
"src": "0:588:22"
},
"legacyAST": {
"absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/mock/MockAddressUtils.sol",
"exportedSymbols": {
"MockAddressUtils": [
5779
]
},
"id": 5780,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 5734,
"literals": [
"solidity",
">=",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:25:22"
},
{
"id": 5735,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "26:33:22"
},
{
"absolutePath": "/Users/chtian/Documents/01_work/01_develope/jcc/jcc-solidity-utils/contracts/utils/AddressUtils.sol",
"file": "../utils/AddressUtils.sol",
"id": 5736,
"nodeType": "ImportDirective",
"scope": 5780,
"sourceUnit": 6970,
"src": "61:35:22",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 5779,
"linearizedBaseContracts": [
5779
],
"name": "MockAddressUtils",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 5739,
"libraryName": {
"contractScope": null,
"id": 5737,
"name": "AddressUtils",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6969,
"src": "176:12:22",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AddressUtils_$6969",
"typeString": "library AddressUtils"
}
},
"nodeType": "UsingForDirective",
"src": "170:31:22",
"typeName": {
"id": 5738,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "193:7:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
{
"body": {
"id": 5750,
"nodeType": "Block",
"src": "267:36:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 5746,
"name": "_addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5741,
"src": "280:5:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 5747,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "isContract",
"nodeType": "MemberAccess",
"referencedDeclaration": 6748,
"src": "280:16:22",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$bound_to$_t_address_$",
"typeString": "function (address) view returns (bool)"
}
},
"id": 5748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "280:18:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 5745,
"id": 5749,
"nodeType": "Return",
"src": "273:25:22"
}
]
},
"documentation": null,
"id": 5751,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "isContract",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5742,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5741,
"name": "_addr",
"nodeType": "VariableDeclaration",
"scope": 5751,
"src": "225:13:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5740,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "225:7:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "224:15:22"
},
"payable": false,
"returnParameters": {
"id": 5745,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5744,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 5751,
"src": "261:4:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 5743,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "261:4:22",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "260:6:22"
},
"scope": 5779,
"src": "205:98:22",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 5762,
"nodeType": "Block",
"src": "438:35:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 5758,
"name": "_addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5753,
"src": "451:5:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 5759,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "getString",
"nodeType": "MemberAccess",
"referencedDeclaration": 6861,
"src": "451:15:22",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_string_memory_ptr_$bound_to$_t_address_$",
"typeString": "function (address) pure returns (string memory)"
}
},
"id": 5760,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "451:17:22",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"functionReturnParameters": 5757,
"id": 5761,
"nodeType": "Return",
"src": "444:24:22"
}
]
},
"documentation": null,
"id": 5763,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "getString",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5754,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5753,
"name": "_addr",
"nodeType": "VariableDeclaration",
"scope": 5763,
"src": "387:13:22",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5752,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "387:7:22",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "386:15:22"
},
"payable": false,
"returnParameters": {
"id": 5757,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5756,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 5763,
"src": "423:6:22",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 5755,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "423:6:22",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "422:15:22"
},
"scope": 5779,
"src": "368:105:22",
"stateMutability": "pure",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 5777,
"nodeType": "Block",
"src": "540:45:22",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 5774,
"name": "_str",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5765,
"src": "575:4:22",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 5771,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "561:1:22",
"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"