ocean-subgraph/abis/DTFactory.json

4528 lines
200 KiB
JSON
Raw Normal View History

2020-11-26 07:38:08 +01:00
{
"contractName": "DTFactory",
"abi": [
{
"inputs": [
{
"name": "_template",
"type": "address"
},
{
"name": "_collector",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "newTokenAddress",
"type": "address"
},
{
"indexed": true,
"name": "templateAddress",
"type": "address"
},
{
"indexed": true,
"name": "tokenName",
"type": "string"
}
],
"name": "TokenCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "tokenAddress",
"type": "address"
},
{
"indexed": false,
"name": "tokenName",
"type": "string"
},
{
"indexed": false,
"name": "tokenSymbol",
"type": "string"
},
{
"indexed": false,
"name": "tokenCap",
"type": "uint256"
},
{
"indexed": true,
"name": "registeredBy",
"type": "address"
},
{
"indexed": true,
"name": "blob",
"type": "string"
}
],
"name": "TokenRegistered",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "instance",
"type": "address"
}
],
"name": "InstanceDeployed",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "blob",
"type": "string"
},
{
"name": "name",
"type": "string"
},
{
"name": "symbol",
"type": "string"
},
{
"name": "cap",
"type": "uint256"
}
],
"name": "createToken",
"outputs": [
{
"name": "token",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getCurrentTokenCount",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getTokenTemplate",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.7+commit.6da8b019\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"getTokenTemplate\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentTokenCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"blob\",\"type\":\"string\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"symbol\",\"type\":\"string\"},{\"name\":\"cap\",\"type\":\"uint256\"}],\"name\":\"createToken\",\"outputs\":[{\"name\":\"token\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_template\",\"type\":\"address\"},{\"name\":\"_collector\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"newTokenAddress\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"templateAddress\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"tokenName\",\"type\":\"string\"}],\"name\":\"TokenCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"tokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"tokenName\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"tokenSymbol\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"tokenCap\",\"type\":\"uint256\"},{\"indexed\":true,\"name\":\"registeredBy\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"blob\",\"type\":\"string\"}],\"name\":\"TokenRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"instance\",\"type\":\"address\"}],\"name\":\"InstanceDeployed\",\"type\":\"event\"}],\"devdoc\":{\"author\":\"Ocean Protocol Team\",\"details\":\"Implementation of Ocean DataTokens Factory * DTFactory deploys DataToken proxy contracts. New DataToken proxy contracts are links to the template contract's bytecode. Proxy contract functionality is based on Ocean Protocol custom implementation of ERC1167 standard.\",\"methods\":{\"constructor\":{\"details\":\"constructor Called on contract deployment. Could not be called with zero address parameters.\",\"params\":{\"_collector\":\"refers to the community fee collector address\",\"_template\":\"refers to the address of a deployed DataToken contract.\"}},\"createToken(string,string,string,uint256)\":{\"details\":\"Deploys new DataToken proxy contract. Template contract address could not be a zero address.\",\"params\":{\"blob\":\"any string that hold data/metadata for the new token\",\"cap\":\"the maximum total supply\",\"name\":\"token name\",\"symbol\":\"token symbol\"},\"return\":\"address of a new proxy DataToken contract\"},\"getCurrentTokenCount()\":{\"details\":\"get the current token count.\",\"return\":\"the current token count\"},\"getTokenTemplate()\":{\"details\":\"get the token template address\",\"return\":\"the template address\"}},\"title\":\"DTFactory contract\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/DTFactory.sol\":\"DTFactory\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/DTFactory.sol\":{\"keccak256\":\"0x8cf30689a380ec195de52dcee8a0263de862a457ee218d46a3fcb996edc48d89\",\"urls\":[\"bzzr://fb1f26c6ff8246dc38c4ce651fe17c85c8f9e64b3b1344b13c9ec9253202af1f\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/interfaces/IERC20Template.sol\":{\"keccak256\":\"0x022ebed2ba4949e96a05cc394cf690d8fd3190a4733cebe8cbe930ac25cfde18\",\"urls\":[\"bzzr://2fa3d5cae14f0af7d78f6e1d13bc41854082c03ab2f86462ebb09afda88ee6e9\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/utils/Deployer.sol\":{\"keccak256\":
"bytecode": "0x6080604052600160025534801561001557600080fd5b50604051604080610a278339810180604052604081101561003557600080fd5b508051602090910151600160a060020a0382161580159061005e5750600160a060020a03811615155b6100b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260418152602001806109e66041913960600191505060405180910390fd5b60008054600160a060020a03938416600160a060020a031991821617909155600180549290931691161790556108f8806100ee6000396000f3fe608060405234801561001057600080fd5b506004361061005d577c01000000000000000000000000000000000000000000000000000000006000350463490aad768114610062578063c6cf868a14610086578063efbe8fd1146100a0575b600080fd5b61006a610256565b60408051600160a060020a039092168252519081900360200190f35b61008e610265565b60408051918252519081900360200190f35b61006a600480360360808110156100b657600080fd5b8101906020810181356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184600183028401116401000000008311171561010557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561015857600080fd5b82018360208201111561016a57600080fd5b8035906020019184600183028401116401000000008311171561018c57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101df57600080fd5b8201836020820111156101f157600080fd5b8035906020019184600183028401116401000000008311171561021357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061026b915050565b600054600160a060020a031690565b60025490565b6000816102c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806108716022913960400191505060405180910390fd5b6000546102d890600160a060020a0316610791565b9050600160a060020a038116610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180610893603a913960400191505060405180910390fd5b6001546040517f9070d2f8000000000000000000000000000000000000000000000000000000008152336044820181905260648201859052600160a060020a0392831660a4830181905260c060048401908152885160c485015288518695861694639070d2f8948b948b9491938b938f939182916024810191608482019160e4019060208c019080838360005b838110156103de5781810151838201526020016103c6565b50505050905090810190601f16801561040b5780820380516001836020036101000a031916815260200191505b5084810383528951815289516020918201918b019080838360005b8381101561043e578181015183820152602001610426565b50505050905090810190601f16801561046b5780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b8381101561049e578181015183820152602001610486565b50505050905090810190601f1680156104cb5780820380516001836020036101000a031916815260200191505b509950505050505050505050602060405180830381600087803b1580156104f157600080fd5b505af1158015610505573d6000803e3d6000fd5b505050506040513d602081101561051b57600080fd5b5051610572576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180610843602e913960400191505060405180910390fd5b846040518082805190602001908083835b602083106105a25780518252601f199092019160209182019101610583565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822060008054919550600160a060020a039182169450908716927fb51c8cbe199ffe8b0d1d39b62d473569750653cb18b165f77ae423b3900180ad9250a4856040518082805190602001908083835b602083106106365780518252601f199092019160209182019101610617565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902033600160a060020a031683600160a060020a03167f437e99a69c634128e67a85656b80d03b028ba37525b15070606e5c28e846984a888888604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156106e25781810151838201526020016106ca565b50505050905090810190601f16801561070f5780820380516001836020036101000a03191681
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061005d577c01000000000000000000000000000000000000000000000000000000006000350463490aad768114610062578063c6cf868a14610086578063efbe8fd1146100a0575b600080fd5b61006a610256565b60408051600160a060020a039092168252519081900360200190f35b61008e610265565b60408051918252519081900360200190f35b61006a600480360360808110156100b657600080fd5b8101906020810181356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184600183028401116401000000008311171561010557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561015857600080fd5b82018360208201111561016a57600080fd5b8035906020019184600183028401116401000000008311171561018c57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101df57600080fd5b8201836020820111156101f157600080fd5b8035906020019184600183028401116401000000008311171561021357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061026b915050565b600054600160a060020a031690565b60025490565b6000816102c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806108716022913960400191505060405180910390fd5b6000546102d890600160a060020a0316610791565b9050600160a060020a038116610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180610893603a913960400191505060405180910390fd5b6001546040517f9070d2f8000000000000000000000000000000000000000000000000000000008152336044820181905260648201859052600160a060020a0392831660a4830181905260c060048401908152885160c485015288518695861694639070d2f8948b948b9491938b938f939182916024810191608482019160e4019060208c019080838360005b838110156103de5781810151838201526020016103c6565b50505050905090810190601f16801561040b5780820380516001836020036101000a031916815260200191505b5084810383528951815289516020918201918b019080838360005b8381101561043e578181015183820152602001610426565b50505050905090810190601f16801561046b5780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b8381101561049e578181015183820152602001610486565b50505050905090810190601f1680156104cb5780820380516001836020036101000a031916815260200191505b509950505050505050505050602060405180830381600087803b1580156104f157600080fd5b505af1158015610505573d6000803e3d6000fd5b505050506040513d602081101561051b57600080fd5b5051610572576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180610843602e913960400191505060405180910390fd5b846040518082805190602001908083835b602083106105a25780518252601f199092019160209182019101610583565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822060008054919550600160a060020a039182169450908716927fb51c8cbe199ffe8b0d1d39b62d473569750653cb18b165f77ae423b3900180ad9250a4856040518082805190602001908083835b602083106106365780518252601f199092019160209182019101610617565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902033600160a060020a031683600160a060020a03167f437e99a69c634128e67a85656b80d03b028ba37525b15070606e5c28e846984a888888604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156106e25781810151838201526020016106ca565b50505050905090810190601f16801561070f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561074257818101518382015260200161072a565b50505050905090810190601f16801561076f5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a450600280546001019055949350505050565b6040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081526c010000000000000000000000008202601482018190527f5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000602883
"sourceMap": "629:3010:0:-;;;780:1;744:37;;1438:351;8:9:-1;5:2;;;30:1;27;20:12;5:2;1438:351:0;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1438:351:0;;;;;;;-1:-1:-1;;;;;1549:23:0;;;;;;:63;;-1:-1:-1;;;;;;1588:24:0;;;;1549:63;1528:175;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1713:13;:25;;-1:-1:-1;;;;;1713:25:0;;;-1:-1:-1;;;;;;1713:25:0;;;;;;;;1748:34;;;;;;;;;;;629:3010;;;;;;",
"deployedSourceMap": "629:3010:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;629:3010:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3540:97;;;:::i;:::-;;;;-1:-1:-1;;;;;3540:97:0;;;;;;;;;;;;;;3334:105;;;:::i;:::-;;;;;;;;;;;;;;;;2164:1068;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;2164:1068:0;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;2164:1068:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2164:1068:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;2164:1068:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;2164:1068:0;;;;;;;;-1:-1:-1;2164:1068:0;;-1:-1:-1;;21:11;5:28;;2:2;;;46:1;43;36:12;2:2;2164:1068:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2164:1068:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;2164:1068:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;2164:1068:0;;;;;;;;-1:-1:-1;2164:1068:0;;-1:-1:-1;;21:11;5:28;;2:2;;;46:1;43;36:12;2:2;2164:1068:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2164:1068:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;2164:1068:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;2164:1068:0;;-1:-1:-1;;2164:1068:0;;;-1:-1:-1;2164:1068:0;;-1:-1:-1;;2164:1068:0:i;3540:97::-;3591:7;3617:13;-1:-1:-1;;;;;3617:13:0;3540:97;:::o;3334:105::-;3415:17;;3334:105;:::o;2164:1068::-;2330:13;2380:8;2359:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2474:13;;2467:21;;-1:-1:-1;;;;;2474:13:0;2467:6;:21::i;:::-;2459:29;-1:-1:-1;;;;;;2520:19:0;;2499:124;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2875:21;;2716:194;;;;;2804:10;2716:194;;;;;;;;;;;;-1:-1:-1;;;;;2875:21:0;;;2716:194;;;;;;;;;;;;;;;;;;;;;2679:5;;2716:24;;;;;2758:4;;2780:6;;2804:10;;2832:3;;2853:4;;2716:194;;;;;;;;;;;;;;;;;;;;;2633:28;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2716:194:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2716:194:0;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2716:194:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2716:194:0;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2716:194:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2716:194:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2716:194:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2716:194:0;2695:287;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3032:4;2997:40;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;;;;365:33;;2997:40:0;;;;;;;;;-1:-1:-1;3017:13:0;;2997:40;;-1:-1:-1;;;;;;3017:13:0;;;;-1:-1:-1;2997:40:0;;;;;;-1:-1:-1;2997:40:0;3179:4;3052:141;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3052:141:0;;;;;;;;;;;;;;;;3155:10;-1:-1:-1;;;;;3052:141:0;3081:5;-1:-1:-1;;;;;3052:141:0;;3100:4;3118:6;3138:3;3052:141;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3052:141:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3052:141:0;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;3052:141:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3203:17:0;:22;;3224:1;3203:22;;;2164:1068;;-1:-1:-1;;;;2164:1068:0:o;811:963:13:-;1415:4;1409:11;1445:66;1431:81;;944:15;;;1541:4;1530:16;;1523:37;;;1596:66;1589:4;1578:16;;1571:92;889:16;;1703:4;1409:11;889:16;1686:22;1732:35;;;-1:-1:-1;;;;;1732:35:13;;;;;;1674:34;;-1:-1:-1;1732:35:13;;-1:-1:-1;1732:35:13;;;;;;;811:963;;;;:::o",
"source": "pragma solidity 0.5.7;\n// Copyright BigchainDB GmbH and Ocean Protocol contributors\n// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)\n// Code is Apache-2.0 and docs are CC-BY-4.0\n\nimport './utils/Deployer.sol';\nimport './interfaces/IERC20Template.sol';\n\n/**\n * @title DTFactory contract\n * @author Ocean Protocol Team\n *\n * @dev Implementation of Ocean DataTokens Factory\n *\n * DTFactory deploys DataToken proxy contracts.\n * New DataToken proxy contracts are links to the template contract's bytecode.\n * Proxy contract functionality is based on Ocean Protocol custom implementation of ERC1167 standard.\n */\ncontract DTFactory is Deployer {\n address private tokenTemplate;\n address private communityFeeCollector;\n uint256 private currentTokenCount = 1;\n\n event TokenCreated(\n address indexed newTokenAddress,\n address indexed templateAddress,\n string indexed tokenName\n );\n\n event TokenRegistered(\n address indexed tokenAddress,\n string tokenName,\n string tokenSymbol,\n uint256 tokenCap,\n address indexed registeredBy,\n string indexed blob\n );\n\n /**\n * @dev constructor\n * Called on contract deployment. Could not be called with zero address parameters.\n * @param _template refers to the address of a deployed DataToken contract.\n * @param _collector refers to the community fee collector address\n */\n constructor(\n address _template,\n address _collector\n ) public {\n require(\n _template != address(0) &&\n _collector != address(0),\n 'DTFactory: Invalid template token/community fee collector address'\n );\n tokenTemplate = _template;\n communityFeeCollector = _collector;\n }\n\n /**\n * @dev Deploys new DataToken proxy contract.\n * Template contract address could not be a zero address.\n * @param blob any string that hold data/metadata for the new token\n * @param name token name\n * @param symbol token symbol\n * @param cap the maximum total supply\n * @return address of a new proxy DataToken contract\n */\n function createToken(\n string memory blob,\n string memory name,\n string memory symbol,\n uint256 cap\n )\n public\n returns (address token)\n {\n require(\n cap != 0,\n 'DTFactory: zero cap is not allowed'\n );\n\n token = deploy(tokenTemplate);\n\n require(\n token != address(0),\n 'DTFactory: Failed to perform minimal deploy of a new token'\n );\n IERC20Template tokenInstance = IERC20Template(token);\n require(\n tokenInstance.initialize(\n name,\n symbol,\n msg.sender,\n cap,\n blob,\n communityFeeCollector\n ),\n 'DTFactory: Unable to initialize token instance'\n );\n emit TokenCreated(token, tokenTemplate, name);\n emit TokenRegistered(\n token,\n name,\n symbol,\n cap,\n msg.sender,\n blob\n );\n currentTokenCount += 1;\n }\n\n /**\n * @dev get the current token count.\n * @return the current token count\n */\n function getCurrentTokenCount() external view returns (uint256) {\n return currentTokenCount;\n }\n\n /**\n * @dev get the token template address\n * @return the template address\n */\n function getTokenTemplate() external view returns (address) {\n return tokenTemplate;\n }\n}\n",
"sourcePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/DTFactory.sol",
"ast": {
"absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/DTFactory.sol",
"exportedSymbols": {
"DTFactory": [158]
2020-11-26 07:38:08 +01:00
},
"id": 159,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": ["solidity", "0.5", ".7"],
2020-11-26 07:38:08 +01:00
"nodeType": "PragmaDirective",
"src": "0:22:0"
},
{
"absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/utils/Deployer.sol",
"file": "./utils/Deployer.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 159,
"sourceUnit": 5732,
"src": "185:30:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/interfaces/IERC20Template.sol",
"file": "./interfaces/IERC20Template.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 159,
"sourceUnit": 5090,
"src": "216:41:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4,
"name": "Deployer",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5731,
"src": "651:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Deployer_$5731",
"typeString": "contract Deployer"
}
},
"id": 5,
"nodeType": "InheritanceSpecifier",
"src": "651:8:0"
}
],
"contractDependencies": [5731],
2020-11-26 07:38:08 +01:00
"contractKind": "contract",
"documentation": "@title DTFactory contract\n@author Ocean Protocol Team\n * @dev Implementation of Ocean DataTokens Factory\n * DTFactory deploys DataToken proxy contracts.\n New DataToken proxy contracts are links to the template contract's bytecode.\n Proxy contract functionality is based on Ocean Protocol custom implementation of ERC1167 standard.",
"fullyImplemented": true,
"id": 158,
"linearizedBaseContracts": [158, 5731],
2020-11-26 07:38:08 +01:00
"name": "DTFactory",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 7,
"name": "tokenTemplate",
"nodeType": "VariableDeclaration",
"scope": 158,
"src": "666:29:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "666:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "private"
},
{
"constant": false,
"id": 9,
"name": "communityFeeCollector",
"nodeType": "VariableDeclaration",
"scope": 158,
"src": "701:37:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "701:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "private"
},
{
"constant": false,
"id": 12,
"name": "currentTokenCount",
"nodeType": "VariableDeclaration",
"scope": 158,
"src": "744:37:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "744:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31",
"id": 11,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "780:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"visibility": "private"
},
{
"anonymous": false,
"documentation": null,
"id": 20,
"name": "TokenCreated",
"nodeType": "EventDefinition",
"parameters": {
"id": 19,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"indexed": true,
"name": "newTokenAddress",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "816:31:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "816:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"indexed": true,
"name": "templateAddress",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "857:31:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 15,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "857:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 18,
"indexed": true,
"name": "tokenName",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "898:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 17,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "898:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "806:122:0"
},
"src": "788:141:0"
},
{
"anonymous": false,
"documentation": null,
"id": 34,
"name": "TokenRegistered",
"nodeType": "EventDefinition",
"parameters": {
"id": 33,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22,
"indexed": true,
"name": "tokenAddress",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "966:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 21,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "966:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24,
"indexed": false,
"name": "tokenName",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1004:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 23,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1004:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 26,
"indexed": false,
"name": "tokenSymbol",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1030:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 25,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1030:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 28,
"indexed": false,
"name": "tokenCap",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1058:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1058:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 30,
"indexed": true,
"name": "registeredBy",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1084:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 29,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1084:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 32,
"indexed": true,
"name": "blob",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1122:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 31,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1122:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "956:191:0"
},
"src": "935:213:0"
},
{
"body": {
"id": 64,
"nodeType": "Block",
"src": "1518:271:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 52,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 46,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 42,
"name": "_template",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36,
"src": "1549:9:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 44,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1570:1:0",
"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": 43,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1562:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 45,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1562:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "1549:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 51,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 47,
"name": "_collector",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38,
"src": "1588:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 49,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1610:1:0",
"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": 48,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1602:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 50,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1602:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "1588:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1549:63:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4454466163746f72793a20496e76616c69642074656d706c61746520746f6b656e2f636f6d6d756e6974792066656520636f6c6c6563746f722061646472657373",
"id": 53,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1626:67:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_4ad3e5f7655ba83235e545811343b3f1c7739bd2f1b726cbd7686d420baf2813",
"typeString": "literal_string \"DTFactory: Invalid template token/community fee collector address\""
},
"value": "DTFactory: Invalid template token/community fee collector address"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_4ad3e5f7655ba83235e545811343b3f1c7739bd2f1b726cbd7686d420baf2813",
"typeString": "literal_string \"DTFactory: Invalid template token/community fee collector address\""
}
],
"id": 41,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [6555, 6556],
2020-11-26 07:38:08 +01:00
"referencedDeclaration": 6556,
"src": "1528:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 54,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1528:175:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 55,
"nodeType": "ExpressionStatement",
"src": "1528:175:0"
},
{
"expression": {
"argumentTypes": null,
"id": 58,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 56,
"name": "tokenTemplate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "1713:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 57,
"name": "_template",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36,
"src": "1729:9:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1713:25:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 59,
"nodeType": "ExpressionStatement",
"src": "1713:25:0"
},
{
"expression": {
"argumentTypes": null,
"id": 62,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 60,
"name": "communityFeeCollector",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "1748:21:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 61,
"name": "_collector",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38,
"src": "1772:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1748:34:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 63,
"nodeType": "ExpressionStatement",
"src": "1748:34:0"
}
]
},
"documentation": "@dev constructor\n Called on contract deployment. Could not be called with zero address parameters.\n@param _template refers to the address of a deployed DataToken contract.\n@param _collector refers to the community fee collector address",
"id": 65,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 39,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 36,
"name": "_template",
"nodeType": "VariableDeclaration",
"scope": 65,
"src": "1459:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 35,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1459:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 38,
"name": "_collector",
"nodeType": "VariableDeclaration",
"scope": 65,
"src": "1486:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 37,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1486:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1449:61:0"
},
"returnParameters": {
"id": 40,
"nodeType": "ParameterList",
"parameters": [],
"src": "1518:0:0"
},
"scope": 158,
"src": "1438:351:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 140,
"nodeType": "Block",
"src": "2349:883:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 81,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 79,
"name": "cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 73,
"src": "2380:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 80,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2387:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2380:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4454466163746f72793a207a65726f20636170206973206e6f7420616c6c6f776564",
"id": 82,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2402:36:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_275103c39c8e014c8efbcc9e9b88606200c5ae2f95e8ff4229101e5d34ee3597",
"typeString": "literal_string \"DTFactory: zero cap is not allowed\""
},
"value": "DTFactory: zero cap is not allowed"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_275103c39c8e014c8efbcc9e9b88606200c5ae2f95e8ff4229101e5d34ee3597",
"typeString": "literal_string \"DTFactory: zero cap is not allowed\""
}
],
"id": 78,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [6555, 6556],
2020-11-26 07:38:08 +01:00
"referencedDeclaration": 6556,
"src": "2359:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 83,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2359:89:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 84,
"nodeType": "ExpressionStatement",
"src": "2359:89:0"
},
{
"expression": {
"argumentTypes": null,
"id": 89,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 85,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "2459:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 87,
"name": "tokenTemplate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "2474:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 86,
"name": "deploy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5730,
"src": "2467:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$_t_address_$",
"typeString": "function (address) returns (address)"
}
},
"id": 88,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2467:21:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2459:29:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 90,
"nodeType": "ExpressionStatement",
"src": "2459:29:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 96,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 92,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "2520:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 94,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2537:1:0",
"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": 93,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2529:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 95,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2529:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "2520:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4454466163746f72793a204661696c656420746f20706572666f726d206d696e696d616c206465706c6f79206f662061206e657720746f6b656e",
"id": 97,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2553:60:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_864bea267bbab0e2823533999ec879a0c10c7f940117c7fd1687efd3993a56e3",
"typeString": "literal_string \"DTFactory: Failed to perform minimal deploy of a new token\""
},
"value": "DTFactory: Failed to perform minimal deploy of a new token"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_864bea267bbab0e2823533999ec879a0c10c7f940117c7fd1687efd3993a56e3",
"typeString": "literal_string \"DTFactory: Failed to perform minimal deploy of a new token\""
}
],
"id": 91,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [6555, 6556],
2020-11-26 07:38:08 +01:00
"referencedDeclaration": 6556,
"src": "2499:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 98,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2499:124:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 99,
"nodeType": "ExpressionStatement",
"src": "2499:124:0"
},
{
"assignments": [101],
2020-11-26 07:38:08 +01:00
"declarations": [
{
"constant": false,
"id": 101,
"name": "tokenInstance",
"nodeType": "VariableDeclaration",
"scope": 140,
"src": "2633:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Template_$5089",
"typeString": "contract IERC20Template"
},
"typeName": {
"contractScope": null,
"id": 100,
"name": "IERC20Template",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5089,
"src": "2633:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Template_$5089",
"typeString": "contract IERC20Template"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 105,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 103,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "2679:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 102,
"name": "IERC20Template",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5089,
"src": "2664:14:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Template_$5089_$",
"typeString": "type(contract IERC20Template)"
}
},
"id": 104,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2664:21:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Template_$5089",
"typeString": "contract IERC20Template"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2633:52:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 109,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 69,
"src": "2758:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 110,
"name": "symbol",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 71,
"src": "2780:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 111,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6552,
"src": "2804:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 112,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2804:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 113,
"name": "cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 73,
"src": "2832:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 114,
"name": "blob",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 67,
"src": "2853:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 115,
"name": "communityFeeCollector",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "2875:21:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 107,
"name": "tokenInstance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 101,
"src": "2716:13:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Template_$5089",
"typeString": "contract IERC20Template"
}
},
"id": 108,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "initialize",
"nodeType": "MemberAccess",
"referencedDeclaration": 5000,
"src": "2716:24:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_address_$_t_uint256_$_t_string_memory_ptr_$_t_address_$returns$_t_bool_$",
"typeString": "function (string memory,string memory,address,uint256,string memory,address) external returns (bool)"
}
},
"id": 116,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2716:194:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4454466163746f72793a20556e61626c6520746f20696e697469616c697a6520746f6b656e20696e7374616e6365",
"id": 117,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2924:48:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_0d4ad5d97b72e5d205f3629b55676990eb71b941b9757afabcf7e9a4e3e2cbe3",
"typeString": "literal_string \"DTFactory: Unable to initialize token instance\""
},
"value": "DTFactory: Unable to initialize token instance"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_0d4ad5d97b72e5d205f3629b55676990eb71b941b9757afabcf7e9a4e3e2cbe3",
"typeString": "literal_string \"DTFactory: Unable to initialize token instance\""
}
],
"id": 106,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [6555, 6556],
2020-11-26 07:38:08 +01:00
"referencedDeclaration": 6556,
"src": "2695:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 118,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2695:287:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 119,
"nodeType": "ExpressionStatement",
"src": "2695:287:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 121,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "3010:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 122,
"name": "tokenTemplate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "3017:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 123,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 69,
"src": "3032:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 120,
"name": "TokenCreated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 20,
"src": "2997:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (address,address,string memory)"
}
},
"id": 124,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2997:40:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 125,
"nodeType": "EmitStatement",
"src": "2992:45:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 127,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "3081:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 128,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 69,
"src": "3100:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 129,
"name": "symbol",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 71,
"src": "3118:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 130,
"name": "cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 73,
"src": "3138:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 131,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6552,
"src": "3155:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 132,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3155:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 133,
"name": "blob",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 67,
"src": "3179:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 126,
"name": "TokenRegistered",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 34,
"src": "3052:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (address,string memory,string memory,uint256,address,string memory)"
}
},
"id": 134,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3052:141:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 135,
"nodeType": "EmitStatement",
"src": "3047:146:0"
},
{
"expression": {
"argumentTypes": null,
"id": 138,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 136,
"name": "currentTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12,
"src": "3203:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 137,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3224:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3203:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 139,
"nodeType": "ExpressionStatement",
"src": "3203:22:0"
}
]
},
"documentation": "@dev Deploys new DataToken proxy contract.\n Template contract address could not be a zero address.\n@param blob any string that hold data/metadata for the new token\n@param name token name\n@param symbol token symbol\n@param cap the maximum total supply\n@return address of a new proxy DataToken contract",
"id": 141,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "createToken",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 74,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 67,
"name": "blob",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2194:18:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 66,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "2194:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 69,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2222:18:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 68,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "2222:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 71,
"name": "symbol",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2250:20:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 70,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "2250:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 73,
"name": "cap",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2280:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 72,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2280:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2184:113:0"
},
"returnParameters": {
"id": 77,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 76,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2330:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 75,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2330:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2329:15:0"
},
"scope": 158,
"src": "2164:1068:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 148,
"nodeType": "Block",
"src": "3398:41:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 146,
"name": "currentTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12,
"src": "3415:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 145,
"id": 147,
"nodeType": "Return",
"src": "3408:24:0"
}
]
},
"documentation": "@dev get the current token count.\n@return the current token count",
"id": 149,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getCurrentTokenCount",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 142,
"nodeType": "ParameterList",
"parameters": [],
"src": "3363:2:0"
},
"returnParameters": {
"id": 145,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 144,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 149,
"src": "3389:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 143,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3389:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3388:9:0"
},
"scope": 158,
"src": "3334:105:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 156,
"nodeType": "Block",
"src": "3600:37:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 154,
"name": "tokenTemplate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "3617:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 153,
"id": 155,
"nodeType": "Return",
"src": "3610:20:0"
}
]
},
"documentation": "@dev get the token template address\n@return the template address",
"id": 157,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getTokenTemplate",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 150,
"nodeType": "ParameterList",
"parameters": [],
"src": "3565:2:0"
},
"returnParameters": {
"id": 153,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 152,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 157,
"src": "3591:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 151,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3591:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3590:9:0"
},
"scope": 158,
"src": "3540:97:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
}
],
"scope": 159,
"src": "629:3010:0"
}
],
"src": "0:3640:0"
},
"legacyAST": {
"absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/DTFactory.sol",
"exportedSymbols": {
"DTFactory": [158]
2020-11-26 07:38:08 +01:00
},
"id": 159,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": ["solidity", "0.5", ".7"],
2020-11-26 07:38:08 +01:00
"nodeType": "PragmaDirective",
"src": "0:22:0"
},
{
"absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/utils/Deployer.sol",
"file": "./utils/Deployer.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 159,
"sourceUnit": 5732,
"src": "185:30:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/interfaces/IERC20Template.sol",
"file": "./interfaces/IERC20Template.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 159,
"sourceUnit": 5090,
"src": "216:41:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4,
"name": "Deployer",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5731,
"src": "651:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Deployer_$5731",
"typeString": "contract Deployer"
}
},
"id": 5,
"nodeType": "InheritanceSpecifier",
"src": "651:8:0"
}
],
"contractDependencies": [5731],
2020-11-26 07:38:08 +01:00
"contractKind": "contract",
"documentation": "@title DTFactory contract\n@author Ocean Protocol Team\n * @dev Implementation of Ocean DataTokens Factory\n * DTFactory deploys DataToken proxy contracts.\n New DataToken proxy contracts are links to the template contract's bytecode.\n Proxy contract functionality is based on Ocean Protocol custom implementation of ERC1167 standard.",
"fullyImplemented": true,
"id": 158,
"linearizedBaseContracts": [158, 5731],
2020-11-26 07:38:08 +01:00
"name": "DTFactory",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 7,
"name": "tokenTemplate",
"nodeType": "VariableDeclaration",
"scope": 158,
"src": "666:29:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "666:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "private"
},
{
"constant": false,
"id": 9,
"name": "communityFeeCollector",
"nodeType": "VariableDeclaration",
"scope": 158,
"src": "701:37:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 8,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "701:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "private"
},
{
"constant": false,
"id": 12,
"name": "currentTokenCount",
"nodeType": "VariableDeclaration",
"scope": 158,
"src": "744:37:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "744:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "31",
"id": 11,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "780:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"visibility": "private"
},
{
"anonymous": false,
"documentation": null,
"id": 20,
"name": "TokenCreated",
"nodeType": "EventDefinition",
"parameters": {
"id": 19,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"indexed": true,
"name": "newTokenAddress",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "816:31:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "816:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"indexed": true,
"name": "templateAddress",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "857:31:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 15,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "857:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 18,
"indexed": true,
"name": "tokenName",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "898:24:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 17,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "898:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "806:122:0"
},
"src": "788:141:0"
},
{
"anonymous": false,
"documentation": null,
"id": 34,
"name": "TokenRegistered",
"nodeType": "EventDefinition",
"parameters": {
"id": 33,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 22,
"indexed": true,
"name": "tokenAddress",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "966:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 21,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "966:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 24,
"indexed": false,
"name": "tokenName",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1004:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 23,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1004:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 26,
"indexed": false,
"name": "tokenSymbol",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1030:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 25,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1030:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 28,
"indexed": false,
"name": "tokenCap",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1058:16:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 27,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1058:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 30,
"indexed": true,
"name": "registeredBy",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1084:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 29,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1084:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 32,
"indexed": true,
"name": "blob",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1122:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 31,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1122:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "956:191:0"
},
"src": "935:213:0"
},
{
"body": {
"id": 64,
"nodeType": "Block",
"src": "1518:271:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 52,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 46,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 42,
"name": "_template",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36,
"src": "1549:9:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 44,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1570:1:0",
"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": 43,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1562:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 45,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1562:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "1549:23:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 51,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 47,
"name": "_collector",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38,
"src": "1588:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 49,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1610:1:0",
"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": 48,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1602:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 50,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1602:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "1588:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "1549:63:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4454466163746f72793a20496e76616c69642074656d706c61746520746f6b656e2f636f6d6d756e6974792066656520636f6c6c6563746f722061646472657373",
"id": 53,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1626:67:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_4ad3e5f7655ba83235e545811343b3f1c7739bd2f1b726cbd7686d420baf2813",
"typeString": "literal_string \"DTFactory: Invalid template token/community fee collector address\""
},
"value": "DTFactory: Invalid template token/community fee collector address"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_4ad3e5f7655ba83235e545811343b3f1c7739bd2f1b726cbd7686d420baf2813",
"typeString": "literal_string \"DTFactory: Invalid template token/community fee collector address\""
}
],
"id": 41,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [6555, 6556],
2020-11-26 07:38:08 +01:00
"referencedDeclaration": 6556,
"src": "1528:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 54,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1528:175:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 55,
"nodeType": "ExpressionStatement",
"src": "1528:175:0"
},
{
"expression": {
"argumentTypes": null,
"id": 58,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 56,
"name": "tokenTemplate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "1713:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 57,
"name": "_template",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36,
"src": "1729:9:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1713:25:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 59,
"nodeType": "ExpressionStatement",
"src": "1713:25:0"
},
{
"expression": {
"argumentTypes": null,
"id": 62,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 60,
"name": "communityFeeCollector",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "1748:21:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 61,
"name": "_collector",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38,
"src": "1772:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1748:34:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 63,
"nodeType": "ExpressionStatement",
"src": "1748:34:0"
}
]
},
"documentation": "@dev constructor\n Called on contract deployment. Could not be called with zero address parameters.\n@param _template refers to the address of a deployed DataToken contract.\n@param _collector refers to the community fee collector address",
"id": 65,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 39,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 36,
"name": "_template",
"nodeType": "VariableDeclaration",
"scope": 65,
"src": "1459:17:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 35,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1459:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 38,
"name": "_collector",
"nodeType": "VariableDeclaration",
"scope": 65,
"src": "1486:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 37,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1486:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1449:61:0"
},
"returnParameters": {
"id": 40,
"nodeType": "ParameterList",
"parameters": [],
"src": "1518:0:0"
},
"scope": 158,
"src": "1438:351:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 140,
"nodeType": "Block",
"src": "2349:883:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 81,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 79,
"name": "cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 73,
"src": "2380:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 80,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2387:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2380:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4454466163746f72793a207a65726f20636170206973206e6f7420616c6c6f776564",
"id": 82,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2402:36:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_275103c39c8e014c8efbcc9e9b88606200c5ae2f95e8ff4229101e5d34ee3597",
"typeString": "literal_string \"DTFactory: zero cap is not allowed\""
},
"value": "DTFactory: zero cap is not allowed"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_275103c39c8e014c8efbcc9e9b88606200c5ae2f95e8ff4229101e5d34ee3597",
"typeString": "literal_string \"DTFactory: zero cap is not allowed\""
}
],
"id": 78,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [6555, 6556],
2020-11-26 07:38:08 +01:00
"referencedDeclaration": 6556,
"src": "2359:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 83,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2359:89:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 84,
"nodeType": "ExpressionStatement",
"src": "2359:89:0"
},
{
"expression": {
"argumentTypes": null,
"id": 89,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 85,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "2459:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 87,
"name": "tokenTemplate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "2474:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 86,
"name": "deploy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5730,
"src": "2467:6:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$_t_address_$",
"typeString": "function (address) returns (address)"
}
},
"id": 88,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2467:21:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2459:29:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 90,
"nodeType": "ExpressionStatement",
"src": "2459:29:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 96,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 92,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "2520:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 94,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2537:1:0",
"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": 93,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2529:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 95,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2529:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "2520:19:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4454466163746f72793a204661696c656420746f20706572666f726d206d696e696d616c206465706c6f79206f662061206e657720746f6b656e",
"id": 97,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2553:60:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_864bea267bbab0e2823533999ec879a0c10c7f940117c7fd1687efd3993a56e3",
"typeString": "literal_string \"DTFactory: Failed to perform minimal deploy of a new token\""
},
"value": "DTFactory: Failed to perform minimal deploy of a new token"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_864bea267bbab0e2823533999ec879a0c10c7f940117c7fd1687efd3993a56e3",
"typeString": "literal_string \"DTFactory: Failed to perform minimal deploy of a new token\""
}
],
"id": 91,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [6555, 6556],
2020-11-26 07:38:08 +01:00
"referencedDeclaration": 6556,
"src": "2499:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 98,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2499:124:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 99,
"nodeType": "ExpressionStatement",
"src": "2499:124:0"
},
{
"assignments": [101],
2020-11-26 07:38:08 +01:00
"declarations": [
{
"constant": false,
"id": 101,
"name": "tokenInstance",
"nodeType": "VariableDeclaration",
"scope": 140,
"src": "2633:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Template_$5089",
"typeString": "contract IERC20Template"
},
"typeName": {
"contractScope": null,
"id": 100,
"name": "IERC20Template",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5089,
"src": "2633:14:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Template_$5089",
"typeString": "contract IERC20Template"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 105,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 103,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "2679:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 102,
"name": "IERC20Template",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5089,
"src": "2664:14:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20Template_$5089_$",
"typeString": "type(contract IERC20Template)"
}
},
"id": 104,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2664:21:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Template_$5089",
"typeString": "contract IERC20Template"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2633:52:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 109,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 69,
"src": "2758:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 110,
"name": "symbol",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 71,
"src": "2780:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 111,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6552,
"src": "2804:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 112,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2804:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 113,
"name": "cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 73,
"src": "2832:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 114,
"name": "blob",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 67,
"src": "2853:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 115,
"name": "communityFeeCollector",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "2875:21:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 107,
"name": "tokenInstance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 101,
"src": "2716:13:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20Template_$5089",
"typeString": "contract IERC20Template"
}
},
"id": 108,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "initialize",
"nodeType": "MemberAccess",
"referencedDeclaration": 5000,
"src": "2716:24:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_nonpayable$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_address_$_t_uint256_$_t_string_memory_ptr_$_t_address_$returns$_t_bool_$",
"typeString": "function (string memory,string memory,address,uint256,string memory,address) external returns (bool)"
}
},
"id": 116,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2716:194:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4454466163746f72793a20556e61626c6520746f20696e697469616c697a6520746f6b656e20696e7374616e6365",
"id": 117,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2924:48:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_0d4ad5d97b72e5d205f3629b55676990eb71b941b9757afabcf7e9a4e3e2cbe3",
"typeString": "literal_string \"DTFactory: Unable to initialize token instance\""
},
"value": "DTFactory: Unable to initialize token instance"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_0d4ad5d97b72e5d205f3629b55676990eb71b941b9757afabcf7e9a4e3e2cbe3",
"typeString": "literal_string \"DTFactory: Unable to initialize token instance\""
}
],
"id": 106,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [6555, 6556],
2020-11-26 07:38:08 +01:00
"referencedDeclaration": 6556,
"src": "2695:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 118,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2695:287:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 119,
"nodeType": "ExpressionStatement",
"src": "2695:287:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 121,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "3010:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 122,
"name": "tokenTemplate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "3017:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 123,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 69,
"src": "3032:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 120,
"name": "TokenCreated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 20,
"src": "2997:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (address,address,string memory)"
}
},
"id": 124,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2997:40:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 125,
"nodeType": "EmitStatement",
"src": "2992:45:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 127,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "3081:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 128,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 69,
"src": "3100:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 129,
"name": "symbol",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 71,
"src": "3118:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
{
"argumentTypes": null,
"id": 130,
"name": "cap",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 73,
"src": "3138:3:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 131,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6552,
"src": "3155:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 132,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3155:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 133,
"name": "blob",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 67,
"src": "3179:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 126,
"name": "TokenRegistered",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 34,
"src": "3052:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (address,string memory,string memory,uint256,address,string memory)"
}
},
"id": 134,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3052:141:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 135,
"nodeType": "EmitStatement",
"src": "3047:146:0"
},
{
"expression": {
"argumentTypes": null,
"id": 138,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 136,
"name": "currentTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12,
"src": "3203:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "+=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 137,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3224:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "3203:22:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 139,
"nodeType": "ExpressionStatement",
"src": "3203:22:0"
}
]
},
"documentation": "@dev Deploys new DataToken proxy contract.\n Template contract address could not be a zero address.\n@param blob any string that hold data/metadata for the new token\n@param name token name\n@param symbol token symbol\n@param cap the maximum total supply\n@return address of a new proxy DataToken contract",
"id": 141,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "createToken",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 74,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 67,
"name": "blob",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2194:18:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 66,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "2194:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 69,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2222:18:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 68,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "2222:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 71,
"name": "symbol",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2250:20:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 70,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "2250:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 73,
"name": "cap",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2280:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 72,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2280:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2184:113:0"
},
"returnParameters": {
"id": 77,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 76,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 141,
"src": "2330:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 75,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2330:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2329:15:0"
},
"scope": 158,
"src": "2164:1068:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 148,
"nodeType": "Block",
"src": "3398:41:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 146,
"name": "currentTokenCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12,
"src": "3415:17:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 145,
"id": 147,
"nodeType": "Return",
"src": "3408:24:0"
}
]
},
"documentation": "@dev get the current token count.\n@return the current token count",
"id": 149,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getCurrentTokenCount",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 142,
"nodeType": "ParameterList",
"parameters": [],
"src": "3363:2:0"
},
"returnParameters": {
"id": 145,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 144,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 149,
"src": "3389:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 143,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3389:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3388:9:0"
},
"scope": 158,
"src": "3334:105:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 156,
"nodeType": "Block",
"src": "3600:37:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 154,
"name": "tokenTemplate",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "3617:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 153,
"id": 155,
"nodeType": "Return",
"src": "3610:20:0"
}
]
},
"documentation": "@dev get the token template address\n@return the template address",
"id": 157,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getTokenTemplate",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 150,
"nodeType": "ParameterList",
"parameters": [],
"src": "3565:2:0"
},
"returnParameters": {
"id": 153,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 152,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 157,
"src": "3591:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 151,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3591:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3590:9:0"
},
"scope": 158,
"src": "3540:97:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "external"
}
],
"scope": 159,
"src": "629:3010:0"
}
],
"src": "0:3640:0"
},
"compiler": {
"name": "solc",
"version": "0.5.7+commit.6da8b019.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-22T12:03:05.061Z",
"devdoc": {
"author": "Ocean Protocol Team",
"details": "Implementation of Ocean DataTokens Factory * DTFactory deploys DataToken proxy contracts. New DataToken proxy contracts are links to the template contract's bytecode. Proxy contract functionality is based on Ocean Protocol custom implementation of ERC1167 standard.",
"methods": {
"constructor": {
"details": "constructor Called on contract deployment. Could not be called with zero address parameters.",
"params": {
"_collector": "refers to the community fee collector address",
"_template": "refers to the address of a deployed DataToken contract."
}
},
"createToken(string,string,string,uint256)": {
"details": "Deploys new DataToken proxy contract. Template contract address could not be a zero address.",
"params": {
"blob": "any string that hold data/metadata for the new token",
"cap": "the maximum total supply",
"name": "token name",
"symbol": "token symbol"
},
"return": "address of a new proxy DataToken contract"
},
"getCurrentTokenCount()": {
"details": "get the current token count.",
"return": "the current token count"
},
"getTokenTemplate()": {
"details": "get the token template address",
"return": "the template address"
}
},
"title": "DTFactory contract"
},
"userdoc": {
"methods": {}
}
}