UNPKG

tokenboost-solidity-erc20token

Version:
1,155 lines 118 kB
{ "contractName": "AddressUtils", "abi": [], "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820d6caf28a368bb1379a49694263bc17e81eb4946141fcf08452cf3ac307c55da10029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820d6caf28a368bb1379a49694263bc17e81eb4946141fcf08452cf3ac307c55da10029", "sourceMap": "26:625:7:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24", "deployedSourceMap": "26:625:7:-;;;;;;;;", "source": "pragma solidity ^0.4.24;\n\nlibrary AddressUtils {\n function isContract(address _self) internal view returns (bool _r) {\n assembly {\n _r := gt(extcodesize(_self), 0)\n }\n }\n\n function toString(address _self) internal pure returns (string memory) {\n bytes memory data = new bytes(42);\n data[0] = byte(48);\n data[1] = byte(120);\n uint160 num = uint160(_self);\n uint i;\n for (i = 0; i < 40; i++) {\n uint160 c = (num % 16) + 48;\n if (c > 57) c += 39;\n data[40 - i + 1] = byte(c);\n num /= 16;\n }\n return string(data);\n }\n}", "sourcePath": "tokenboost-solidity/contracts/utils/AddressUtils.sol", "ast": { "absolutePath": "tokenboost-solidity/contracts/utils/AddressUtils.sol", "exportedSymbols": { "AddressUtils": [ 914 ] }, "id": 915, "nodeType": "SourceUnit", "nodes": [ { "id": 815, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:24:7" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": null, "fullyImplemented": true, "id": 914, "linearizedBaseContracts": [ 914 ], "name": "AddressUtils", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 823, "nodeType": "Block", "src": "120:80:7", "statements": [ { "externalReferences": [ { "_self": { "declaration": 817, "isOffset": false, "isSlot": false, "src": "174:5:7", "valueSize": 1 } }, { "_r": { "declaration": 820, "isOffset": false, "isSlot": false, "src": "153:2:7", "valueSize": 1 } } ], "id": 822, "nodeType": "InlineAssembly", "operations": "{\n _r := gt(extcodesize(_self), 0)\n}", "src": "130:70:7" } ] }, "documentation": null, "id": 824, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "isContract", "nodeType": "FunctionDefinition", "parameters": { "id": 818, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 817, "name": "_self", "nodeType": "VariableDeclaration", "scope": 824, "src": "73:13:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 816, "name": "address", "nodeType": "ElementaryTypeName", "src": "73:7:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "72:15:7" }, "payable": false, "returnParameters": { "id": 821, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 820, "name": "_r", "nodeType": "VariableDeclaration", "scope": 824, "src": "111:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 819, "name": "bool", "nodeType": "ElementaryTypeName", "src": "111:4:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "110:9:7" }, "scope": 914, "src": "53:147:7", "stateMutability": "view", "superFunction": null, "visibility": "internal" }, { "body": { "id": 912, "nodeType": "Block", "src": "277:372:7", "statements": [ { "assignments": [ 832 ], "declarations": [ { "constant": false, "id": 832, "name": "data", "nodeType": "VariableDeclaration", "scope": 913, "src": "287:17:7", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 831, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "287:5:7", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "id": 837, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "3432", "id": 835, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "317:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_42_by_1", "typeString": "int_const 42" }, "value": "42" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_42_by_1", "typeString": "int_const 42" } ], "id": 834, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "NewExpression", "src": "307:9:7", "typeDescriptions": { "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_bytes_memory_$", "typeString": "function (uint256) pure returns (bytes memory)" }, "typeName": { "id": 833, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "311:5:7", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } } }, "id": 836, "isConstant": false, "isLValue": false, "isPure": true, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "307:13:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory", "typeString": "bytes memory" } }, "nodeType": "VariableDeclarationStatement", "src": "287:33:7" }, { "expression": { "argumentTypes": null, "id": 844, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 838, "name": "data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 832, "src": "330:4:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 840, "indexExpression": { "argumentTypes": null, "hexValue": "30", "id": 839, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "335:1:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "330:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "3438", "id": 842, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "345:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_48_by_1", "typeString": "int_const 48" }, "value": "48" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_48_by_1", "typeString": "int_const 48" } ], "id": 841, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "340:4:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes1_$", "typeString": "type(bytes1)" }, "typeName": "byte" }, "id": 843, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "340:8:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "src": "330:18:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 845, "nodeType": "ExpressionStatement", "src": "330:18:7" }, { "expression": { "argumentTypes": null, "id": 852, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 846, "name": "data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 832, "src": "358:4:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 848, "indexExpression": { "argumentTypes": null, "hexValue": "31", "id": 847, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "363:1:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "358:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "313230", "id": 850, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "373:3:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_120_by_1", "typeString": "int_const 120" }, "value": "120" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_120_by_1", "typeString": "int_const 120" } ], "id": 849, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "368:4:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes1_$", "typeString": "type(bytes1)" }, "typeName": "byte" }, "id": 851, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "368:9:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "src": "358:19:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 853, "nodeType": "ExpressionStatement", "src": "358:19:7" }, { "assignments": [ 855 ], "declarations": [ { "constant": false, "id": 855, "name": "num", "nodeType": "VariableDeclaration", "scope": 913, "src": "387:11:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" }, "typeName": { "id": 854, "name": "uint160", "nodeType": "ElementaryTypeName", "src": "387:7:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "value": null, "visibility": "internal" } ], "id": 859, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 857, "name": "_self", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 826, "src": "409:5:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 856, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "401:7:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint160_$", "typeString": "type(uint160)" }, "typeName": "uint160" }, "id": 858, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "401:14:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "nodeType": "VariableDeclarationStatement", "src": "387:28:7" }, { "assignments": [], "declarations": [ { "constant": false, "id": 861, "name": "i", "nodeType": "VariableDeclaration", "scope": 913, "src": "425:6:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 860, "name": "uint", "nodeType": "ElementaryTypeName", "src": "425:4:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "id": 862, "initialValue": null, "nodeType": "VariableDeclarationStatement", "src": "425:6:7" }, { "body": { "id": 906, "nodeType": "Block", "src": "466:148:7", "statements": [ { "assignments": [ 874 ], "declarations": [ { "constant": false, "id": 874, "name": "c", "nodeType": "VariableDeclaration", "scope": 913, "src": "480:9:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" }, "typeName": { "id": 873, "name": "uint160", "nodeType": "ElementaryTypeName", "src": "480:7:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "value": null, "visibility": "internal" } ], "id": 881, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint160", "typeString": "uint160" }, "id": 880, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint160", "typeString": "uint160" }, "id": 877, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 875, "name": "num", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 855, "src": "493:3:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "nodeType": "BinaryOperation", "operator": "%", "rightExpression": { "argumentTypes": null, "hexValue": "3136", "id": 876, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "499:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "493:8:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } } ], "id": 878, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "492:10:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "3438", "id": 879, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "505:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_48_by_1", "typeString": "int_const 48" }, "value": "48" }, "src": "492:15:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "nodeType": "VariableDeclarationStatement", "src": "480:27:7" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint160", "typeString": "uint160" }, "id": 884, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 882, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 874, "src": "525:1:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "3537", "id": 883, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "529:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_57_by_1", "typeString": "int_const 57" }, "value": "57" }, "src": "525:6:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 889, "nodeType": "IfStatement", "src": "521:19:7", "trueBody": { "expression": { "argumentTypes": null, "id": 887, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 885, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 874, "src": "533:1:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "nodeType": "Assignment", "operator": "+=", "rightHandSide": { "argumentTypes": null, "hexValue": "3339", "id": 886, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "538:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_39_by_1", "typeString": "int_const 39" }, "value": "39" }, "src": "533:7:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "id": 888, "nodeType": "ExpressionStatement", "src": "533:7:7" } }, { "expression": { "argumentTypes": null, "id": 900, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 890, "name": "data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 832, "src": "554:4:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 896, "indexExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 895, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 893, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "hexValue": "3430", "id": 891, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "559:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_40_by_1", "typeString": "int_const 40" }, "value": "40" }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 892, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 861, "src": "564:1:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "559:6:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "hexValue": "31", "id": 894, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "568:1:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "559:10:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", "src": "554:16:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 898, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 874, "src": "578:1:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint160", "typeString": "uint160" } ], "id": 897, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "573:4:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes1_$", "typeString": "type(bytes1)" }, "typeName": "byte" }, "id": 899, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "573:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "src": "554:26:7", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" } }, "id": 901, "nodeType": "ExpressionStatement", "src": "554:26:7" }, { "expression": { "argumentTypes": null, "id": 904, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 902, "name": "num", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 855, "src": "594:3:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "argumentTypes": null, "hexValue": "3136", "id": 903, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "601:2:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_16_by_1", "typeString": "int_const 16" }, "value": "16" }, "src": "594:9:7", "typeDescriptions": { "typeIdentifier": "t_uint160", "typeString": "uint160" } }, "id": 905, "nodeType": "ExpressionStatement", "src": "594:9:7" } ] }, "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 869, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 867, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 861, "src": "453:1:7", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "argumentTypes": null, "hexValue": "3430", "id": 868, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequ