From b39ecb6e12e508cf745529ffdeb1ed0e58ff83fe Mon Sep 17 00:00:00 2001 From: mihaisc Date: Thu, 4 Nov 2021 17:00:43 +0200 Subject: [PATCH] basic events --- .eslintignore | 2 +- abis/BFactory.json | 2986 ----- abis/BPool.json | 1526 --- abis/BToken.json | 13920 -------------------- abis/DTFactory.json | 4527 ------- abis/DataTokenTemplate.json | 679 - abis/Dispenser.json | 17468 -------------------------- abis/ERC20.json | 222 - abis/ERC20NameBytes.json | 17 - abis/ERC20SymbolBytes.json | 17 - abis/ERC20Template.json | 1174 ++ abis/ERC721Factory.json | 1095 ++ abis/FactoryRouter.json | 790 ++ abis/FixedRateExchange.json | 16462 ++---------------------- abis/Metadata.json | 2392 ---- docker/docker-compose.yml | 2 +- package-lock.json | 547 +- schema.graphql | 83 +- scripts/generatebargesubgraph.js | 41 +- src/helpers.ts | 733 +- src/mappings/erc20Template.ts | 9 + src/mappings/erc721Factory.ts | 33 + src/mappings/factoryRouter.ts | 11 + src/mappings/fixedRateExchange.ts | 23 + src/mappings/fixedrateexchange.ts | 135 - src/mappings/{ => old}/datatoken.ts | 0 src/mappings/{ => old}/dispenser.ts | 4 +- src/mappings/{ => old}/dtfactory.ts | 0 src/mappings/{ => old}/factory.ts | 0 src/mappings/{ => old}/metadata.ts | 0 src/mappings/old/pool.ts | 577 + src/mappings/pool.ts | 577 - subgraph.yaml | 202 +- 33 files changed, 5399 insertions(+), 60855 deletions(-) delete mode 100644 abis/BFactory.json delete mode 100644 abis/BPool.json delete mode 100644 abis/BToken.json delete mode 100644 abis/DTFactory.json delete mode 100644 abis/DataTokenTemplate.json delete mode 100644 abis/Dispenser.json delete mode 100644 abis/ERC20.json delete mode 100644 abis/ERC20NameBytes.json delete mode 100644 abis/ERC20SymbolBytes.json create mode 100644 abis/ERC20Template.json create mode 100644 abis/ERC721Factory.json create mode 100644 abis/FactoryRouter.json delete mode 100644 abis/Metadata.json create mode 100644 src/mappings/erc20Template.ts create mode 100644 src/mappings/erc721Factory.ts create mode 100644 src/mappings/factoryRouter.ts create mode 100644 src/mappings/fixedRateExchange.ts delete mode 100644 src/mappings/fixedrateexchange.ts rename src/mappings/{ => old}/datatoken.ts (100%) rename src/mappings/{ => old}/dispenser.ts (98%) rename src/mappings/{ => old}/dtfactory.ts (100%) rename src/mappings/{ => old}/factory.ts (100%) rename src/mappings/{ => old}/metadata.ts (100%) create mode 100644 src/mappings/old/pool.ts delete mode 100644 src/mappings/pool.ts diff --git a/.eslintignore b/.eslintignore index 8fa0138..59a74ea 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,4 @@ node_modules data -src/types \ No newline at end of file +src/@types diff --git a/abis/BFactory.json b/abis/BFactory.json deleted file mode 100644 index 32de5fa..0000000 --- a/abis/BFactory.json +++ /dev/null @@ -1,2986 +0,0 @@ -{ - "contractName": "BFactory", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "MAX_TOTAL_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BPOW_PRECISION", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BALANCE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "INIT_POOL_SUPPLY", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_OUT_RATIO", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_BOUND_TOKENS", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BOUND_TOKENS", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BPOW_BASE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "bpoolTemplate", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_BPOW_BASE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BONE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "EXIT_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_IN_RATIO", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "_bpoolTemplate", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "newBPoolAddress", - "type": "address" - }, - { - "indexed": true, - "name": "bpoolTemplateAddress", - "type": "address" - } - ], - "name": "BPoolCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "bpoolAddress", - "type": "address" - }, - { - "indexed": true, - "name": "registeredBy", - "type": "address" - } - ], - "name": "BPoolRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "instance", - "type": "address" - } - ], - "name": "InstanceDeployed", - "type": "event" - }, - { - "constant": false, - "inputs": [], - "name": "newBPool", - "outputs": [ - { - "name": "bpool", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.7+commit.6da8b019\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"MAX_TOTAL_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BPOW_PRECISION\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BALANCE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"INIT_POOL_SUPPLY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_OUT_RATIO\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BOUND_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BOUND_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BPOW_BASE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"bpoolTemplate\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BPOW_BASE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BONE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"EXIT_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"newBPool\",\"outputs\":[{\"name\":\"bpool\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_IN_RATIO\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_bpoolTemplate\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"newBPoolAddress\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"bpoolTemplateAddress\",\"type\":\"address\"}],\"name\":\"BPoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"bpoolAddress\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"registeredBy\",\"type\":\"address\"}],\"name\":\"BPoolRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"instance\",\"type\":\"address\"}],\"name\":\"InstanceDeployed\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BFactory.sol\":\"BFactory\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BConst.sol\":{\"keccak256\":\"0x21675a0793e0be762a27e09ed3b0bd86e035c73ac3078dd841c38804445d5f5a\",\"urls\":[\"bzzr://47016ef4a80276f320b28a058fc92e7d9d93433bb5e4aa934668383cbefad77e\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BFactory.sol\":{\"keccak256\":\"0xbe79e34d5d123d52d92d4b576e822574d8a61462aec76042ccf70848c8ad9d1c\",\"urls\":[\"bzzr://b6dbeb70ebcdee5e23b973e6025abeb4dd3bc85dd5714fe8f1ab095d0b739ba1\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BMath.sol\":{\"keccak256\":\"0x2e3f07713561f2a0983999255794f5741c5854633b8524675767fde35f1b98c2\",\"urls\":[\"bzzr://e8c50205e3f6bd1d37fcdf178486f9560814e28ed8467af5a4ceb30651991cf8\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BNum.sol\":{\"keccak256\":\"0xc4e5c934d6b04c1fad116ea81c2fa65eaa2700e4e48bcc5045c8c96f55e729c8\",\"urls\":[\"bzzr://a3946b7fd2095ca3c7c4bb3daf3078cc48e20b0e107f113e10fb0c6ebaa77e74\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BPool.sol\":{\"keccak256\":\"0x5317eb03e13ef8512444d550ce4811c67610fef0ece0d45f583fc14658bb2d92\",\"urls\":[\"bzzr://0557c64a1179384e994a9675724430e4db5b2dd15fdc7e59b9b6fdfa65f12dcb\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BToken.sol\":{\"keccak256\":\"0xad046b7ad912f72a90330abb3abddc3aa711077c0021d6a9d0dba2c99534e51b\",\"urls\":[\"bzzr://159aed1b631f2af168fd17235b6827859cb5d6cb7e95abeff3cc3d8079710f41\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/utils/Deployer.sol\":{\"keccak256\":\"0x60ebf25d36c0ee9d310c74eda954a474b0d867f23f57d3b8923d9ee7cc313dcc\",\"urls\":[\"bzzr://81ebb3c5acb99bc74b4bd7ee9897282cb2c983344195645cec8bc2e642680c53\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzzr://cf2d583b8dce38d0617fdcd65f2fd9f126fe17b7f683b5a515ea9d2762d8b062\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405160208061069f8339810180604052602081101561003057600080fd5b5051600160a060020a038116610091576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d815260200180610672602d913960400191505060405180910390fd5b60008054600160a060020a03909216600160a060020a03199092169190911790556105b1806100c16000396000f3fe608060405234801561001057600080fd5b5060043610610133576000357c010000000000000000000000000000000000000000000000000000000090048063ba019dab116100bf578063c36596a61161008e578063c36596a61461015a578063c6580d12146101ce578063d556c5dc146101d6578063e4a28a5214610138578063ec093021146101de57610133565b8063ba019dab14610192578063bae6ae121461019a578063bc063e1a146101be578063bc694ea2146101c657610133565b8063867378c511610106578063867378c51461016a5780639381cd2b14610172578063992e2a921461017a578063b0e0d13614610182578063b7b800a41461018a57610133565b806309a3bbe414610138578063189d00ca14610152578063218b53821461015a57806376c7a3c714610162575b600080fd5b6101406101e6565b60408051918252519081900360200190f35b6101406101f3565b610140610207565b610140610213565b610140610225565b610140610239565b610140610246565b610140610252565b610140610257565b61014061025c565b6101a2610261565b60408051600160a060020a039092168252519081900360200190f35b610140610270565b610140610280565b61014061028c565b6101a2610291565b6101406104a0565b6802b5e3af16b188000081565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b620f4240670de0b6b3a7640000610203565b64e8d4a51000670de0b6b3a7640000610203565b68056bc75e2d6310000081565b6704a03ce68d21555681565b600881565b600281565b600181565b600054600160a060020a031681565b600a670de0b6b3a7640000610203565b671bc16d674ec7ffff81565b600081565b600080546102a790600160a060020a03166104b0565b9050600160a060020a038116610308576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806105626024913960400191505060405180910390fd5b604080517f506de97400000000000000000000000000000000000000000000000000000000815233600482015230602482015264e8d4a5100060448201526000606482018190526084820181905291518392600160a060020a0384169263506de9749260a48083019360209383900390910190829087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b505050506040513d60208110156103b657600080fd5b505161042357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4552525f494e495449414c495a455f42504f4f4c000000000000000000000000604482015290519081900360640190fd5b60008054604051600160a060020a0391821692918516917f83d56eda3b93446228a036eafbbbcb38aa8f27a21a302b860469af9cb27c84eb91a360408051600160a060020a0384168152905133917fb19f201dd081bc52562d1f83f3585fd08caa9de15534e6e4787f5ae63d39106c919081900360200190a25090565b6002670de0b6b3a7640000610203565b6040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081526c010000000000000000000000008202601482018190527f5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000602883015260009160378184f060408051600160a060020a038316815290519194507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c925081900360200190a15091905056fe42466163746f72793a20696e76616c69642062706f6f6c207a65726f2061646472657373a165627a7a72305820ddcddd1650c55b817d297fa03f4dd1c79629208959489c7158f54b71f7b5110e002942466163746f72793a20696e76616c69642062706f6f6c2074656d706c617465207a65726f2061646472657373", - "deployedBytecode": "0x608060405234801561001057600080fd5b5060043610610133576000357c010000000000000000000000000000000000000000000000000000000090048063ba019dab116100bf578063c36596a61161008e578063c36596a61461015a578063c6580d12146101ce578063d556c5dc146101d6578063e4a28a5214610138578063ec093021146101de57610133565b8063ba019dab14610192578063bae6ae121461019a578063bc063e1a146101be578063bc694ea2146101c657610133565b8063867378c511610106578063867378c51461016a5780639381cd2b14610172578063992e2a921461017a578063b0e0d13614610182578063b7b800a41461018a57610133565b806309a3bbe414610138578063189d00ca14610152578063218b53821461015a57806376c7a3c714610162575b600080fd5b6101406101e6565b60408051918252519081900360200190f35b6101406101f3565b610140610207565b610140610213565b610140610225565b610140610239565b610140610246565b610140610252565b610140610257565b61014061025c565b6101a2610261565b60408051600160a060020a039092168252519081900360200190f35b610140610270565b610140610280565b61014061028c565b6101a2610291565b6101406104a0565b6802b5e3af16b188000081565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b620f4240670de0b6b3a7640000610203565b64e8d4a51000670de0b6b3a7640000610203565b68056bc75e2d6310000081565b6704a03ce68d21555681565b600881565b600281565b600181565b600054600160a060020a031681565b600a670de0b6b3a7640000610203565b671bc16d674ec7ffff81565b600081565b600080546102a790600160a060020a03166104b0565b9050600160a060020a038116610308576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806105626024913960400191505060405180910390fd5b604080517f506de97400000000000000000000000000000000000000000000000000000000815233600482015230602482015264e8d4a5100060448201526000606482018190526084820181905291518392600160a060020a0384169263506de9749260a48083019360209383900390910190829087803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b505050506040513d60208110156103b657600080fd5b505161042357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f4552525f494e495449414c495a455f42504f4f4c000000000000000000000000604482015290519081900360640190fd5b60008054604051600160a060020a0391821692918516917f83d56eda3b93446228a036eafbbbcb38aa8f27a21a302b860469af9cb27c84eb91a360408051600160a060020a0384168152905133917fb19f201dd081bc52562d1f83f3585fd08caa9de15534e6e4787f5ae63d39106c919081900360200190a25090565b6002670de0b6b3a7640000610203565b6040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081526c010000000000000000000000008202601482018190527f5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000602883015260009160378184f060408051600160a060020a038316815290519194507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c925081900360200190a15091905056fe42466163746f72793a20696e76616c69642062706f6f6c207a65726f2061646472657373a165627a7a72305820ddcddd1650c55b817d297fa03f4dd1c79629208959489c7158f54b71f7b5110e0029", - "sourceMap": "650:1489:3:-;;;1110:234;8:9:-1;5:2;;;30:1;27;20:12;5:2;1110:234:3;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1110:234:3;-1:-1:-1;;;;;1197:28:3;;1176:121;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1307:13;:30;;-1:-1:-1;;;;;1307:30:3;;;-1:-1:-1;;;;;;1307:30:3;;;;;;;;;650:1489;;;;;;", - "deployedSourceMap": "650:1489:3:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;650:1489:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1111:50:2;;;:::i;:::-;;;;;;;;;;;;;;;;1403:54;;;:::i;1004:45::-;;;:::i;840:53::-;;;:::i;1167:54::-;;;:::i;1228:51::-;;;:::i;1519:59::-;;;:::i;791:42::-;;;:::i;743:::-;;;:::i;1286:46::-;;;:::i;695:28:3:-;;;:::i;:::-;;;;-1:-1:-1;;;;;695:28:3;;;;;;;;;;;;;;899:50:2;;;:::i;1338:59::-;;;:::i;955:42::-;;;:::i;1515:622:3:-;;;:::i;1464:49:2:-;;;:::i;1111:50::-;1152:9;1111:50;:::o;1403:54::-;1451:6;730;1444:13;;1403:54;:::o;1004:45::-;730:6;1004:45;:::o;840:53::-;888:5;730:6;881:12;;1167:54;1215:6;730;1208:13;;1228:51;1269:10;1228:51;:::o;1519:59::-;1560:18;1519:59;:::o;791:42::-;832:1;791:42;:::o;743:::-;784:1;743:42;:::o;1286:46::-;1327:5;1286:46;:::o;695:28:3:-;;;-1:-1:-1;;;;;695:28:3;;:::o;899:50:2:-;947:2;730:6;940:9;;1338:59;1379:18;1338:59;:::o;955:42::-;996:1;955:42;:::o;1515:622:3:-;1569:13;1613;;1606:21;;-1:-1:-1;;;;;1613:13:3;1606:6;:21::i;:::-;1598:29;-1:-1:-1;;;;;;1658:19:3;;1637:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1816:170;;;;;;1858:10;1816:170;;;;1894:4;1816:170;;;;881:12:2;1816:170:3;;;;-1:-1:-1;1816:170:3;;;;;;;;;;;;;;1778:5;;-1:-1:-1;;;;;1816:24:3;;;;;:170;;;;;;;;;;;;;;;;:24;:170;;;5:2:-1;;;;30:1;27;20:12;5:2;1816:170:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1816:170:3;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1816:170:3;1795:237;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2067:13;;;2047:34;;-1:-1:-1;;;;;2067:13:3;;;;2047:34;;;;;;;2096;;;-1:-1:-1;;;;;2096:34:3;;;;;;2119:10;;2096:34;;;;;;;;;;1515:622;;:::o;1464:49:2:-;1512:1;730:6;1505:8;;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 './BPool.sol';\nimport './BConst.sol';\nimport '../utils/Deployer.sol';\n\n/*\n* @title BFactory contract\n* @author Ocean Protocol (with code from Balancer Labs)\n*\n* @dev Ocean implementation of Balancer BPool Factory\n* BFactory deploys BPool proxy contracts.\n* New BPool proxy contracts are links to the template contract's bytecode.\n* Proxy contract functionality is based on Ocean Protocol custom\n* implementation of ERC1167 standard.\n*/\ncontract BFactory is BConst, Deployer {\n\n address public bpoolTemplate;\n\n event BPoolCreated(\n address indexed newBPoolAddress,\n address indexed bpoolTemplateAddress\n );\n \n event BPoolRegistered(\n address bpoolAddress,\n address indexed registeredBy\n );\n \n /* @dev Called on contract deployment. Cannot be called with zero address.\n @param _bpoolTemplate -- address of a deployed BPool contract. */\n constructor(address _bpoolTemplate)\n public \n {\n require(\n _bpoolTemplate != address(0), \n 'BFactory: invalid bpool template zero address'\n );\n bpoolTemplate = _bpoolTemplate;\n }\n\n /* @dev Deploys new BPool proxy contract.\n Template contract address could not be a zero address. \n @return address of a new proxy BPool contract */\n function newBPool()\n external\n returns (address bpool)\n {\n bpool = deploy(bpoolTemplate);\n require(\n bpool != address(0), \n 'BFactory: invalid bpool zero address'\n );\n BPool bpoolInstance = BPool(bpool);\t\n require(\n bpoolInstance.initialize(\n msg.sender,\n address(this), \n MIN_FEE, \n false,\n false\n ),\n 'ERR_INITIALIZE_BPOOL'\n );\n emit BPoolCreated(bpool, bpoolTemplate);\n emit BPoolRegistered(bpool, msg.sender);\n }\n}\n", - "sourcePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BFactory.sol", - "ast": { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BFactory.sol", - "exportedSymbols": { - "BFactory": [376] - }, - "id": 377, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 282, - "literals": ["solidity", "0.5", ".7"], - "nodeType": "PragmaDirective", - "src": "0:22:3" - }, - { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BPool.sol", - "file": "./BPool.sol", - "id": 283, - "nodeType": "ImportDirective", - "scope": 377, - "sourceUnit": 3779, - "src": "185:21:3", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BConst.sol", - "file": "./BConst.sol", - "id": 284, - "nodeType": "ImportDirective", - "scope": 377, - "sourceUnit": 281, - "src": "207:22:3", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/utils/Deployer.sol", - "file": "../utils/Deployer.sol", - "id": 285, - "nodeType": "ImportDirective", - "scope": 377, - "sourceUnit": 5732, - "src": "230:31:3", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 286, - "name": "BConst", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 280, - "src": "671:6:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BConst_$280", - "typeString": "contract BConst" - } - }, - "id": 287, - "nodeType": "InheritanceSpecifier", - "src": "671:6:3" - }, - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 288, - "name": "Deployer", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5731, - "src": "679:8:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Deployer_$5731", - "typeString": "contract Deployer" - } - }, - "id": 289, - "nodeType": "InheritanceSpecifier", - "src": "679:8:3" - } - ], - "contractDependencies": [280, 5731], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 376, - "linearizedBaseContracts": [376, 5731, 280], - "name": "BFactory", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 291, - "name": "bpoolTemplate", - "nodeType": "VariableDeclaration", - "scope": 376, - "src": "695:28:3", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 290, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "695:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 297, - "name": "BPoolCreated", - "nodeType": "EventDefinition", - "parameters": { - "id": 296, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 293, - "indexed": true, - "name": "newBPoolAddress", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "758:31:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 292, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "758:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 295, - "indexed": true, - "name": "bpoolTemplateAddress", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "799:36:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 294, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "799:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "748:93:3" - }, - "src": "730:112:3" - }, - { - "anonymous": false, - "documentation": null, - "id": 303, - "name": "BPoolRegistered", - "nodeType": "EventDefinition", - "parameters": { - "id": 302, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 299, - "indexed": false, - "name": "bpoolAddress", - "nodeType": "VariableDeclaration", - "scope": 303, - "src": "883:20:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 298, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "883:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 301, - "indexed": true, - "name": "registeredBy", - "nodeType": "VariableDeclaration", - "scope": 303, - "src": "913:28:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 300, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "913:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "873:74:3" - }, - "src": "852:96:3" - }, - { - "body": { - "id": 321, - "nodeType": "Block", - "src": "1166:178:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 313, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 309, - "name": "_bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 305, - "src": "1197:14:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 311, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1223:1:3", - "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": 310, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1215:7:3", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 312, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1215:10:3", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1197:28:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "42466163746f72793a20696e76616c69642062706f6f6c2074656d706c617465207a65726f2061646472657373", - "id": 314, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1240:47:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_49a92892ed7a662247fa7cd45ceca8efadce7dcbf82de2eb28b2dfc85ee3a8ce", - "typeString": "literal_string \"BFactory: invalid bpool template zero address\"" - }, - "value": "BFactory: invalid bpool template zero address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_49a92892ed7a662247fa7cd45ceca8efadce7dcbf82de2eb28b2dfc85ee3a8ce", - "typeString": "literal_string \"BFactory: invalid bpool template zero address\"" - } - ], - "id": 308, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "1176:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 315, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1176:121:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 316, - "nodeType": "ExpressionStatement", - "src": "1176:121:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 319, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 317, - "name": "bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 291, - "src": "1307:13:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 318, - "name": "_bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 305, - "src": "1323:14:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "1307:30:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 320, - "nodeType": "ExpressionStatement", - "src": "1307:30:3" - } - ] - }, - "documentation": null, - "id": 322, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 306, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 305, - "name": "_bpoolTemplate", - "nodeType": "VariableDeclaration", - "scope": 322, - "src": "1122:22:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 304, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1122:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1121:24:3" - }, - "returnParameters": { - "id": 307, - "nodeType": "ParameterList", - "parameters": [], - "src": "1166:0:3" - }, - "scope": 376, - "src": "1110:234:3", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 374, - "nodeType": "Block", - "src": "1588:549:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 331, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 327, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "1598:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 329, - "name": "bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 291, - "src": "1613:13:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 328, - "name": "deploy", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5730, - "src": "1606:6:3", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$_t_address_$", - "typeString": "function (address) returns (address)" - } - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1606:21:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "1598:29:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 332, - "nodeType": "ExpressionStatement", - "src": "1598:29:3" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 338, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 334, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "1658:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 336, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1675:1:3", - "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": 335, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1667:7:3", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 337, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1667:10:3", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1658:19:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "42466163746f72793a20696e76616c69642062706f6f6c207a65726f2061646472657373", - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1692:38:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2f7929f7a9d1eec1904ee2b3469854d272342ec90cd225a9e6ccdd2ba8672552", - "typeString": "literal_string \"BFactory: invalid bpool zero address\"" - }, - "value": "BFactory: invalid bpool zero address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2f7929f7a9d1eec1904ee2b3469854d272342ec90cd225a9e6ccdd2ba8672552", - "typeString": "literal_string \"BFactory: invalid bpool zero address\"" - } - ], - "id": 333, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "1637:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1637:103:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 341, - "nodeType": "ExpressionStatement", - "src": "1637:103:3" - }, - { - "assignments": [343], - "declarations": [ - { - "constant": false, - "id": 343, - "name": "bpoolInstance", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "1750:19:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BPool_$3778", - "typeString": "contract BPool" - }, - "typeName": { - "contractScope": null, - "id": 342, - "name": "BPool", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 3778, - "src": "1750:5:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BPool_$3778", - "typeString": "contract BPool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 347, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 345, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "1778:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 344, - "name": "BPool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3778, - "src": "1772:5:3", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_BPool_$3778_$", - "typeString": "type(contract BPool)" - } - }, - "id": 346, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1772:12:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BPool_$3778", - "typeString": "contract BPool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1750:34:3" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 351, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "1858:3:3", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 352, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1858:10:3", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 354, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6588, - "src": "1894:4:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BFactory_$376", - "typeString": "contract BFactory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BFactory_$376", - "typeString": "contract BFactory" - } - ], - "id": 353, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1886:7:3", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 355, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1886:13:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 356, - "name": "MIN_FEE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1918:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 357, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1944:5:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 358, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1967:5:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "expression": { - "argumentTypes": null, - "id": 349, - "name": "bpoolInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 343, - "src": "1816:13:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BPool_$3778", - "typeString": "contract BPool" - } - }, - "id": 350, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "initialize", - "nodeType": "MemberAccess", - "referencedDeclaration": 1630, - "src": "1816:24:3", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bool_$_t_bool_$returns$_t_bool_$", - "typeString": "function (address,address,uint256,bool,bool) external returns (bool)" - } - }, - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1816:170:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552525f494e495449414c495a455f42504f4f4c", - "id": 360, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2000:22:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_e72bfb874cc5fc9c4486bc89c825d8de1ff180586329759974eaedb736a911fb", - "typeString": "literal_string \"ERR_INITIALIZE_BPOOL\"" - }, - "value": "ERR_INITIALIZE_BPOOL" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_e72bfb874cc5fc9c4486bc89c825d8de1ff180586329759974eaedb736a911fb", - "typeString": "literal_string \"ERR_INITIALIZE_BPOOL\"" - } - ], - "id": 348, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "1795:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 361, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1795:237:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 362, - "nodeType": "ExpressionStatement", - "src": "1795:237:3" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 364, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "2060:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 365, - "name": "bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 291, - "src": "2067:13:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 363, - "name": "BPoolCreated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 297, - "src": "2047:12:3", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", - "typeString": "function (address,address)" - } - }, - "id": 366, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2047:34:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 367, - "nodeType": "EmitStatement", - "src": "2042:39:3" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 369, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "2112:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 370, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "2119:3:3", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 371, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2119:10:3", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 368, - "name": "BPoolRegistered", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 303, - "src": "2096:15:3", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", - "typeString": "function (address,address)" - } - }, - "id": 372, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2096:34:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 373, - "nodeType": "EmitStatement", - "src": "2091:39:3" - } - ] - }, - "documentation": null, - "id": 375, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "newBPool", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 323, - "nodeType": "ParameterList", - "parameters": [], - "src": "1532:2:3" - }, - "returnParameters": { - "id": 326, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 325, - "name": "bpool", - "nodeType": "VariableDeclaration", - "scope": 375, - "src": "1569:13:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 324, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1569:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1568:15:3" - }, - "scope": 376, - "src": "1515:622:3", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - } - ], - "scope": 377, - "src": "650:1489:3" - } - ], - "src": "0:2140:3" - }, - "legacyAST": { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BFactory.sol", - "exportedSymbols": { - "BFactory": [376] - }, - "id": 377, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 282, - "literals": ["solidity", "0.5", ".7"], - "nodeType": "PragmaDirective", - "src": "0:22:3" - }, - { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BPool.sol", - "file": "./BPool.sol", - "id": 283, - "nodeType": "ImportDirective", - "scope": 377, - "sourceUnit": 3779, - "src": "185:21:3", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BConst.sol", - "file": "./BConst.sol", - "id": 284, - "nodeType": "ImportDirective", - "scope": 377, - "sourceUnit": 281, - "src": "207:22:3", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/utils/Deployer.sol", - "file": "../utils/Deployer.sol", - "id": 285, - "nodeType": "ImportDirective", - "scope": 377, - "sourceUnit": 5732, - "src": "230:31:3", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 286, - "name": "BConst", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 280, - "src": "671:6:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BConst_$280", - "typeString": "contract BConst" - } - }, - "id": 287, - "nodeType": "InheritanceSpecifier", - "src": "671:6:3" - }, - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 288, - "name": "Deployer", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5731, - "src": "679:8:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Deployer_$5731", - "typeString": "contract Deployer" - } - }, - "id": 289, - "nodeType": "InheritanceSpecifier", - "src": "679:8:3" - } - ], - "contractDependencies": [280, 5731], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 376, - "linearizedBaseContracts": [376, 5731, 280], - "name": "BFactory", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 291, - "name": "bpoolTemplate", - "nodeType": "VariableDeclaration", - "scope": 376, - "src": "695:28:3", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 290, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "695:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 297, - "name": "BPoolCreated", - "nodeType": "EventDefinition", - "parameters": { - "id": 296, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 293, - "indexed": true, - "name": "newBPoolAddress", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "758:31:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 292, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "758:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 295, - "indexed": true, - "name": "bpoolTemplateAddress", - "nodeType": "VariableDeclaration", - "scope": 297, - "src": "799:36:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 294, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "799:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "748:93:3" - }, - "src": "730:112:3" - }, - { - "anonymous": false, - "documentation": null, - "id": 303, - "name": "BPoolRegistered", - "nodeType": "EventDefinition", - "parameters": { - "id": 302, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 299, - "indexed": false, - "name": "bpoolAddress", - "nodeType": "VariableDeclaration", - "scope": 303, - "src": "883:20:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 298, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "883:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 301, - "indexed": true, - "name": "registeredBy", - "nodeType": "VariableDeclaration", - "scope": 303, - "src": "913:28:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 300, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "913:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "873:74:3" - }, - "src": "852:96:3" - }, - { - "body": { - "id": 321, - "nodeType": "Block", - "src": "1166:178:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 313, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 309, - "name": "_bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 305, - "src": "1197:14:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 311, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1223:1:3", - "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": 310, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1215:7:3", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 312, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1215:10:3", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1197:28:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "42466163746f72793a20696e76616c69642062706f6f6c2074656d706c617465207a65726f2061646472657373", - "id": 314, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1240:47:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_49a92892ed7a662247fa7cd45ceca8efadce7dcbf82de2eb28b2dfc85ee3a8ce", - "typeString": "literal_string \"BFactory: invalid bpool template zero address\"" - }, - "value": "BFactory: invalid bpool template zero address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_49a92892ed7a662247fa7cd45ceca8efadce7dcbf82de2eb28b2dfc85ee3a8ce", - "typeString": "literal_string \"BFactory: invalid bpool template zero address\"" - } - ], - "id": 308, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "1176:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 315, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1176:121:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 316, - "nodeType": "ExpressionStatement", - "src": "1176:121:3" - }, - { - "expression": { - "argumentTypes": null, - "id": 319, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 317, - "name": "bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 291, - "src": "1307:13:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 318, - "name": "_bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 305, - "src": "1323:14:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "1307:30:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 320, - "nodeType": "ExpressionStatement", - "src": "1307:30:3" - } - ] - }, - "documentation": null, - "id": 322, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 306, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 305, - "name": "_bpoolTemplate", - "nodeType": "VariableDeclaration", - "scope": 322, - "src": "1122:22:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 304, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1122:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1121:24:3" - }, - "returnParameters": { - "id": 307, - "nodeType": "ParameterList", - "parameters": [], - "src": "1166:0:3" - }, - "scope": 376, - "src": "1110:234:3", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 374, - "nodeType": "Block", - "src": "1588:549:3", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 331, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 327, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "1598:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 329, - "name": "bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 291, - "src": "1613:13:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 328, - "name": "deploy", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5730, - "src": "1606:6:3", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$_t_address_$", - "typeString": "function (address) returns (address)" - } - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1606:21:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "1598:29:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 332, - "nodeType": "ExpressionStatement", - "src": "1598:29:3" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 338, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 334, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "1658:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 336, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1675:1:3", - "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": 335, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1667:7:3", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 337, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1667:10:3", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1658:19:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "42466163746f72793a20696e76616c69642062706f6f6c207a65726f2061646472657373", - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1692:38:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2f7929f7a9d1eec1904ee2b3469854d272342ec90cd225a9e6ccdd2ba8672552", - "typeString": "literal_string \"BFactory: invalid bpool zero address\"" - }, - "value": "BFactory: invalid bpool zero address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2f7929f7a9d1eec1904ee2b3469854d272342ec90cd225a9e6ccdd2ba8672552", - "typeString": "literal_string \"BFactory: invalid bpool zero address\"" - } - ], - "id": 333, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "1637:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1637:103:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 341, - "nodeType": "ExpressionStatement", - "src": "1637:103:3" - }, - { - "assignments": [343], - "declarations": [ - { - "constant": false, - "id": 343, - "name": "bpoolInstance", - "nodeType": "VariableDeclaration", - "scope": 374, - "src": "1750:19:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BPool_$3778", - "typeString": "contract BPool" - }, - "typeName": { - "contractScope": null, - "id": 342, - "name": "BPool", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 3778, - "src": "1750:5:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BPool_$3778", - "typeString": "contract BPool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 347, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 345, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "1778:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 344, - "name": "BPool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3778, - "src": "1772:5:3", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_BPool_$3778_$", - "typeString": "type(contract BPool)" - } - }, - "id": 346, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1772:12:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BPool_$3778", - "typeString": "contract BPool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "1750:34:3" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 351, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "1858:3:3", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 352, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1858:10:3", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 354, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6588, - "src": "1894:4:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BFactory_$376", - "typeString": "contract BFactory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BFactory_$376", - "typeString": "contract BFactory" - } - ], - "id": 353, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1886:7:3", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 355, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1886:13:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 356, - "name": "MIN_FEE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 215, - "src": "1918:7:3", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 357, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1944:5:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 358, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1967:5:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "expression": { - "argumentTypes": null, - "id": 349, - "name": "bpoolInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 343, - "src": "1816:13:3", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BPool_$3778", - "typeString": "contract BPool" - } - }, - "id": 350, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "initialize", - "nodeType": "MemberAccess", - "referencedDeclaration": 1630, - "src": "1816:24:3", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$_t_bool_$_t_bool_$returns$_t_bool_$", - "typeString": "function (address,address,uint256,bool,bool) external returns (bool)" - } - }, - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1816:170:3", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552525f494e495449414c495a455f42504f4f4c", - "id": 360, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2000:22:3", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_e72bfb874cc5fc9c4486bc89c825d8de1ff180586329759974eaedb736a911fb", - "typeString": "literal_string \"ERR_INITIALIZE_BPOOL\"" - }, - "value": "ERR_INITIALIZE_BPOOL" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_e72bfb874cc5fc9c4486bc89c825d8de1ff180586329759974eaedb736a911fb", - "typeString": "literal_string \"ERR_INITIALIZE_BPOOL\"" - } - ], - "id": 348, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "1795:7:3", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 361, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1795:237:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 362, - "nodeType": "ExpressionStatement", - "src": "1795:237:3" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 364, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "2060:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 365, - "name": "bpoolTemplate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 291, - "src": "2067:13:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 363, - "name": "BPoolCreated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 297, - "src": "2047:12:3", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", - "typeString": "function (address,address)" - } - }, - "id": 366, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2047:34:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 367, - "nodeType": "EmitStatement", - "src": "2042:39:3" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 369, - "name": "bpool", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 325, - "src": "2112:5:3", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 370, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "2119:3:3", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 371, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2119:10:3", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 368, - "name": "BPoolRegistered", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 303, - "src": "2096:15:3", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$", - "typeString": "function (address,address)" - } - }, - "id": 372, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2096:34:3", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 373, - "nodeType": "EmitStatement", - "src": "2091:39:3" - } - ] - }, - "documentation": null, - "id": 375, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "newBPool", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 323, - "nodeType": "ParameterList", - "parameters": [], - "src": "1532:2:3" - }, - "returnParameters": { - "id": 326, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 325, - "name": "bpool", - "nodeType": "VariableDeclaration", - "scope": 375, - "src": "1569:13:3", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 324, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1569:7:3", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1568:15:3" - }, - "scope": 376, - "src": "1515:622:3", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - } - ], - "scope": 377, - "src": "650:1489:3" - } - ], - "src": "0:2140:3" - }, - "compiler": { - "name": "solc", - "version": "0.5.7+commit.6da8b019.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.2.4", - "updatedAt": "2020-10-22T12:03:05.065Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} diff --git a/abis/BPool.json b/abis/BPool.json deleted file mode 100644 index 1e20013..0000000 --- a/abis/BPool.json +++ /dev/null @@ -1,1526 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_TOTAL_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BPOW_PRECISION", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "src", - "type": "address" - }, - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenBalanceIn", - "type": "uint256" - }, - { - "name": "tokenWeightIn", - "type": "uint256" - }, - { - "name": "poolSupply", - "type": "uint256" - }, - { - "name": "totalWeight", - "type": "uint256" - }, - { - "name": "poolAmountOut", - "type": "uint256" - }, - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "calcSingleInGivenPoolOut", - "outputs": [ - { - "name": "tokenAmountIn", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "decreaseApproval", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "whom", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenBalanceOut", - "type": "uint256" - }, - { - "name": "tokenWeightOut", - "type": "uint256" - }, - { - "name": "poolSupply", - "type": "uint256" - }, - { - "name": "totalWeight", - "type": "uint256" - }, - { - "name": "tokenAmountOut", - "type": "uint256" - }, - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "calcPoolInGivenSingleOut", - "outputs": [ - { - "name": "poolAmountIn", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenBalanceIn", - "type": "uint256" - }, - { - "name": "tokenWeightIn", - "type": "uint256" - }, - { - "name": "poolSupply", - "type": "uint256" - }, - { - "name": "totalWeight", - "type": "uint256" - }, - { - "name": "tokenAmountIn", - "type": "uint256" - }, - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "calcPoolOutGivenSingleIn", - "outputs": [ - { - "name": "poolAmountOut", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BALANCE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenBalanceOut", - "type": "uint256" - }, - { - "name": "tokenWeightOut", - "type": "uint256" - }, - { - "name": "poolSupply", - "type": "uint256" - }, - { - "name": "totalWeight", - "type": "uint256" - }, - { - "name": "poolAmountIn", - "type": "uint256" - }, - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "calcSingleOutGivenPoolIn", - "outputs": [ - { - "name": "tokenAmountOut", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "INIT_POOL_SUPPLY", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_OUT_RATIO", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenBalanceIn", - "type": "uint256" - }, - { - "name": "tokenWeightIn", - "type": "uint256" - }, - { - "name": "tokenBalanceOut", - "type": "uint256" - }, - { - "name": "tokenWeightOut", - "type": "uint256" - }, - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "calcSpotPrice", - "outputs": [ - { - "name": "spotPrice", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_BOUND_TOKENS", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BOUND_TOKENS", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BPOW_BASE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenBalanceIn", - "type": "uint256" - }, - { - "name": "tokenWeightIn", - "type": "uint256" - }, - { - "name": "tokenBalanceOut", - "type": "uint256" - }, - { - "name": "tokenWeightOut", - "type": "uint256" - }, - { - "name": "tokenAmountIn", - "type": "uint256" - }, - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "calcOutGivenIn", - "outputs": [ - { - "name": "tokenAmountOut", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_BPOW_BASE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BONE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "EXIT_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "increaseApproval", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "src", - "type": "address" - }, - { - "name": "dst", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_IN_RATIO", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenBalanceIn", - "type": "uint256" - }, - { - "name": "tokenWeightIn", - "type": "uint256" - }, - { - "name": "tokenBalanceOut", - "type": "uint256" - }, - { - "name": "tokenWeightOut", - "type": "uint256" - }, - { - "name": "tokenAmountOut", - "type": "uint256" - }, - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "calcInGivenOut", - "outputs": [ - { - "name": "tokenAmountIn", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "name": "tokenIn", - "type": "address" - }, - { - "indexed": true, - "name": "tokenOut", - "type": "address" - }, - { - "indexed": false, - "name": "tokenAmountIn", - "type": "uint256" - }, - { - "indexed": false, - "name": "tokenAmountOut", - "type": "uint256" - } - ], - "name": "LOG_SWAP", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "name": "tokenIn", - "type": "address" - }, - { - "indexed": false, - "name": "tokenAmountIn", - "type": "uint256" - } - ], - "name": "LOG_JOIN", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "caller", - "type": "address" - }, - { - "indexed": true, - "name": "tokenOut", - "type": "address" - }, - { - "indexed": false, - "name": "tokenAmountOut", - "type": "uint256" - } - ], - "name": "LOG_EXIT", - "type": "event" - }, - { - "anonymous": true, - "inputs": [ - { - "indexed": true, - "name": "sig", - "type": "bytes4" - }, - { - "indexed": true, - "name": "caller", - "type": "address" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - } - ], - "name": "LOG_CALL", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "controller", - "type": "address" - }, - { - "name": "factory", - "type": "address" - }, - { - "name": "swapFee", - "type": "uint256" - }, - { - "name": "publicSwap", - "type": "bool" - }, - { - "name": "finalized", - "type": "bool" - } - ], - "name": "initialize", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dataTokenAaddress", - "type": "address" - }, - { - "name": "dataTokenAmount", - "type": "uint256" - }, - { - "name": "dataTokenWeight", - "type": "uint256" - }, - { - "name": "baseTokenAddress", - "type": "address" - }, - { - "name": "baseTokenAmount", - "type": "uint256" - }, - { - "name": "baseTokenWeight", - "type": "uint256" - }, - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "setup", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "isPublicSwap", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "isFinalized", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "t", - "type": "address" - } - ], - "name": "isBound", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNumTokens", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getCurrentTokens", - "outputs": [ - { - "name": "tokens", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getFinalTokens", - "outputs": [ - { - "name": "tokens", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "token", - "type": "address" - } - ], - "name": "getDenormalizedWeight", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getTotalDenormalizedWeight", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "token", - "type": "address" - } - ], - "name": "getNormalizedWeight", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "token", - "type": "address" - } - ], - "name": "getBalance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getSwapFee", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getController", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "swapFee", - "type": "uint256" - } - ], - "name": "setSwapFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "manager", - "type": "address" - } - ], - "name": "setController", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "public_", - "type": "bool" - } - ], - "name": "setPublicSwap", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "finalize", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "token", - "type": "address" - }, - { - "name": "balance", - "type": "uint256" - }, - { - "name": "denorm", - "type": "uint256" - } - ], - "name": "bind", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "token", - "type": "address" - }, - { - "name": "balance", - "type": "uint256" - }, - { - "name": "denorm", - "type": "uint256" - } - ], - "name": "rebind", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "token", - "type": "address" - } - ], - "name": "unbind", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "token", - "type": "address" - } - ], - "name": "gulp", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenIn", - "type": "address" - }, - { - "name": "tokenOut", - "type": "address" - } - ], - "name": "getSpotPrice", - "outputs": [ - { - "name": "spotPrice", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "tokenIn", - "type": "address" - }, - { - "name": "tokenOut", - "type": "address" - } - ], - "name": "getSpotPriceSansFee", - "outputs": [ - { - "name": "spotPrice", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "poolAmountOut", - "type": "uint256" - }, - { - "name": "maxAmountsIn", - "type": "uint256[]" - } - ], - "name": "joinPool", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "poolAmountIn", - "type": "uint256" - }, - { - "name": "minAmountsOut", - "type": "uint256[]" - } - ], - "name": "exitPool", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "tokenIn", - "type": "address" - }, - { - "name": "tokenAmountIn", - "type": "uint256" - }, - { - "name": "tokenOut", - "type": "address" - }, - { - "name": "minAmountOut", - "type": "uint256" - }, - { - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "swapExactAmountIn", - "outputs": [ - { - "name": "tokenAmountOut", - "type": "uint256" - }, - { - "name": "spotPriceAfter", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "tokenIn", - "type": "address" - }, - { - "name": "maxAmountIn", - "type": "uint256" - }, - { - "name": "tokenOut", - "type": "address" - }, - { - "name": "tokenAmountOut", - "type": "uint256" - }, - { - "name": "maxPrice", - "type": "uint256" - } - ], - "name": "swapExactAmountOut", - "outputs": [ - { - "name": "tokenAmountIn", - "type": "uint256" - }, - { - "name": "spotPriceAfter", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "tokenIn", - "type": "address" - }, - { - "name": "tokenAmountIn", - "type": "uint256" - }, - { - "name": "minPoolAmountOut", - "type": "uint256" - } - ], - "name": "joinswapExternAmountIn", - "outputs": [ - { - "name": "poolAmountOut", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "tokenIn", - "type": "address" - }, - { - "name": "poolAmountOut", - "type": "uint256" - }, - { - "name": "maxAmountIn", - "type": "uint256" - } - ], - "name": "joinswapPoolAmountOut", - "outputs": [ - { - "name": "tokenAmountIn", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "tokenOut", - "type": "address" - }, - { - "name": "poolAmountIn", - "type": "uint256" - }, - { - "name": "minAmountOut", - "type": "uint256" - } - ], - "name": "exitswapPoolAmountIn", - "outputs": [ - { - "name": "tokenAmountOut", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "tokenOut", - "type": "address" - }, - { - "name": "tokenAmountOut", - "type": "uint256" - }, - { - "name": "maxPoolAmountIn", - "type": "uint256" - } - ], - "name": "exitswapExternAmountOut", - "outputs": [ - { - "name": "poolAmountIn", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/abis/BToken.json b/abis/BToken.json deleted file mode 100644 index e399e34..0000000 --- a/abis/BToken.json +++ /dev/null @@ -1,13920 +0,0 @@ -{ - "contractName": "BToken", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "MAX_TOTAL_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BPOW_PRECISION", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BALANCE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "INIT_POOL_SUPPLY", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_OUT_RATIO", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_BOUND_TOKENS", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BOUND_TOKENS", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MIN_BPOW_BASE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_BPOW_BASE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BONE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "EXIT_FEE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_WEIGHT", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_IN_RATIO", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "src", - "type": "address" - }, - { - "name": "dst", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "whom", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "increaseApproval", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "decreaseApproval", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "src", - "type": "address" - }, - { - "name": "dst", - "type": "address" - }, - { - "name": "amt", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.7+commit.6da8b019\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_TOTAL_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BPOW_PRECISION\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"src\",\"type\":\"address\"},{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"decreaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"whom\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BALANCE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"INIT_POOL_SUPPLY\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_OUT_RATIO\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BOUND_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BOUND_TOKENS\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MIN_BPOW_BASE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_BPOW_BASE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"BONE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"EXIT_FEE\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dst\",\"type\":\"address\"},{\"name\":\"amt\",\"type\":\"uint256\"}],\"name\":\"increaseApproval\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"src\",\"type\":\"address\"},{\"name\":\"dst\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_WEIGHT\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"MAX_IN_RATIO\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BToken.sol\":\"BToken\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BConst.sol\":{\"keccak256\":\"0x21675a0793e0be762a27e09ed3b0bd86e035c73ac3078dd841c38804445d5f5a\",\"urls\":[\"bzzr://47016ef4a80276f320b28a058fc92e7d9d93433bb5e4aa934668383cbefad77e\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BNum.sol\":{\"keccak256\":\"0xc4e5c934d6b04c1fad116ea81c2fa65eaa2700e4e48bcc5045c8c96f55e729c8\",\"urls\":[\"bzzr://a3946b7fd2095ca3c7c4bb3daf3078cc48e20b0e107f113e10fb0c6ebaa77e74\"]},\"/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BToken.sol\":{\"keccak256\":\"0xad046b7ad912f72a90330abb3abddc3aa711077c0021d6a9d0dba2c99534e51b\",\"urls\":[\"bzzr://159aed1b631f2af168fd17235b6827859cb5d6cb7e95abeff3cc3d8079710f41\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzzr://cf2d583b8dce38d0617fdcd65f2fd9f126fe17b7f683b5a515ea9d2762d8b062\"]}},\"version\":1}", - "bytecode": "0x60c0604052601360808190527f42616c616e63657220506f6f6c20546f6b656e0000000000000000000000000060a090815261003e91600391906100a3565b506040805180820190915260038082527f42505400000000000000000000000000000000000000000000000000000000006020909201918252610083916004916100a3565b506005805460ff1916601217905534801561009d57600080fd5b5061013e565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100e457805160ff1916838001178555610111565b82800160010185558215610111579182015b828111156101115782518255916020019190600101906100f6565b5061011d929150610121565b5090565b61013b91905b8082111561011d5760008155600101610127565b90565b610bc88061014d6000396000f3fe608060405234801561001057600080fd5b50600436106101c6576000357c01000000000000000000000000000000000000000000000000000000009004806395d89b4111610116578063bc694ea2116100b4578063d73dd6231161008e578063d73dd623146103e4578063dd62ed3e14610410578063e4a28a5214610288578063ec0930211461043e576101c6565b8063bc694ea2146103d4578063c36596a6146102b2578063c6580d12146103dc576101c6565b8063b0e0d136116100f0578063b0e0d136146103b4578063b7b800a4146103bc578063ba019dab146103c4578063bc063e1a146103cc576101c6565b806395d89b4114610378578063992e2a9214610380578063a9059cbb14610388576101c6565b806323b872dd1161018357806370a082311161015d57806370a082311461033a57806376c7a3c714610360578063867378c5146103685780639381cd2b14610370576101c6565b806323b872dd146102ba578063313ce567146102f0578063661884631461030e576101c6565b806306fdde03146101cb578063095ea7b31461024857806309a3bbe41461028857806318160ddd146102a2578063189d00ca146102aa578063218b5382146102b2575b600080fd5b6101d3610446565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561020d5781810151838201526020016101f5565b50505050905090810190601f16801561023a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102746004803603604081101561025e57600080fd5b50600160a060020a0381351690602001356104dc565b604080519115158252519081900360200190f35b610290610530565b60408051918252519081900360200190f35b61029061053d565b610290610543565b610290610557565b610274600480360360608110156102d057600080fd5b50600160a060020a03813581169160208101359091169060400135610563565b6102f86106c8565b6040805160ff9092168252519081900360200190f35b6102746004803603604081101561032457600080fd5b50600160a060020a0381351690602001356106d1565b6102906004803603602081101561035057600080fd5b5035600160a060020a03166107a9565b6102906107c4565b6102906107d6565b6102906107ea565b6101d36107f7565b610290610858565b6102746004803603604081101561039e57600080fd5b50600160a060020a038135169060200135610864565b61029061087a565b61029061087f565b610290610884565b610290610889565b610290610899565b6102906108a5565b610274600480360360408110156103fa57600080fd5b50600160a060020a0381351690602001356108aa565b6102906004803603604081101561042657600080fd5b50600160a060020a038135811691602001351661092b565b610290610956565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d25780601f106104a7576101008083540402835291602001916104d2565b820191906000526020600020905b8154815290600101906020018083116104b557829003601f168201915b5050505050905090565b336000818152600160209081526040808320600160a060020a03871680855290835281842086905581518681529151939490939092600080516020610b7d833981519152928290030190a350600192915050565b6802b5e3af16b188000081565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b600033600160a060020a038516148061059f5750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b6105f3576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42544f4b454e5f4241445f43414c4c45520000000000000000000000604482015290519081900360640190fd5b6105fe848484610966565b33600160a060020a0385161480159061063c5750600160a060020a038416600090815260016020908152604080832033845290915290205460001914155b156106be57600160a060020a038416600090815260016020908152604080832033845290915290205461066f9083610a82565b600160a060020a0385811660009081526001602090815260408083203380855290835292819020859055805194855251928716939192600080516020610b7d8339815191529281900390910190a35b5060019392505050565b60055460ff1690565b336000908152600160209081526040808320600160a060020a03861684529091528120548083111561072657336000908152600160209081526040808320600160a060020a0388168452909152812055610755565b6107308184610a82565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a038916808552908352928190205481519081529051929392600080516020610b7d833981519152929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b620f4240670de0b6b3a7640000610553565b64e8d4a51000670de0b6b3a7640000610553565b68056bc75e2d6310000081565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d25780601f106104a7576101008083540402835291602001916104d2565b6704a03ce68d21555681565b6000610871338484610966565b50600192915050565b600881565b600281565b600181565b600a670de0b6b3a7640000610553565b671bc16d674ec7ffff81565b600081565b336000908152600160209081526040808320600160a060020a03861684529091528120546108d89083610af3565b336000818152600160209081526040808320600160a060020a038916808552908352928190208590558051948552519193600080516020610b7d833981519152929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6002670de0b6b3a7640000610553565b600160a060020a0383166000908152602081905260409020548111156109d6576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b600160a060020a0383166000908152602081905260409020546109f99082610a82565b600160a060020a038085166000908152602081905260408082209390935590841681522054610a289082610af3565b600160a060020a038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000806000610a918585610b57565b915091508015610aeb576040805160e560020a62461bcd02815260206004820152601160248201527f4552525f5355425f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b509392505050565b600082820183811015610b50576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4144445f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b600080828410610b6d5750508082036000610b75565b505081810360015b925092905056fe8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a165627a7a72305820118805bb64d4c864b5a76fa6ca987b24e407431ab691f2998760e51f5551899a0029", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c6576000357c01000000000000000000000000000000000000000000000000000000009004806395d89b4111610116578063bc694ea2116100b4578063d73dd6231161008e578063d73dd623146103e4578063dd62ed3e14610410578063e4a28a5214610288578063ec0930211461043e576101c6565b8063bc694ea2146103d4578063c36596a6146102b2578063c6580d12146103dc576101c6565b8063b0e0d136116100f0578063b0e0d136146103b4578063b7b800a4146103bc578063ba019dab146103c4578063bc063e1a146103cc576101c6565b806395d89b4114610378578063992e2a9214610380578063a9059cbb14610388576101c6565b806323b872dd1161018357806370a082311161015d57806370a082311461033a57806376c7a3c714610360578063867378c5146103685780639381cd2b14610370576101c6565b806323b872dd146102ba578063313ce567146102f0578063661884631461030e576101c6565b806306fdde03146101cb578063095ea7b31461024857806309a3bbe41461028857806318160ddd146102a2578063189d00ca146102aa578063218b5382146102b2575b600080fd5b6101d3610446565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561020d5781810151838201526020016101f5565b50505050905090810190601f16801561023a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102746004803603604081101561025e57600080fd5b50600160a060020a0381351690602001356104dc565b604080519115158252519081900360200190f35b610290610530565b60408051918252519081900360200190f35b61029061053d565b610290610543565b610290610557565b610274600480360360608110156102d057600080fd5b50600160a060020a03813581169160208101359091169060400135610563565b6102f86106c8565b6040805160ff9092168252519081900360200190f35b6102746004803603604081101561032457600080fd5b50600160a060020a0381351690602001356106d1565b6102906004803603602081101561035057600080fd5b5035600160a060020a03166107a9565b6102906107c4565b6102906107d6565b6102906107ea565b6101d36107f7565b610290610858565b6102746004803603604081101561039e57600080fd5b50600160a060020a038135169060200135610864565b61029061087a565b61029061087f565b610290610884565b610290610889565b610290610899565b6102906108a5565b610274600480360360408110156103fa57600080fd5b50600160a060020a0381351690602001356108aa565b6102906004803603604081101561042657600080fd5b50600160a060020a038135811691602001351661092b565b610290610956565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d25780601f106104a7576101008083540402835291602001916104d2565b820191906000526020600020905b8154815290600101906020018083116104b557829003601f168201915b5050505050905090565b336000818152600160209081526040808320600160a060020a03871680855290835281842086905581518681529151939490939092600080516020610b7d833981519152928290030190a350600192915050565b6802b5e3af16b188000081565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b600033600160a060020a038516148061059f5750600160a060020a03841660009081526001602090815260408083203384529091529020548211155b6105f3576040805160e560020a62461bcd02815260206004820152601560248201527f4552525f42544f4b454e5f4241445f43414c4c45520000000000000000000000604482015290519081900360640190fd5b6105fe848484610966565b33600160a060020a0385161480159061063c5750600160a060020a038416600090815260016020908152604080832033845290915290205460001914155b156106be57600160a060020a038416600090815260016020908152604080832033845290915290205461066f9083610a82565b600160a060020a0385811660009081526001602090815260408083203380855290835292819020859055805194855251928716939192600080516020610b7d8339815191529281900390910190a35b5060019392505050565b60055460ff1690565b336000908152600160209081526040808320600160a060020a03861684529091528120548083111561072657336000908152600160209081526040808320600160a060020a0388168452909152812055610755565b6107308184610a82565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a038916808552908352928190205481519081529051929392600080516020610b7d833981519152929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b620f4240670de0b6b3a7640000610553565b64e8d4a51000670de0b6b3a7640000610553565b68056bc75e2d6310000081565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104d25780601f106104a7576101008083540402835291602001916104d2565b6704a03ce68d21555681565b6000610871338484610966565b50600192915050565b600881565b600281565b600181565b600a670de0b6b3a7640000610553565b671bc16d674ec7ffff81565b600081565b336000908152600160209081526040808320600160a060020a03861684529091528120546108d89083610af3565b336000818152600160209081526040808320600160a060020a038916808552908352928190208590558051948552519193600080516020610b7d833981519152929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6002670de0b6b3a7640000610553565b600160a060020a0383166000908152602081905260409020548111156109d6576040805160e560020a62461bcd02815260206004820152601460248201527f4552525f494e53554646494349454e545f42414c000000000000000000000000604482015290519081900360640190fd5b600160a060020a0383166000908152602081905260409020546109f99082610a82565b600160a060020a038085166000908152602081905260408082209390935590841681522054610a289082610af3565b600160a060020a038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000806000610a918585610b57565b915091508015610aeb576040805160e560020a62461bcd02815260206004820152601160248201527f4552525f5355425f554e444552464c4f57000000000000000000000000000000604482015290519081900360640190fd5b509392505050565b600082820183811015610b50576040805160e560020a62461bcd02815260206004820152601060248201527f4552525f4144445f4f564552464c4f5700000000000000000000000000000000604482015290519081900360640190fd5b9392505050565b600080828410610b6d5750508082036000610b75565b505081810360015b925092905056fe8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a165627a7a72305820118805bb64d4c864b5a76fa6ca987b24e407431ab691f2998760e51f5551899a0029", - "sourceMap": "2857:49:7:-;2812:2299;2857:49;;2812:2299;2857:49;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;2912:33:7;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;2951:30:7;;;-1:-1:-1;;2951:30:7;2979:2;2951:30;;;2812:2299;5:2:-1;;;;30:1;27;20:12;5:2;2812:2299:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2812:2299:7;;;-1:-1:-1;2812:2299:7;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "2812:2299:7:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2812:2299:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2988:81;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;2988:81:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3574:180;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3574:180:7;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;1111:50:2;;;:::i;:::-;;;;;;;;;;;;;;;;3482:86:7;;;:::i;1403:54:2:-;;;:::i;1004:45::-;;;:::i;4544:565:7:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;4544:565:7;;;;;;;;;;;;;;;;;:::i;3166:80::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;4014:388;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;4014:388:7;;;;;;;;:::i;3376:100::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3376:100:7;-1:-1:-1;;;;;3376:100:7;;:::i;840:53:2:-;;;:::i;1167:54::-;;;:::i;1228:51::-;;;:::i;3075:85:7:-;;;:::i;1519:59:2:-;;;:::i;4408:130:7:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;4408:130:7;;;;;;;;:::i;791:42:2:-;;;:::i;743:::-;;;:::i;1286:46::-;;;:::i;899:50::-;;;:::i;1338:59::-;;;:::i;955:42::-;;;:::i;3760:248:7:-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3760:248:7;;;;;;;;:::i;3252:118::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3252:118:7;;;;;;;;;;:::i;1464:49:2:-;;;:::i;2988:81:7:-;3057:5;3050:12;;;;;;;;-1:-1:-1;;3050:12:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3025:13;;3050:12;;3057:5;;3050:12;;3057:5;3050:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2988:81;:::o;3574:180::-;3659:10;3632:4;3648:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;3648:27:7;;;;;;;;;;;:33;;;3696:30;;;;;;;3632:4;;3648:27;;3659:10;;-1:-1:-1;;;;;;;;;;;3696:30:7;;;;;;;-1:-1:-1;3743:4:7;3574:180;;;;:::o;1111:50:2:-;1152:9;1111:50;:::o;3482:86:7:-;3549:12;;3482:86;:::o;1403:54:2:-;1451:6;730;1444:13;;1403:54;:::o;1004:45::-;730:6;1004:45;:::o;4544:565:7:-;4662:4;4704:10;-1:-1:-1;;;;;4704:17:7;;;;:55;;-1:-1:-1;;;;;;4732:15:7;;;;;;:10;:15;;;;;;;;4748:10;4732:27;;;;;;;;4725:34;;;4704:55;4683:124;;;;;-1:-1:-1;;;;;4683:124:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;4817:20;4823:3;4828;4833;4817:5;:20::i;:::-;4851:10;-1:-1:-1;;;;;4851:17:7;;;;;;:63;;-1:-1:-1;;;;;;4872:15:7;;;;;;:10;:15;;;;;;;;4888:10;4872:27;;;;;;;;-1:-1:-1;;4872:42:7;;4851:63;4847:235;;;-1:-1:-1;;;;;4965:15:7;;;;;;:10;:15;;;;;;;;4981:10;4965:27;;;;;;;;4960:38;;4994:3;4960:4;:38::i;:::-;-1:-1:-1;;;;;4930:15:7;;;;;;;:10;:15;;;;;;;;4946:10;4930:27;;;;;;;;;;:68;;;5017:54;;;;;;;;;;4946:10;;-1:-1:-1;;;;;;;;;;;5017:54:7;;;;;;;;;4847:235;-1:-1:-1;5098:4:7;4544:565;;;;;:::o;3166:80::-;3230:9;;;;3166:80;:::o;4014:388::-;4124:10;4081:4;4113:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;4113:27:7;;;;;;;;;;4154:14;;;4150:156;;;4195:10;4214:1;4184:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;4184:27:7;;;;;;;;;:31;4150:156;;;4276:19;4281:8;4291:3;4276:4;:19::i;:::-;4257:10;4246:22;;;;:10;:22;;;;;;;;-1:-1:-1;;;;;4246:27:7;;;;;;;;;:49;4150:156;4329:10;4346:22;;;;:10;:22;;;;;;;;-1:-1:-1;;;;;4320:54:7;;4346:27;;;;;;;;;;;4320:54;;;;;;;;;4329:10;-1:-1:-1;;;;;;;;;;;4320:54:7;;;;;;;;;;-1:-1:-1;4391:4:7;;4014:388;-1:-1:-1;;;4014:388:7:o;3376:100::-;-1:-1:-1;;;;;3455:14:7;3432:4;3455:14;;;;;;;;;;;;3376:100::o;840:53:2:-;888:5;730:6;881:12;;1167:54;1215:6;730;1208:13;;1228:51;1269:10;1228:51;:::o;3075:85:7:-;3146:7;3139:14;;;;;;;;-1:-1:-1;;3139:14:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3114:13;;3139:14;;3146:7;;3139:14;;3146:7;3139:14;;;;;;;;;;;;;;;;;;;;;;;;1519:59:2;1560:18;1519:59;:::o;4408:130:7:-;4467:4;4483:27;4489:10;4501:3;4506;4483:5;:27::i;:::-;-1:-1:-1;4527:4:7;4408:130;;;;:::o;791:42:2:-;832:1;791:42;:::o;743:::-;784:1;743:42;:::o;1286:46::-;1327:5;1286:46;:::o;899:50::-;947:2;730:6;940:9;;1338:59;1379:18;1338:59;:::o;955:42::-;996:1;955:42;:::o;3760:248:7:-;3889:10;3827:4;3878:22;;;:10;:22;;;;;;;;-1:-1:-1;;;;;3878:27:7;;;;;;;;;;3873:38;;3907:3;3873:4;:38::i;:::-;3854:10;3843:22;;;;:10;:22;;;;;;;;-1:-1:-1;;;;;3843:27:7;;;;;;;;;;;;:68;;;3926:54;;;;;;3843:27;;-1:-1:-1;;;;;;;;;;;3926:54:7;;;;;;;;;;-1:-1:-1;3997:4:7;3760:248;;;;:::o;3252:118::-;-1:-1:-1;;;;;3343:15:7;;;3320:4;3343:15;;;:10;:15;;;;;;;;:20;;;;;;;;;;;;;3252:118::o;1464:49:2:-;1512:1;730:6;1505:8;;2340:268:7;-1:-1:-1;;;;;2418:13:7;;:8;:13;;;;;;;;;;;:20;-1:-1:-1;2418:20:7;2410:53;;;;;-1:-1:-1;;;;;2410:53:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2494:13:7;;:8;:13;;;;;;;;;;;2489:24;;2509:3;2489:4;:24::i;:::-;-1:-1:-1;;;;;2473:13:7;;;:8;:13;;;;;;;;;;;:40;;;;2544:13;;;;;;;2539:24;;2559:3;2539:4;:24::i;:::-;-1:-1:-1;;;;;2523:13:7;;;:8;:13;;;;;;;;;;;;:40;;;;2578:23;;;;;;;2523:13;;2578:23;;;;;;;;;;;;;2340:268;;;:::o;1128:195:5:-;1197:4;1218:6;1226:9;1239:14;1248:1;1251;1239:8;:14::i;:::-;1217:36;;;;1272:4;1271:5;1263:35;;;;;-1:-1:-1;;;;;1263:35:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1315:1:5;1128:195;-1:-1:-1;;;1128:195:5:o;949:173::-;1018:4;1047:5;;;1070:6;;;;1062:35;;;;;-1:-1:-1;;;;;1062:35:5;;;;;;;;;;;;;;;;;;;;;;;;;;;;1114:1;949:173;-1:-1:-1;;;949:173:5:o;1329:214::-;1402:4;1408;1437:1;1432;:6;1428:109;;-1:-1:-1;;1462:5:5;;;1469;1454:21;;1428:109;-1:-1:-1;;1514:5:5;;;1521:4;1428:109;1329:214;;;;;:::o", - "source": "// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n\n// You should have received a copy of the GNU General Public License\n// along with this program. If not, see .\n\npragma solidity 0.5.7;\n\nimport './BNum.sol';\nimport 'openzeppelin-solidity/contracts/token/ERC20/IERC20.sol';\n\n// Highly opinionated token implementation\n\n// interface IERC20 {\n// event Approval(address indexed src, address indexed dst, uint amt);\n// event Transfer(address indexed src, address indexed dst, uint amt);\n\n// function totalSupply() external view returns (uint);\n// function balanceOf(address whom) external view returns (uint);\n// function allowance(address src, address dst) external view returns (uint);\n\n// function approve(address dst, uint amt) external returns (bool);\n// function transfer(address dst, uint amt) external returns (bool);\n// function transferFrom(\n// address src, address dst, uint amt\n// ) external returns (bool);\n// }\n\ncontract BTokenBase is BNum {\n\n mapping(address => uint) internal _balance;\n mapping(address => mapping(address=>uint)) internal _allowance;\n uint internal _totalSupply;\n\n event Approval(address indexed src, address indexed dst, uint amt);\n event Transfer(address indexed src, address indexed dst, uint amt);\n\n function _mint(uint amt) internal {\n _balance[address(this)] = badd(_balance[address(this)], amt);\n _totalSupply = badd(_totalSupply, amt);\n emit Transfer(address(0), address(this), amt);\n }\n\n function _burn(uint amt) internal {\n require(\n _balance[address(this)] >= amt, \n 'ERR_INSUFFICIENT_BAL'\n );\n _balance[address(this)] = bsub(_balance[address(this)], amt);\n _totalSupply = bsub(_totalSupply, amt);\n emit Transfer(address(this), address(0), amt);\n }\n\n function _move(address src, address dst, uint amt) internal {\n require(_balance[src] >= amt, 'ERR_INSUFFICIENT_BAL');\n _balance[src] = bsub(_balance[src], amt);\n _balance[dst] = badd(_balance[dst], amt);\n emit Transfer(src, dst, amt);\n }\n\n function _push(address to, uint amt) internal {\n _move(address(this), to, amt);\n }\n\n function _pull(address from, uint amt) internal {\n _move(from, address(this), amt);\n }\n}\n\ncontract BToken is BTokenBase, IERC20 {\n\n string private _name = 'Balancer Pool Token';\n string private _symbol = 'BPT';\n uint8 private _decimals = 18;\n\n function name() public view returns (string memory) {\n return _name;\n }\n\n function symbol() public view returns (string memory) {\n return _symbol;\n }\n\n function decimals() public view returns(uint8) {\n return _decimals;\n }\n\n function allowance(address src, address dst) external view returns (uint) {\n return _allowance[src][dst];\n }\n\n function balanceOf(address whom) external view returns (uint) {\n return _balance[whom];\n }\n\n function totalSupply() public view returns (uint) {\n return _totalSupply;\n }\n\n function approve(address dst, uint amt) external returns (bool) {\n _allowance[msg.sender][dst] = amt;\n emit Approval(msg.sender, dst, amt);\n return true;\n }\n\n function increaseApproval(address dst, uint amt) external returns (bool) {\n _allowance[msg.sender][dst] = badd(_allowance[msg.sender][dst], amt);\n emit Approval(msg.sender, dst, _allowance[msg.sender][dst]);\n return true;\n }\n\n function decreaseApproval(address dst, uint amt) external returns (bool) {\n uint oldValue = _allowance[msg.sender][dst];\n if (amt > oldValue) {\n _allowance[msg.sender][dst] = 0;\n } else {\n _allowance[msg.sender][dst] = bsub(oldValue, amt);\n }\n emit Approval(msg.sender, dst, _allowance[msg.sender][dst]);\n return true;\n }\n\n function transfer(address dst, uint amt) external returns (bool) {\n _move(msg.sender, dst, amt);\n return true;\n }\n\n function transferFrom(\n address src, \n address dst, \n uint amt\n ) \n external \n returns (bool) \n {\n require(\n msg.sender == src || amt <= _allowance[src][msg.sender], \n 'ERR_BTOKEN_BAD_CALLER'\n );\n _move(src, dst, amt);\n if (msg.sender != src && _allowance[src][msg.sender] != uint256(-1)) {\n _allowance[src][msg.sender] = bsub(_allowance[src][msg.sender], amt);\n emit Approval(msg.sender, dst, _allowance[src][msg.sender]);\n }\n return true;\n }\n}\n", - "sourcePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BToken.sol", - "ast": { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BToken.sol", - "exportedSymbols": { - "BToken": [4285], - "BTokenBase": [3979] - }, - "id": 4286, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 3780, - "literals": ["solidity", "0.5", ".7"], - "nodeType": "PragmaDirective", - "src": "643:22:7" - }, - { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BNum.sol", - "file": "./BNum.sol", - "id": 3781, - "nodeType": "ImportDirective", - "scope": 4286, - "sourceUnit": 1423, - "src": "667:20:7", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 3782, - "nodeType": "ImportDirective", - "scope": 4286, - "sourceUnit": 6538, - "src": "688:64:7", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 3783, - "name": "BNum", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 1422, - "src": "1468:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BNum_$1422", - "typeString": "contract BNum" - } - }, - "id": 3784, - "nodeType": "InheritanceSpecifier", - "src": "1468:4:7" - } - ], - "contractDependencies": [280, 1422], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 3979, - "linearizedBaseContracts": [3979, 1422, 280], - "name": "BTokenBase", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 3788, - "name": "_balance", - "nodeType": "VariableDeclaration", - "scope": 3979, - "src": "1480:60:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - }, - "typeName": { - "id": 3787, - "keyType": { - "id": 3785, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1488:7:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1480:24:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - }, - "valueType": { - "id": 3786, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1499:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3794, - "name": "_allowance", - "nodeType": "VariableDeclaration", - "scope": 3979, - "src": "1546:62:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - }, - "typeName": { - "id": 3793, - "keyType": { - "id": 3789, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1554:7:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1546:42:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - }, - "valueType": { - "id": 3792, - "keyType": { - "id": 3790, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1573:7:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1565:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - }, - "valueType": { - "id": 3791, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1582:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3796, - "name": "_totalSupply", - "nodeType": "VariableDeclaration", - "scope": 3979, - "src": "1614:26:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3795, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1614:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 3804, - "name": "Approval", - "nodeType": "EventDefinition", - "parameters": { - "id": 3803, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3798, - "indexed": true, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 3804, - "src": "1662:19:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3797, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1662:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3800, - "indexed": true, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 3804, - "src": "1683:19:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3799, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1683:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3802, - "indexed": false, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3804, - "src": "1704:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3801, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1704:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1661:52:7" - }, - "src": "1647:67:7" - }, - { - "anonymous": false, - "documentation": null, - "id": 3812, - "name": "Transfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 3811, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3806, - "indexed": true, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 3812, - "src": "1734:19:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3805, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1734:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3808, - "indexed": true, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 3812, - "src": "1755:19:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3807, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1755:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3810, - "indexed": false, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3812, - "src": "1776:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3809, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1776:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1733:52:7" - }, - "src": "1719:67:7" - }, - { - "body": { - "id": 3849, - "nodeType": "Block", - "src": "1826:180:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 3830, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3817, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "1836:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3821, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3819, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "1853:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3818, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1845:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3820, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1845:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1836:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3823, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "1867:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3827, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3825, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "1884:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3824, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1876:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3826, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1876:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1867:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3828, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3814, - "src": "1892:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3822, - "name": "badd", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1001, - "src": "1862:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3829, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1862:34:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1836:60:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3831, - "nodeType": "ExpressionStatement", - "src": "1836:60:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3837, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 3832, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "1906:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3834, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "1926:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3835, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3814, - "src": "1940:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3833, - "name": "badd", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1001, - "src": "1921:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3836, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1921:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1906:38:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3838, - "nodeType": "ExpressionStatement", - "src": "1906:38:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 3841, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1976:1:7", - "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": 3840, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1968:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3842, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1968:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3844, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "1988:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3843, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1980:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3845, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1980:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3846, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3814, - "src": "1995:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3839, - "name": "Transfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3812, - "src": "1959:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3847, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1959:40:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3848, - "nodeType": "EmitStatement", - "src": "1954:45:7" - } - ] - }, - "documentation": null, - "id": 3850, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_mint", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3815, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3814, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3850, - "src": "1807:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3813, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1807:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1806:10:7" - }, - "returnParameters": { - "id": 3816, - "nodeType": "ParameterList", - "parameters": [], - "src": "1826:0:7" - }, - "scope": 3979, - "src": "1792:214:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 3898, - "nodeType": "Block", - "src": "2046:288:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 3862, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3856, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2077:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3860, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3858, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2094:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3857, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2086:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3859, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2086:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2077:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 3861, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3852, - "src": "2104:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2077:30:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552525f494e53554646494349454e545f42414c", - "id": 3863, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2122:22:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6d886dfa4c52985ff7e07248f8343de807c72a722ad596b432ce38fd268e3469", - "typeString": "literal_string \"ERR_INSUFFICIENT_BAL\"" - }, - "value": "ERR_INSUFFICIENT_BAL" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6d886dfa4c52985ff7e07248f8343de807c72a722ad596b432ce38fd268e3469", - "typeString": "literal_string \"ERR_INSUFFICIENT_BAL\"" - } - ], - "id": 3855, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "2056:7:7", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 3864, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2056:98:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3865, - "nodeType": "ExpressionStatement", - "src": "2056:98:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3879, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3866, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2164:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3870, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3868, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2181:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3867, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2173:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3869, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2173:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2164:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3872, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2195:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3876, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3874, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2212:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3873, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2204:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3875, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2204:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2195:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3877, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3852, - "src": "2220:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3871, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "2190:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3878, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2190:34:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2164:60:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3880, - "nodeType": "ExpressionStatement", - "src": "2164:60:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3886, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 3881, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "2234:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3883, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "2254:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3884, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3852, - "src": "2268:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3882, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "2249:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3885, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2249:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2234:38:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3887, - "nodeType": "ExpressionStatement", - "src": "2234:38:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3890, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2304:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3889, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2296:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3891, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2296:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 3893, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2319:1:7", - "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": 3892, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2311:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3894, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2311:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 3895, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3852, - "src": "2323:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3888, - "name": "Transfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3812, - "src": "2287:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3896, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2287:40:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3897, - "nodeType": "EmitStatement", - "src": "2282:45:7" - } - ] - }, - "documentation": null, - "id": 3899, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_burn", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3853, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3852, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3899, - "src": "2027:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3851, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2027:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2026:10:7" - }, - "returnParameters": { - "id": 3854, - "nodeType": "ParameterList", - "parameters": [], - "src": "2046:0:7" - }, - "scope": 3979, - "src": "2012:322:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 3945, - "nodeType": "Block", - "src": "2400:208:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 3913, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3909, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2418:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3911, - "indexExpression": { - "argumentTypes": null, - "id": 3910, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3901, - "src": "2427:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2418:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 3912, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3905, - "src": "2435:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2418:20:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552525f494e53554646494349454e545f42414c", - "id": 3914, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2440:22:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6d886dfa4c52985ff7e07248f8343de807c72a722ad596b432ce38fd268e3469", - "typeString": "literal_string \"ERR_INSUFFICIENT_BAL\"" - }, - "value": "ERR_INSUFFICIENT_BAL" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6d886dfa4c52985ff7e07248f8343de807c72a722ad596b432ce38fd268e3469", - "typeString": "literal_string \"ERR_INSUFFICIENT_BAL\"" - } - ], - "id": 3908, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "2410:7:7", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 3915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2410:53:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3916, - "nodeType": "ExpressionStatement", - "src": "2410:53:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3926, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3917, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2473:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3919, - "indexExpression": { - "argumentTypes": null, - "id": 3918, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3901, - "src": "2482:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2473:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3921, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2494:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3923, - "indexExpression": { - "argumentTypes": null, - "id": 3922, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3901, - "src": "2503:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2494:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3924, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3905, - "src": "2509:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3920, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "2489:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3925, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2489:24:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2473:40:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3927, - "nodeType": "ExpressionStatement", - "src": "2473:40:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3937, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3928, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2523:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3930, - "indexExpression": { - "argumentTypes": null, - "id": 3929, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3903, - "src": "2532:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2523:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3932, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2544:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3934, - "indexExpression": { - "argumentTypes": null, - "id": 3933, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3903, - "src": "2553:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2544:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3935, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3905, - "src": "2559:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3931, - "name": "badd", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1001, - "src": "2539:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3936, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2539:24:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2523:40:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3938, - "nodeType": "ExpressionStatement", - "src": "2523:40:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3940, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3901, - "src": "2587:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3941, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3903, - "src": "2592:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3942, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3905, - "src": "2597:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3939, - "name": "Transfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3812, - "src": "2578:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3943, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2578:23:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3944, - "nodeType": "EmitStatement", - "src": "2573:28:7" - } - ] - }, - "documentation": null, - "id": 3946, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_move", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3906, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3901, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 3946, - "src": "2355:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3900, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2355:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3903, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 3946, - "src": "2368:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3902, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2368:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3905, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3946, - "src": "2381:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3904, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2381:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2354:36:7" - }, - "returnParameters": { - "id": 3907, - "nodeType": "ParameterList", - "parameters": [], - "src": "2400:0:7" - }, - "scope": 3979, - "src": "2340:268:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 3961, - "nodeType": "Block", - "src": "2660:46:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3955, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2684:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3954, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2676:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3956, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2676:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3957, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3948, - "src": "2691:2:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3958, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3950, - "src": "2695:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3953, - "name": "_move", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3946, - "src": "2670:5:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3959, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2670:29:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3960, - "nodeType": "ExpressionStatement", - "src": "2670:29:7" - } - ] - }, - "documentation": null, - "id": 3962, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_push", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3951, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3948, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 3962, - "src": "2629:10:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3947, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2629:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3950, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3962, - "src": "2641:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3949, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2641:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2628:22:7" - }, - "returnParameters": { - "id": 3952, - "nodeType": "ParameterList", - "parameters": [], - "src": "2660:0:7" - }, - "scope": 3979, - "src": "2614:92:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 3977, - "nodeType": "Block", - "src": "2760:48:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3970, - "name": "from", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3964, - "src": "2776:4:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3972, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2790:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3971, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2782:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3973, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2782:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3974, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3966, - "src": "2797:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3969, - "name": "_move", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3946, - "src": "2770:5:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3975, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2770:31:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3976, - "nodeType": "ExpressionStatement", - "src": "2770:31:7" - } - ] - }, - "documentation": null, - "id": 3978, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_pull", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3967, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3964, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 3978, - "src": "2727:12:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3963, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2727:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3966, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3978, - "src": "2741:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3965, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2741:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2726:24:7" - }, - "returnParameters": { - "id": 3968, - "nodeType": "ParameterList", - "parameters": [], - "src": "2760:0:7" - }, - "scope": 3979, - "src": "2712:96:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - } - ], - "scope": 4286, - "src": "1445:1365:7" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 3980, - "name": "BTokenBase", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 3979, - "src": "2831:10:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - }, - "id": 3981, - "nodeType": "InheritanceSpecifier", - "src": "2831:10:7" - }, - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 3982, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 6537, - "src": "2843:6:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$6537", - "typeString": "contract IERC20" - } - }, - "id": 3983, - "nodeType": "InheritanceSpecifier", - "src": "2843:6:7" - } - ], - "contractDependencies": [280, 1422, 3979, 6537], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 4285, - "linearizedBaseContracts": [4285, 6537, 3979, 1422, 280], - "name": "BToken", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 3986, - "name": "_name", - "nodeType": "VariableDeclaration", - "scope": 4285, - "src": "2857:49:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string" - }, - "typeName": { - "id": 3984, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2857:6:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "42616c616e63657220506f6f6c20546f6b656e", - "id": 3985, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2885:21:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_86726d210cafef5a97cd8551cc3cd59ead4ad6b4a08f1b0e2ca14d5024839298", - "typeString": "literal_string \"Balancer Pool Token\"" - }, - "value": "Balancer Pool Token" - }, - "visibility": "private" - }, - { - "constant": false, - "id": 3989, - "name": "_symbol", - "nodeType": "VariableDeclaration", - "scope": 4285, - "src": "2912:33:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string" - }, - "typeName": { - "id": 3987, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2912:6:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "425054", - "id": 3988, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2940:5:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2c4469c3871c2223d094ce996c22463935f1f3c0f4a0177add993c1ee46e9606", - "typeString": "literal_string \"BPT\"" - }, - "value": "BPT" - }, - "visibility": "private" - }, - { - "constant": false, - "id": 3992, - "name": "_decimals", - "nodeType": "VariableDeclaration", - "scope": 4285, - "src": "2951:30:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 3990, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "2951:5:7", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "3138", - "id": 3991, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2979:2:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_18_by_1", - "typeString": "int_const 18" - }, - "value": "18" - }, - "visibility": "private" - }, - { - "body": { - "id": 3999, - "nodeType": "Block", - "src": "3040:29:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 3997, - "name": "_name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3986, - "src": "3057:5:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "functionReturnParameters": 3996, - "id": 3998, - "nodeType": "Return", - "src": "3050:12:7" - } - ] - }, - "documentation": null, - "id": 4000, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "name", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3993, - "nodeType": "ParameterList", - "parameters": [], - "src": "3001:2:7" - }, - "returnParameters": { - "id": 3996, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3995, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4000, - "src": "3025:13:7", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 3994, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "3025:6:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3024:15:7" - }, - "scope": 4285, - "src": "2988:81:7", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4007, - "nodeType": "Block", - "src": "3129:31:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4005, - "name": "_symbol", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3989, - "src": "3146:7:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "functionReturnParameters": 4004, - "id": 4006, - "nodeType": "Return", - "src": "3139:14:7" - } - ] - }, - "documentation": null, - "id": 4008, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "symbol", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4001, - "nodeType": "ParameterList", - "parameters": [], - "src": "3090:2:7" - }, - "returnParameters": { - "id": 4004, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4003, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4008, - "src": "3114:13:7", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 4002, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "3114:6:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3113:15:7" - }, - "scope": 4285, - "src": "3075:85:7", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4015, - "nodeType": "Block", - "src": "3213:33:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4013, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3992, - "src": "3230:9:7", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "functionReturnParameters": 4012, - "id": 4014, - "nodeType": "Return", - "src": "3223:16:7" - } - ] - }, - "documentation": null, - "id": 4016, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "decimals", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4009, - "nodeType": "ParameterList", - "parameters": [], - "src": "3183:2:7" - }, - "returnParameters": { - "id": 4012, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4011, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4016, - "src": "3206:5:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 4010, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "3206:5:7", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3205:7:7" - }, - "scope": 4285, - "src": "3166:80:7", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4031, - "nodeType": "Block", - "src": "3326:44:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4025, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3343:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4027, - "indexExpression": { - "argumentTypes": null, - "id": 4026, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4018, - "src": "3354:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3343:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4029, - "indexExpression": { - "argumentTypes": null, - "id": 4028, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4020, - "src": "3359:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3343:20:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4024, - "id": 4030, - "nodeType": "Return", - "src": "3336:27:7" - } - ] - }, - "documentation": null, - "id": 4032, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4021, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4018, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 4032, - "src": "3271:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4017, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3271:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4020, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4032, - "src": "3284:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4019, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3284:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3270:26:7" - }, - "returnParameters": { - "id": 4024, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4023, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4032, - "src": "3320:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4022, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3320:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3319:6:7" - }, - "scope": 4285, - "src": "3252:118:7", - "stateMutability": "view", - "superFunction": 6500, - "visibility": "external" - }, - { - "body": { - "id": 4043, - "nodeType": "Block", - "src": "3438:38:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4039, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "3455:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4041, - "indexExpression": { - "argumentTypes": null, - "id": 4040, - "name": "whom", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4034, - "src": "3464:4:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3455:14:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4038, - "id": 4042, - "nodeType": "Return", - "src": "3448:21:7" - } - ] - }, - "documentation": null, - "id": 4044, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4035, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4034, - "name": "whom", - "nodeType": "VariableDeclaration", - "scope": 4044, - "src": "3395:12:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4033, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3395:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3394:14:7" - }, - "returnParameters": { - "id": 4038, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4037, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4044, - "src": "3432:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4036, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3432:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3431:6:7" - }, - "scope": 4285, - "src": "3376:100:7", - "stateMutability": "view", - "superFunction": 6482, - "visibility": "external" - }, - { - "body": { - "id": 4051, - "nodeType": "Block", - "src": "3532:36:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4049, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "3549:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4048, - "id": 4050, - "nodeType": "Return", - "src": "3542:19:7" - } - ] - }, - "documentation": null, - "id": 4052, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4045, - "nodeType": "ParameterList", - "parameters": [], - "src": "3502:2:7" - }, - "returnParameters": { - "id": 4048, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4047, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4052, - "src": "3526:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4046, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3526:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3525:6:7" - }, - "scope": 4285, - "src": "3482:86:7", - "stateMutability": "view", - "superFunction": 6475, - "visibility": "public" - }, - { - "body": { - "id": 4079, - "nodeType": "Block", - "src": "3638:116:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4068, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4061, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3648:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4065, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4062, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3659:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4063, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3659:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3648:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4066, - "indexExpression": { - "argumentTypes": null, - "id": 4064, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4054, - "src": "3671:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3648:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4067, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4056, - "src": "3678:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3648:33:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4069, - "nodeType": "ExpressionStatement", - "src": "3648:33:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4071, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3705:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4072, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3705:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4073, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4054, - "src": "3717:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4074, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4056, - "src": "3722:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4070, - "name": "Approval", - "nodeType": "Identifier", - "overloadedDeclarations": [6536], - "referencedDeclaration": 6536, - "src": "3696:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4075, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3696:30:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4076, - "nodeType": "EmitStatement", - "src": "3691:35:7" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4077, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3743:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4060, - "id": 4078, - "nodeType": "Return", - "src": "3736:11:7" - } - ] - }, - "documentation": null, - "id": 4080, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "approve", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4057, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4054, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4080, - "src": "3591:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4053, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3591:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4056, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4080, - "src": "3604:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4055, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3604:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3590:23:7" - }, - "returnParameters": { - "id": 4060, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4059, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4080, - "src": "3632:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4058, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3632:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3631:6:7" - }, - "scope": 4285, - "src": "3574:180:7", - "stateMutability": "nonpayable", - "superFunction": 6509, - "visibility": "external" - }, - { - "body": { - "id": 4120, - "nodeType": "Block", - "src": "3833:175:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4104, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4089, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3843:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4093, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4090, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3854:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4091, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3854:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3843:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4094, - "indexExpression": { - "argumentTypes": null, - "id": 4092, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4082, - "src": "3866:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3843:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4096, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3878:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4099, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4097, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3889:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4098, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3889:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3878:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4101, - "indexExpression": { - "argumentTypes": null, - "id": 4100, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4082, - "src": "3901:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3878:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 4102, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4084, - "src": "3907:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4095, - "name": "badd", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1001, - "src": "3873:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4103, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3873:38:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3843:68:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4105, - "nodeType": "ExpressionStatement", - "src": "3843:68:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4107, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3935:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4108, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3935:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4109, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4082, - "src": "3947:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4110, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3952:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4113, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4111, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3963:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4112, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3963:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3952:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4115, - "indexExpression": { - "argumentTypes": null, - "id": 4114, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4082, - "src": "3975:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3952:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4106, - "name": "Approval", - "nodeType": "Identifier", - "overloadedDeclarations": [6536], - "referencedDeclaration": 6536, - "src": "3926:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3926:54:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4117, - "nodeType": "EmitStatement", - "src": "3921:59:7" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4118, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3997:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4088, - "id": 4119, - "nodeType": "Return", - "src": "3990:11:7" - } - ] - }, - "documentation": null, - "id": 4121, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "increaseApproval", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4085, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4082, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4121, - "src": "3786:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4081, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3786:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4084, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4121, - "src": "3799:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4083, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3799:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3785:23:7" - }, - "returnParameters": { - "id": 4088, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4087, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4121, - "src": "3827:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4086, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3827:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3826:6:7" - }, - "scope": 4285, - "src": "3760:248:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4180, - "nodeType": "Block", - "src": "4087:315:7", - "statements": [ - { - "assignments": [4131], - "declarations": [ - { - "constant": false, - "id": 4131, - "name": "oldValue", - "nodeType": "VariableDeclaration", - "scope": 4180, - "src": "4097:13:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4130, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4097:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4138, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4132, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4113:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4135, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4133, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4124:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4134, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4124:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4113:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4137, - "indexExpression": { - "argumentTypes": null, - "id": 4136, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4136:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4113:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4097:43:7" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4141, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4139, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4125, - "src": "4154:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 4140, - "name": "oldValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4131, - "src": "4160:8:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4154:14:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 4164, - "nodeType": "Block", - "src": "4232:74:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4152, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4246:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4156, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4153, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4257:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4154, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4257:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4246:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4157, - "indexExpression": { - "argumentTypes": null, - "id": 4155, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4269:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4246:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4159, - "name": "oldValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4131, - "src": "4281:8:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 4160, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4125, - "src": "4291:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4158, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "4276:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4276:19:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4246:49:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4163, - "nodeType": "ExpressionStatement", - "src": "4246:49:7" - } - ] - }, - "id": 4165, - "nodeType": "IfStatement", - "src": "4150:156:7", - "trueBody": { - "id": 4151, - "nodeType": "Block", - "src": "4170:56:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4149, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4142, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4184:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4146, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4143, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4195:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4144, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4195:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4184:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4147, - "indexExpression": { - "argumentTypes": null, - "id": 4145, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4207:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4184:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 4148, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4214:1:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4184:31:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4150, - "nodeType": "ExpressionStatement", - "src": "4184:31:7" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4167, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4329:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4168, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4329:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4169, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4341:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4170, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4346:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4173, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4171, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4357:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4172, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4357:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4346:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4175, - "indexExpression": { - "argumentTypes": null, - "id": 4174, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4369:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4346:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4166, - "name": "Approval", - "nodeType": "Identifier", - "overloadedDeclarations": [6536], - "referencedDeclaration": 6536, - "src": "4320:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4176, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4320:54:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4177, - "nodeType": "EmitStatement", - "src": "4315:59:7" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4178, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4391:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4129, - "id": 4179, - "nodeType": "Return", - "src": "4384:11:7" - } - ] - }, - "documentation": null, - "id": 4181, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "decreaseApproval", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4126, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4123, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4181, - "src": "4040:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4122, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4040:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4125, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4181, - "src": "4053:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4124, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4053:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4039:23:7" - }, - "returnParameters": { - "id": 4129, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4128, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4181, - "src": "4081:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4127, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4081:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4080:6:7" - }, - "scope": 4285, - "src": "4014:388:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4199, - "nodeType": "Block", - "src": "4473:65:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4191, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4489:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4192, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4489:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4193, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4183, - "src": "4501:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4194, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4185, - "src": "4506:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4190, - "name": "_move", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3946, - "src": "4483:5:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4195, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4483:27:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4196, - "nodeType": "ExpressionStatement", - "src": "4483:27:7" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4197, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4527:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4189, - "id": 4198, - "nodeType": "Return", - "src": "4520:11:7" - } - ] - }, - "documentation": null, - "id": 4200, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4186, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4183, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4200, - "src": "4426:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4182, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4426:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4185, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4200, - "src": "4439:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4184, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4439:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4425:23:7" - }, - "returnParameters": { - "id": 4189, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4188, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4200, - "src": "4467:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4187, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4467:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4466:6:7" - }, - "scope": 4285, - "src": "4408:130:7", - "stateMutability": "nonpayable", - "superFunction": 6491, - "visibility": "external" - }, - { - "body": { - "id": 4283, - "nodeType": "Block", - "src": "4673:436:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4224, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4215, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4212, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4704:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4213, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4704:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 4214, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4718:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "4704:17:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4223, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4216, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4206, - "src": "4725:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4217, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4732:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4219, - "indexExpression": { - "argumentTypes": null, - "id": 4218, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4743:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4732:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4222, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4220, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4748:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4221, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4748:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4732:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4725:34:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "4704:55:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552525f42544f4b454e5f4241445f43414c4c4552", - "id": 4225, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4774:23:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7c78c5c07128d4fb2c83ecfae573652cc351a44f64cf0f454240bdf4749e318c", - "typeString": "literal_string \"ERR_BTOKEN_BAD_CALLER\"" - }, - "value": "ERR_BTOKEN_BAD_CALLER" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7c78c5c07128d4fb2c83ecfae573652cc351a44f64cf0f454240bdf4749e318c", - "typeString": "literal_string \"ERR_BTOKEN_BAD_CALLER\"" - } - ], - "id": 4211, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "4683:7:7", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4226, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4683:124:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4227, - "nodeType": "ExpressionStatement", - "src": "4683:124:7" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4229, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4823:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4230, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4204, - "src": "4828:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4231, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4206, - "src": "4833:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4228, - "name": "_move", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3946, - "src": "4817:5:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4232, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4817:20:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4233, - "nodeType": "ExpressionStatement", - "src": "4817:20:7" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4237, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4234, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4851:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4235, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4851:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "id": 4236, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4865:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "4851:17:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4238, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4872:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4240, - "indexExpression": { - "argumentTypes": null, - "id": 4239, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4883:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4872:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4243, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4241, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4888:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4242, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4888:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4872:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4246, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "4911:2:7", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 4245, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4912:1:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 4244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4903:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint256" - }, - "id": 4247, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4903:11:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4872:42:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "4851:63:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 4280, - "nodeType": "IfStatement", - "src": "4847:235:7", - "trueBody": { - "id": 4279, - "nodeType": "Block", - "src": "4916:166:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4265, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4250, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4930:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4254, - "indexExpression": { - "argumentTypes": null, - "id": 4251, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4941:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4930:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4255, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4252, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4946:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4946:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4930:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4257, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4965:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4259, - "indexExpression": { - "argumentTypes": null, - "id": 4258, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4976:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4965:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4262, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4260, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4981:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4981:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4965:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 4263, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4206, - "src": "4994:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4256, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "4960:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4960:38:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4930:68:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4266, - "nodeType": "ExpressionStatement", - "src": "4930:68:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4268, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "5026:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5026:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4270, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4204, - "src": "5038:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4271, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "5043:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4273, - "indexExpression": { - "argumentTypes": null, - "id": 4272, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "5054:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5043:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4276, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4274, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "5059:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4275, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5059:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5043:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4267, - "name": "Approval", - "nodeType": "Identifier", - "overloadedDeclarations": [6536], - "referencedDeclaration": 6536, - "src": "5017:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4277, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5017:54:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4278, - "nodeType": "EmitStatement", - "src": "5012:59:7" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4281, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5098:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4210, - "id": 4282, - "nodeType": "Return", - "src": "5091:11:7" - } - ] - }, - "documentation": null, - "id": 4284, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4207, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4202, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 4284, - "src": "4575:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4201, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4575:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4204, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4284, - "src": "4597:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4203, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4597:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4206, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4284, - "src": "4619:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4205, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4619:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4565:68:7" - }, - "returnParameters": { - "id": 4210, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4209, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4284, - "src": "4662:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4208, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4662:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4661:6:7" - }, - "scope": 4285, - "src": "4544:565:7", - "stateMutability": "nonpayable", - "superFunction": 6520, - "visibility": "external" - } - ], - "scope": 4286, - "src": "2812:2299:7" - } - ], - "src": "643:4469:7" - }, - "legacyAST": { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BToken.sol", - "exportedSymbols": { - "BToken": [4285], - "BTokenBase": [3979] - }, - "id": 4286, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 3780, - "literals": ["solidity", "0.5", ".7"], - "nodeType": "PragmaDirective", - "src": "643:22:7" - }, - { - "absolutePath": "/home/travis/build/oceanprotocol/ocean-contracts/contracts/balancer/BNum.sol", - "file": "./BNum.sol", - "id": 3781, - "nodeType": "ImportDirective", - "scope": 4286, - "sourceUnit": 1423, - "src": "667:20:7", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 3782, - "nodeType": "ImportDirective", - "scope": 4286, - "sourceUnit": 6538, - "src": "688:64:7", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 3783, - "name": "BNum", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 1422, - "src": "1468:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BNum_$1422", - "typeString": "contract BNum" - } - }, - "id": 3784, - "nodeType": "InheritanceSpecifier", - "src": "1468:4:7" - } - ], - "contractDependencies": [280, 1422], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 3979, - "linearizedBaseContracts": [3979, 1422, 280], - "name": "BTokenBase", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 3788, - "name": "_balance", - "nodeType": "VariableDeclaration", - "scope": 3979, - "src": "1480:60:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - }, - "typeName": { - "id": 3787, - "keyType": { - "id": 3785, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1488:7:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1480:24:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - }, - "valueType": { - "id": 3786, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1499:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3794, - "name": "_allowance", - "nodeType": "VariableDeclaration", - "scope": 3979, - "src": "1546:62:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - }, - "typeName": { - "id": 3793, - "keyType": { - "id": 3789, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1554:7:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1546:42:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - }, - "valueType": { - "id": 3792, - "keyType": { - "id": 3790, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1573:7:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1565:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - }, - "valueType": { - "id": 3791, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1582:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3796, - "name": "_totalSupply", - "nodeType": "VariableDeclaration", - "scope": 3979, - "src": "1614:26:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3795, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1614:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 3804, - "name": "Approval", - "nodeType": "EventDefinition", - "parameters": { - "id": 3803, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3798, - "indexed": true, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 3804, - "src": "1662:19:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3797, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1662:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3800, - "indexed": true, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 3804, - "src": "1683:19:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3799, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1683:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3802, - "indexed": false, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3804, - "src": "1704:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3801, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1704:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1661:52:7" - }, - "src": "1647:67:7" - }, - { - "anonymous": false, - "documentation": null, - "id": 3812, - "name": "Transfer", - "nodeType": "EventDefinition", - "parameters": { - "id": 3811, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3806, - "indexed": true, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 3812, - "src": "1734:19:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3805, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1734:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3808, - "indexed": true, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 3812, - "src": "1755:19:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3807, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1755:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3810, - "indexed": false, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3812, - "src": "1776:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3809, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1776:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1733:52:7" - }, - "src": "1719:67:7" - }, - { - "body": { - "id": 3849, - "nodeType": "Block", - "src": "1826:180:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 3830, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3817, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "1836:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3821, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3819, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "1853:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3818, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1845:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3820, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1845:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "1836:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3823, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "1867:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3827, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3825, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "1884:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3824, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1876:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3826, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1876:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1867:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3828, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3814, - "src": "1892:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3822, - "name": "badd", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1001, - "src": "1862:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3829, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1862:34:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1836:60:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3831, - "nodeType": "ExpressionStatement", - "src": "1836:60:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3837, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 3832, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "1906:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3834, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "1926:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3835, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3814, - "src": "1940:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3833, - "name": "badd", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1001, - "src": "1921:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3836, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1921:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1906:38:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3838, - "nodeType": "ExpressionStatement", - "src": "1906:38:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 3841, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1976:1:7", - "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": 3840, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1968:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3842, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1968:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3844, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "1988:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3843, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "1980:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3845, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1980:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3846, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3814, - "src": "1995:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3839, - "name": "Transfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3812, - "src": "1959:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3847, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1959:40:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3848, - "nodeType": "EmitStatement", - "src": "1954:45:7" - } - ] - }, - "documentation": null, - "id": 3850, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_mint", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3815, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3814, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3850, - "src": "1807:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3813, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1807:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1806:10:7" - }, - "returnParameters": { - "id": 3816, - "nodeType": "ParameterList", - "parameters": [], - "src": "1826:0:7" - }, - "scope": 3979, - "src": "1792:214:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 3898, - "nodeType": "Block", - "src": "2046:288:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 3862, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3856, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2077:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3860, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3858, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2094:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3857, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2086:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3859, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2086:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2077:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 3861, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3852, - "src": "2104:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2077:30:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552525f494e53554646494349454e545f42414c", - "id": 3863, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2122:22:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6d886dfa4c52985ff7e07248f8343de807c72a722ad596b432ce38fd268e3469", - "typeString": "literal_string \"ERR_INSUFFICIENT_BAL\"" - }, - "value": "ERR_INSUFFICIENT_BAL" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6d886dfa4c52985ff7e07248f8343de807c72a722ad596b432ce38fd268e3469", - "typeString": "literal_string \"ERR_INSUFFICIENT_BAL\"" - } - ], - "id": 3855, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "2056:7:7", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 3864, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2056:98:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3865, - "nodeType": "ExpressionStatement", - "src": "2056:98:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3879, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3866, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2164:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3870, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3868, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2181:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3867, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2173:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3869, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2173:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2164:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3872, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2195:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3876, - "indexExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3874, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2212:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3873, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2204:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3875, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2204:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2195:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3877, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3852, - "src": "2220:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3871, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "2190:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3878, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2190:34:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2164:60:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3880, - "nodeType": "ExpressionStatement", - "src": "2164:60:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3886, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 3881, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "2234:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3883, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "2254:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3884, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3852, - "src": "2268:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3882, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "2249:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3885, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2249:23:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2234:38:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3887, - "nodeType": "ExpressionStatement", - "src": "2234:38:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3890, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2304:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3889, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2296:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3891, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2296:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 3893, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2319:1:7", - "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": 3892, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2311:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3894, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2311:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 3895, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3852, - "src": "2323:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3888, - "name": "Transfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3812, - "src": "2287:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3896, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2287:40:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3897, - "nodeType": "EmitStatement", - "src": "2282:45:7" - } - ] - }, - "documentation": null, - "id": 3899, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_burn", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3853, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3852, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3899, - "src": "2027:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3851, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2027:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2026:10:7" - }, - "returnParameters": { - "id": 3854, - "nodeType": "ParameterList", - "parameters": [], - "src": "2046:0:7" - }, - "scope": 3979, - "src": "2012:322:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 3945, - "nodeType": "Block", - "src": "2400:208:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 3913, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3909, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2418:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3911, - "indexExpression": { - "argumentTypes": null, - "id": 3910, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3901, - "src": "2427:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2418:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 3912, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3905, - "src": "2435:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2418:20:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552525f494e53554646494349454e545f42414c", - "id": 3914, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2440:22:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6d886dfa4c52985ff7e07248f8343de807c72a722ad596b432ce38fd268e3469", - "typeString": "literal_string \"ERR_INSUFFICIENT_BAL\"" - }, - "value": "ERR_INSUFFICIENT_BAL" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6d886dfa4c52985ff7e07248f8343de807c72a722ad596b432ce38fd268e3469", - "typeString": "literal_string \"ERR_INSUFFICIENT_BAL\"" - } - ], - "id": 3908, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "2410:7:7", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 3915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2410:53:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3916, - "nodeType": "ExpressionStatement", - "src": "2410:53:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3926, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3917, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2473:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3919, - "indexExpression": { - "argumentTypes": null, - "id": 3918, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3901, - "src": "2482:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2473:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3921, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2494:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3923, - "indexExpression": { - "argumentTypes": null, - "id": 3922, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3901, - "src": "2503:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2494:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3924, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3905, - "src": "2509:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3920, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "2489:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3925, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2489:24:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2473:40:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3927, - "nodeType": "ExpressionStatement", - "src": "2473:40:7" - }, - { - "expression": { - "argumentTypes": null, - "id": 3937, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3928, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2523:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3930, - "indexExpression": { - "argumentTypes": null, - "id": 3929, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3903, - "src": "2532:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2523:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 3932, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "2544:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 3934, - "indexExpression": { - "argumentTypes": null, - "id": 3933, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3903, - "src": "2553:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2544:13:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 3935, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3905, - "src": "2559:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3931, - "name": "badd", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1001, - "src": "2539:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 3936, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2539:24:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2523:40:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 3938, - "nodeType": "ExpressionStatement", - "src": "2523:40:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3940, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3901, - "src": "2587:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3941, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3903, - "src": "2592:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3942, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3905, - "src": "2597:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3939, - "name": "Transfer", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3812, - "src": "2578:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3943, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2578:23:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3944, - "nodeType": "EmitStatement", - "src": "2573:28:7" - } - ] - }, - "documentation": null, - "id": 3946, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_move", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3906, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3901, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 3946, - "src": "2355:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3900, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2355:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3903, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 3946, - "src": "2368:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3902, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2368:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3905, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3946, - "src": "2381:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3904, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2381:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2354:36:7" - }, - "returnParameters": { - "id": 3907, - "nodeType": "ParameterList", - "parameters": [], - "src": "2400:0:7" - }, - "scope": 3979, - "src": "2340:268:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 3961, - "nodeType": "Block", - "src": "2660:46:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3955, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2684:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3954, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2676:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3956, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2676:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3957, - "name": "to", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3948, - "src": "2691:2:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3958, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3950, - "src": "2695:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3953, - "name": "_move", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3946, - "src": "2670:5:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3959, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2670:29:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3960, - "nodeType": "ExpressionStatement", - "src": "2670:29:7" - } - ] - }, - "documentation": null, - "id": 3962, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_push", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3951, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3948, - "name": "to", - "nodeType": "VariableDeclaration", - "scope": 3962, - "src": "2629:10:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3947, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2629:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3950, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3962, - "src": "2641:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3949, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2641:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2628:22:7" - }, - "returnParameters": { - "id": 3952, - "nodeType": "ParameterList", - "parameters": [], - "src": "2660:0:7" - }, - "scope": 3979, - "src": "2614:92:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 3977, - "nodeType": "Block", - "src": "2760:48:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3970, - "name": "from", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3964, - "src": "2776:4:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 3972, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6580, - "src": "2790:4:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - ], - "id": 3971, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2782:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 3973, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2782:13:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 3974, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3966, - "src": "2797:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 3969, - "name": "_move", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3946, - "src": "2770:5:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 3975, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2770:31:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 3976, - "nodeType": "ExpressionStatement", - "src": "2770:31:7" - } - ] - }, - "documentation": null, - "id": 3978, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_pull", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3967, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3964, - "name": "from", - "nodeType": "VariableDeclaration", - "scope": 3978, - "src": "2727:12:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 3963, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2727:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 3966, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 3978, - "src": "2741:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 3965, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2741:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2726:24:7" - }, - "returnParameters": { - "id": 3968, - "nodeType": "ParameterList", - "parameters": [], - "src": "2760:0:7" - }, - "scope": 3979, - "src": "2712:96:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "internal" - } - ], - "scope": 4286, - "src": "1445:1365:7" - }, - { - "baseContracts": [ - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 3980, - "name": "BTokenBase", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 3979, - "src": "2831:10:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_BTokenBase_$3979", - "typeString": "contract BTokenBase" - } - }, - "id": 3981, - "nodeType": "InheritanceSpecifier", - "src": "2831:10:7" - }, - { - "arguments": null, - "baseName": { - "contractScope": null, - "id": 3982, - "name": "IERC20", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 6537, - "src": "2843:6:7", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$6537", - "typeString": "contract IERC20" - } - }, - "id": 3983, - "nodeType": "InheritanceSpecifier", - "src": "2843:6:7" - } - ], - "contractDependencies": [280, 1422, 3979, 6537], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 4285, - "linearizedBaseContracts": [4285, 6537, 3979, 1422, 280], - "name": "BToken", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 3986, - "name": "_name", - "nodeType": "VariableDeclaration", - "scope": 4285, - "src": "2857:49:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string" - }, - "typeName": { - "id": 3984, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2857:6:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "42616c616e63657220506f6f6c20546f6b656e", - "id": 3985, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2885:21:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_86726d210cafef5a97cd8551cc3cd59ead4ad6b4a08f1b0e2ca14d5024839298", - "typeString": "literal_string \"Balancer Pool Token\"" - }, - "value": "Balancer Pool Token" - }, - "visibility": "private" - }, - { - "constant": false, - "id": 3989, - "name": "_symbol", - "nodeType": "VariableDeclaration", - "scope": 4285, - "src": "2912:33:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string" - }, - "typeName": { - "id": 3987, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2912:6:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "425054", - "id": 3988, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2940:5:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2c4469c3871c2223d094ce996c22463935f1f3c0f4a0177add993c1ee46e9606", - "typeString": "literal_string \"BPT\"" - }, - "value": "BPT" - }, - "visibility": "private" - }, - { - "constant": false, - "id": 3992, - "name": "_decimals", - "nodeType": "VariableDeclaration", - "scope": 4285, - "src": "2951:30:7", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 3990, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "2951:5:7", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "3138", - "id": 3991, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2979:2:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_18_by_1", - "typeString": "int_const 18" - }, - "value": "18" - }, - "visibility": "private" - }, - { - "body": { - "id": 3999, - "nodeType": "Block", - "src": "3040:29:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 3997, - "name": "_name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3986, - "src": "3057:5:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "functionReturnParameters": 3996, - "id": 3998, - "nodeType": "Return", - "src": "3050:12:7" - } - ] - }, - "documentation": null, - "id": 4000, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "name", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 3993, - "nodeType": "ParameterList", - "parameters": [], - "src": "3001:2:7" - }, - "returnParameters": { - "id": 3996, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 3995, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4000, - "src": "3025:13:7", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 3994, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "3025:6:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3024:15:7" - }, - "scope": 4285, - "src": "2988:81:7", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4007, - "nodeType": "Block", - "src": "3129:31:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4005, - "name": "_symbol", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3989, - "src": "3146:7:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "functionReturnParameters": 4004, - "id": 4006, - "nodeType": "Return", - "src": "3139:14:7" - } - ] - }, - "documentation": null, - "id": 4008, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "symbol", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4001, - "nodeType": "ParameterList", - "parameters": [], - "src": "3090:2:7" - }, - "returnParameters": { - "id": 4004, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4003, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4008, - "src": "3114:13:7", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 4002, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "3114:6:7", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3113:15:7" - }, - "scope": 4285, - "src": "3075:85:7", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4015, - "nodeType": "Block", - "src": "3213:33:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4013, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3992, - "src": "3230:9:7", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "functionReturnParameters": 4012, - "id": 4014, - "nodeType": "Return", - "src": "3223:16:7" - } - ] - }, - "documentation": null, - "id": 4016, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "decimals", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4009, - "nodeType": "ParameterList", - "parameters": [], - "src": "3183:2:7" - }, - "returnParameters": { - "id": 4012, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4011, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4016, - "src": "3206:5:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 4010, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "3206:5:7", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3205:7:7" - }, - "scope": 4285, - "src": "3166:80:7", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4031, - "nodeType": "Block", - "src": "3326:44:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4025, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3343:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4027, - "indexExpression": { - "argumentTypes": null, - "id": 4026, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4018, - "src": "3354:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3343:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4029, - "indexExpression": { - "argumentTypes": null, - "id": 4028, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4020, - "src": "3359:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3343:20:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4024, - "id": 4030, - "nodeType": "Return", - "src": "3336:27:7" - } - ] - }, - "documentation": null, - "id": 4032, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "allowance", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4021, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4018, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 4032, - "src": "3271:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4017, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3271:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4020, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4032, - "src": "3284:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4019, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3284:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3270:26:7" - }, - "returnParameters": { - "id": 4024, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4023, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4032, - "src": "3320:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4022, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3320:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3319:6:7" - }, - "scope": 4285, - "src": "3252:118:7", - "stateMutability": "view", - "superFunction": 6500, - "visibility": "external" - }, - { - "body": { - "id": 4043, - "nodeType": "Block", - "src": "3438:38:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4039, - "name": "_balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3788, - "src": "3455:8:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4041, - "indexExpression": { - "argumentTypes": null, - "id": 4040, - "name": "whom", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4034, - "src": "3464:4:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3455:14:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4038, - "id": 4042, - "nodeType": "Return", - "src": "3448:21:7" - } - ] - }, - "documentation": null, - "id": 4044, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "balanceOf", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4035, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4034, - "name": "whom", - "nodeType": "VariableDeclaration", - "scope": 4044, - "src": "3395:12:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4033, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3395:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3394:14:7" - }, - "returnParameters": { - "id": 4038, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4037, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4044, - "src": "3432:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4036, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3432:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3431:6:7" - }, - "scope": 4285, - "src": "3376:100:7", - "stateMutability": "view", - "superFunction": 6482, - "visibility": "external" - }, - { - "body": { - "id": 4051, - "nodeType": "Block", - "src": "3532:36:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4049, - "name": "_totalSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3796, - "src": "3549:12:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4048, - "id": 4050, - "nodeType": "Return", - "src": "3542:19:7" - } - ] - }, - "documentation": null, - "id": 4052, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "totalSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4045, - "nodeType": "ParameterList", - "parameters": [], - "src": "3502:2:7" - }, - "returnParameters": { - "id": 4048, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4047, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4052, - "src": "3526:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4046, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3526:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3525:6:7" - }, - "scope": 4285, - "src": "3482:86:7", - "stateMutability": "view", - "superFunction": 6475, - "visibility": "public" - }, - { - "body": { - "id": 4079, - "nodeType": "Block", - "src": "3638:116:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4068, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4061, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3648:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4065, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4062, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3659:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4063, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3659:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3648:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4066, - "indexExpression": { - "argumentTypes": null, - "id": 4064, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4054, - "src": "3671:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3648:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4067, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4056, - "src": "3678:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3648:33:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4069, - "nodeType": "ExpressionStatement", - "src": "3648:33:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4071, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3705:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4072, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3705:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4073, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4054, - "src": "3717:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4074, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4056, - "src": "3722:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4070, - "name": "Approval", - "nodeType": "Identifier", - "overloadedDeclarations": [6536], - "referencedDeclaration": 6536, - "src": "3696:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4075, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3696:30:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4076, - "nodeType": "EmitStatement", - "src": "3691:35:7" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4077, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3743:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4060, - "id": 4078, - "nodeType": "Return", - "src": "3736:11:7" - } - ] - }, - "documentation": null, - "id": 4080, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "approve", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4057, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4054, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4080, - "src": "3591:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4053, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3591:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4056, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4080, - "src": "3604:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4055, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3604:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3590:23:7" - }, - "returnParameters": { - "id": 4060, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4059, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4080, - "src": "3632:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4058, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3632:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3631:6:7" - }, - "scope": 4285, - "src": "3574:180:7", - "stateMutability": "nonpayable", - "superFunction": 6509, - "visibility": "external" - }, - { - "body": { - "id": 4120, - "nodeType": "Block", - "src": "3833:175:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4104, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4089, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3843:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4093, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4090, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3854:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4091, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3854:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3843:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4094, - "indexExpression": { - "argumentTypes": null, - "id": 4092, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4082, - "src": "3866:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3843:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4096, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3878:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4099, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4097, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3889:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4098, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3889:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3878:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4101, - "indexExpression": { - "argumentTypes": null, - "id": 4100, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4082, - "src": "3901:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3878:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 4102, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4084, - "src": "3907:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4095, - "name": "badd", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1001, - "src": "3873:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4103, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3873:38:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3843:68:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4105, - "nodeType": "ExpressionStatement", - "src": "3843:68:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4107, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3935:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4108, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3935:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4109, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4082, - "src": "3947:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4110, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "3952:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4113, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4111, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "3963:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4112, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3963:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3952:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4115, - "indexExpression": { - "argumentTypes": null, - "id": 4114, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4082, - "src": "3975:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3952:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4106, - "name": "Approval", - "nodeType": "Identifier", - "overloadedDeclarations": [6536], - "referencedDeclaration": 6536, - "src": "3926:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4116, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3926:54:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4117, - "nodeType": "EmitStatement", - "src": "3921:59:7" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4118, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3997:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4088, - "id": 4119, - "nodeType": "Return", - "src": "3990:11:7" - } - ] - }, - "documentation": null, - "id": 4121, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "increaseApproval", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4085, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4082, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4121, - "src": "3786:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4081, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3786:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4084, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4121, - "src": "3799:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4083, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3799:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3785:23:7" - }, - "returnParameters": { - "id": 4088, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4087, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4121, - "src": "3827:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4086, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "3827:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3826:6:7" - }, - "scope": 4285, - "src": "3760:248:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4180, - "nodeType": "Block", - "src": "4087:315:7", - "statements": [ - { - "assignments": [4131], - "declarations": [ - { - "constant": false, - "id": 4131, - "name": "oldValue", - "nodeType": "VariableDeclaration", - "scope": 4180, - "src": "4097:13:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4130, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4097:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4138, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4132, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4113:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4135, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4133, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4124:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4134, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4124:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4113:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4137, - "indexExpression": { - "argumentTypes": null, - "id": 4136, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4136:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4113:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4097:43:7" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4141, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4139, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4125, - "src": "4154:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 4140, - "name": "oldValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4131, - "src": "4160:8:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4154:14:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 4164, - "nodeType": "Block", - "src": "4232:74:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4152, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4246:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4156, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4153, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4257:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4154, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4257:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4246:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4157, - "indexExpression": { - "argumentTypes": null, - "id": 4155, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4269:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4246:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4159, - "name": "oldValue", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4131, - "src": "4281:8:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 4160, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4125, - "src": "4291:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4158, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "4276:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4276:19:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4246:49:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4163, - "nodeType": "ExpressionStatement", - "src": "4246:49:7" - } - ] - }, - "id": 4165, - "nodeType": "IfStatement", - "src": "4150:156:7", - "trueBody": { - "id": 4151, - "nodeType": "Block", - "src": "4170:56:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4149, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4142, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4184:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4146, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4143, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4195:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4144, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4195:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4184:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4147, - "indexExpression": { - "argumentTypes": null, - "id": 4145, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4207:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4184:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 4148, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4214:1:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4184:31:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4150, - "nodeType": "ExpressionStatement", - "src": "4184:31:7" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4167, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4329:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4168, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4329:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4169, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4341:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4170, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4346:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4173, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4171, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4357:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4172, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4357:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4346:22:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4175, - "indexExpression": { - "argumentTypes": null, - "id": 4174, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4123, - "src": "4369:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4346:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4166, - "name": "Approval", - "nodeType": "Identifier", - "overloadedDeclarations": [6536], - "referencedDeclaration": 6536, - "src": "4320:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4176, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4320:54:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4177, - "nodeType": "EmitStatement", - "src": "4315:59:7" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4178, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4391:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4129, - "id": 4179, - "nodeType": "Return", - "src": "4384:11:7" - } - ] - }, - "documentation": null, - "id": 4181, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "decreaseApproval", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4126, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4123, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4181, - "src": "4040:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4122, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4040:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4125, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4181, - "src": "4053:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4124, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4053:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4039:23:7" - }, - "returnParameters": { - "id": 4129, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4128, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4181, - "src": "4081:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4127, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4081:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4080:6:7" - }, - "scope": 4285, - "src": "4014:388:7", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4199, - "nodeType": "Block", - "src": "4473:65:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4191, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4489:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4192, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4489:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4193, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4183, - "src": "4501:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4194, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4185, - "src": "4506:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4190, - "name": "_move", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3946, - "src": "4483:5:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4195, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4483:27:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4196, - "nodeType": "ExpressionStatement", - "src": "4483:27:7" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4197, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4527:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4189, - "id": 4198, - "nodeType": "Return", - "src": "4520:11:7" - } - ] - }, - "documentation": null, - "id": 4200, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "transfer", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4186, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4183, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4200, - "src": "4426:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4182, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4426:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4185, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4200, - "src": "4439:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4184, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4439:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4425:23:7" - }, - "returnParameters": { - "id": 4189, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4188, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4200, - "src": "4467:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4187, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4467:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4466:6:7" - }, - "scope": 4285, - "src": "4408:130:7", - "stateMutability": "nonpayable", - "superFunction": 6491, - "visibility": "external" - }, - { - "body": { - "id": 4283, - "nodeType": "Block", - "src": "4673:436:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4224, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4215, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4212, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4704:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4213, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4704:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 4214, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4718:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "4704:17:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4223, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4216, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4206, - "src": "4725:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4217, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4732:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4219, - "indexExpression": { - "argumentTypes": null, - "id": 4218, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4743:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4732:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4222, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4220, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4748:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4221, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4748:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4732:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4725:34:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "4704:55:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552525f42544f4b454e5f4241445f43414c4c4552", - "id": 4225, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4774:23:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7c78c5c07128d4fb2c83ecfae573652cc351a44f64cf0f454240bdf4749e318c", - "typeString": "literal_string \"ERR_BTOKEN_BAD_CALLER\"" - }, - "value": "ERR_BTOKEN_BAD_CALLER" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7c78c5c07128d4fb2c83ecfae573652cc351a44f64cf0f454240bdf4749e318c", - "typeString": "literal_string \"ERR_BTOKEN_BAD_CALLER\"" - } - ], - "id": 4211, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6555, 6556], - "referencedDeclaration": 6556, - "src": "4683:7:7", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4226, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4683:124:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4227, - "nodeType": "ExpressionStatement", - "src": "4683:124:7" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4229, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4823:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4230, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4204, - "src": "4828:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4231, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4206, - "src": "4833:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4228, - "name": "_move", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3946, - "src": "4817:5:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4232, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4817:20:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4233, - "nodeType": "ExpressionStatement", - "src": "4817:20:7" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4237, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4234, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4851:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4235, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4851:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "id": 4236, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4865:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "4851:17:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4238, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4872:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4240, - "indexExpression": { - "argumentTypes": null, - "id": 4239, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4883:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4872:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4243, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4241, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4888:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4242, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4888:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4872:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4246, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "4911:2:7", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 4245, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4912:1:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_minus_1_by_1", - "typeString": "int_const -1" - } - ], - "id": 4244, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4903:7:7", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint256" - }, - "id": 4247, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4903:11:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4872:42:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "4851:63:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 4280, - "nodeType": "IfStatement", - "src": "4847:235:7", - "trueBody": { - "id": 4279, - "nodeType": "Block", - "src": "4916:166:7", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4265, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4250, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4930:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4254, - "indexExpression": { - "argumentTypes": null, - "id": 4251, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4941:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4930:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4255, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4252, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4946:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4946:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4930:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4257, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "4965:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4259, - "indexExpression": { - "argumentTypes": null, - "id": 4258, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "4976:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4965:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4262, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4260, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "4981:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4981:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4965:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 4263, - "name": "amt", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4206, - "src": "4994:3:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4256, - "name": "bsub", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1028, - "src": "4960:4:7", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4960:38:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4930:68:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4266, - "nodeType": "ExpressionStatement", - "src": "4930:68:7" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4268, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "5026:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5026:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4270, - "name": "dst", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4204, - "src": "5038:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4271, - "name": "_allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3794, - "src": "5043:10:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 4273, - "indexExpression": { - "argumentTypes": null, - "id": 4272, - "name": "src", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4202, - "src": "5054:3:7", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5043:15:7", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 4276, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4274, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6552, - "src": "5059:3:7", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4275, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5059:10:7", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5043:27:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4267, - "name": "Approval", - "nodeType": "Identifier", - "overloadedDeclarations": [6536], - "referencedDeclaration": 6536, - "src": "5017:8:7", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4277, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5017:54:7", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4278, - "nodeType": "EmitStatement", - "src": "5012:59:7" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4281, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5098:4:7", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 4210, - "id": 4282, - "nodeType": "Return", - "src": "5091:11:7" - } - ] - }, - "documentation": null, - "id": 4284, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "transferFrom", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4207, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4202, - "name": "src", - "nodeType": "VariableDeclaration", - "scope": 4284, - "src": "4575:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4201, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4575:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4204, - "name": "dst", - "nodeType": "VariableDeclaration", - "scope": 4284, - "src": "4597:11:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4203, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4597:7:7", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4206, - "name": "amt", - "nodeType": "VariableDeclaration", - "scope": 4284, - "src": "4619:8:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4205, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4619:4:7", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4565:68:7" - }, - "returnParameters": { - "id": 4210, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4209, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4284, - "src": "4662:4:7", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4208, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4662:4:7", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4661:6:7" - }, - "scope": 4285, - "src": "4544:565:7", - "stateMutability": "nonpayable", - "superFunction": 6520, - "visibility": "external" - } - ], - "scope": 4286, - "src": "2812:2299:7" - } - ], - "src": "643:4469:7" - }, - "compiler": { - "name": "solc", - "version": "0.5.7+commit.6da8b019.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.2.4", - "updatedAt": "2020-10-22T12:03:05.101Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} diff --git a/abis/DTFactory.json b/abis/DTFactory.json deleted file mode 100644 index 4d71b15..0000000 --- a/abis/DTFactory.json +++ /dev/null @@ -1,4527 +0,0 @@ -{ - "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\":\"0x60ebf25d36c0ee9d310c74eda954a474b0d867f23f57d3b8923d9ee7cc313dcc\",\"urls\":[\"bzzr://81ebb3c5acb99bc74b4bd7ee9897282cb2c983344195645cec8bc2e642680c53\"]}},\"version\":1}", - "bytecode": "0x6080604052600160025534801561001557600080fd5b50604051604080610a278339810180604052604081101561003557600080fd5b508051602090910151600160a060020a0382161580159061005e5750600160a060020a03811615155b6100b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260418152602001806109e66041913960600191505060405180910390fd5b60008054600160a060020a03938416600160a060020a031991821617909155600180549290931691161790556108f8806100ee6000396000f3fe608060405234801561001057600080fd5b506004361061005d577c01000000000000000000000000000000000000000000000000000000006000350463490aad768114610062578063c6cf868a14610086578063efbe8fd1146100a0575b600080fd5b61006a610256565b60408051600160a060020a039092168252519081900360200190f35b61008e610265565b60408051918252519081900360200190f35b61006a600480360360808110156100b657600080fd5b8101906020810181356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184600183028401116401000000008311171561010557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561015857600080fd5b82018360208201111561016a57600080fd5b8035906020019184600183028401116401000000008311171561018c57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101df57600080fd5b8201836020820111156101f157600080fd5b8035906020019184600183028401116401000000008311171561021357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061026b915050565b600054600160a060020a031690565b60025490565b6000816102c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806108716022913960400191505060405180910390fd5b6000546102d890600160a060020a0316610791565b9050600160a060020a038116610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180610893603a913960400191505060405180910390fd5b6001546040517f9070d2f8000000000000000000000000000000000000000000000000000000008152336044820181905260648201859052600160a060020a0392831660a4830181905260c060048401908152885160c485015288518695861694639070d2f8948b948b9491938b938f939182916024810191608482019160e4019060208c019080838360005b838110156103de5781810151838201526020016103c6565b50505050905090810190601f16801561040b5780820380516001836020036101000a031916815260200191505b5084810383528951815289516020918201918b019080838360005b8381101561043e578181015183820152602001610426565b50505050905090810190601f16801561046b5780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b8381101561049e578181015183820152602001610486565b50505050905090810190601f1680156104cb5780820380516001836020036101000a031916815260200191505b509950505050505050505050602060405180830381600087803b1580156104f157600080fd5b505af1158015610505573d6000803e3d6000fd5b505050506040513d602081101561051b57600080fd5b5051610572576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180610843602e913960400191505060405180910390fd5b846040518082805190602001908083835b602083106105a25780518252601f199092019160209182019101610583565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822060008054919550600160a060020a039182169450908716927fb51c8cbe199ffe8b0d1d39b62d473569750653cb18b165f77ae423b3900180ad9250a4856040518082805190602001908083835b602083106106365780518252601f199092019160209182019101610617565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902033600160a060020a031683600160a060020a03167f437e99a69c634128e67a85656b80d03b028ba37525b15070606e5c28e846984a888888604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156106e25781810151838201526020016106ca565b50505050905090810190601f16801561070f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561074257818101518382015260200161072a565b50505050905090810190601f16801561076f5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a450600280546001019055949350505050565b6040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081526c010000000000000000000000008202601482018190527f5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000602883015260009160378184f060408051600160a060020a038316815290519194507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c925081900360200190a15091905056fe4454466163746f72793a20556e61626c6520746f20696e697469616c697a6520746f6b656e20696e7374616e63654454466163746f72793a207a65726f20636170206973206e6f7420616c6c6f7765644454466163746f72793a204661696c656420746f20706572666f726d206d696e696d616c206465706c6f79206f662061206e657720746f6b656ea165627a7a723058207fab3b4520813dad84cc05df6fc8f694d4a0cbcd831c90ebd338ba1ec484046700294454466163746f72793a20496e76616c69642074656d706c61746520746f6b656e2f636f6d6d756e6974792066656520636f6c6c6563746f722061646472657373", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061005d577c01000000000000000000000000000000000000000000000000000000006000350463490aad768114610062578063c6cf868a14610086578063efbe8fd1146100a0575b600080fd5b61006a610256565b60408051600160a060020a039092168252519081900360200190f35b61008e610265565b60408051918252519081900360200190f35b61006a600480360360808110156100b657600080fd5b8101906020810181356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184600183028401116401000000008311171561010557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561015857600080fd5b82018360208201111561016a57600080fd5b8035906020019184600183028401116401000000008311171561018c57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101df57600080fd5b8201836020820111156101f157600080fd5b8035906020019184600183028401116401000000008311171561021357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061026b915050565b600054600160a060020a031690565b60025490565b6000816102c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806108716022913960400191505060405180910390fd5b6000546102d890600160a060020a0316610791565b9050600160a060020a038116610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603a815260200180610893603a913960400191505060405180910390fd5b6001546040517f9070d2f8000000000000000000000000000000000000000000000000000000008152336044820181905260648201859052600160a060020a0392831660a4830181905260c060048401908152885160c485015288518695861694639070d2f8948b948b9491938b938f939182916024810191608482019160e4019060208c019080838360005b838110156103de5781810151838201526020016103c6565b50505050905090810190601f16801561040b5780820380516001836020036101000a031916815260200191505b5084810383528951815289516020918201918b019080838360005b8381101561043e578181015183820152602001610426565b50505050905090810190601f16801561046b5780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b8381101561049e578181015183820152602001610486565b50505050905090810190601f1680156104cb5780820380516001836020036101000a031916815260200191505b509950505050505050505050602060405180830381600087803b1580156104f157600080fd5b505af1158015610505573d6000803e3d6000fd5b505050506040513d602081101561051b57600080fd5b5051610572576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180610843602e913960400191505060405180910390fd5b846040518082805190602001908083835b602083106105a25780518252601f199092019160209182019101610583565b5181516020939093036101000a60001901801990911692169190911790526040519201829003822060008054919550600160a060020a039182169450908716927fb51c8cbe199ffe8b0d1d39b62d473569750653cb18b165f77ae423b3900180ad9250a4856040518082805190602001908083835b602083106106365780518252601f199092019160209182019101610617565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902033600160a060020a031683600160a060020a03167f437e99a69c634128e67a85656b80d03b028ba37525b15070606e5c28e846984a888888604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156106e25781810151838201526020016106ca565b50505050905090810190601f16801561070f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561074257818101518382015260200161072a565b50505050905090810190601f16801561076f5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a450600280546001019055949350505050565b6040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081526c010000000000000000000000008202601482018190527f5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000602883015260009160378184f060408051600160a060020a038316815290519194507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c925081900360200190a15091905056fe4454466163746f72793a20556e61626c6520746f20696e697469616c697a6520746f6b656e20696e7374616e63654454466163746f72793a207a65726f20636170206973206e6f7420616c6c6f7765644454466163746f72793a204661696c656420746f20706572666f726d206d696e696d616c206465706c6f79206f662061206e657720746f6b656ea165627a7a723058207fab3b4520813dad84cc05df6fc8f694d4a0cbcd831c90ebd338ba1ec48404670029", - "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] - }, - "id": 159, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": ["solidity", "0.5", ".7"], - "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], - "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], - "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], - "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], - "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], - "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], - "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], - "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] - }, - "id": 159, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": ["solidity", "0.5", ".7"], - "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], - "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], - "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], - "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], - "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], - "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], - "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], - "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": {} - } -} diff --git a/abis/DataTokenTemplate.json b/abis/DataTokenTemplate.json deleted file mode 100644 index 38e4d8f..0000000 --- a/abis/DataTokenTemplate.json +++ /dev/null @@ -1,679 +0,0 @@ -[ - { - "constant": false, - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "sender", - "type": "address" - }, - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BASE_MARKET_FEE_PERCENTAGE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "spender", - "type": "address" - }, - { - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "recipient", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BASE_COMMUNITY_FEE_PERCENTAGE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "owner", - "type": "address" - }, - { - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "BASE", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "name", - "type": "string" - }, - { - "name": "symbol", - "type": "string" - }, - { - "name": "minterAddress", - "type": "address" - }, - { - "name": "cap", - "type": "uint256" - }, - { - "name": "blob", - "type": "string" - }, - { - "name": "feeCollector", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "consumer", - "type": "address" - }, - { - "indexed": true, - "name": "payer", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "serviceId", - "type": "uint256" - }, - { - "indexed": false, - "name": "timestamp", - "type": "uint256" - }, - { - "indexed": true, - "name": "mrktFeeCollector", - "type": "address" - }, - { - "indexed": false, - "name": "marketFee", - "type": "uint256" - } - ], - "name": "OrderStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "orderTxId", - "type": "bytes32" - }, - { - "indexed": true, - "name": "consumer", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "name": "serviceId", - "type": "uint256" - }, - { - "indexed": true, - "name": "provider", - "type": "address" - }, - { - "indexed": false, - "name": "timestamp", - "type": "uint256" - } - ], - "name": "OrderFinished", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "currentMinter", - "type": "address" - }, - { - "indexed": false, - "name": "newMinter", - "type": "address" - } - ], - "name": "MinterProposed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "currentMinter", - "type": "address" - }, - { - "indexed": false, - "name": "newMinter", - "type": "address" - } - ], - "name": "MinterApproved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "name", - "type": "string" - }, - { - "name": "symbol", - "type": "string" - }, - { - "name": "minterAddress", - "type": "address" - }, - { - "name": "cap", - "type": "uint256" - }, - { - "name": "blob", - "type": "string" - }, - { - "name": "feeCollector", - "type": "address" - } - ], - "name": "initialize", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "account", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "consumer", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - }, - { - "name": "serviceId", - "type": "uint256" - }, - { - "name": "mrktFeeCollector", - "type": "address" - } - ], - "name": "startOrder", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "orderTxId", - "type": "bytes32" - }, - { - "name": "consumer", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - }, - { - "name": "serviceId", - "type": "uint256" - } - ], - "name": "finishOrder", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "newMinter", - "type": "address" - } - ], - "name": "proposeMinter", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "approveMinter", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "blob", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "cap", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "account", - "type": "address" - } - ], - "name": "isMinter", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "minter", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "isInitialized", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "amount", - "type": "uint256" - }, - { - "name": "feePercentage", - "type": "uint256" - } - ], - "name": "calculateFee", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - } -] diff --git a/abis/Dispenser.json b/abis/Dispenser.json deleted file mode 100644 index 5955c72..0000000 --- a/abis/Dispenser.json +++ /dev/null @@ -1,17468 +0,0 @@ -{ - "contractName": "Dispenser", - "abi": [ - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "datatokensList", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "payable": true, - "stateMutability": "payable", - "type": "fallback" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "datatokenAddress", - "type": "address" - } - ], - "name": "Activated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "datatokenAddress", - "type": "address" - } - ], - "name": "Deactivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "datatokenAddress", - "type": "address" - } - ], - "name": "AcceptedMinter", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "datatokenAddress", - "type": "address" - } - ], - "name": "RemovedMinter", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "datatokenAddress", - "type": "address" - }, - { - "indexed": true, - "name": "userAddress", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - } - ], - "name": "TokensDispensed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "datatoken", - "type": "address" - }, - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "name": "amount", - "type": "uint256" - } - ], - "name": "OwnerWithdrawed", - "type": "event" - }, - { - "constant": true, - "inputs": [ - { - "name": "datatoken", - "type": "address" - } - ], - "name": "status", - "outputs": [ - { - "name": "active", - "type": "bool" - }, - { - "name": "owner", - "type": "address" - }, - { - "name": "minterApproved", - "type": "bool" - }, - { - "name": "isTrueMinter", - "type": "bool" - }, - { - "name": "maxTokens", - "type": "uint256" - }, - { - "name": "maxBalance", - "type": "uint256" - }, - { - "name": "balance", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "datatoken", - "type": "address" - }, - { - "name": "maxTokens", - "type": "uint256" - }, - { - "name": "maxBalance", - "type": "uint256" - } - ], - "name": "activate", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "datatoken", - "type": "address" - } - ], - "name": "deactivate", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "datatoken", - "type": "address" - } - ], - "name": "acceptMinter", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "datatoken", - "type": "address" - } - ], - "name": "removeMinter", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "datatoken", - "type": "address" - }, - { - "name": "amount", - "type": "uint256" - } - ], - "name": "dispense", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "datatoken", - "type": "address" - } - ], - "name": "ownerWithdraw", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.7+commit.6da8b019\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"datatoken\",\"type\":\"address\"}],\"name\":\"removeMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"datatokensList\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"datatoken\",\"type\":\"address\"}],\"name\":\"deactivate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"datatoken\",\"type\":\"address\"}],\"name\":\"status\",\"outputs\":[{\"name\":\"active\",\"type\":\"bool\"},{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"minterApproved\",\"type\":\"bool\"},{\"name\":\"isTrueMinter\",\"type\":\"bool\"},{\"name\":\"maxTokens\",\"type\":\"uint256\"},{\"name\":\"maxBalance\",\"type\":\"uint256\"},{\"name\":\"balance\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"datatoken\",\"type\":\"address\"},{\"name\":\"maxTokens\",\"type\":\"uint256\"},{\"name\":\"maxBalance\",\"type\":\"uint256\"}],\"name\":\"activate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"datatoken\",\"type\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"dispense\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"datatoken\",\"type\":\"address\"}],\"name\":\"acceptMinter\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"datatoken\",\"type\":\"address\"}],\"name\":\"ownerWithdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"datatokenAddress\",\"type\":\"address\"}],\"name\":\"Activated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"datatokenAddress\",\"type\":\"address\"}],\"name\":\"Deactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"datatokenAddress\",\"type\":\"address\"}],\"name\":\"AcceptedMinter\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"datatokenAddress\",\"type\":\"address\"}],\"name\":\"RemovedMinter\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"datatokenAddress\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"userAddress\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"TokensDispensed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"datatoken\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"OwnerWithdrawed\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"acceptMinter(address)\":{\"details\":\"acceptMinter Accepts Minter role (existing datatoken minter has to call datatoken.proposeMinter(dispenserAddress) first)\",\"params\":{\"datatoken\":\"refers to datatoken address.\"}},\"activate(address,uint256,uint256)\":{\"details\":\"activate Activate a new dispenser\",\"params\":{\"datatoken\":\"refers to datatoken address.\",\"maxBalance\":\"- max balance of requester.\",\"maxTokens\":\"- max tokens to dispense\"}},\"deactivate(address)\":{\"details\":\"deactivate Deactivate an existing dispenser\",\"params\":{\"datatoken\":\"refers to datatoken address.\"}},\"dispense(address,uint256)\":{\"details\":\"dispense Dispense datatokens to caller. The dispenser must be active, hold enough DT (or be able to mint more) and respect maxTokens/maxBalance requirements\",\"params\":{\"datatoken\":\"amount of datatokens required.\"}},\"ownerWithdraw(address)\":{\"details\":\"ownerWithdraw Allow owner to withdraw all datatokens in this dispenser balance\",\"params\":{\"datatoken\":\"refers to datatoken address.\"}},\"removeMinter(address)\":{\"details\":\"removeMinter Removes Minter role and proposes the owner as a new minter (the owner has to call approveMinter after this)\",\"params\":{\"datatoken\":\"refers to datatoken address.\"}},\"status(address)\":{\"details\":\"status Get information about a datatoken dispenser\",\"params\":{\"datatoken\":\"refers to datatoken address.\"},\"return\":\"active - if the dispenser is active for this datatokenowner - owner of this dispenserminterApproved - if the dispenser is a minter for this datatokenisTrueMinter - check the datatoken contract if this contract is really a mintermaxTokens - max tokens to dispensemaxBalance - max balance of requester. If the balance is higher, the dispense is rejectedbalance - internal balance of the contract (if any)\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/ahmedali/Desktop/work/ocean/contracts/contracts/dispenser/Dispenser.sol\":\"Dispenser\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/ahmedali/Desktop/work/ocean/contracts/contracts/dispenser/Dispenser.sol\":{\"keccak256\":\"0x6acf943424d35f94f558e980af605acbee444243f64a79f9a6d7c8e49e6ae2c7\",\"urls\":[\"bzzr://76b4928f491fbabfe0f0f9b235f3bc5ebef8ac4476ce01aa934d1b8dd36d1a4b\"]},\"/Users/ahmedali/Desktop/work/ocean/contracts/contracts/interfaces/IERC20Template.sol\":{\"keccak256\":\"0x022ebed2ba4949e96a05cc394cf690d8fd3190a4733cebe8cbe930ac25cfde18\",\"urls\":[\"bzzr://2fa3d5cae14f0af7d78f6e1d13bc41854082c03ab2f86462ebb09afda88ee6e9\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50611491806100206000396000f3fe608060405260043610610098576000357c010000000000000000000000000000000000000000000000000000000090048063938d71d01161006b578063938d71d0146101bb578063bef54a5e146101fa578063efa0ac4314610226578063f9bfaa7d1461025957610098565b80633092afd51461009a5780633398086a146100cd5780633ea053eb14610113578063645b8b1b14610146575b005b3480156100a657600080fd5b50610098600480360360208110156100bd57600080fd5b5035600160a060020a031661028c565b3480156100d957600080fd5b506100f7600480360360208110156100f057600080fd5b5035610508565b60408051600160a060020a039092168252519081900360200190f35b34801561011f57600080fd5b506100986004803603602081101561013657600080fd5b5035600160a060020a031661052f565b34801561015257600080fd5b506101796004803603602081101561016957600080fd5b5035600160a060020a031661063a565b604080519715158852600160a060020a039096166020880152931515868601529115156060860152608085015260a084015260c0830152519081900360e00190f35b3480156101c757600080fd5b50610098600480360360608110156101de57600080fd5b50600160a060020a0381351690602081013590604001356107dd565b6100986004803603604081101561021057600080fd5b50600160a060020a038135169060200135610a5d565b34801561023257600080fd5b506100986004803603602081101561024957600080fd5b5035600160a060020a0316611003565b34801561026557600080fd5b506100986004803603602081101561027c57600080fd5b5035600160a060020a0316611203565b600160a060020a0381166102d8576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a03818116600090815260208190526040902054610100900416331461034e576040805160e560020a62461bcd02815260206004820152601b60248201527f44617461546f6b656e20616c7265616479206163746976617465640000000000604482015290519081900360640190fd5b6040805160e160020a6355138f0d02815230600482015290518291600160a060020a0383169163aa271e1a91602480820192602092909190829003018186803b15801561039a57600080fd5b505afa1580156103ae573d6000803e3d6000fd5b505050506040513d60208110156103c457600080fd5b505161041a576040805160e560020a62461bcd02815260206004820152601e60248201527f4552523a2043616e6e6f7420616363657074206d696e74657220726f6c650000604482015290519081900360640190fd5b600160a060020a038281166000908152602081905260408082205481517f50d2fcc4000000000000000000000000000000000000000000000000000000008152610100909104841660048201529051928416926350d2fcc49260248084019391929182900301818387803b15801561049157600080fd5b505af11580156104a5573d6000803e3d6000fd5b50505050600160a060020a038216600081815260208190526040808220805475ff00000000000000000000000000000000000000000019169055517fc93cfdd5d8f442c448a02ed11ccff64355643272c9f2be94b723f2181af1a8969190a25050565b6001818154811061051557fe5b600091825260209091200154600160a060020a0316905081565b600160a060020a03811661057b576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a0381811660009081526020819052604090205461010090041633146105f1576040805160e560020a62461bcd02815260206004820152601b60248201527f44617461546f6b656e20616c7265616479206163746976617465640000000000604482015290519081900360640190fd5b600160a060020a038116600081815260208190526040808220805460ff19169055517f749cb6b4c510bc468cf6b9c2086d6f0a54d6b18e25d37bf3200e68eab0880c009190a250565b6000808080808080600160a060020a03881661068e576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a038089166000818152602081815260409182902080546001820154600290920154845160e060020a6370a08231028152306004820152945160ff8084169f5061010084049098169d5075010000000000000000000000000000000000000000009092049096169a509097509395508b936370a08231926024808201939291829003018186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d602081101561075157600080fd5b50516040805160e160020a6355138f0d0281523060048201529051919350600160a060020a0383169163aa271e1a91602480820192602092909190829003018186803b1580156107a057600080fd5b505afa1580156107b4573d6000803e3d6000fd5b505050506040513d60208110156107ca57600080fd5b5051979996985094969592945090925090565b600160a060020a038316610829576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a0383811660009081526020819052604090205461010090041615806108735750600160a060020a0383811660009081526020819052604090205461010090041633145b6108c7576040805160e560020a62461bcd02815260206004820152601b60248201527f44617461546f6b656e20616c7265616479206163746976617465640000000000604482015290519081900360640190fd5b6040805160e160020a6355138f0d02815233600482015290518491600160a060020a0383169163aa271e1a91602480820192602092909190829003018186803b15801561091357600080fd5b505afa158015610927573d6000803e3d6000fd5b505050506040513d602081101561093d57600080fd5b505161097d5760405160e560020a62461bcd0281526004018080602001828103825260248152602001806114226024913960400191505060405180910390fd5b600160a060020a038416600081815260208190526040808220805460018083018990556002830188905560ff19909116811774ffffffffffffffffffffffffffffffffffffffff00191661010033021775ff0000000000000000000000000000000000000000001916909155805480820182559083527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff191684179055517f0cc43938d137e7efade6a531f663e78c1fc75257b0d65ffda2fdaf70cb49cdf99190a250505050565b600160a060020a038216610aa9576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a03821660009081526020819052604090205460ff161515600114610b1e576040805160e560020a62461bcd02815260206004820152601460248201527f44697370656e736572206e6f7420616374697665000000000000000000000000604482015290519081900360640190fd5b60008111610b76576040805160e560020a62461bcd02815260206004820152601360248201527f496e76616c6964207a65726f20616d6f756e7400000000000000000000000000604482015290519081900360640190fd5b600160a060020a038216600090815260208190526040902060010154811115610be9576040805160e560020a62461bcd02815260206004820152600f60248201527f416d6f756e7420746f6f20686967680000000000000000000000000000000000604482015290519081900360640190fd5b6040805160e060020a6370a0823102815233600482015290518391600091600160a060020a038416916370a08231916024808301926020929190829003018186803b158015610c3757600080fd5b505afa158015610c4b573d6000803e3d6000fd5b505050506040513d6020811015610c6157600080fd5b5051600160a060020a0385166000908152602081905260409020600201549091508110610cd8576040805160e560020a62461bcd02815260206004820152601760248201527f43616c6c65722062616c616e636520746f6f2068696768000000000000000000604482015290519081900360640190fd5b6040805160e060020a6370a082310281523060048201529051600091600160a060020a038516916370a0823191602480820192602092909190829003018186803b158015610d2557600080fd5b505afa158015610d39573d6000803e3d6000fd5b505050506040513d6020811015610d4f57600080fd5b505190508381108015610dd357506040805160e160020a6355138f0d0281523060048201529051600160a060020a0385169163aa271e1a916024808301926020929190829003018186803b158015610da657600080fd5b505afa158015610dba573d6000803e3d6000fd5b505050506040513d6020811015610dd057600080fd5b50515b15610ed057604080517f40c10f1900000000000000000000000000000000000000000000000000000000815230600482015282860360248201529051600160a060020a038516916340c10f1991604480830192600092919082900301818387803b158015610e4057600080fd5b505af1158015610e54573d6000803e3d6000fd5b50506040805160e060020a6370a082310281523060048201529051600160a060020a03871693506370a0823192506024808301926020929190829003018186803b158015610ea157600080fd5b505afa158015610eb5573d6000803e3d6000fd5b505050506040513d6020811015610ecb57600080fd5b505190505b83811015610f28576040805160e560020a62461bcd02815260206004820152601360248201527f4e6f7420656e6f75676820726573657276657300000000000000000000000000604482015290519081900360640190fd5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018690529051600160a060020a0385169163a9059cbb9160448083019260209291908290030181600087803b158015610f9057600080fd5b505af1158015610fa4573d6000803e3d6000fd5b505050506040513d6020811015610fba57600080fd5b50506040805185815290513391600160a060020a038816917f63e223ff524bd93d4cbff98ef34405b39f63ded87f5a8d85e39ccda966f135439181900360200190a35050505050565b600160a060020a03811661104f576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600081905080600160a060020a031663eb40024b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1580156110ab57600080fd5b505af11580156110bf573d6000803e3d6000fd5b50506040805160e160020a6355138f0d0281523060048201529051600160a060020a038516935063aa271e1a92506024808301926020929190829003018186803b15801561110c57600080fd5b505afa158015611120573d6000803e3d6000fd5b505050506040513d602081101561113657600080fd5b505161118c576040805160e560020a62461bcd02815260206004820152601e60248201527f4552523a2043616e6e6f7420616363657074206d696e74657220726f6c650000604482015290519081900360640190fd5b600160a060020a038216600081815260208190526040808220805475ff00000000000000000000000000000000000000000019167501000000000000000000000000000000000000000000179055517ffef43e73eccfaf6e7c8c743baaa69fc51e375d972142bee1ffa6ee98f28339e99190a25050565b600160a060020a03811661124f576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a0381811660009081526020819052604090205461010090041633146112c5576040805160e560020a62461bcd02815260206004820152600d60248201527f496e76616c6964206f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160e060020a6370a0823102815230600482015290518291600091600160a060020a038416916370a08231916024808301926020929190829003018186803b15801561131357600080fd5b505afa158015611327573d6000803e3d6000fd5b505050506040513d602081101561133d57600080fd5b50519050801561141c57604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051600160a060020a0384169163a9059cbb9160448083019260209291908290030181600087803b1580156113af57600080fd5b505af11580156113c3573d6000803e3d6000fd5b505050506040513d60208110156113d957600080fd5b50506040805182815290513391600160a060020a038616917f03185212530fcdce6b38fbf62ed27ab29b1b047f59b76b17401388a70a95f41b9181900360200190a35b50505056fe53656e64657220646f6573206e6f74206861766520746865206d696e74657220726f6c65496e76616c696420746f6b656e20636f6e747261637420616464726573730000a165627a7a72305820912566faae5bbd326f1ceefce2069e2d2206f629febcbb8ea833de618c7c9d2e0029", - "deployedBytecode": "0x608060405260043610610098576000357c010000000000000000000000000000000000000000000000000000000090048063938d71d01161006b578063938d71d0146101bb578063bef54a5e146101fa578063efa0ac4314610226578063f9bfaa7d1461025957610098565b80633092afd51461009a5780633398086a146100cd5780633ea053eb14610113578063645b8b1b14610146575b005b3480156100a657600080fd5b50610098600480360360208110156100bd57600080fd5b5035600160a060020a031661028c565b3480156100d957600080fd5b506100f7600480360360208110156100f057600080fd5b5035610508565b60408051600160a060020a039092168252519081900360200190f35b34801561011f57600080fd5b506100986004803603602081101561013657600080fd5b5035600160a060020a031661052f565b34801561015257600080fd5b506101796004803603602081101561016957600080fd5b5035600160a060020a031661063a565b604080519715158852600160a060020a039096166020880152931515868601529115156060860152608085015260a084015260c0830152519081900360e00190f35b3480156101c757600080fd5b50610098600480360360608110156101de57600080fd5b50600160a060020a0381351690602081013590604001356107dd565b6100986004803603604081101561021057600080fd5b50600160a060020a038135169060200135610a5d565b34801561023257600080fd5b506100986004803603602081101561024957600080fd5b5035600160a060020a0316611003565b34801561026557600080fd5b506100986004803603602081101561027c57600080fd5b5035600160a060020a0316611203565b600160a060020a0381166102d8576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a03818116600090815260208190526040902054610100900416331461034e576040805160e560020a62461bcd02815260206004820152601b60248201527f44617461546f6b656e20616c7265616479206163746976617465640000000000604482015290519081900360640190fd5b6040805160e160020a6355138f0d02815230600482015290518291600160a060020a0383169163aa271e1a91602480820192602092909190829003018186803b15801561039a57600080fd5b505afa1580156103ae573d6000803e3d6000fd5b505050506040513d60208110156103c457600080fd5b505161041a576040805160e560020a62461bcd02815260206004820152601e60248201527f4552523a2043616e6e6f7420616363657074206d696e74657220726f6c650000604482015290519081900360640190fd5b600160a060020a038281166000908152602081905260408082205481517f50d2fcc4000000000000000000000000000000000000000000000000000000008152610100909104841660048201529051928416926350d2fcc49260248084019391929182900301818387803b15801561049157600080fd5b505af11580156104a5573d6000803e3d6000fd5b50505050600160a060020a038216600081815260208190526040808220805475ff00000000000000000000000000000000000000000019169055517fc93cfdd5d8f442c448a02ed11ccff64355643272c9f2be94b723f2181af1a8969190a25050565b6001818154811061051557fe5b600091825260209091200154600160a060020a0316905081565b600160a060020a03811661057b576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a0381811660009081526020819052604090205461010090041633146105f1576040805160e560020a62461bcd02815260206004820152601b60248201527f44617461546f6b656e20616c7265616479206163746976617465640000000000604482015290519081900360640190fd5b600160a060020a038116600081815260208190526040808220805460ff19169055517f749cb6b4c510bc468cf6b9c2086d6f0a54d6b18e25d37bf3200e68eab0880c009190a250565b6000808080808080600160a060020a03881661068e576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a038089166000818152602081815260409182902080546001820154600290920154845160e060020a6370a08231028152306004820152945160ff8084169f5061010084049098169d5075010000000000000000000000000000000000000000009092049096169a509097509395508b936370a08231926024808201939291829003018186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d602081101561075157600080fd5b50516040805160e160020a6355138f0d0281523060048201529051919350600160a060020a0383169163aa271e1a91602480820192602092909190829003018186803b1580156107a057600080fd5b505afa1580156107b4573d6000803e3d6000fd5b505050506040513d60208110156107ca57600080fd5b5051979996985094969592945090925090565b600160a060020a038316610829576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a0383811660009081526020819052604090205461010090041615806108735750600160a060020a0383811660009081526020819052604090205461010090041633145b6108c7576040805160e560020a62461bcd02815260206004820152601b60248201527f44617461546f6b656e20616c7265616479206163746976617465640000000000604482015290519081900360640190fd5b6040805160e160020a6355138f0d02815233600482015290518491600160a060020a0383169163aa271e1a91602480820192602092909190829003018186803b15801561091357600080fd5b505afa158015610927573d6000803e3d6000fd5b505050506040513d602081101561093d57600080fd5b505161097d5760405160e560020a62461bcd0281526004018080602001828103825260248152602001806114226024913960400191505060405180910390fd5b600160a060020a038416600081815260208190526040808220805460018083018990556002830188905560ff19909116811774ffffffffffffffffffffffffffffffffffffffff00191661010033021775ff0000000000000000000000000000000000000000001916909155805480820182559083527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf601805473ffffffffffffffffffffffffffffffffffffffff191684179055517f0cc43938d137e7efade6a531f663e78c1fc75257b0d65ffda2fdaf70cb49cdf99190a250505050565b600160a060020a038216610aa9576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a03821660009081526020819052604090205460ff161515600114610b1e576040805160e560020a62461bcd02815260206004820152601460248201527f44697370656e736572206e6f7420616374697665000000000000000000000000604482015290519081900360640190fd5b60008111610b76576040805160e560020a62461bcd02815260206004820152601360248201527f496e76616c6964207a65726f20616d6f756e7400000000000000000000000000604482015290519081900360640190fd5b600160a060020a038216600090815260208190526040902060010154811115610be9576040805160e560020a62461bcd02815260206004820152600f60248201527f416d6f756e7420746f6f20686967680000000000000000000000000000000000604482015290519081900360640190fd5b6040805160e060020a6370a0823102815233600482015290518391600091600160a060020a038416916370a08231916024808301926020929190829003018186803b158015610c3757600080fd5b505afa158015610c4b573d6000803e3d6000fd5b505050506040513d6020811015610c6157600080fd5b5051600160a060020a0385166000908152602081905260409020600201549091508110610cd8576040805160e560020a62461bcd02815260206004820152601760248201527f43616c6c65722062616c616e636520746f6f2068696768000000000000000000604482015290519081900360640190fd5b6040805160e060020a6370a082310281523060048201529051600091600160a060020a038516916370a0823191602480820192602092909190829003018186803b158015610d2557600080fd5b505afa158015610d39573d6000803e3d6000fd5b505050506040513d6020811015610d4f57600080fd5b505190508381108015610dd357506040805160e160020a6355138f0d0281523060048201529051600160a060020a0385169163aa271e1a916024808301926020929190829003018186803b158015610da657600080fd5b505afa158015610dba573d6000803e3d6000fd5b505050506040513d6020811015610dd057600080fd5b50515b15610ed057604080517f40c10f1900000000000000000000000000000000000000000000000000000000815230600482015282860360248201529051600160a060020a038516916340c10f1991604480830192600092919082900301818387803b158015610e4057600080fd5b505af1158015610e54573d6000803e3d6000fd5b50506040805160e060020a6370a082310281523060048201529051600160a060020a03871693506370a0823192506024808301926020929190829003018186803b158015610ea157600080fd5b505afa158015610eb5573d6000803e3d6000fd5b505050506040513d6020811015610ecb57600080fd5b505190505b83811015610f28576040805160e560020a62461bcd02815260206004820152601360248201527f4e6f7420656e6f75676820726573657276657300000000000000000000000000604482015290519081900360640190fd5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018690529051600160a060020a0385169163a9059cbb9160448083019260209291908290030181600087803b158015610f9057600080fd5b505af1158015610fa4573d6000803e3d6000fd5b505050506040513d6020811015610fba57600080fd5b50506040805185815290513391600160a060020a038816917f63e223ff524bd93d4cbff98ef34405b39f63ded87f5a8d85e39ccda966f135439181900360200190a35050505050565b600160a060020a03811661104f576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600081905080600160a060020a031663eb40024b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1580156110ab57600080fd5b505af11580156110bf573d6000803e3d6000fd5b50506040805160e160020a6355138f0d0281523060048201529051600160a060020a038516935063aa271e1a92506024808301926020929190829003018186803b15801561110c57600080fd5b505afa158015611120573d6000803e3d6000fd5b505050506040513d602081101561113657600080fd5b505161118c576040805160e560020a62461bcd02815260206004820152601e60248201527f4552523a2043616e6e6f7420616363657074206d696e74657220726f6c650000604482015290519081900360640190fd5b600160a060020a038216600081815260208190526040808220805475ff00000000000000000000000000000000000000000019167501000000000000000000000000000000000000000000179055517ffef43e73eccfaf6e7c8c743baaa69fc51e375d972142bee1ffa6ee98f28339e99190a25050565b600160a060020a03811661124f576040805160e560020a62461bcd02815260206004820152601e6024820152600080516020611446833981519152604482015290519081900360640190fd5b600160a060020a0381811660009081526020819052604090205461010090041633146112c5576040805160e560020a62461bcd02815260206004820152600d60248201527f496e76616c6964206f776e657200000000000000000000000000000000000000604482015290519081900360640190fd5b6040805160e060020a6370a0823102815230600482015290518291600091600160a060020a038416916370a08231916024808301926020929190829003018186803b15801561131357600080fd5b505afa158015611327573d6000803e3d6000fd5b505050506040513d602081101561133d57600080fd5b50519050801561141c57604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051600160a060020a0384169163a9059cbb9160448083019260209291908290030181600087803b1580156113af57600080fd5b505af11580156113c3573d6000803e3d6000fd5b505050506040513d60208110156113d957600080fd5b50506040805182815290513391600160a060020a038616917f03185212530fcdce6b38fbf62ed27ab29b1b047f59b76b17401388a70a95f41b9181900360200190a35b50505056fe53656e64657220646f6573206e6f74206861766520746865206d696e74657220726f6c65496e76616c696420746f6b656e20636f6e747261637420616464726573730000a165627a7a72305820912566faae5bbd326f1ceefce2069e2d2206f629febcbb8ea833de618c7c9d2e0029", - "sourceMap": "231:8452:9:-;;;741:23;8:9:-1;5:2;;;30:1;27;20:12;5:2;741:23:9;231:8452;;;;;;", - "deployedSourceMap": "231:8452:9:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5593:640;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5593:640:9;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5593:640:9;-1:-1:-1;;;;;5593:640:9;;:::i;704:31::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;704:31:9;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;704:31:9;;:::i;:::-;;;;-1:-1:-1;;;;;704:31:9;;;;;;;;;;;;;;4293:372;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4293:372:9;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4293:372:9;-1:-1:-1;;;;;4293:372:9;;:::i;2255:756::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2255:756:9;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2255:756:9;-1:-1:-1;;;;;2255:756:9;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;2255:756:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3246:904;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3246:904:9;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3246:904:9;;;;;;;;;;;;;:::i;6544:1304::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;6544:1304:9;;;;;;;;:::i;4886:488::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4886:488:9;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4886:488:9;-1:-1:-1;;;;;4886:488:9;;:::i;8026:577::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8026:577:9;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8026:577:9;-1:-1:-1;;;;;8026:577:9;;:::i;5593:640::-;-1:-1:-1;;;;;5673:23:9;;5652:100;;;;;-1:-1:-1;;;;;5652:100:9;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;5652:100:9;;;;;;;;;;;;;;;-1:-1:-1;;;;;5783:21:9;;;:10;:21;;;;;;;;;;:27;;;;;5814:10;5783:41;5762:115;;;;;-1:-1:-1;;;;;5762:115:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;5974:37;;;-1:-1:-1;;;;;5974:37:9;;6005:4;5974:37;;;;;;5933:9;;-1:-1:-1;;;;;5974:22:9;;;;;:37;;;;;;;;;;;;;;;:22;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;5974:37:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5974:37:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5974:37:9;5953:114;;;;;-1:-1:-1;;;;;5953:114:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6105:21:9;;;:10;:21;;;;;;;;;;;:27;6077:56;;;;;6105:27;;;;;;6077:56;;;;;;:27;;;;;;:56;;;;;6105:10;;6077:56;;;;;;6105:10;6077:27;:56;;;5:2:-1;;;;30:1;27;20:12;5:2;6077:56:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;;;;;;;;6143:21:9;;6182:5;6143:21;;;;;;;;;;;:44;;-1:-1:-1;;6143:44:9;;;6202:24;;;6182:5;6202:24;5593:640;;:::o;704:31::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;704:31:9;;-1:-1:-1;704:31:9;:::o;4293:372::-;-1:-1:-1;;;;;4371:23:9;;4350:100;;;;;-1:-1:-1;;;;;4350:100:9;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4350:100:9;;;;;;;;;;;;;;;-1:-1:-1;;;;;4481:21:9;;;:10;:21;;;;;;;;;;:27;;;;;4512:10;4481:41;4460:115;;;;;-1:-1:-1;;;;;4460:115:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4585:21:9;;4616:5;4585:21;;;;;;;;;;;:36;;-1:-1:-1;;4585:36:9;;;4636:22;;;4616:5;4636:22;4293:372;:::o;2255:756::-;2322:11;;;;;;;-1:-1:-1;;;;;2476:23:9;;2455:100;;;;;-1:-1:-1;;;;;2455:100:9;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;2455:100:9;;;;;;;;;;;;;;;-1:-1:-1;;;;;2574:21:9;;;:10;:21;;;;;;;;;;;;:28;;;2732:31;;;2786:32;;;;;2904:38;;-1:-1:-1;;;;;2904:38:9;;2936:4;2904:38;;;;;;2574:28;;;;;-1:-1:-1;2574:28:9;2620:27;;;;;;-1:-1:-1;2674:36:9;;;;;;;;-1:-1:-1;2732:31:9;;-1:-1:-1;2786:32:9;;-1:-1:-1;2585:9:9;;2904:23;;:38;;;;;2574:21;2904:38;;;;;;2574:21;2904:38;;;5:2:-1;;;;30:1;27;20:12;5:2;2904:38:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2904:38:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2904:38:9;2967:37;;;-1:-1:-1;;;;;2967:37:9;;2998:4;2967:37;;;;;;2904:38;;-1:-1:-1;;;;;;2967:22:9;;;;;:37;;;;;2904:38;;2967:37;;;;;;;;:22;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;2967:37:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2967:37:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2967:37:9;2255:756;;;;-1:-1:-1;2255:756:9;;2967:37;2255:756;;-1:-1:-1;2255:756:9;;-1:-1:-1;2255:756:9;:::o;3246:904::-;-1:-1:-1;;;;;3369:23:9;;3348:100;;;;;-1:-1:-1;;;;;3348:100:9;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;3348:100:9;;;;;;;;;;;;;;;-1:-1:-1;;;;;3479:21:9;;;3518:1;3479:21;;;;;;;;;;:27;;;;;:41;;:86;;-1:-1:-1;;;;;;3524:21:9;;;:10;:21;;;;;;;;;;:27;;;;;3555:10;3524:41;3479:86;3458:160;;;;;-1:-1:-1;;;;;3458:160:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;3715:34;;;-1:-1:-1;;;;;3715:34:9;;3738:10;3715:34;;;;;;3674:9;;-1:-1:-1;;;;;3715:22:9;;;;;:34;;;;;;;;;;;;;;;:22;:34;;;5:2:-1;;;;30:1;27;20:12;5:2;3715:34:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3715:34:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3715:34:9;3694:117;;;;-1:-1:-1;;;;;3694:117:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3821:21:9;;:10;:21;;;;;;;;;;;:35;;3852:4;3916:31;;;:43;;;3969:32;;;:45;;;-1:-1:-1;;3821:35:9;;;;;-1:-1:-1;;3866:40:9;3821:35;3896:10;3866:40;;-1:-1:-1;;4024:44:9;;;;27:10:-1;;23:18;;;45:23;;4078:30:9;;;;;;;-1:-1:-1;;4078:30:9;;;;;4123:20;;;3821:10;4123:20;3246:904;;;;:::o;6544:1304::-;-1:-1:-1;;;;;6644:23:9;;6623:100;;;;;-1:-1:-1;;;;;6623:100:9;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;6623:100:9;;;;;;;;;;;;;;;-1:-1:-1;;;;;6754:21:9;;:10;:21;;;;;;;;;;:28;;;:36;;:28;:36;6733:103;;;;;-1:-1:-1;;;;;6733:103:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;6876:1;6867:6;:10;6846:76;;;;;-1:-1:-1;;;;;6846:76:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6953:21:9;;:10;:21;;;;;;;;;;:31;;;:41;-1:-1:-1;6953:41:9;6932:103;;;;;-1:-1:-1;;;;;6932:103:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;7135:35;;;-1:-1:-1;;;;;7135:35:9;;7159:10;7135:35;;;;;;7091:9;;7045:28;;-1:-1:-1;;;;;7135:23:9;;;;;:35;;;;;;;;;;;;;;:23;:35;;;5:2:-1;;;;30:1;27;20:12;5:2;7135:35:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7135:35:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7135:35:9;-1:-1:-1;;;;;7215:21:9;;:10;:21;;;7135:35;7215:21;;;;;;:32;;;7135:35;;-1:-1:-1;7201:46:9;;7180:116;;;;;-1:-1:-1;;;;;7180:116:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;7327:38;;;-1:-1:-1;;;;;7327:38:9;;7359:4;7327:38;;;;;;7306:18;;-1:-1:-1;;;;;7327:23:9;;;;;:38;;;;;;;;;;;;;;;:23;:38;;;5:2:-1;;;;30:1;27;20:12;5:2;7327:38:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7327:38:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7327:38:9;;-1:-1:-1;7378:17:9;;;:58;;;;-1:-1:-1;7399:37:9;;;-1:-1:-1;;;;;7399:37:9;;7430:4;7399:37;;;;;;-1:-1:-1;;;;;7399:22:9;;;;;:37;;;;;;;;;;;;;;:22;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;7399:37:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7399:37:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7399:37:9;7378:58;7375:261;;;7507:53;;;;;;7534:4;7507:53;;;;7540:19;;;7507:53;;;;;;-1:-1:-1;;;;;7507:18:9;;;;;:53;;;;;-1:-1:-1;;7507:53:9;;;;;;;-1:-1:-1;7507:18:9;:53;;;5:2:-1;;;;30:1;27;20:12;5:2;7507:53:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;7587:38:9;;;-1:-1:-1;;;;;7587:38:9;;7619:4;7587:38;;;;;;-1:-1:-1;;;;;7587:23:9;;;-1:-1:-1;7587:23:9;;-1:-1:-1;7587:38:9;;;;;;;;;;;;;;:23;:38;;;5:2:-1;;;;30:1;27;20:12;5:2;7587:38:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7587:38:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7587:38:9;;-1:-1:-1;7375:261:9;7678:6;7666:10;:18;;7645:84;;;;;-1:-1:-1;;;;;7645:84:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;7739:41;;;;;;7762:10;7739:41;;;;;;;;;;;;-1:-1:-1;;;;;7739:22:9;;;;;:41;;;;;;;;;;;;;;-1:-1:-1;7739:22:9;:41;;;5:2:-1;;;;30:1;27;20:12;5:2;7739:41:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7739:41:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;7795:46:9;;;;;;;;7822:10;;-1:-1:-1;;;;;7795:46:9;;;;;;;;7739:41;7795:46;;;6544:1304;;;;;:::o;4886:488::-;-1:-1:-1;;;;;4966:23:9;;4945:100;;;;;-1:-1:-1;;;;;4945:100:9;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;4945:100:9;;;;;;;;;;;;;;;5055:28;5101:9;5055:56;;5121:13;-1:-1:-1;;;;;5121:27:9;;:29;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5121:29:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;5181:37:9;;;-1:-1:-1;;;;;5181:37:9;;5212:4;5181:37;;;;;;-1:-1:-1;;;;;5181:22:9;;;-1:-1:-1;5181:22:9;;-1:-1:-1;5181:37:9;;;;;;;;;;;;;;:22;:37;;;5:2:-1;;;;30:1;27;20:12;5:2;5181:37:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5181:37:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5181:37:9;5160:114;;;;;-1:-1:-1;;;;;5160:114:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5284:21:9;;:10;:21;;;;;;;;;;;:43;;-1:-1:-1;;5284:43:9;;;;;5342:25;;;5284:10;5342:25;4886:488;;:::o;8026:577::-;-1:-1:-1;;;;;8107:23:9;;8086:100;;;;;-1:-1:-1;;;;;8086:100:9;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;8086:100:9;;;;;;;;;;;;;;;-1:-1:-1;;;;;8217:21:9;;;:10;:21;;;;;;;;;;:27;;;;;8248:10;8217:41;8196:101;;;;;-1:-1:-1;;;;;8196:101:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;8394:38;;;-1:-1:-1;;;;;8394:38:9;;8426:4;8394:38;;;;;;8353:9;;8307:28;;-1:-1:-1;;;;;8394:23:9;;;;;:38;;;;;;;;;;;;;;:23;:38;;;5:2:-1;;;;30:1;27;20:12;5:2;8394:38:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8394:38:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8394:38:9;;-1:-1:-1;8445:12:9;;8442:155;;8472:45;;;;;;8495:10;8472:45;;;;;;;;;;;;-1:-1:-1;;;;;8472:22:9;;;;;:45;;;;;;;;;;;;;;-1:-1:-1;8472:22:9;:45;;;5:2:-1;;;;30:1;27;20:12;5:2;8472:45:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8472:45:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;8536:50:9;;;;;;;;8563:10;;-1:-1:-1;;;;;8536:50:9;;;;;;;;8472:45;8536:50;;;8442:155;8026:577;;;:::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 '../interfaces/IERC20Template.sol';\n\n\n\ncontract Dispenser {\n struct DataToken {\n bool active; // if the dispenser is active for this datatoken\n address owner; // owner of this dispenser\n bool minterApproved; // if the dispenser is a minter for this datatoken\n uint256 maxTokens; // max tokens to dispense\n uint256 maxBalance; // max balance of requester. \n //If the balance is higher, the dispense is rejected\n }\n mapping(address => DataToken) datatokens;\n address[] public datatokensList;\n constructor() public {}\n \n event Activated( // emited when a dispenser is activated\n address indexed datatokenAddress\n );\n\n event Deactivated( // emited when a dispenser is deactivated\n address indexed datatokenAddress\n );\n\n event AcceptedMinter( \n // emited when a dispenser becomes minter of the datatoken\n address indexed datatokenAddress\n );\n\n event RemovedMinter( \n // emited when a dispenser if removed as minter of the datatoken\n address indexed datatokenAddress\n );\n\n event TokensDispensed( \n // emited when tokens are dispended\n address indexed datatokenAddress,\n address indexed userAddress,\n uint256 amount\n );\n\n event OwnerWithdrawed(\n address indexed datatoken,\n address indexed owner,\n uint256 amount\n );\n\n /**\n * @dev status\n * Get information about a datatoken dispenser\n * @param datatoken refers to datatoken address.\n * @return active - if the dispenser is active for this datatoken\n * @return owner - owner of this dispenser\n * @return minterApproved - if the dispenser is a minter for this datatoken\n * @return isTrueMinter - check the datatoken contract if this contract is really a minter\n * @return maxTokens - max tokens to dispense\n * @return maxBalance - max balance of requester. If the balance is higher, the dispense is rejected\n * @return balance - internal balance of the contract (if any)\n */\n function status(address datatoken) \n external view \n returns(bool active,address owner,bool minterApproved,\n bool isTrueMinter,uint256 maxTokens,uint256 maxBalance, uint256 balance){\n require(\n datatoken != address(0),\n 'Invalid token contract address'\n );\n active = datatokens[datatoken].active;\n owner = datatokens[datatoken].owner;\n minterApproved = datatokens[datatoken].minterApproved;\n maxTokens = datatokens[datatoken].maxTokens;\n maxBalance = datatokens[datatoken].maxBalance;\n IERC20Template tokenInstance = IERC20Template(datatoken);\n balance = tokenInstance.balanceOf(address(this));\n isTrueMinter = tokenInstance.isMinter(address(this));\n }\n\n /**\n * @dev activate\n * Activate a new dispenser\n * @param datatoken refers to datatoken address.\n * @param maxTokens - max tokens to dispense\n * @param maxBalance - max balance of requester.\n */\n function activate(address datatoken,uint256 maxTokens, uint256 maxBalance)\n external {\n require(\n datatoken != address(0),\n 'Invalid token contract address'\n );\n require(\n datatokens[datatoken].owner == address(0) || datatokens[datatoken].owner == msg.sender,\n 'DataToken already activated'\n );\n IERC20Template tokenInstance = IERC20Template(datatoken);\n require(\n tokenInstance.isMinter(msg.sender),\n 'Sender does not have the minter role'\n );\n datatokens[datatoken].active = true;\n datatokens[datatoken].owner = msg.sender;\n datatokens[datatoken].maxTokens = maxTokens;\n datatokens[datatoken].maxBalance = maxBalance;\n datatokens[datatoken].minterApproved = false;\n datatokensList.push(datatoken);\n emit Activated(datatoken);\n }\n\n /**\n * @dev deactivate\n * Deactivate an existing dispenser\n * @param datatoken refers to datatoken address.\n */\n function deactivate(address datatoken) external{\n require(\n datatoken != address(0),\n 'Invalid token contract address'\n );\n require(\n datatokens[datatoken].owner == msg.sender,\n 'DataToken already activated'\n );\n datatokens[datatoken].active = false;\n emit Deactivated(datatoken);\n }\n\n /**\n * @dev acceptMinter\n * Accepts Minter role (existing datatoken minter has to call datatoken.proposeMinter(dispenserAddress) first)\n * @param datatoken refers to datatoken address.\n */\n function acceptMinter(address datatoken) external{\n require(\n datatoken != address(0),\n 'Invalid token contract address'\n );\n IERC20Template tokenInstance = IERC20Template(datatoken);\n tokenInstance.approveMinter();\n require(\n tokenInstance.isMinter(address(this)),\n 'ERR: Cannot accept minter role'\n );\n datatokens[datatoken].minterApproved = true;\n emit AcceptedMinter(datatoken);\n }\n /**\n * @dev removeMinter\n * Removes Minter role and proposes the owner as a new minter (the owner has to call approveMinter after this)\n * @param datatoken refers to datatoken address.\n */\n function removeMinter(address datatoken) external{\n require(\n datatoken != address(0),\n 'Invalid token contract address'\n );\n require(\n datatokens[datatoken].owner == msg.sender,\n 'DataToken already activated'\n );\n IERC20Template tokenInstance = IERC20Template(datatoken);\n require(\n tokenInstance.isMinter(address(this)),\n 'ERR: Cannot accept minter role'\n );\n tokenInstance.proposeMinter(datatokens[datatoken].owner);\n datatokens[datatoken].minterApproved = false;\n emit RemovedMinter(datatoken);\n }\n\n /**\n * @dev dispense\n * Dispense datatokens to caller. The dispenser must be active, hold enough DT (or be able to mint more) and respect maxTokens/maxBalance requirements\n * @param datatoken refers to datatoken address.\n * @param datatoken amount of datatokens required.\n */\n function dispense(address datatoken, uint256 amount) external payable{\n require(\n datatoken != address(0),\n 'Invalid token contract address'\n );\n require(\n datatokens[datatoken].active == true,\n 'Dispenser not active'\n );\n require(\n amount > 0,\n 'Invalid zero amount'\n );\n require(\n datatokens[datatoken].maxTokens >= amount,\n 'Amount too high'\n );\n IERC20Template tokenInstance = IERC20Template(datatoken);\n uint256 callerBalance = tokenInstance.balanceOf(msg.sender);\n require(\n callerBalance=amount,\n 'Not enough reserves'\n );\n tokenInstance.transfer(msg.sender,amount);\n emit TokensDispensed(datatoken, msg.sender, amount);\n }\n\n /**\n * @dev ownerWithdraw\n * Allow owner to withdraw all datatokens in this dispenser balance\n * @param datatoken refers to datatoken address.\n */\n function ownerWithdraw(address datatoken) external{\n require(\n datatoken != address(0),\n 'Invalid token contract address'\n );\n require(\n datatokens[datatoken].owner == msg.sender,\n 'Invalid owner'\n );\n IERC20Template tokenInstance = IERC20Template(datatoken);\n uint256 ourBalance = tokenInstance.balanceOf(address(this));\n if(ourBalance>0){\n tokenInstance.transfer(msg.sender,ourBalance);\n emit OwnerWithdrawed(datatoken, msg.sender, ourBalance);\n }\n }\n function() external payable {\n //thank you for your donation\n }\n}", - "sourcePath": "/Users/ahmedali/Desktop/work/ocean/contracts/contracts/dispenser/Dispenser.sol", - "ast": { - "absolutePath": "/Users/ahmedali/Desktop/work/ocean/contracts/contracts/dispenser/Dispenser.sol", - "exportedSymbols": { - "Dispenser": [ - 4986 - ] - }, - "id": 4987, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 4400, - "literals": [ - "solidity", - "0.5", - ".7" - ], - "nodeType": "PragmaDirective", - "src": "0:22:9" - }, - { - "absolutePath": "/Users/ahmedali/Desktop/work/ocean/contracts/contracts/interfaces/IERC20Template.sol", - "file": "../interfaces/IERC20Template.sol", - "id": 4401, - "nodeType": "ImportDirective", - "scope": 4987, - "sourceUnit": 5659, - "src": "185:42:9", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 4986, - "linearizedBaseContracts": [ - 4986 - ], - "name": "Dispenser", - "nodeType": "ContractDefinition", - "nodes": [ - { - "canonicalName": "Dispenser.DataToken", - "id": 4412, - "members": [ - { - "constant": false, - "id": 4403, - "name": "active", - "nodeType": "VariableDeclaration", - "scope": 4412, - "src": "283:11:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4402, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "283:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4405, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 4412, - "src": "354:13:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4404, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "354:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4407, - "name": "minterApproved", - "nodeType": "VariableDeclaration", - "scope": 4412, - "src": "404:19:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4406, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "404:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4409, - "name": "maxTokens", - "nodeType": "VariableDeclaration", - "scope": 4412, - "src": "484:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4408, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "484:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4411, - "name": "maxBalance", - "nodeType": "VariableDeclaration", - "scope": 4412, - "src": "537:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4410, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "537:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "DataToken", - "nodeType": "StructDefinition", - "scope": 4986, - "src": "256:397:9", - "visibility": "public" - }, - { - "constant": false, - "id": 4416, - "name": "datatokens", - "nodeType": "VariableDeclaration", - "scope": 4986, - "src": "658:40:9", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken)" - }, - "typeName": { - "id": 4415, - "keyType": { - "id": 4413, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "666:7:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "658:29:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken)" - }, - "valueType": { - "contractScope": null, - "id": 4414, - "name": "DataToken", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 4412, - "src": "677:9:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage_ptr", - "typeString": "struct Dispenser.DataToken" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4419, - "name": "datatokensList", - "nodeType": "VariableDeclaration", - "scope": 4986, - "src": "704:31:9", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 4417, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "704:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4418, - "length": null, - "nodeType": "ArrayTypeName", - "src": "704:9:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 4422, - "nodeType": "Block", - "src": "762:2:9", - "statements": [] - }, - "documentation": null, - "id": 4423, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4420, - "nodeType": "ParameterList", - "parameters": [], - "src": "752:2:9" - }, - "returnParameters": { - "id": 4421, - "nodeType": "ParameterList", - "parameters": [], - "src": "762:0:9" - }, - "scope": 4986, - "src": "741:23:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 4427, - "name": "Activated", - "nodeType": "EventDefinition", - "parameters": { - "id": 4426, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4425, - "indexed": true, - "name": "datatokenAddress", - "nodeType": "VariableDeclaration", - "scope": 4427, - "src": "840:32:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4424, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "840:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "789:89:9" - }, - "src": "774:105:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4431, - "name": "Deactivated", - "nodeType": "EventDefinition", - "parameters": { - "id": 4430, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4429, - "indexed": true, - "name": "datatokenAddress", - "nodeType": "VariableDeclaration", - "scope": 4431, - "src": "954:32:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4428, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "954:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "902:90:9" - }, - "src": "885:108:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4435, - "name": "AcceptedMinter", - "nodeType": "EventDefinition", - "parameters": { - "id": 4434, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4433, - "indexed": true, - "name": "datatokenAddress", - "nodeType": "VariableDeclaration", - "scope": 4435, - "src": "1097:32:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4432, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1097:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1019:116:9" - }, - "src": "999:137:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4439, - "name": "RemovedMinter", - "nodeType": "EventDefinition", - "parameters": { - "id": 4438, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4437, - "indexed": true, - "name": "datatokenAddress", - "nodeType": "VariableDeclaration", - "scope": 4439, - "src": "1245:32:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4436, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1245:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1161:122:9" - }, - "src": "1142:142:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4447, - "name": "TokensDispensed", - "nodeType": "EventDefinition", - "parameters": { - "id": 4446, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4441, - "indexed": true, - "name": "datatokenAddress", - "nodeType": "VariableDeclaration", - "scope": 4447, - "src": "1366:32:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4440, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1366:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4443, - "indexed": true, - "name": "userAddress", - "nodeType": "VariableDeclaration", - "scope": 4447, - "src": "1408:27:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4442, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1408:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4445, - "indexed": false, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 4447, - "src": "1445:14:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4444, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1445:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1311:154:9" - }, - "src": "1290:176:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4455, - "name": "OwnerWithdrawed", - "nodeType": "EventDefinition", - "parameters": { - "id": 4454, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4449, - "indexed": true, - "name": "datatoken", - "nodeType": "VariableDeclaration", - "scope": 4455, - "src": "1503:25:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4448, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1503:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4451, - "indexed": true, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 4455, - "src": "1538:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4450, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1538:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4453, - "indexed": false, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 4455, - "src": "1569:14:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4452, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1569:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1493:96:9" - }, - "src": "1472:118:9" - }, - { - "body": { - "id": 4542, - "nodeType": "Block", - "src": "2445:566:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4479, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4475, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4457, - "src": "2476:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4477, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2497:1:9", - "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": 4476, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2489:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4478, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2489:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "2476:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "id": 4480, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2513:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - }, - "value": "Invalid token contract address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "id": 4474, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "2455:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4481, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2455:100:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4482, - "nodeType": "ExpressionStatement", - "src": "2455:100:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4488, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4483, - "name": "active", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4460, - "src": "2565:6:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4484, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "2574:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4486, - "indexExpression": { - "argumentTypes": null, - "id": 4485, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4457, - "src": "2585:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2574:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4487, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4403, - "src": "2574:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2565:37:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4489, - "nodeType": "ExpressionStatement", - "src": "2565:37:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4495, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4490, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4462, - "src": "2612:5:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4491, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "2620:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4493, - "indexExpression": { - "argumentTypes": null, - "id": 4492, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4457, - "src": "2631:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2620:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4494, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "owner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4405, - "src": "2620:27:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "2612:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4496, - "nodeType": "ExpressionStatement", - "src": "2612:35:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4502, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4497, - "name": "minterApproved", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4464, - "src": "2657:14:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4498, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "2674:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4500, - "indexExpression": { - "argumentTypes": null, - "id": 4499, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4457, - "src": "2685:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2674:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4501, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "minterApproved", - "nodeType": "MemberAccess", - "referencedDeclaration": 4407, - "src": "2674:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2657:53:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4503, - "nodeType": "ExpressionStatement", - "src": "2657:53:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4509, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4504, - "name": "maxTokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4468, - "src": "2720:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4505, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "2732:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4507, - "indexExpression": { - "argumentTypes": null, - "id": 4506, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4457, - "src": "2743:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2732:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4508, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "maxTokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 4409, - "src": "2732:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2720:43:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4510, - "nodeType": "ExpressionStatement", - "src": "2720:43:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4516, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4511, - "name": "maxBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4470, - "src": "2773:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4512, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "2786:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4514, - "indexExpression": { - "argumentTypes": null, - "id": 4513, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4457, - "src": "2797:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2786:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4515, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "maxBalance", - "nodeType": "MemberAccess", - "referencedDeclaration": 4411, - "src": "2786:32:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2773:45:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4517, - "nodeType": "ExpressionStatement", - "src": "2773:45:9" - }, - { - "assignments": [ - 4519 - ], - "declarations": [ - { - "constant": false, - "id": 4519, - "name": "tokenInstance", - "nodeType": "VariableDeclaration", - "scope": 4542, - "src": "2828:28:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - }, - "typeName": { - "contractScope": null, - "id": 4518, - "name": "IERC20Template", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5658, - "src": "2828:14:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4523, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4521, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4457, - "src": "2874:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4520, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5658, - "src": "2859:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5658_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4522, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2859:25:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2828:56:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4524, - "name": "balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4472, - "src": "2894:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4528, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "2936:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4527, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2928:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4529, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2928:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4525, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4519, - "src": "2904:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4526, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 5640, - "src": "2904:23:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 4530, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2904:38:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2894:48:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4532, - "nodeType": "ExpressionStatement", - "src": "2894:48:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4540, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4533, - "name": "isTrueMinter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4466, - "src": "2952:12:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4537, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "2998:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4536, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2990:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4538, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2990:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4534, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4519, - "src": "2967:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "isMinter", - "nodeType": "MemberAccess", - "referencedDeclaration": 5608, - "src": "2967:22:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$", - "typeString": "function (address) view external returns (bool)" - } - }, - "id": 4539, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2967:37:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "2952:52:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4541, - "nodeType": "ExpressionStatement", - "src": "2952:52:9" - } - ] - }, - "documentation": "@dev status\n Get information about a datatoken dispenser\n@param datatoken refers to datatoken address.\n@return active - if the dispenser is active for this datatoken\n@return owner - owner of this dispenser\n@return minterApproved - if the dispenser is a minter for this datatoken\n@return isTrueMinter - check the datatoken contract if this contract is really a minter\n@return maxTokens - max tokens to dispense\n@return maxBalance - max balance of requester. If the balance is higher, the dispense is rejected\n@return balance - internal balance of the contract (if any)", - "id": 4543, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "status", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4458, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4457, - "name": "datatoken", - "nodeType": "VariableDeclaration", - "scope": 4543, - "src": "2271:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4456, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2271:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2270:19:9" - }, - "returnParameters": { - "id": 4473, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4460, - "name": "active", - "nodeType": "VariableDeclaration", - "scope": 4543, - "src": "2322:11:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4459, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2322:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4462, - "name": "owner", - "nodeType": "VariableDeclaration", - "scope": 4543, - "src": "2334:13:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4461, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2334:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4464, - "name": "minterApproved", - "nodeType": "VariableDeclaration", - "scope": 4543, - "src": "2348:19:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4463, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2348:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4466, - "name": "isTrueMinter", - "nodeType": "VariableDeclaration", - "scope": 4543, - "src": "2373:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4465, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2373:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4468, - "name": "maxTokens", - "nodeType": "VariableDeclaration", - "scope": 4543, - "src": "2391:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4467, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2391:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4470, - "name": "maxBalance", - "nodeType": "VariableDeclaration", - "scope": 4543, - "src": "2409:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4469, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2409:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4472, - "name": "balance", - "nodeType": "VariableDeclaration", - "scope": 4543, - "src": "2429:15:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4471, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2429:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2321:124:9" - }, - "scope": 4986, - "src": "2255:756:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4642, - "nodeType": "Block", - "src": "3338:812:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4557, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4553, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "3369:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4555, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3390:1:9", - "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": 4554, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3382:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4556, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3382:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "3369:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "id": 4558, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3406:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - }, - "value": "Invalid token contract address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "id": 4552, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "3348:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4559, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3348:100:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4560, - "nodeType": "ExpressionStatement", - "src": "3348:100:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4577, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4569, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4562, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "3479:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4564, - "indexExpression": { - "argumentTypes": null, - "id": 4563, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "3490:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3479:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4565, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "owner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4405, - "src": "3479:27:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4567, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3518:1:9", - "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": 4566, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3510:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4568, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3510:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "3479:41:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4576, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4570, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "3524:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4572, - "indexExpression": { - "argumentTypes": null, - "id": 4571, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "3535:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3524:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4573, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "owner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4405, - "src": "3524:27:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4574, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "3555:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4575, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3555:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "3524:41:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "3479:86:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "44617461546f6b656e20616c726561647920616374697661746564", - "id": 4578, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3579:29:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - }, - "value": "DataToken already activated" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - } - ], - "id": 4561, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "3458:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3458:160:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4580, - "nodeType": "ExpressionStatement", - "src": "3458:160:9" - }, - { - "assignments": [ - 4582 - ], - "declarations": [ - { - "constant": false, - "id": 4582, - "name": "tokenInstance", - "nodeType": "VariableDeclaration", - "scope": 4642, - "src": "3628:28:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - }, - "typeName": { - "contractScope": null, - "id": 4581, - "name": "IERC20Template", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5658, - "src": "3628:14:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4586, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4584, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "3674:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4583, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5658, - "src": "3659:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5658_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3659:25:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3628:56:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4590, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "3738:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4591, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3738:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4588, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4582, - "src": "3715:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4589, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "isMinter", - "nodeType": "MemberAccess", - "referencedDeclaration": 5608, - "src": "3715:22:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$", - "typeString": "function (address) view external returns (bool)" - } - }, - "id": 4592, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3715:34:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "53656e64657220646f6573206e6f74206861766520746865206d696e74657220726f6c65", - "id": 4593, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3763:38:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_b9ee47ffa5d7be08bbcf8e567aa23ba3d67c2f7b7ccc9551956c2443209e5c72", - "typeString": "literal_string \"Sender does not have the minter role\"" - }, - "value": "Sender does not have the minter role" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_b9ee47ffa5d7be08bbcf8e567aa23ba3d67c2f7b7ccc9551956c2443209e5c72", - "typeString": "literal_string \"Sender does not have the minter role\"" - } - ], - "id": 4587, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "3694:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4594, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3694:117:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4595, - "nodeType": "ExpressionStatement", - "src": "3694:117:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4601, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4596, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "3821:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4598, - "indexExpression": { - "argumentTypes": null, - "id": 4597, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "3832:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3821:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4599, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4403, - "src": "3821:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4600, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3852:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "3821:35:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4602, - "nodeType": "ExpressionStatement", - "src": "3821:35:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4609, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4603, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "3866:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4605, - "indexExpression": { - "argumentTypes": null, - "id": 4604, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "3877:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3866:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4606, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "owner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4405, - "src": "3866:27:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4607, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "3896:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4608, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3896:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "3866:40:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4610, - "nodeType": "ExpressionStatement", - "src": "3866:40:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4616, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4611, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "3916:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4613, - "indexExpression": { - "argumentTypes": null, - "id": 4612, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "3927:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3916:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4614, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "maxTokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 4409, - "src": "3916:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4615, - "name": "maxTokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4547, - "src": "3950:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3916:43:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4617, - "nodeType": "ExpressionStatement", - "src": "3916:43:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4623, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4618, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "3969:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4620, - "indexExpression": { - "argumentTypes": null, - "id": 4619, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "3980:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3969:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4621, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "maxBalance", - "nodeType": "MemberAccess", - "referencedDeclaration": 4411, - "src": "3969:32:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4622, - "name": "maxBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4549, - "src": "4004:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3969:45:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4624, - "nodeType": "ExpressionStatement", - "src": "3969:45:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4630, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4625, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "4024:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4627, - "indexExpression": { - "argumentTypes": null, - "id": 4626, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "4035:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4024:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4628, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "minterApproved", - "nodeType": "MemberAccess", - "referencedDeclaration": 4407, - "src": "4024:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 4629, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4063:5:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "4024:44:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4631, - "nodeType": "ExpressionStatement", - "src": "4024:44:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4635, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "4098:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 4632, - "name": "datatokensList", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4419, - "src": "4078:14:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 4634, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4078:19:9", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 4636, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4078:30:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4637, - "nodeType": "ExpressionStatement", - "src": "4078:30:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4639, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4545, - "src": "4133:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4638, - "name": "Activated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4427, - "src": "4123:9:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 4640, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4123:20:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4641, - "nodeType": "EmitStatement", - "src": "4118:25:9" - } - ] - }, - "documentation": "@dev activate\n Activate a new dispenser\n@param datatoken refers to datatoken address.\n@param maxTokens - max tokens to dispense\n@param maxBalance - max balance of requester.", - "id": 4643, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "activate", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4550, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4545, - "name": "datatoken", - "nodeType": "VariableDeclaration", - "scope": 4643, - "src": "3264:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4544, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3264:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4547, - "name": "maxTokens", - "nodeType": "VariableDeclaration", - "scope": 4643, - "src": "3282:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4546, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3282:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4549, - "name": "maxBalance", - "nodeType": "VariableDeclaration", - "scope": 4643, - "src": "3301:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4548, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3301:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "3263:57:9" - }, - "returnParameters": { - "id": 4551, - "nodeType": "ParameterList", - "parameters": [], - "src": "3338:0:9" - }, - "scope": 4986, - "src": "3246:904:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4679, - "nodeType": "Block", - "src": "4340:325:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4653, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4649, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4645, - "src": "4371:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4651, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4392:1:9", - "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": 4650, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4384:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4652, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4384:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "4371:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "id": 4654, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4408:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - }, - "value": "Invalid token contract address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "id": 4648, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "4350:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4655, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4350:100:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4656, - "nodeType": "ExpressionStatement", - "src": "4350:100:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4664, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4658, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "4481:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4660, - "indexExpression": { - "argumentTypes": null, - "id": 4659, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4645, - "src": "4492:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4481:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4661, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "owner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4405, - "src": "4481:27:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4662, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "4512:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4663, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4512:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "4481:41:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "44617461546f6b656e20616c726561647920616374697661746564", - "id": 4665, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4536:29:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - }, - "value": "DataToken already activated" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - } - ], - "id": 4657, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "4460:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4666, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4460:115:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4667, - "nodeType": "ExpressionStatement", - "src": "4460:115:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4673, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4668, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "4585:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4670, - "indexExpression": { - "argumentTypes": null, - "id": 4669, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4645, - "src": "4596:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4585:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4671, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4403, - "src": "4585:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 4672, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4616:5:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "4585:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4674, - "nodeType": "ExpressionStatement", - "src": "4585:36:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4676, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4645, - "src": "4648:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4675, - "name": "Deactivated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4431, - "src": "4636:11:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 4677, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4636:22:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4678, - "nodeType": "EmitStatement", - "src": "4631:27:9" - } - ] - }, - "documentation": "@dev deactivate\n Deactivate an existing dispenser\n@param datatoken refers to datatoken address.", - "id": 4680, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "deactivate", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4646, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4645, - "name": "datatoken", - "nodeType": "VariableDeclaration", - "scope": 4680, - "src": "4313:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4644, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4313:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4312:19:9" - }, - "returnParameters": { - "id": 4647, - "nodeType": "ParameterList", - "parameters": [], - "src": "4340:0:9" - }, - "scope": 4986, - "src": "4293:372:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4726, - "nodeType": "Block", - "src": "4935:439:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4690, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4686, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4682, - "src": "4966:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4688, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4987:1:9", - "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": 4687, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4979:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4689, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4979:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "4966:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "id": 4691, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5003:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - }, - "value": "Invalid token contract address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "id": 4685, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "4945:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4692, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4945:100:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4693, - "nodeType": "ExpressionStatement", - "src": "4945:100:9" - }, - { - "assignments": [ - 4695 - ], - "declarations": [ - { - "constant": false, - "id": 4695, - "name": "tokenInstance", - "nodeType": "VariableDeclaration", - "scope": 4726, - "src": "5055:28:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - }, - "typeName": { - "contractScope": null, - "id": 4694, - "name": "IERC20Template", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5658, - "src": "5055:14:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4699, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4697, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4682, - "src": "5101:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4696, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5658, - "src": "5086:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5658_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4698, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5086:25:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5055:56:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "argumentTypes": null, - "id": 4700, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4695, - "src": "5121:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4702, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approveMinter", - "nodeType": "MemberAccess", - "referencedDeclaration": 5657, - "src": "5121:27:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", - "typeString": "function () external" - } - }, - "id": 4703, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5121:29:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4704, - "nodeType": "ExpressionStatement", - "src": "5121:29:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4709, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "5212:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4708, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5204:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5204:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4706, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4695, - "src": "5181:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4707, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "isMinter", - "nodeType": "MemberAccess", - "referencedDeclaration": 5608, - "src": "5181:22:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$", - "typeString": "function (address) view external returns (bool)" - } - }, - "id": 4711, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5181:37:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552523a2043616e6e6f7420616363657074206d696e74657220726f6c65", - "id": 4712, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5232:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0cfbec393383e0fce86a0bb31aa847b6ed694cf44c618a4606d1f2f2834c3497", - "typeString": "literal_string \"ERR: Cannot accept minter role\"" - }, - "value": "ERR: Cannot accept minter role" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cfbec393383e0fce86a0bb31aa847b6ed694cf44c618a4606d1f2f2834c3497", - "typeString": "literal_string \"ERR: Cannot accept minter role\"" - } - ], - "id": 4705, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "5160:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4713, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5160:114:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4714, - "nodeType": "ExpressionStatement", - "src": "5160:114:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4715, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "5284:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4717, - "indexExpression": { - "argumentTypes": null, - "id": 4716, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4682, - "src": "5295:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5284:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4718, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "minterApproved", - "nodeType": "MemberAccess", - "referencedDeclaration": 4407, - "src": "5284:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4719, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5323:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "5284:43:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4721, - "nodeType": "ExpressionStatement", - "src": "5284:43:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4723, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4682, - "src": "5357:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4722, - "name": "AcceptedMinter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4435, - "src": "5342:14:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 4724, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5342:25:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4725, - "nodeType": "EmitStatement", - "src": "5337:30:9" - } - ] - }, - "documentation": "@dev acceptMinter\n Accepts Minter role (existing datatoken minter has to call datatoken.proposeMinter(dispenserAddress) first)\n@param datatoken refers to datatoken address.", - "id": 4727, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "acceptMinter", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4683, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4682, - "name": "datatoken", - "nodeType": "VariableDeclaration", - "scope": 4727, - "src": "4908:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4681, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4908:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4907:19:9" - }, - "returnParameters": { - "id": 4684, - "nodeType": "ParameterList", - "parameters": [], - "src": "4935:0:9" - }, - "scope": 4986, - "src": "4886:488:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4788, - "nodeType": "Block", - "src": "5642:591:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4737, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4733, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4729, - "src": "5673:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4735, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5694:1:9", - "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": 4734, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5686:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4736, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5686:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "5673:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "id": 4738, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5710:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - }, - "value": "Invalid token contract address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "id": 4732, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "5652:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4739, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5652:100:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4740, - "nodeType": "ExpressionStatement", - "src": "5652:100:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4748, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4742, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "5783:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4744, - "indexExpression": { - "argumentTypes": null, - "id": 4743, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4729, - "src": "5794:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5783:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4745, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "owner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4405, - "src": "5783:27:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4746, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "5814:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4747, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5814:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "5783:41:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "44617461546f6b656e20616c726561647920616374697661746564", - "id": 4749, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5838:29:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - }, - "value": "DataToken already activated" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - } - ], - "id": 4741, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "5762:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4750, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5762:115:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4751, - "nodeType": "ExpressionStatement", - "src": "5762:115:9" - }, - { - "assignments": [ - 4753 - ], - "declarations": [ - { - "constant": false, - "id": 4753, - "name": "tokenInstance", - "nodeType": "VariableDeclaration", - "scope": 4788, - "src": "5887:28:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - }, - "typeName": { - "contractScope": null, - "id": 4752, - "name": "IERC20Template", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5658, - "src": "5887:14:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4757, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4755, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4729, - "src": "5933:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4754, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5658, - "src": "5918:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5658_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4756, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5918:25:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5887:56:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4762, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "6005:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4761, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5997:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4763, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5997:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4759, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4753, - "src": "5974:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4760, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "isMinter", - "nodeType": "MemberAccess", - "referencedDeclaration": 5608, - "src": "5974:22:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$", - "typeString": "function (address) view external returns (bool)" - } - }, - "id": 4764, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5974:37:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4552523a2043616e6e6f7420616363657074206d696e74657220726f6c65", - "id": 4765, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6025:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0cfbec393383e0fce86a0bb31aa847b6ed694cf44c618a4606d1f2f2834c3497", - "typeString": "literal_string \"ERR: Cannot accept minter role\"" - }, - "value": "ERR: Cannot accept minter role" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cfbec393383e0fce86a0bb31aa847b6ed694cf44c618a4606d1f2f2834c3497", - "typeString": "literal_string \"ERR: Cannot accept minter role\"" - } - ], - "id": 4758, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "5953:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4766, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5953:114:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4767, - "nodeType": "ExpressionStatement", - "src": "5953:114:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4771, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "6105:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4773, - "indexExpression": { - "argumentTypes": null, - "id": 4772, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4729, - "src": "6116:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6105:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4774, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "owner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4405, - "src": "6105:27:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 4768, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4753, - "src": "6077:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4770, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "proposeMinter", - "nodeType": "MemberAccess", - "referencedDeclaration": 5654, - "src": "6077:27:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$returns$__$", - "typeString": "function (address) external" - } - }, - "id": 4775, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6077:56:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4776, - "nodeType": "ExpressionStatement", - "src": "6077:56:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4782, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4777, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "6143:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4779, - "indexExpression": { - "argumentTypes": null, - "id": 4778, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4729, - "src": "6154:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6143:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4780, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "minterApproved", - "nodeType": "MemberAccess", - "referencedDeclaration": 4407, - "src": "6143:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 4781, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6182:5:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "6143:44:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4783, - "nodeType": "ExpressionStatement", - "src": "6143:44:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4785, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4729, - "src": "6216:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4784, - "name": "RemovedMinter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4439, - "src": "6202:13:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 4786, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6202:24:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4787, - "nodeType": "EmitStatement", - "src": "6197:29:9" - } - ] - }, - "documentation": "@dev removeMinter\n Removes Minter role and proposes the owner as a new minter (the owner has to call approveMinter after this)\n@param datatoken refers to datatoken address.", - "id": 4789, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "removeMinter", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4730, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4729, - "name": "datatoken", - "nodeType": "VariableDeclaration", - "scope": 4789, - "src": "5615:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4728, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5615:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5614:19:9" - }, - "returnParameters": { - "id": 4731, - "nodeType": "ParameterList", - "parameters": [], - "src": "5642:0:9" - }, - "scope": 4986, - "src": "5593:640:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4919, - "nodeType": "Block", - "src": "6613:1235:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4801, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4797, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4791, - "src": "6644:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4799, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6665:1:9", - "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": 4798, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6657:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4800, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6657:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "6644:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "id": 4802, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6681:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - }, - "value": "Invalid token contract address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "id": 4796, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "6623:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4803, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6623:100:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4804, - "nodeType": "ExpressionStatement", - "src": "6623:100:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4811, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4806, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "6754:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4808, - "indexExpression": { - "argumentTypes": null, - "id": 4807, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4791, - "src": "6765:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6754:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4809, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4403, - "src": "6754:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4810, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6786:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "6754:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "44697370656e736572206e6f7420616374697665", - "id": 4812, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6804:22:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ad22fc5ad027c7c8b01eef1a92f40801532cfc3acc4dec7288322ef61342b858", - "typeString": "literal_string \"Dispenser not active\"" - }, - "value": "Dispenser not active" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ad22fc5ad027c7c8b01eef1a92f40801532cfc3acc4dec7288322ef61342b858", - "typeString": "literal_string \"Dispenser not active\"" - } - ], - "id": 4805, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "6733:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4813, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6733:103:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4814, - "nodeType": "ExpressionStatement", - "src": "6733:103:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4818, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4816, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4793, - "src": "6867:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4817, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6876:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "6867:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c6964207a65726f20616d6f756e74", - "id": 4819, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6891:21:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_3e58cd0dd15e69c386ad46aeaec0637af7b133b0b08192a22e891c7d736d3ac8", - "typeString": "literal_string \"Invalid zero amount\"" - }, - "value": "Invalid zero amount" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_3e58cd0dd15e69c386ad46aeaec0637af7b133b0b08192a22e891c7d736d3ac8", - "typeString": "literal_string \"Invalid zero amount\"" - } - ], - "id": 4815, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "6846:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4820, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6846:76:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4821, - "nodeType": "ExpressionStatement", - "src": "6846:76:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4828, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4823, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "6953:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4825, - "indexExpression": { - "argumentTypes": null, - "id": 4824, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4791, - "src": "6964:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6953:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4826, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "maxTokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 4409, - "src": "6953:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 4827, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4793, - "src": "6988:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6953:41:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "416d6f756e7420746f6f2068696768", - "id": 4829, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7008:17:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7353a6bd8628dd713e866f78b282b0b6793f273d47e76330330b9a5a159c17ef", - "typeString": "literal_string \"Amount too high\"" - }, - "value": "Amount too high" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7353a6bd8628dd713e866f78b282b0b6793f273d47e76330330b9a5a159c17ef", - "typeString": "literal_string \"Amount too high\"" - } - ], - "id": 4822, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "6932:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4830, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6932:103:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4831, - "nodeType": "ExpressionStatement", - "src": "6932:103:9" - }, - { - "assignments": [ - 4833 - ], - "declarations": [ - { - "constant": false, - "id": 4833, - "name": "tokenInstance", - "nodeType": "VariableDeclaration", - "scope": 4919, - "src": "7045:28:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - }, - "typeName": { - "contractScope": null, - "id": 4832, - "name": "IERC20Template", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5658, - "src": "7045:14:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4837, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4835, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4791, - "src": "7091:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4834, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5658, - "src": "7076:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5658_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4836, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7076:25:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7045:56:9" - }, - { - "assignments": [ - 4839 - ], - "declarations": [ - { - "constant": false, - "id": 4839, - "name": "callerBalance", - "nodeType": "VariableDeclaration", - "scope": 4919, - "src": "7111:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4838, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7111:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4845, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4842, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "7159:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4843, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7159:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4840, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4833, - "src": "7135:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4841, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 5640, - "src": "7135:23:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 4844, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7135:35:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7111:59:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4847, - "name": "callerBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4839, - "src": "7201:13:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4848, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "7215:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4850, - "indexExpression": { - "argumentTypes": null, - "id": 4849, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4791, - "src": "7226:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7215:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4851, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "maxBalance", - "nodeType": "MemberAccess", - "referencedDeclaration": 4411, - "src": "7215:32:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7201:46:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616c6c65722062616c616e636520746f6f2068696768", - "id": 4853, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7261:25:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_036daf442604eb31ad74da9a69fe5dbd62aabfebb2991e7c7d29a1f2fe39919a", - "typeString": "literal_string \"Caller balance too high\"" - }, - "value": "Caller balance too high" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_036daf442604eb31ad74da9a69fe5dbd62aabfebb2991e7c7d29a1f2fe39919a", - "typeString": "literal_string \"Caller balance too high\"" - } - ], - "id": 4846, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "7180:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4854, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7180:116:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4855, - "nodeType": "ExpressionStatement", - "src": "7180:116:9" - }, - { - "assignments": [ - 4857 - ], - "declarations": [ - { - "constant": false, - "id": 4857, - "name": "ourBalance", - "nodeType": "VariableDeclaration", - "scope": 4919, - "src": "7306:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4856, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7306:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4864, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4861, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "7359:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4860, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7351:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4862, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7351:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4858, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4833, - "src": "7327:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4859, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 5640, - "src": "7327:23:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 4863, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7327:38:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7306:59:9" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4874, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4867, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4865, - "name": "ourBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4857, - "src": "7378:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 4866, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4793, - "src": "7389:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7378:17:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4871, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "7430:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4870, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7422:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4872, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7422:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4868, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4833, - "src": "7399:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4869, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "isMinter", - "nodeType": "MemberAccess", - "referencedDeclaration": 5608, - "src": "7399:22:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$", - "typeString": "function (address) view external returns (bool)" - } - }, - "id": 4873, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7399:37:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "7378:58:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 4896, - "nodeType": "IfStatement", - "src": "7375:261:9", - "trueBody": { - "id": 4895, - "nodeType": "Block", - "src": "7437:199:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4879, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "7534:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4878, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7526:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4880, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7526:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4883, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4881, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4793, - "src": "7540:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 4882, - "name": "ourBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4857, - "src": "7549:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7540:19:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 4875, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4833, - "src": "7507:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4877, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mint", - "nodeType": "MemberAccess", - "referencedDeclaration": 5576, - "src": "7507:18:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256) external" - } - }, - "id": 4884, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7507:53:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4885, - "nodeType": "ExpressionStatement", - "src": "7507:53:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4893, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4886, - "name": "ourBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4857, - "src": "7574:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4890, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "7619:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4889, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7611:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4891, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7611:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4887, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4833, - "src": "7587:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4888, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 5640, - "src": "7587:23:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 4892, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7587:38:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7574:51:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4894, - "nodeType": "ExpressionStatement", - "src": "7574:51:9" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4900, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4898, - "name": "ourBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4857, - "src": "7666:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 4899, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4793, - "src": "7678:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7666:18:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420656e6f756768207265736572766573", - "id": 4901, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7698:21:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6b90a513fa74c2a8dc35fe1591468e10fc67c299dc0f325ea992d29212514d24", - "typeString": "literal_string \"Not enough reserves\"" - }, - "value": "Not enough reserves" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6b90a513fa74c2a8dc35fe1591468e10fc67c299dc0f325ea992d29212514d24", - "typeString": "literal_string \"Not enough reserves\"" - } - ], - "id": 4897, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "7645:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4902, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7645:84:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4903, - "nodeType": "ExpressionStatement", - "src": "7645:84:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4907, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "7762:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4908, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7762:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4909, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4793, - "src": "7773:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 4904, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4833, - "src": "7739:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4906, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": 5649, - "src": "7739:22:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 4910, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7739:41:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4911, - "nodeType": "ExpressionStatement", - "src": "7739:41:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4913, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4791, - "src": "7811:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4914, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "7822:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7822:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4916, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4793, - "src": "7834:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4912, - "name": "TokensDispensed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4447, - "src": "7795:15:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4917, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7795:46:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4918, - "nodeType": "EmitStatement", - "src": "7790:51:9" - } - ] - }, - "documentation": "@dev dispense\n Dispense datatokens to caller. The dispenser must be active, hold enough DT (or be able to mint more) and respect maxTokens/maxBalance requirements\n@param datatoken refers to datatoken address.\n@param datatoken amount of datatokens required.", - "id": 4920, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "dispense", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4794, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4791, - "name": "datatoken", - "nodeType": "VariableDeclaration", - "scope": 4920, - "src": "6562:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4790, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6562:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4793, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 4920, - "src": "6581:14:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4792, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6581:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6561:35:9" - }, - "returnParameters": { - "id": 4795, - "nodeType": "ParameterList", - "parameters": [], - "src": "6613:0:9" - }, - "scope": 4986, - "src": "6544:1304:9", - "stateMutability": "payable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4980, - "nodeType": "Block", - "src": "8076:527:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4930, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4926, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4922, - "src": "8107:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4928, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8128:1:9", - "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": 4927, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "8120:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4929, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8120:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "8107:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "id": 4931, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8144:32:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - }, - "value": "Invalid token contract address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "id": 4925, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "8086:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4932, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8086:100:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4933, - "nodeType": "ExpressionStatement", - "src": "8086:100:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4941, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4935, - "name": "datatokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4416, - "src": "8217:10:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_DataToken_$4412_storage_$", - "typeString": "mapping(address => struct Dispenser.DataToken storage ref)" - } - }, - "id": 4937, - "indexExpression": { - "argumentTypes": null, - "id": 4936, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4922, - "src": "8228:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8217:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_DataToken_$4412_storage", - "typeString": "struct Dispenser.DataToken storage ref" - } - }, - "id": 4938, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "owner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4405, - "src": "8217:27:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4939, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "8248:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4940, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8248:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "8217:41:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "496e76616c6964206f776e6572", - "id": 4942, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8272:15:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_110461b12e459dc76e692e7a47f9621cf45c7d48020c3c7b2066107cdf1f52ae", - "typeString": "literal_string \"Invalid owner\"" - }, - "value": "Invalid owner" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_110461b12e459dc76e692e7a47f9621cf45c7d48020c3c7b2066107cdf1f52ae", - "typeString": "literal_string \"Invalid owner\"" - } - ], - "id": 4934, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "src": "8196:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4943, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8196:101:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4944, - "nodeType": "ExpressionStatement", - "src": "8196:101:9" - }, - { - "assignments": [ - 4946 - ], - "declarations": [ - { - "constant": false, - "id": 4946, - "name": "tokenInstance", - "nodeType": "VariableDeclaration", - "scope": 4980, - "src": "8307:28:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - }, - "typeName": { - "contractScope": null, - "id": 4945, - "name": "IERC20Template", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5658, - "src": "8307:14:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4950, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4948, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4922, - "src": "8353:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4947, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5658, - "src": "8338:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5658_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4949, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8338:25:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8307:56:9" - }, - { - "assignments": [ - 4952 - ], - "declarations": [ - { - "constant": false, - "id": 4952, - "name": "ourBalance", - "nodeType": "VariableDeclaration", - "scope": 4980, - "src": "8373:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4951, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8373:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4959, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4956, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7165, - "src": "8426:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "id": 4955, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "8418:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4957, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8418:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "id": 4953, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4946, - "src": "8394:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4954, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 5640, - "src": "8394:23:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 4958, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8394:38:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8373:59:9" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4962, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4960, - "name": "ourBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4952, - "src": "8445:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4961, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8456:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "8445:12:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 4979, - "nodeType": "IfStatement", - "src": "8442:155:9", - "trueBody": { - "id": 4978, - "nodeType": "Block", - "src": "8458:139:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4966, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "8495:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4967, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8495:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4968, - "name": "ourBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4952, - "src": "8506:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 4963, - "name": "tokenInstance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4946, - "src": "8472:13:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5658", - "typeString": "contract IERC20Template" - } - }, - "id": 4965, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": 5649, - "src": "8472:22:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 4969, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8472:45:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4970, - "nodeType": "ExpressionStatement", - "src": "8472:45:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4972, - "name": "datatoken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4922, - "src": "8552:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4973, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7121, - "src": "8563:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4974, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8563:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4975, - "name": "ourBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4952, - "src": "8575:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4971, - "name": "OwnerWithdrawed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4455, - "src": "8536:15:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256)" - } - }, - "id": 4976, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8536:50:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4977, - "nodeType": "EmitStatement", - "src": "8531:55:9" - } - ] - } - } - ] - }, - "documentation": "@dev ownerWithdraw\n Allow owner to withdraw all datatokens in this dispenser balance\n@param datatoken refers to datatoken address.", - "id": 4981, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "ownerWithdraw", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4923, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4922, - "name": "datatoken", - "nodeType": "VariableDeclaration", - "scope": 4981, - "src": "8049:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4921, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "8049:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8048:19:9" - }, - "returnParameters": { - "id": 4924, - "nodeType": "ParameterList", - "parameters": [], - "src": "8076:0:9" - }, - "scope": 4986, - "src": "8026:577:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4984, - "nodeType": "Block", - "src": "8636:45:9", - "statements": [] - }, - "documentation": null, - "id": 4985, - "implemented": true, - "kind": "fallback", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4982, - "nodeType": "ParameterList", - "parameters": [], - "src": "8616:2:9" - }, - "returnParameters": { - "id": 4983, - "nodeType": "ParameterList", - "parameters": [], - "src": "8636:0:9" - }, - "scope": 4986, - "src": "8608:73:9", - "stateMutability": "payable", - "superFunction": null, - "visibility": "external" - } - ], - "scope": 4987, - "src": "231:8452:9" - } - ], - "src": "0:8683:9" - }, - "legacyAST": { - "attributes": { - "absolutePath": "/Users/ahmedali/Desktop/work/ocean/contracts/contracts/dispenser/Dispenser.sol", - "exportedSymbols": { - "Dispenser": [ - 4986 - ] - } - }, - "children": [ - { - "attributes": { - "literals": [ - "solidity", - "0.5", - ".7" - ] - }, - "id": 4400, - "name": "PragmaDirective", - "src": "0:22:9" - }, - { - "attributes": { - "SourceUnit": 5659, - "absolutePath": "/Users/ahmedali/Desktop/work/ocean/contracts/contracts/interfaces/IERC20Template.sol", - "file": "../interfaces/IERC20Template.sol", - "scope": 4987, - "symbolAliases": [ - null - ], - "unitAlias": "" - }, - "id": 4401, - "name": "ImportDirective", - "src": "185:42:9" - }, - { - "attributes": { - "baseContracts": [ - null - ], - "contractDependencies": [ - null - ], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "linearizedBaseContracts": [ - 4986 - ], - "name": "Dispenser", - "scope": 4987 - }, - "children": [ - { - "attributes": { - "canonicalName": "Dispenser.DataToken", - "name": "DataToken", - "scope": 4986, - "visibility": "public" - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "active", - "scope": 4412, - "stateVariable": false, - "storageLocation": "default", - "type": "bool", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "bool", - "type": "bool" - }, - "id": 4402, - "name": "ElementaryTypeName", - "src": "283:4:9" - } - ], - "id": 4403, - "name": "VariableDeclaration", - "src": "283:11:9" - }, - { - "attributes": { - "constant": false, - "name": "owner", - "scope": 4412, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4404, - "name": "ElementaryTypeName", - "src": "354:7:9" - } - ], - "id": 4405, - "name": "VariableDeclaration", - "src": "354:13:9" - }, - { - "attributes": { - "constant": false, - "name": "minterApproved", - "scope": 4412, - "stateVariable": false, - "storageLocation": "default", - "type": "bool", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "bool", - "type": "bool" - }, - "id": 4406, - "name": "ElementaryTypeName", - "src": "404:4:9" - } - ], - "id": 4407, - "name": "VariableDeclaration", - "src": "404:19:9" - }, - { - "attributes": { - "constant": false, - "name": "maxTokens", - "scope": 4412, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4408, - "name": "ElementaryTypeName", - "src": "484:7:9" - } - ], - "id": 4409, - "name": "VariableDeclaration", - "src": "484:17:9" - }, - { - "attributes": { - "constant": false, - "name": "maxBalance", - "scope": 4412, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4410, - "name": "ElementaryTypeName", - "src": "537:7:9" - } - ], - "id": 4411, - "name": "VariableDeclaration", - "src": "537:18:9" - } - ], - "id": 4412, - "name": "StructDefinition", - "src": "256:397:9" - }, - { - "attributes": { - "constant": false, - "name": "datatokens", - "scope": 4986, - "stateVariable": true, - "storageLocation": "default", - "type": "mapping(address => struct Dispenser.DataToken)", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "type": "mapping(address => struct Dispenser.DataToken)" - }, - "children": [ - { - "attributes": { - "name": "address", - "type": "address" - }, - "id": 4413, - "name": "ElementaryTypeName", - "src": "666:7:9" - }, - { - "attributes": { - "contractScope": null, - "name": "DataToken", - "referencedDeclaration": 4412, - "type": "struct Dispenser.DataToken" - }, - "id": 4414, - "name": "UserDefinedTypeName", - "src": "677:9:9" - } - ], - "id": 4415, - "name": "Mapping", - "src": "658:29:9" - } - ], - "id": 4416, - "name": "VariableDeclaration", - "src": "658:40:9" - }, - { - "attributes": { - "constant": false, - "name": "datatokensList", - "scope": 4986, - "stateVariable": true, - "storageLocation": "default", - "type": "address[]", - "value": null, - "visibility": "public" - }, - "children": [ - { - "attributes": { - "length": null, - "type": "address[]" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4417, - "name": "ElementaryTypeName", - "src": "704:7:9" - } - ], - "id": 4418, - "name": "ArrayTypeName", - "src": "704:9:9" - } - ], - "id": 4419, - "name": "VariableDeclaration", - "src": "704:31:9" - }, - { - "attributes": { - "documentation": null, - "implemented": true, - "isConstructor": true, - "kind": "constructor", - "modifiers": [ - null - ], - "name": "", - "scope": 4986, - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - "children": [ - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4420, - "name": "ParameterList", - "src": "752:2:9" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4421, - "name": "ParameterList", - "src": "762:0:9" - }, - { - "attributes": { - "statements": [ - null - ] - }, - "children": [], - "id": 4422, - "name": "Block", - "src": "762:2:9" - } - ], - "id": 4423, - "name": "FunctionDefinition", - "src": "741:23:9" - }, - { - "attributes": { - "anonymous": false, - "documentation": null, - "name": "Activated" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "indexed": true, - "name": "datatokenAddress", - "scope": 4427, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4424, - "name": "ElementaryTypeName", - "src": "840:7:9" - } - ], - "id": 4425, - "name": "VariableDeclaration", - "src": "840:32:9" - } - ], - "id": 4426, - "name": "ParameterList", - "src": "789:89:9" - } - ], - "id": 4427, - "name": "EventDefinition", - "src": "774:105:9" - }, - { - "attributes": { - "anonymous": false, - "documentation": null, - "name": "Deactivated" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "indexed": true, - "name": "datatokenAddress", - "scope": 4431, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4428, - "name": "ElementaryTypeName", - "src": "954:7:9" - } - ], - "id": 4429, - "name": "VariableDeclaration", - "src": "954:32:9" - } - ], - "id": 4430, - "name": "ParameterList", - "src": "902:90:9" - } - ], - "id": 4431, - "name": "EventDefinition", - "src": "885:108:9" - }, - { - "attributes": { - "anonymous": false, - "documentation": null, - "name": "AcceptedMinter" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "indexed": true, - "name": "datatokenAddress", - "scope": 4435, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4432, - "name": "ElementaryTypeName", - "src": "1097:7:9" - } - ], - "id": 4433, - "name": "VariableDeclaration", - "src": "1097:32:9" - } - ], - "id": 4434, - "name": "ParameterList", - "src": "1019:116:9" - } - ], - "id": 4435, - "name": "EventDefinition", - "src": "999:137:9" - }, - { - "attributes": { - "anonymous": false, - "documentation": null, - "name": "RemovedMinter" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "indexed": true, - "name": "datatokenAddress", - "scope": 4439, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4436, - "name": "ElementaryTypeName", - "src": "1245:7:9" - } - ], - "id": 4437, - "name": "VariableDeclaration", - "src": "1245:32:9" - } - ], - "id": 4438, - "name": "ParameterList", - "src": "1161:122:9" - } - ], - "id": 4439, - "name": "EventDefinition", - "src": "1142:142:9" - }, - { - "attributes": { - "anonymous": false, - "documentation": null, - "name": "TokensDispensed" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "indexed": true, - "name": "datatokenAddress", - "scope": 4447, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4440, - "name": "ElementaryTypeName", - "src": "1366:7:9" - } - ], - "id": 4441, - "name": "VariableDeclaration", - "src": "1366:32:9" - }, - { - "attributes": { - "constant": false, - "indexed": true, - "name": "userAddress", - "scope": 4447, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4442, - "name": "ElementaryTypeName", - "src": "1408:7:9" - } - ], - "id": 4443, - "name": "VariableDeclaration", - "src": "1408:27:9" - }, - { - "attributes": { - "constant": false, - "indexed": false, - "name": "amount", - "scope": 4447, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4444, - "name": "ElementaryTypeName", - "src": "1445:7:9" - } - ], - "id": 4445, - "name": "VariableDeclaration", - "src": "1445:14:9" - } - ], - "id": 4446, - "name": "ParameterList", - "src": "1311:154:9" - } - ], - "id": 4447, - "name": "EventDefinition", - "src": "1290:176:9" - }, - { - "attributes": { - "anonymous": false, - "documentation": null, - "name": "OwnerWithdrawed" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "indexed": true, - "name": "datatoken", - "scope": 4455, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4448, - "name": "ElementaryTypeName", - "src": "1503:7:9" - } - ], - "id": 4449, - "name": "VariableDeclaration", - "src": "1503:25:9" - }, - { - "attributes": { - "constant": false, - "indexed": true, - "name": "owner", - "scope": 4455, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4450, - "name": "ElementaryTypeName", - "src": "1538:7:9" - } - ], - "id": 4451, - "name": "VariableDeclaration", - "src": "1538:21:9" - }, - { - "attributes": { - "constant": false, - "indexed": false, - "name": "amount", - "scope": 4455, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4452, - "name": "ElementaryTypeName", - "src": "1569:7:9" - } - ], - "id": 4453, - "name": "VariableDeclaration", - "src": "1569:14:9" - } - ], - "id": 4454, - "name": "ParameterList", - "src": "1493:96:9" - } - ], - "id": 4455, - "name": "EventDefinition", - "src": "1472:118:9" - }, - { - "attributes": { - "documentation": "@dev status\n Get information about a datatoken dispenser\n@param datatoken refers to datatoken address.\n@return active - if the dispenser is active for this datatoken\n@return owner - owner of this dispenser\n@return minterApproved - if the dispenser is a minter for this datatoken\n@return isTrueMinter - check the datatoken contract if this contract is really a minter\n@return maxTokens - max tokens to dispense\n@return maxBalance - max balance of requester. If the balance is higher, the dispense is rejected\n@return balance - internal balance of the contract (if any)", - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "status", - "scope": 4986, - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "name": "datatoken", - "scope": 4543, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4456, - "name": "ElementaryTypeName", - "src": "2271:7:9" - } - ], - "id": 4457, - "name": "VariableDeclaration", - "src": "2271:17:9" - } - ], - "id": 4458, - "name": "ParameterList", - "src": "2270:19:9" - }, - { - "children": [ - { - "attributes": { - "constant": false, - "name": "active", - "scope": 4543, - "stateVariable": false, - "storageLocation": "default", - "type": "bool", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "bool", - "type": "bool" - }, - "id": 4459, - "name": "ElementaryTypeName", - "src": "2322:4:9" - } - ], - "id": 4460, - "name": "VariableDeclaration", - "src": "2322:11:9" - }, - { - "attributes": { - "constant": false, - "name": "owner", - "scope": 4543, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4461, - "name": "ElementaryTypeName", - "src": "2334:7:9" - } - ], - "id": 4462, - "name": "VariableDeclaration", - "src": "2334:13:9" - }, - { - "attributes": { - "constant": false, - "name": "minterApproved", - "scope": 4543, - "stateVariable": false, - "storageLocation": "default", - "type": "bool", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "bool", - "type": "bool" - }, - "id": 4463, - "name": "ElementaryTypeName", - "src": "2348:4:9" - } - ], - "id": 4464, - "name": "VariableDeclaration", - "src": "2348:19:9" - }, - { - "attributes": { - "constant": false, - "name": "isTrueMinter", - "scope": 4543, - "stateVariable": false, - "storageLocation": "default", - "type": "bool", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "bool", - "type": "bool" - }, - "id": 4465, - "name": "ElementaryTypeName", - "src": "2373:4:9" - } - ], - "id": 4466, - "name": "VariableDeclaration", - "src": "2373:17:9" - }, - { - "attributes": { - "constant": false, - "name": "maxTokens", - "scope": 4543, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4467, - "name": "ElementaryTypeName", - "src": "2391:7:9" - } - ], - "id": 4468, - "name": "VariableDeclaration", - "src": "2391:17:9" - }, - { - "attributes": { - "constant": false, - "name": "maxBalance", - "scope": 4543, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4469, - "name": "ElementaryTypeName", - "src": "2409:7:9" - } - ], - "id": 4470, - "name": "VariableDeclaration", - "src": "2409:18:9" - }, - { - "attributes": { - "constant": false, - "name": "balance", - "scope": 4543, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4471, - "name": "ElementaryTypeName", - "src": "2429:7:9" - } - ], - "id": 4472, - "name": "VariableDeclaration", - "src": "2429:15:9" - } - ], - "id": 4473, - "name": "ParameterList", - "src": "2321:124:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4474, - "name": "Identifier", - "src": "2455:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "!=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4457, - "type": "address", - "value": "datatoken" - }, - "id": 4475, - "name": "Identifier", - "src": "2476:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4476, - "name": "ElementaryTypeNameExpression", - "src": "2489:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4477, - "name": "Literal", - "src": "2497:1:9" - } - ], - "id": 4478, - "name": "FunctionCall", - "src": "2489:10:9" - } - ], - "id": 4479, - "name": "BinaryOperation", - "src": "2476:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid token contract address\"", - "value": "Invalid token contract address" - }, - "id": 4480, - "name": "Literal", - "src": "2513:32:9" - } - ], - "id": 4481, - "name": "FunctionCall", - "src": "2455:100:9" - } - ], - "id": 4482, - "name": "ExpressionStatement", - "src": "2455:100:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4460, - "type": "bool", - "value": "active" - }, - "id": 4483, - "name": "Identifier", - "src": "2565:6:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "active", - "referencedDeclaration": 4403, - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4484, - "name": "Identifier", - "src": "2574:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4457, - "type": "address", - "value": "datatoken" - }, - "id": 4485, - "name": "Identifier", - "src": "2585:9:9" - } - ], - "id": 4486, - "name": "IndexAccess", - "src": "2574:21:9" - } - ], - "id": 4487, - "name": "MemberAccess", - "src": "2574:28:9" - } - ], - "id": 4488, - "name": "Assignment", - "src": "2565:37:9" - } - ], - "id": 4489, - "name": "ExpressionStatement", - "src": "2565:37:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4462, - "type": "address", - "value": "owner" - }, - "id": 4490, - "name": "Identifier", - "src": "2612:5:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "owner", - "referencedDeclaration": 4405, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4491, - "name": "Identifier", - "src": "2620:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4457, - "type": "address", - "value": "datatoken" - }, - "id": 4492, - "name": "Identifier", - "src": "2631:9:9" - } - ], - "id": 4493, - "name": "IndexAccess", - "src": "2620:21:9" - } - ], - "id": 4494, - "name": "MemberAccess", - "src": "2620:27:9" - } - ], - "id": 4495, - "name": "Assignment", - "src": "2612:35:9" - } - ], - "id": 4496, - "name": "ExpressionStatement", - "src": "2612:35:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4464, - "type": "bool", - "value": "minterApproved" - }, - "id": 4497, - "name": "Identifier", - "src": "2657:14:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "minterApproved", - "referencedDeclaration": 4407, - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4498, - "name": "Identifier", - "src": "2674:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4457, - "type": "address", - "value": "datatoken" - }, - "id": 4499, - "name": "Identifier", - "src": "2685:9:9" - } - ], - "id": 4500, - "name": "IndexAccess", - "src": "2674:21:9" - } - ], - "id": 4501, - "name": "MemberAccess", - "src": "2674:36:9" - } - ], - "id": 4502, - "name": "Assignment", - "src": "2657:53:9" - } - ], - "id": 4503, - "name": "ExpressionStatement", - "src": "2657:53:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4468, - "type": "uint256", - "value": "maxTokens" - }, - "id": 4504, - "name": "Identifier", - "src": "2720:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "maxTokens", - "referencedDeclaration": 4409, - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4505, - "name": "Identifier", - "src": "2732:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4457, - "type": "address", - "value": "datatoken" - }, - "id": 4506, - "name": "Identifier", - "src": "2743:9:9" - } - ], - "id": 4507, - "name": "IndexAccess", - "src": "2732:21:9" - } - ], - "id": 4508, - "name": "MemberAccess", - "src": "2732:31:9" - } - ], - "id": 4509, - "name": "Assignment", - "src": "2720:43:9" - } - ], - "id": 4510, - "name": "ExpressionStatement", - "src": "2720:43:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4470, - "type": "uint256", - "value": "maxBalance" - }, - "id": 4511, - "name": "Identifier", - "src": "2773:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "maxBalance", - "referencedDeclaration": 4411, - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4512, - "name": "Identifier", - "src": "2786:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4457, - "type": "address", - "value": "datatoken" - }, - "id": 4513, - "name": "Identifier", - "src": "2797:9:9" - } - ], - "id": 4514, - "name": "IndexAccess", - "src": "2786:21:9" - } - ], - "id": 4515, - "name": "MemberAccess", - "src": "2786:32:9" - } - ], - "id": 4516, - "name": "Assignment", - "src": "2773:45:9" - } - ], - "id": 4517, - "name": "ExpressionStatement", - "src": "2773:45:9" - }, - { - "attributes": { - "assignments": [ - 4519 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "tokenInstance", - "scope": 4542, - "stateVariable": false, - "storageLocation": "default", - "type": "contract IERC20Template", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "contractScope": null, - "name": "IERC20Template", - "referencedDeclaration": 5658, - "type": "contract IERC20Template" - }, - "id": 4518, - "name": "UserDefinedTypeName", - "src": "2828:14:9" - } - ], - "id": 4519, - "name": "VariableDeclaration", - "src": "2828:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "contract IERC20Template", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 5658, - "type": "type(contract IERC20Template)", - "value": "IERC20Template" - }, - "id": 4520, - "name": "Identifier", - "src": "2859:14:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4457, - "type": "address", - "value": "datatoken" - }, - "id": 4521, - "name": "Identifier", - "src": "2874:9:9" - } - ], - "id": 4522, - "name": "FunctionCall", - "src": "2859:25:9" - } - ], - "id": 4523, - "name": "VariableDeclarationStatement", - "src": "2828:56:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4472, - "type": "uint256", - "value": "balance" - }, - "id": 4524, - "name": "Identifier", - "src": "2894:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "uint256", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "balanceOf", - "referencedDeclaration": 5640, - "type": "function (address) view external returns (uint256)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4519, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4525, - "name": "Identifier", - "src": "2904:13:9" - } - ], - "id": 4526, - "name": "MemberAccess", - "src": "2904:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4527, - "name": "ElementaryTypeNameExpression", - "src": "2928:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4528, - "name": "Identifier", - "src": "2936:4:9" - } - ], - "id": 4529, - "name": "FunctionCall", - "src": "2928:13:9" - } - ], - "id": 4530, - "name": "FunctionCall", - "src": "2904:38:9" - } - ], - "id": 4531, - "name": "Assignment", - "src": "2894:48:9" - } - ], - "id": 4532, - "name": "ExpressionStatement", - "src": "2894:48:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4466, - "type": "bool", - "value": "isTrueMinter" - }, - "id": 4533, - "name": "Identifier", - "src": "2952:12:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "bool", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "isMinter", - "referencedDeclaration": 5608, - "type": "function (address) view external returns (bool)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4519, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4534, - "name": "Identifier", - "src": "2967:13:9" - } - ], - "id": 4535, - "name": "MemberAccess", - "src": "2967:22:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4536, - "name": "ElementaryTypeNameExpression", - "src": "2990:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4537, - "name": "Identifier", - "src": "2998:4:9" - } - ], - "id": 4538, - "name": "FunctionCall", - "src": "2990:13:9" - } - ], - "id": 4539, - "name": "FunctionCall", - "src": "2967:37:9" - } - ], - "id": 4540, - "name": "Assignment", - "src": "2952:52:9" - } - ], - "id": 4541, - "name": "ExpressionStatement", - "src": "2952:52:9" - } - ], - "id": 4542, - "name": "Block", - "src": "2445:566:9" - } - ], - "id": 4543, - "name": "FunctionDefinition", - "src": "2255:756:9" - }, - { - "attributes": { - "documentation": "@dev activate\n Activate a new dispenser\n@param datatoken refers to datatoken address.\n@param maxTokens - max tokens to dispense\n@param maxBalance - max balance of requester.", - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "activate", - "scope": 4986, - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "name": "datatoken", - "scope": 4643, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4544, - "name": "ElementaryTypeName", - "src": "3264:7:9" - } - ], - "id": 4545, - "name": "VariableDeclaration", - "src": "3264:17:9" - }, - { - "attributes": { - "constant": false, - "name": "maxTokens", - "scope": 4643, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4546, - "name": "ElementaryTypeName", - "src": "3282:7:9" - } - ], - "id": 4547, - "name": "VariableDeclaration", - "src": "3282:17:9" - }, - { - "attributes": { - "constant": false, - "name": "maxBalance", - "scope": 4643, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4548, - "name": "ElementaryTypeName", - "src": "3301:7:9" - } - ], - "id": 4549, - "name": "VariableDeclaration", - "src": "3301:18:9" - } - ], - "id": 4550, - "name": "ParameterList", - "src": "3263:57:9" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4551, - "name": "ParameterList", - "src": "3338:0:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4552, - "name": "Identifier", - "src": "3348:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "!=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4553, - "name": "Identifier", - "src": "3369:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4554, - "name": "ElementaryTypeNameExpression", - "src": "3382:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4555, - "name": "Literal", - "src": "3390:1:9" - } - ], - "id": 4556, - "name": "FunctionCall", - "src": "3382:10:9" - } - ], - "id": 4557, - "name": "BinaryOperation", - "src": "3369:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid token contract address\"", - "value": "Invalid token contract address" - }, - "id": 4558, - "name": "Literal", - "src": "3406:32:9" - } - ], - "id": 4559, - "name": "FunctionCall", - "src": "3348:100:9" - } - ], - "id": 4560, - "name": "ExpressionStatement", - "src": "3348:100:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4561, - "name": "Identifier", - "src": "3458:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "||", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "==", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "owner", - "referencedDeclaration": 4405, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4562, - "name": "Identifier", - "src": "3479:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4563, - "name": "Identifier", - "src": "3490:9:9" - } - ], - "id": 4564, - "name": "IndexAccess", - "src": "3479:21:9" - } - ], - "id": 4565, - "name": "MemberAccess", - "src": "3479:27:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4566, - "name": "ElementaryTypeNameExpression", - "src": "3510:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4567, - "name": "Literal", - "src": "3518:1:9" - } - ], - "id": 4568, - "name": "FunctionCall", - "src": "3510:10:9" - } - ], - "id": 4569, - "name": "BinaryOperation", - "src": "3479:41:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "==", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "owner", - "referencedDeclaration": 4405, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4570, - "name": "Identifier", - "src": "3524:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4571, - "name": "Identifier", - "src": "3535:9:9" - } - ], - "id": 4572, - "name": "IndexAccess", - "src": "3524:21:9" - } - ], - "id": 4573, - "name": "MemberAccess", - "src": "3524:27:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4574, - "name": "Identifier", - "src": "3555:3:9" - } - ], - "id": 4575, - "name": "MemberAccess", - "src": "3555:10:9" - } - ], - "id": 4576, - "name": "BinaryOperation", - "src": "3524:41:9" - } - ], - "id": 4577, - "name": "BinaryOperation", - "src": "3479:86:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "44617461546f6b656e20616c726561647920616374697661746564", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"DataToken already activated\"", - "value": "DataToken already activated" - }, - "id": 4578, - "name": "Literal", - "src": "3579:29:9" - } - ], - "id": 4579, - "name": "FunctionCall", - "src": "3458:160:9" - } - ], - "id": 4580, - "name": "ExpressionStatement", - "src": "3458:160:9" - }, - { - "attributes": { - "assignments": [ - 4582 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "tokenInstance", - "scope": 4642, - "stateVariable": false, - "storageLocation": "default", - "type": "contract IERC20Template", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "contractScope": null, - "name": "IERC20Template", - "referencedDeclaration": 5658, - "type": "contract IERC20Template" - }, - "id": 4581, - "name": "UserDefinedTypeName", - "src": "3628:14:9" - } - ], - "id": 4582, - "name": "VariableDeclaration", - "src": "3628:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "contract IERC20Template", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 5658, - "type": "type(contract IERC20Template)", - "value": "IERC20Template" - }, - "id": 4583, - "name": "Identifier", - "src": "3659:14:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4584, - "name": "Identifier", - "src": "3674:9:9" - } - ], - "id": 4585, - "name": "FunctionCall", - "src": "3659:25:9" - } - ], - "id": 4586, - "name": "VariableDeclarationStatement", - "src": "3628:56:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_b9ee47ffa5d7be08bbcf8e567aa23ba3d67c2f7b7ccc9551956c2443209e5c72", - "typeString": "literal_string \"Sender does not have the minter role\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4587, - "name": "Identifier", - "src": "3694:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "bool", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "isMinter", - "referencedDeclaration": 5608, - "type": "function (address) view external returns (bool)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4582, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4588, - "name": "Identifier", - "src": "3715:13:9" - } - ], - "id": 4589, - "name": "MemberAccess", - "src": "3715:22:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4590, - "name": "Identifier", - "src": "3738:3:9" - } - ], - "id": 4591, - "name": "MemberAccess", - "src": "3738:10:9" - } - ], - "id": 4592, - "name": "FunctionCall", - "src": "3715:34:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "53656e64657220646f6573206e6f74206861766520746865206d696e74657220726f6c65", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Sender does not have the minter role\"", - "value": "Sender does not have the minter role" - }, - "id": 4593, - "name": "Literal", - "src": "3763:38:9" - } - ], - "id": 4594, - "name": "FunctionCall", - "src": "3694:117:9" - } - ], - "id": 4595, - "name": "ExpressionStatement", - "src": "3694:117:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "member_name": "active", - "referencedDeclaration": 4403, - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4596, - "name": "Identifier", - "src": "3821:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4597, - "name": "Identifier", - "src": "3832:9:9" - } - ], - "id": 4598, - "name": "IndexAccess", - "src": "3821:21:9" - } - ], - "id": 4599, - "name": "MemberAccess", - "src": "3821:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "74727565", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "bool", - "type": "bool", - "value": "true" - }, - "id": 4600, - "name": "Literal", - "src": "3852:4:9" - } - ], - "id": 4601, - "name": "Assignment", - "src": "3821:35:9" - } - ], - "id": 4602, - "name": "ExpressionStatement", - "src": "3821:35:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "member_name": "owner", - "referencedDeclaration": 4405, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4603, - "name": "Identifier", - "src": "3866:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4604, - "name": "Identifier", - "src": "3877:9:9" - } - ], - "id": 4605, - "name": "IndexAccess", - "src": "3866:21:9" - } - ], - "id": 4606, - "name": "MemberAccess", - "src": "3866:27:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4607, - "name": "Identifier", - "src": "3896:3:9" - } - ], - "id": 4608, - "name": "MemberAccess", - "src": "3896:10:9" - } - ], - "id": 4609, - "name": "Assignment", - "src": "3866:40:9" - } - ], - "id": 4610, - "name": "ExpressionStatement", - "src": "3866:40:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "member_name": "maxTokens", - "referencedDeclaration": 4409, - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4611, - "name": "Identifier", - "src": "3916:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4612, - "name": "Identifier", - "src": "3927:9:9" - } - ], - "id": 4613, - "name": "IndexAccess", - "src": "3916:21:9" - } - ], - "id": 4614, - "name": "MemberAccess", - "src": "3916:31:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4547, - "type": "uint256", - "value": "maxTokens" - }, - "id": 4615, - "name": "Identifier", - "src": "3950:9:9" - } - ], - "id": 4616, - "name": "Assignment", - "src": "3916:43:9" - } - ], - "id": 4617, - "name": "ExpressionStatement", - "src": "3916:43:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "member_name": "maxBalance", - "referencedDeclaration": 4411, - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4618, - "name": "Identifier", - "src": "3969:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4619, - "name": "Identifier", - "src": "3980:9:9" - } - ], - "id": 4620, - "name": "IndexAccess", - "src": "3969:21:9" - } - ], - "id": 4621, - "name": "MemberAccess", - "src": "3969:32:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4549, - "type": "uint256", - "value": "maxBalance" - }, - "id": 4622, - "name": "Identifier", - "src": "4004:10:9" - } - ], - "id": 4623, - "name": "Assignment", - "src": "3969:45:9" - } - ], - "id": 4624, - "name": "ExpressionStatement", - "src": "3969:45:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "member_name": "minterApproved", - "referencedDeclaration": 4407, - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4625, - "name": "Identifier", - "src": "4024:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4626, - "name": "Identifier", - "src": "4035:9:9" - } - ], - "id": 4627, - "name": "IndexAccess", - "src": "4024:21:9" - } - ], - "id": 4628, - "name": "MemberAccess", - "src": "4024:36:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "66616c7365", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "bool", - "type": "bool", - "value": "false" - }, - "id": 4629, - "name": "Literal", - "src": "4063:5:9" - } - ], - "id": 4630, - "name": "Assignment", - "src": "4024:44:9" - } - ], - "id": 4631, - "name": "ExpressionStatement", - "src": "4024:44:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "uint256", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "push", - "referencedDeclaration": null, - "type": "function (address) returns (uint256)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4419, - "type": "address[] storage ref", - "value": "datatokensList" - }, - "id": 4632, - "name": "Identifier", - "src": "4078:14:9" - } - ], - "id": 4634, - "name": "MemberAccess", - "src": "4078:19:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4635, - "name": "Identifier", - "src": "4098:9:9" - } - ], - "id": 4636, - "name": "FunctionCall", - "src": "4078:30:9" - } - ], - "id": 4637, - "name": "ExpressionStatement", - "src": "4078:30:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4427, - "type": "function (address)", - "value": "Activated" - }, - "id": 4638, - "name": "Identifier", - "src": "4123:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4545, - "type": "address", - "value": "datatoken" - }, - "id": 4639, - "name": "Identifier", - "src": "4133:9:9" - } - ], - "id": 4640, - "name": "FunctionCall", - "src": "4123:20:9" - } - ], - "id": 4641, - "name": "EmitStatement", - "src": "4118:25:9" - } - ], - "id": 4642, - "name": "Block", - "src": "3338:812:9" - } - ], - "id": 4643, - "name": "FunctionDefinition", - "src": "3246:904:9" - }, - { - "attributes": { - "documentation": "@dev deactivate\n Deactivate an existing dispenser\n@param datatoken refers to datatoken address.", - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "deactivate", - "scope": 4986, - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "name": "datatoken", - "scope": 4680, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4644, - "name": "ElementaryTypeName", - "src": "4313:7:9" - } - ], - "id": 4645, - "name": "VariableDeclaration", - "src": "4313:17:9" - } - ], - "id": 4646, - "name": "ParameterList", - "src": "4312:19:9" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4647, - "name": "ParameterList", - "src": "4340:0:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4648, - "name": "Identifier", - "src": "4350:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "!=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4645, - "type": "address", - "value": "datatoken" - }, - "id": 4649, - "name": "Identifier", - "src": "4371:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4650, - "name": "ElementaryTypeNameExpression", - "src": "4384:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4651, - "name": "Literal", - "src": "4392:1:9" - } - ], - "id": 4652, - "name": "FunctionCall", - "src": "4384:10:9" - } - ], - "id": 4653, - "name": "BinaryOperation", - "src": "4371:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid token contract address\"", - "value": "Invalid token contract address" - }, - "id": 4654, - "name": "Literal", - "src": "4408:32:9" - } - ], - "id": 4655, - "name": "FunctionCall", - "src": "4350:100:9" - } - ], - "id": 4656, - "name": "ExpressionStatement", - "src": "4350:100:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4657, - "name": "Identifier", - "src": "4460:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "==", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "owner", - "referencedDeclaration": 4405, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4658, - "name": "Identifier", - "src": "4481:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4645, - "type": "address", - "value": "datatoken" - }, - "id": 4659, - "name": "Identifier", - "src": "4492:9:9" - } - ], - "id": 4660, - "name": "IndexAccess", - "src": "4481:21:9" - } - ], - "id": 4661, - "name": "MemberAccess", - "src": "4481:27:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4662, - "name": "Identifier", - "src": "4512:3:9" - } - ], - "id": 4663, - "name": "MemberAccess", - "src": "4512:10:9" - } - ], - "id": 4664, - "name": "BinaryOperation", - "src": "4481:41:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "44617461546f6b656e20616c726561647920616374697661746564", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"DataToken already activated\"", - "value": "DataToken already activated" - }, - "id": 4665, - "name": "Literal", - "src": "4536:29:9" - } - ], - "id": 4666, - "name": "FunctionCall", - "src": "4460:115:9" - } - ], - "id": 4667, - "name": "ExpressionStatement", - "src": "4460:115:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "member_name": "active", - "referencedDeclaration": 4403, - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4668, - "name": "Identifier", - "src": "4585:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4645, - "type": "address", - "value": "datatoken" - }, - "id": 4669, - "name": "Identifier", - "src": "4596:9:9" - } - ], - "id": 4670, - "name": "IndexAccess", - "src": "4585:21:9" - } - ], - "id": 4671, - "name": "MemberAccess", - "src": "4585:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "66616c7365", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "bool", - "type": "bool", - "value": "false" - }, - "id": 4672, - "name": "Literal", - "src": "4616:5:9" - } - ], - "id": 4673, - "name": "Assignment", - "src": "4585:36:9" - } - ], - "id": 4674, - "name": "ExpressionStatement", - "src": "4585:36:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4431, - "type": "function (address)", - "value": "Deactivated" - }, - "id": 4675, - "name": "Identifier", - "src": "4636:11:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4645, - "type": "address", - "value": "datatoken" - }, - "id": 4676, - "name": "Identifier", - "src": "4648:9:9" - } - ], - "id": 4677, - "name": "FunctionCall", - "src": "4636:22:9" - } - ], - "id": 4678, - "name": "EmitStatement", - "src": "4631:27:9" - } - ], - "id": 4679, - "name": "Block", - "src": "4340:325:9" - } - ], - "id": 4680, - "name": "FunctionDefinition", - "src": "4293:372:9" - }, - { - "attributes": { - "documentation": "@dev acceptMinter\n Accepts Minter role (existing datatoken minter has to call datatoken.proposeMinter(dispenserAddress) first)\n@param datatoken refers to datatoken address.", - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "acceptMinter", - "scope": 4986, - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "name": "datatoken", - "scope": 4727, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4681, - "name": "ElementaryTypeName", - "src": "4908:7:9" - } - ], - "id": 4682, - "name": "VariableDeclaration", - "src": "4908:17:9" - } - ], - "id": 4683, - "name": "ParameterList", - "src": "4907:19:9" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4684, - "name": "ParameterList", - "src": "4935:0:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4685, - "name": "Identifier", - "src": "4945:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "!=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4682, - "type": "address", - "value": "datatoken" - }, - "id": 4686, - "name": "Identifier", - "src": "4966:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4687, - "name": "ElementaryTypeNameExpression", - "src": "4979:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4688, - "name": "Literal", - "src": "4987:1:9" - } - ], - "id": 4689, - "name": "FunctionCall", - "src": "4979:10:9" - } - ], - "id": 4690, - "name": "BinaryOperation", - "src": "4966:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid token contract address\"", - "value": "Invalid token contract address" - }, - "id": 4691, - "name": "Literal", - "src": "5003:32:9" - } - ], - "id": 4692, - "name": "FunctionCall", - "src": "4945:100:9" - } - ], - "id": 4693, - "name": "ExpressionStatement", - "src": "4945:100:9" - }, - { - "attributes": { - "assignments": [ - 4695 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "tokenInstance", - "scope": 4726, - "stateVariable": false, - "storageLocation": "default", - "type": "contract IERC20Template", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "contractScope": null, - "name": "IERC20Template", - "referencedDeclaration": 5658, - "type": "contract IERC20Template" - }, - "id": 4694, - "name": "UserDefinedTypeName", - "src": "5055:14:9" - } - ], - "id": 4695, - "name": "VariableDeclaration", - "src": "5055:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "contract IERC20Template", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 5658, - "type": "type(contract IERC20Template)", - "value": "IERC20Template" - }, - "id": 4696, - "name": "Identifier", - "src": "5086:14:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4682, - "type": "address", - "value": "datatoken" - }, - "id": 4697, - "name": "Identifier", - "src": "5101:9:9" - } - ], - "id": 4698, - "name": "FunctionCall", - "src": "5086:25:9" - } - ], - "id": 4699, - "name": "VariableDeclarationStatement", - "src": "5055:56:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "arguments": [ - null - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - null - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "approveMinter", - "referencedDeclaration": 5657, - "type": "function () external" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4695, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4700, - "name": "Identifier", - "src": "5121:13:9" - } - ], - "id": 4702, - "name": "MemberAccess", - "src": "5121:27:9" - } - ], - "id": 4703, - "name": "FunctionCall", - "src": "5121:29:9" - } - ], - "id": 4704, - "name": "ExpressionStatement", - "src": "5121:29:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cfbec393383e0fce86a0bb31aa847b6ed694cf44c618a4606d1f2f2834c3497", - "typeString": "literal_string \"ERR: Cannot accept minter role\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4705, - "name": "Identifier", - "src": "5160:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "bool", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "isMinter", - "referencedDeclaration": 5608, - "type": "function (address) view external returns (bool)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4695, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4706, - "name": "Identifier", - "src": "5181:13:9" - } - ], - "id": 4707, - "name": "MemberAccess", - "src": "5181:22:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4708, - "name": "ElementaryTypeNameExpression", - "src": "5204:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4709, - "name": "Identifier", - "src": "5212:4:9" - } - ], - "id": 4710, - "name": "FunctionCall", - "src": "5204:13:9" - } - ], - "id": 4711, - "name": "FunctionCall", - "src": "5181:37:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "4552523a2043616e6e6f7420616363657074206d696e74657220726f6c65", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"ERR: Cannot accept minter role\"", - "value": "ERR: Cannot accept minter role" - }, - "id": 4712, - "name": "Literal", - "src": "5232:32:9" - } - ], - "id": 4713, - "name": "FunctionCall", - "src": "5160:114:9" - } - ], - "id": 4714, - "name": "ExpressionStatement", - "src": "5160:114:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "member_name": "minterApproved", - "referencedDeclaration": 4407, - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4715, - "name": "Identifier", - "src": "5284:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4682, - "type": "address", - "value": "datatoken" - }, - "id": 4716, - "name": "Identifier", - "src": "5295:9:9" - } - ], - "id": 4717, - "name": "IndexAccess", - "src": "5284:21:9" - } - ], - "id": 4718, - "name": "MemberAccess", - "src": "5284:36:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "74727565", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "bool", - "type": "bool", - "value": "true" - }, - "id": 4719, - "name": "Literal", - "src": "5323:4:9" - } - ], - "id": 4720, - "name": "Assignment", - "src": "5284:43:9" - } - ], - "id": 4721, - "name": "ExpressionStatement", - "src": "5284:43:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4435, - "type": "function (address)", - "value": "AcceptedMinter" - }, - "id": 4722, - "name": "Identifier", - "src": "5342:14:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4682, - "type": "address", - "value": "datatoken" - }, - "id": 4723, - "name": "Identifier", - "src": "5357:9:9" - } - ], - "id": 4724, - "name": "FunctionCall", - "src": "5342:25:9" - } - ], - "id": 4725, - "name": "EmitStatement", - "src": "5337:30:9" - } - ], - "id": 4726, - "name": "Block", - "src": "4935:439:9" - } - ], - "id": 4727, - "name": "FunctionDefinition", - "src": "4886:488:9" - }, - { - "attributes": { - "documentation": "@dev removeMinter\n Removes Minter role and proposes the owner as a new minter (the owner has to call approveMinter after this)\n@param datatoken refers to datatoken address.", - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "removeMinter", - "scope": 4986, - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "name": "datatoken", - "scope": 4789, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4728, - "name": "ElementaryTypeName", - "src": "5615:7:9" - } - ], - "id": 4729, - "name": "VariableDeclaration", - "src": "5615:17:9" - } - ], - "id": 4730, - "name": "ParameterList", - "src": "5614:19:9" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4731, - "name": "ParameterList", - "src": "5642:0:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4732, - "name": "Identifier", - "src": "5652:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "!=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4729, - "type": "address", - "value": "datatoken" - }, - "id": 4733, - "name": "Identifier", - "src": "5673:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4734, - "name": "ElementaryTypeNameExpression", - "src": "5686:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4735, - "name": "Literal", - "src": "5694:1:9" - } - ], - "id": 4736, - "name": "FunctionCall", - "src": "5686:10:9" - } - ], - "id": 4737, - "name": "BinaryOperation", - "src": "5673:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid token contract address\"", - "value": "Invalid token contract address" - }, - "id": 4738, - "name": "Literal", - "src": "5710:32:9" - } - ], - "id": 4739, - "name": "FunctionCall", - "src": "5652:100:9" - } - ], - "id": 4740, - "name": "ExpressionStatement", - "src": "5652:100:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_802727ce41e9ef5c4e956e0703828b375cc164569f34790696628fad0573768e", - "typeString": "literal_string \"DataToken already activated\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4741, - "name": "Identifier", - "src": "5762:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "==", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "owner", - "referencedDeclaration": 4405, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4742, - "name": "Identifier", - "src": "5783:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4729, - "type": "address", - "value": "datatoken" - }, - "id": 4743, - "name": "Identifier", - "src": "5794:9:9" - } - ], - "id": 4744, - "name": "IndexAccess", - "src": "5783:21:9" - } - ], - "id": 4745, - "name": "MemberAccess", - "src": "5783:27:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4746, - "name": "Identifier", - "src": "5814:3:9" - } - ], - "id": 4747, - "name": "MemberAccess", - "src": "5814:10:9" - } - ], - "id": 4748, - "name": "BinaryOperation", - "src": "5783:41:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "44617461546f6b656e20616c726561647920616374697661746564", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"DataToken already activated\"", - "value": "DataToken already activated" - }, - "id": 4749, - "name": "Literal", - "src": "5838:29:9" - } - ], - "id": 4750, - "name": "FunctionCall", - "src": "5762:115:9" - } - ], - "id": 4751, - "name": "ExpressionStatement", - "src": "5762:115:9" - }, - { - "attributes": { - "assignments": [ - 4753 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "tokenInstance", - "scope": 4788, - "stateVariable": false, - "storageLocation": "default", - "type": "contract IERC20Template", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "contractScope": null, - "name": "IERC20Template", - "referencedDeclaration": 5658, - "type": "contract IERC20Template" - }, - "id": 4752, - "name": "UserDefinedTypeName", - "src": "5887:14:9" - } - ], - "id": 4753, - "name": "VariableDeclaration", - "src": "5887:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "contract IERC20Template", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 5658, - "type": "type(contract IERC20Template)", - "value": "IERC20Template" - }, - "id": 4754, - "name": "Identifier", - "src": "5918:14:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4729, - "type": "address", - "value": "datatoken" - }, - "id": 4755, - "name": "Identifier", - "src": "5933:9:9" - } - ], - "id": 4756, - "name": "FunctionCall", - "src": "5918:25:9" - } - ], - "id": 4757, - "name": "VariableDeclarationStatement", - "src": "5887:56:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0cfbec393383e0fce86a0bb31aa847b6ed694cf44c618a4606d1f2f2834c3497", - "typeString": "literal_string \"ERR: Cannot accept minter role\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4758, - "name": "Identifier", - "src": "5953:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "bool", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "isMinter", - "referencedDeclaration": 5608, - "type": "function (address) view external returns (bool)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4753, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4759, - "name": "Identifier", - "src": "5974:13:9" - } - ], - "id": 4760, - "name": "MemberAccess", - "src": "5974:22:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4761, - "name": "ElementaryTypeNameExpression", - "src": "5997:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4762, - "name": "Identifier", - "src": "6005:4:9" - } - ], - "id": 4763, - "name": "FunctionCall", - "src": "5997:13:9" - } - ], - "id": 4764, - "name": "FunctionCall", - "src": "5974:37:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "4552523a2043616e6e6f7420616363657074206d696e74657220726f6c65", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"ERR: Cannot accept minter role\"", - "value": "ERR: Cannot accept minter role" - }, - "id": 4765, - "name": "Literal", - "src": "6025:32:9" - } - ], - "id": 4766, - "name": "FunctionCall", - "src": "5953:114:9" - } - ], - "id": 4767, - "name": "ExpressionStatement", - "src": "5953:114:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "proposeMinter", - "referencedDeclaration": 5654, - "type": "function (address) external" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4753, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4768, - "name": "Identifier", - "src": "6077:13:9" - } - ], - "id": 4770, - "name": "MemberAccess", - "src": "6077:27:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "owner", - "referencedDeclaration": 4405, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4771, - "name": "Identifier", - "src": "6105:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4729, - "type": "address", - "value": "datatoken" - }, - "id": 4772, - "name": "Identifier", - "src": "6116:9:9" - } - ], - "id": 4773, - "name": "IndexAccess", - "src": "6105:21:9" - } - ], - "id": 4774, - "name": "MemberAccess", - "src": "6105:27:9" - } - ], - "id": 4775, - "name": "FunctionCall", - "src": "6077:56:9" - } - ], - "id": 4776, - "name": "ExpressionStatement", - "src": "6077:56:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "member_name": "minterApproved", - "referencedDeclaration": 4407, - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4777, - "name": "Identifier", - "src": "6143:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4729, - "type": "address", - "value": "datatoken" - }, - "id": 4778, - "name": "Identifier", - "src": "6154:9:9" - } - ], - "id": 4779, - "name": "IndexAccess", - "src": "6143:21:9" - } - ], - "id": 4780, - "name": "MemberAccess", - "src": "6143:36:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "66616c7365", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "bool", - "type": "bool", - "value": "false" - }, - "id": 4781, - "name": "Literal", - "src": "6182:5:9" - } - ], - "id": 4782, - "name": "Assignment", - "src": "6143:44:9" - } - ], - "id": 4783, - "name": "ExpressionStatement", - "src": "6143:44:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4439, - "type": "function (address)", - "value": "RemovedMinter" - }, - "id": 4784, - "name": "Identifier", - "src": "6202:13:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4729, - "type": "address", - "value": "datatoken" - }, - "id": 4785, - "name": "Identifier", - "src": "6216:9:9" - } - ], - "id": 4786, - "name": "FunctionCall", - "src": "6202:24:9" - } - ], - "id": 4787, - "name": "EmitStatement", - "src": "6197:29:9" - } - ], - "id": 4788, - "name": "Block", - "src": "5642:591:9" - } - ], - "id": 4789, - "name": "FunctionDefinition", - "src": "5593:640:9" - }, - { - "attributes": { - "documentation": "@dev dispense\n Dispense datatokens to caller. The dispenser must be active, hold enough DT (or be able to mint more) and respect maxTokens/maxBalance requirements\n@param datatoken refers to datatoken address.\n@param datatoken amount of datatokens required.", - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "dispense", - "scope": 4986, - "stateMutability": "payable", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "name": "datatoken", - "scope": 4920, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4790, - "name": "ElementaryTypeName", - "src": "6562:7:9" - } - ], - "id": 4791, - "name": "VariableDeclaration", - "src": "6562:17:9" - }, - { - "attributes": { - "constant": false, - "name": "amount", - "scope": 4920, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4792, - "name": "ElementaryTypeName", - "src": "6581:7:9" - } - ], - "id": 4793, - "name": "VariableDeclaration", - "src": "6581:14:9" - } - ], - "id": 4794, - "name": "ParameterList", - "src": "6561:35:9" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4795, - "name": "ParameterList", - "src": "6613:0:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4796, - "name": "Identifier", - "src": "6623:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "!=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4791, - "type": "address", - "value": "datatoken" - }, - "id": 4797, - "name": "Identifier", - "src": "6644:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4798, - "name": "ElementaryTypeNameExpression", - "src": "6657:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4799, - "name": "Literal", - "src": "6665:1:9" - } - ], - "id": 4800, - "name": "FunctionCall", - "src": "6657:10:9" - } - ], - "id": 4801, - "name": "BinaryOperation", - "src": "6644:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid token contract address\"", - "value": "Invalid token contract address" - }, - "id": 4802, - "name": "Literal", - "src": "6681:32:9" - } - ], - "id": 4803, - "name": "FunctionCall", - "src": "6623:100:9" - } - ], - "id": 4804, - "name": "ExpressionStatement", - "src": "6623:100:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ad22fc5ad027c7c8b01eef1a92f40801532cfc3acc4dec7288322ef61342b858", - "typeString": "literal_string \"Dispenser not active\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4805, - "name": "Identifier", - "src": "6733:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "==", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "active", - "referencedDeclaration": 4403, - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4806, - "name": "Identifier", - "src": "6754:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4791, - "type": "address", - "value": "datatoken" - }, - "id": 4807, - "name": "Identifier", - "src": "6765:9:9" - } - ], - "id": 4808, - "name": "IndexAccess", - "src": "6754:21:9" - } - ], - "id": 4809, - "name": "MemberAccess", - "src": "6754:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "74727565", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "bool", - "type": "bool", - "value": "true" - }, - "id": 4810, - "name": "Literal", - "src": "6786:4:9" - } - ], - "id": 4811, - "name": "BinaryOperation", - "src": "6754:36:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "44697370656e736572206e6f7420616374697665", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Dispenser not active\"", - "value": "Dispenser not active" - }, - "id": 4812, - "name": "Literal", - "src": "6804:22:9" - } - ], - "id": 4813, - "name": "FunctionCall", - "src": "6733:103:9" - } - ], - "id": 4814, - "name": "ExpressionStatement", - "src": "6733:103:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_3e58cd0dd15e69c386ad46aeaec0637af7b133b0b08192a22e891c7d736d3ac8", - "typeString": "literal_string \"Invalid zero amount\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4815, - "name": "Identifier", - "src": "6846:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": ">", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4793, - "type": "uint256", - "value": "amount" - }, - "id": 4816, - "name": "Identifier", - "src": "6867:6:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4817, - "name": "Literal", - "src": "6876:1:9" - } - ], - "id": 4818, - "name": "BinaryOperation", - "src": "6867:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c6964207a65726f20616d6f756e74", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid zero amount\"", - "value": "Invalid zero amount" - }, - "id": 4819, - "name": "Literal", - "src": "6891:21:9" - } - ], - "id": 4820, - "name": "FunctionCall", - "src": "6846:76:9" - } - ], - "id": 4821, - "name": "ExpressionStatement", - "src": "6846:76:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7353a6bd8628dd713e866f78b282b0b6793f273d47e76330330b9a5a159c17ef", - "typeString": "literal_string \"Amount too high\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4822, - "name": "Identifier", - "src": "6932:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": ">=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "maxTokens", - "referencedDeclaration": 4409, - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4823, - "name": "Identifier", - "src": "6953:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4791, - "type": "address", - "value": "datatoken" - }, - "id": 4824, - "name": "Identifier", - "src": "6964:9:9" - } - ], - "id": 4825, - "name": "IndexAccess", - "src": "6953:21:9" - } - ], - "id": 4826, - "name": "MemberAccess", - "src": "6953:31:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4793, - "type": "uint256", - "value": "amount" - }, - "id": 4827, - "name": "Identifier", - "src": "6988:6:9" - } - ], - "id": 4828, - "name": "BinaryOperation", - "src": "6953:41:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "416d6f756e7420746f6f2068696768", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Amount too high\"", - "value": "Amount too high" - }, - "id": 4829, - "name": "Literal", - "src": "7008:17:9" - } - ], - "id": 4830, - "name": "FunctionCall", - "src": "6932:103:9" - } - ], - "id": 4831, - "name": "ExpressionStatement", - "src": "6932:103:9" - }, - { - "attributes": { - "assignments": [ - 4833 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "tokenInstance", - "scope": 4919, - "stateVariable": false, - "storageLocation": "default", - "type": "contract IERC20Template", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "contractScope": null, - "name": "IERC20Template", - "referencedDeclaration": 5658, - "type": "contract IERC20Template" - }, - "id": 4832, - "name": "UserDefinedTypeName", - "src": "7045:14:9" - } - ], - "id": 4833, - "name": "VariableDeclaration", - "src": "7045:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "contract IERC20Template", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 5658, - "type": "type(contract IERC20Template)", - "value": "IERC20Template" - }, - "id": 4834, - "name": "Identifier", - "src": "7076:14:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4791, - "type": "address", - "value": "datatoken" - }, - "id": 4835, - "name": "Identifier", - "src": "7091:9:9" - } - ], - "id": 4836, - "name": "FunctionCall", - "src": "7076:25:9" - } - ], - "id": 4837, - "name": "VariableDeclarationStatement", - "src": "7045:56:9" - }, - { - "attributes": { - "assignments": [ - 4839 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "callerBalance", - "scope": 4919, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4838, - "name": "ElementaryTypeName", - "src": "7111:7:9" - } - ], - "id": 4839, - "name": "VariableDeclaration", - "src": "7111:21:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "uint256", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "balanceOf", - "referencedDeclaration": 5640, - "type": "function (address) view external returns (uint256)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4833, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4840, - "name": "Identifier", - "src": "7135:13:9" - } - ], - "id": 4841, - "name": "MemberAccess", - "src": "7135:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4842, - "name": "Identifier", - "src": "7159:3:9" - } - ], - "id": 4843, - "name": "MemberAccess", - "src": "7159:10:9" - } - ], - "id": 4844, - "name": "FunctionCall", - "src": "7135:35:9" - } - ], - "id": 4845, - "name": "VariableDeclarationStatement", - "src": "7111:59:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_036daf442604eb31ad74da9a69fe5dbd62aabfebb2991e7c7d29a1f2fe39919a", - "typeString": "literal_string \"Caller balance too high\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4846, - "name": "Identifier", - "src": "7180:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "<", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4839, - "type": "uint256", - "value": "callerBalance" - }, - "id": 4847, - "name": "Identifier", - "src": "7201:13:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "maxBalance", - "referencedDeclaration": 4411, - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4848, - "name": "Identifier", - "src": "7215:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4791, - "type": "address", - "value": "datatoken" - }, - "id": 4849, - "name": "Identifier", - "src": "7226:9:9" - } - ], - "id": 4850, - "name": "IndexAccess", - "src": "7215:21:9" - } - ], - "id": 4851, - "name": "MemberAccess", - "src": "7215:32:9" - } - ], - "id": 4852, - "name": "BinaryOperation", - "src": "7201:46:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "43616c6c65722062616c616e636520746f6f2068696768", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Caller balance too high\"", - "value": "Caller balance too high" - }, - "id": 4853, - "name": "Literal", - "src": "7261:25:9" - } - ], - "id": 4854, - "name": "FunctionCall", - "src": "7180:116:9" - } - ], - "id": 4855, - "name": "ExpressionStatement", - "src": "7180:116:9" - }, - { - "attributes": { - "assignments": [ - 4857 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "ourBalance", - "scope": 4919, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4856, - "name": "ElementaryTypeName", - "src": "7306:7:9" - } - ], - "id": 4857, - "name": "VariableDeclaration", - "src": "7306:18:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "uint256", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "balanceOf", - "referencedDeclaration": 5640, - "type": "function (address) view external returns (uint256)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4833, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4858, - "name": "Identifier", - "src": "7327:13:9" - } - ], - "id": 4859, - "name": "MemberAccess", - "src": "7327:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4860, - "name": "ElementaryTypeNameExpression", - "src": "7351:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4861, - "name": "Identifier", - "src": "7359:4:9" - } - ], - "id": 4862, - "name": "FunctionCall", - "src": "7351:13:9" - } - ], - "id": 4863, - "name": "FunctionCall", - "src": "7327:38:9" - } - ], - "id": 4864, - "name": "VariableDeclarationStatement", - "src": "7306:59:9" - }, - { - "attributes": { - "falseBody": null - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "&&", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "<", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4857, - "type": "uint256", - "value": "ourBalance" - }, - "id": 4865, - "name": "Identifier", - "src": "7378:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4793, - "type": "uint256", - "value": "amount" - }, - "id": 4866, - "name": "Identifier", - "src": "7389:6:9" - } - ], - "id": 4867, - "name": "BinaryOperation", - "src": "7378:17:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "bool", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "isMinter", - "referencedDeclaration": 5608, - "type": "function (address) view external returns (bool)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4833, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4868, - "name": "Identifier", - "src": "7399:13:9" - } - ], - "id": 4869, - "name": "MemberAccess", - "src": "7399:22:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4870, - "name": "ElementaryTypeNameExpression", - "src": "7422:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4871, - "name": "Identifier", - "src": "7430:4:9" - } - ], - "id": 4872, - "name": "FunctionCall", - "src": "7422:13:9" - } - ], - "id": 4873, - "name": "FunctionCall", - "src": "7399:37:9" - } - ], - "id": 4874, - "name": "BinaryOperation", - "src": "7378:58:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "mint", - "referencedDeclaration": 5576, - "type": "function (address,uint256) external" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4833, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4875, - "name": "Identifier", - "src": "7507:13:9" - } - ], - "id": 4877, - "name": "MemberAccess", - "src": "7507:18:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4878, - "name": "ElementaryTypeNameExpression", - "src": "7526:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4879, - "name": "Identifier", - "src": "7534:4:9" - } - ], - "id": 4880, - "name": "FunctionCall", - "src": "7526:13:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "-", - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4793, - "type": "uint256", - "value": "amount" - }, - "id": 4881, - "name": "Identifier", - "src": "7540:6:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4857, - "type": "uint256", - "value": "ourBalance" - }, - "id": 4882, - "name": "Identifier", - "src": "7549:10:9" - } - ], - "id": 4883, - "name": "BinaryOperation", - "src": "7540:19:9" - } - ], - "id": 4884, - "name": "FunctionCall", - "src": "7507:53:9" - } - ], - "id": 4885, - "name": "ExpressionStatement", - "src": "7507:53:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "=", - "type": "uint256" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4857, - "type": "uint256", - "value": "ourBalance" - }, - "id": 4886, - "name": "Identifier", - "src": "7574:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "uint256", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "balanceOf", - "referencedDeclaration": 5640, - "type": "function (address) view external returns (uint256)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4833, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4887, - "name": "Identifier", - "src": "7587:13:9" - } - ], - "id": 4888, - "name": "MemberAccess", - "src": "7587:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4889, - "name": "ElementaryTypeNameExpression", - "src": "7611:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4890, - "name": "Identifier", - "src": "7619:4:9" - } - ], - "id": 4891, - "name": "FunctionCall", - "src": "7611:13:9" - } - ], - "id": 4892, - "name": "FunctionCall", - "src": "7587:38:9" - } - ], - "id": 4893, - "name": "Assignment", - "src": "7574:51:9" - } - ], - "id": 4894, - "name": "ExpressionStatement", - "src": "7574:51:9" - } - ], - "id": 4895, - "name": "Block", - "src": "7437:199:9" - } - ], - "id": 4896, - "name": "IfStatement", - "src": "7375:261:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6b90a513fa74c2a8dc35fe1591468e10fc67c299dc0f325ea992d29212514d24", - "typeString": "literal_string \"Not enough reserves\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4897, - "name": "Identifier", - "src": "7645:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": ">=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4857, - "type": "uint256", - "value": "ourBalance" - }, - "id": 4898, - "name": "Identifier", - "src": "7666:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4793, - "type": "uint256", - "value": "amount" - }, - "id": 4899, - "name": "Identifier", - "src": "7678:6:9" - } - ], - "id": 4900, - "name": "BinaryOperation", - "src": "7666:18:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "4e6f7420656e6f756768207265736572766573", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Not enough reserves\"", - "value": "Not enough reserves" - }, - "id": 4901, - "name": "Literal", - "src": "7698:21:9" - } - ], - "id": 4902, - "name": "FunctionCall", - "src": "7645:84:9" - } - ], - "id": 4903, - "name": "ExpressionStatement", - "src": "7645:84:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "bool", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "transfer", - "referencedDeclaration": 5649, - "type": "function (address,uint256) external returns (bool)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4833, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4904, - "name": "Identifier", - "src": "7739:13:9" - } - ], - "id": 4906, - "name": "MemberAccess", - "src": "7739:22:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4907, - "name": "Identifier", - "src": "7762:3:9" - } - ], - "id": 4908, - "name": "MemberAccess", - "src": "7762:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4793, - "type": "uint256", - "value": "amount" - }, - "id": 4909, - "name": "Identifier", - "src": "7773:6:9" - } - ], - "id": 4910, - "name": "FunctionCall", - "src": "7739:41:9" - } - ], - "id": 4911, - "name": "ExpressionStatement", - "src": "7739:41:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4447, - "type": "function (address,address,uint256)", - "value": "TokensDispensed" - }, - "id": 4912, - "name": "Identifier", - "src": "7795:15:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4791, - "type": "address", - "value": "datatoken" - }, - "id": 4913, - "name": "Identifier", - "src": "7811:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4914, - "name": "Identifier", - "src": "7822:3:9" - } - ], - "id": 4915, - "name": "MemberAccess", - "src": "7822:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4793, - "type": "uint256", - "value": "amount" - }, - "id": 4916, - "name": "Identifier", - "src": "7834:6:9" - } - ], - "id": 4917, - "name": "FunctionCall", - "src": "7795:46:9" - } - ], - "id": 4918, - "name": "EmitStatement", - "src": "7790:51:9" - } - ], - "id": 4919, - "name": "Block", - "src": "6613:1235:9" - } - ], - "id": 4920, - "name": "FunctionDefinition", - "src": "6544:1304:9" - }, - { - "attributes": { - "documentation": "@dev ownerWithdraw\n Allow owner to withdraw all datatokens in this dispenser balance\n@param datatoken refers to datatoken address.", - "implemented": true, - "isConstructor": false, - "kind": "function", - "modifiers": [ - null - ], - "name": "ownerWithdraw", - "scope": 4986, - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "children": [ - { - "attributes": { - "constant": false, - "name": "datatoken", - "scope": 4981, - "stateVariable": false, - "storageLocation": "default", - "type": "address", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "address", - "stateMutability": "nonpayable", - "type": "address" - }, - "id": 4921, - "name": "ElementaryTypeName", - "src": "8049:7:9" - } - ], - "id": 4922, - "name": "VariableDeclaration", - "src": "8049:17:9" - } - ], - "id": 4923, - "name": "ParameterList", - "src": "8048:19:9" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4924, - "name": "ParameterList", - "src": "8076:0:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06ebfe378f7fe772505ae89070020ed35d339723d05a163f9140463cf1c3e2e1", - "typeString": "literal_string \"Invalid token contract address\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4925, - "name": "Identifier", - "src": "8086:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "!=", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4922, - "type": "address", - "value": "datatoken" - }, - "id": 4926, - "name": "Identifier", - "src": "8107:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": true, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4927, - "name": "ElementaryTypeNameExpression", - "src": "8120:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4928, - "name": "Literal", - "src": "8128:1:9" - } - ], - "id": 4929, - "name": "FunctionCall", - "src": "8120:10:9" - } - ], - "id": 4930, - "name": "BinaryOperation", - "src": "8107:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c696420746f6b656e20636f6e74726163742061646472657373", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid token contract address\"", - "value": "Invalid token contract address" - }, - "id": 4931, - "name": "Literal", - "src": "8144:32:9" - } - ], - "id": 4932, - "name": "FunctionCall", - "src": "8086:100:9" - } - ], - "id": 4933, - "name": "ExpressionStatement", - "src": "8086:100:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_110461b12e459dc76e692e7a47f9621cf45c7d48020c3c7b2066107cdf1f52ae", - "typeString": "literal_string \"Invalid owner\"" - } - ], - "overloadedDeclarations": [ - 7124, - 7125 - ], - "referencedDeclaration": 7125, - "type": "function (bool,string memory) pure", - "value": "require" - }, - "id": 4934, - "name": "Identifier", - "src": "8196:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": "==", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "member_name": "owner", - "referencedDeclaration": 4405, - "type": "address" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "type": "struct Dispenser.DataToken storage ref" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4416, - "type": "mapping(address => struct Dispenser.DataToken storage ref)", - "value": "datatokens" - }, - "id": 4935, - "name": "Identifier", - "src": "8217:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4922, - "type": "address", - "value": "datatoken" - }, - "id": 4936, - "name": "Identifier", - "src": "8228:9:9" - } - ], - "id": 4937, - "name": "IndexAccess", - "src": "8217:21:9" - } - ], - "id": 4938, - "name": "MemberAccess", - "src": "8217:27:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4939, - "name": "Identifier", - "src": "8248:3:9" - } - ], - "id": 4940, - "name": "MemberAccess", - "src": "8248:10:9" - } - ], - "id": 4941, - "name": "BinaryOperation", - "src": "8217:41:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "496e76616c6964206f776e6572", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "string", - "type": "literal_string \"Invalid owner\"", - "value": "Invalid owner" - }, - "id": 4942, - "name": "Literal", - "src": "8272:15:9" - } - ], - "id": 4943, - "name": "FunctionCall", - "src": "8196:101:9" - } - ], - "id": 4944, - "name": "ExpressionStatement", - "src": "8196:101:9" - }, - { - "attributes": { - "assignments": [ - 4946 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "tokenInstance", - "scope": 4980, - "stateVariable": false, - "storageLocation": "default", - "type": "contract IERC20Template", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "contractScope": null, - "name": "IERC20Template", - "referencedDeclaration": 5658, - "type": "contract IERC20Template" - }, - "id": 4945, - "name": "UserDefinedTypeName", - "src": "8307:14:9" - } - ], - "id": 4946, - "name": "VariableDeclaration", - "src": "8307:28:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "contract IERC20Template", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 5658, - "type": "type(contract IERC20Template)", - "value": "IERC20Template" - }, - "id": 4947, - "name": "Identifier", - "src": "8338:14:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4922, - "type": "address", - "value": "datatoken" - }, - "id": 4948, - "name": "Identifier", - "src": "8353:9:9" - } - ], - "id": 4949, - "name": "FunctionCall", - "src": "8338:25:9" - } - ], - "id": 4950, - "name": "VariableDeclarationStatement", - "src": "8307:56:9" - }, - { - "attributes": { - "assignments": [ - 4952 - ] - }, - "children": [ - { - "attributes": { - "constant": false, - "name": "ourBalance", - "scope": 4980, - "stateVariable": false, - "storageLocation": "default", - "type": "uint256", - "value": null, - "visibility": "internal" - }, - "children": [ - { - "attributes": { - "name": "uint256", - "type": "uint256" - }, - "id": 4951, - "name": "ElementaryTypeName", - "src": "8373:7:9" - } - ], - "id": 4952, - "name": "VariableDeclaration", - "src": "8373:18:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "uint256", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "balanceOf", - "referencedDeclaration": 5640, - "type": "function (address) view external returns (uint256)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4946, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4953, - "name": "Identifier", - "src": "8394:13:9" - } - ], - "id": 4954, - "name": "MemberAccess", - "src": "8394:23:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "address payable", - "type_conversion": true - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_Dispenser_$4986", - "typeString": "contract Dispenser" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "type": "type(address)", - "value": "address" - }, - "id": 4955, - "name": "ElementaryTypeNameExpression", - "src": "8418:7:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7165, - "type": "contract Dispenser", - "value": "this" - }, - "id": 4956, - "name": "Identifier", - "src": "8426:4:9" - } - ], - "id": 4957, - "name": "FunctionCall", - "src": "8418:13:9" - } - ], - "id": 4958, - "name": "FunctionCall", - "src": "8394:38:9" - } - ], - "id": 4959, - "name": "VariableDeclarationStatement", - "src": "8373:59:9" - }, - { - "attributes": { - "falseBody": null - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "operator": ">", - "type": "bool" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4952, - "type": "uint256", - "value": "ourBalance" - }, - "id": 4960, - "name": "Identifier", - "src": "8445:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "hexvalue": "30", - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "subdenomination": null, - "token": "number", - "type": "int_const 0", - "value": "0" - }, - "id": 4961, - "name": "Literal", - "src": "8456:1:9" - } - ], - "id": 4962, - "name": "BinaryOperation", - "src": "8445:12:9" - }, - { - "children": [ - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "bool", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "transfer", - "referencedDeclaration": 5649, - "type": "function (address,uint256) external returns (bool)" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4946, - "type": "contract IERC20Template", - "value": "tokenInstance" - }, - "id": 4963, - "name": "Identifier", - "src": "8472:13:9" - } - ], - "id": 4965, - "name": "MemberAccess", - "src": "8472:22:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4966, - "name": "Identifier", - "src": "8495:3:9" - } - ], - "id": 4967, - "name": "MemberAccess", - "src": "8495:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4952, - "type": "uint256", - "value": "ourBalance" - }, - "id": 4968, - "name": "Identifier", - "src": "8506:10:9" - } - ], - "id": 4969, - "name": "FunctionCall", - "src": "8472:45:9" - } - ], - "id": 4970, - "name": "ExpressionStatement", - "src": "8472:45:9" - }, - { - "children": [ - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "isStructConstructorCall": false, - "lValueRequested": false, - "names": [ - null - ], - "type": "tuple()", - "type_conversion": false - }, - "children": [ - { - "attributes": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4455, - "type": "function (address,address,uint256)", - "value": "OwnerWithdrawed" - }, - "id": 4971, - "name": "Identifier", - "src": "8536:15:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4922, - "type": "address", - "value": "datatoken" - }, - "id": 4972, - "name": "Identifier", - "src": "8552:9:9" - }, - { - "attributes": { - "argumentTypes": null, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "member_name": "sender", - "referencedDeclaration": null, - "type": "address payable" - }, - "children": [ - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 7121, - "type": "msg", - "value": "msg" - }, - "id": 4973, - "name": "Identifier", - "src": "8563:3:9" - } - ], - "id": 4974, - "name": "MemberAccess", - "src": "8563:10:9" - }, - { - "attributes": { - "argumentTypes": null, - "overloadedDeclarations": [ - null - ], - "referencedDeclaration": 4952, - "type": "uint256", - "value": "ourBalance" - }, - "id": 4975, - "name": "Identifier", - "src": "8575:10:9" - } - ], - "id": 4976, - "name": "FunctionCall", - "src": "8536:50:9" - } - ], - "id": 4977, - "name": "EmitStatement", - "src": "8531:55:9" - } - ], - "id": 4978, - "name": "Block", - "src": "8458:139:9" - } - ], - "id": 4979, - "name": "IfStatement", - "src": "8442:155:9" - } - ], - "id": 4980, - "name": "Block", - "src": "8076:527:9" - } - ], - "id": 4981, - "name": "FunctionDefinition", - "src": "8026:577:9" - }, - { - "attributes": { - "documentation": null, - "implemented": true, - "isConstructor": false, - "kind": "fallback", - "modifiers": [ - null - ], - "name": "", - "scope": 4986, - "stateMutability": "payable", - "superFunction": null, - "visibility": "external" - }, - "children": [ - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4982, - "name": "ParameterList", - "src": "8616:2:9" - }, - { - "attributes": { - "parameters": [ - null - ] - }, - "children": [], - "id": 4983, - "name": "ParameterList", - "src": "8636:0:9" - }, - { - "attributes": { - "statements": [ - null - ] - }, - "children": [], - "id": 4984, - "name": "Block", - "src": "8636:45:9" - } - ], - "id": 4985, - "name": "FunctionDefinition", - "src": "8608:73:9" - } - ], - "id": 4986, - "name": "ContractDefinition", - "src": "231:8452:9" - } - ], - "id": 4987, - "name": "SourceUnit", - "src": "0:8683:9" - }, - "compiler": { - "name": "solc", - "version": "0.5.7+commit.6da8b019.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.3.4", - "updatedAt": "2021-04-26T10:46:14.822Z", - "devdoc": { - "methods": { - "acceptMinter(address)": { - "details": "acceptMinter Accepts Minter role (existing datatoken minter has to call datatoken.proposeMinter(dispenserAddress) first)", - "params": { - "datatoken": "refers to datatoken address." - } - }, - "activate(address,uint256,uint256)": { - "details": "activate Activate a new dispenser", - "params": { - "datatoken": "refers to datatoken address.", - "maxBalance": "- max balance of requester.", - "maxTokens": "- max tokens to dispense" - } - }, - "deactivate(address)": { - "details": "deactivate Deactivate an existing dispenser", - "params": { - "datatoken": "refers to datatoken address." - } - }, - "dispense(address,uint256)": { - "details": "dispense Dispense datatokens to caller. The dispenser must be active, hold enough DT (or be able to mint more) and respect maxTokens/maxBalance requirements", - "params": { - "datatoken": "amount of datatokens required." - } - }, - "ownerWithdraw(address)": { - "details": "ownerWithdraw Allow owner to withdraw all datatokens in this dispenser balance", - "params": { - "datatoken": "refers to datatoken address." - } - }, - "removeMinter(address)": { - "details": "removeMinter Removes Minter role and proposes the owner as a new minter (the owner has to call approveMinter after this)", - "params": { - "datatoken": "refers to datatoken address." - } - }, - "status(address)": { - "details": "status Get information about a datatoken dispenser", - "params": { - "datatoken": "refers to datatoken address." - }, - "return": "active - if the dispenser is active for this datatokenowner - owner of this dispenserminterApproved - if the dispenser is a minter for this datatokenisTrueMinter - check the datatoken contract if this contract is really a mintermaxTokens - max tokens to dispensemaxBalance - max balance of requester. If the balance is higher, the dispense is rejectedbalance - internal balance of the contract (if any)" - } - } - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/abis/ERC20.json b/abis/ERC20.json deleted file mode 100644 index 02214fe..0000000 --- a/abis/ERC20.json +++ /dev/null @@ -1,222 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_spender", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_from", - "type": "address" - }, - { - "name": "_to", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "decimals", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "name": "balance", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "name": "", - "type": "string" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "_to", - "type": "address" - }, - { - "name": "_value", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "_owner", - "type": "address" - }, - { - "name": "_spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "payable": true, - "stateMutability": "payable", - "type": "fallback" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "from", - "type": "address" - }, - { - "indexed": true, - "name": "to", - "type": "address" - }, - { - "indexed": false, - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - } - ] \ No newline at end of file diff --git a/abis/ERC20NameBytes.json b/abis/ERC20NameBytes.json deleted file mode 100644 index 93e9abb..0000000 --- a/abis/ERC20NameBytes.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } - ] \ No newline at end of file diff --git a/abis/ERC20SymbolBytes.json b/abis/ERC20SymbolBytes.json deleted file mode 100644 index f0bcf3e..0000000 --- a/abis/ERC20SymbolBytes.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "constant": true, - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } - ] \ No newline at end of file diff --git a/abis/ERC20Template.json b/abis/ERC20Template.json new file mode 100644 index 0000000..c2a3a85 --- /dev/null +++ b/abis/ERC20Template.json @@ -0,0 +1,1174 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ERC20Template", + "sourceName": "contracts/templates/ERC20Template.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "AddedFeeManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "AddedMinter", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "CleanedPermissions", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "currentMinter", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newMinter", + "type": "address" + } + ], + "name": "MinterApproved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "currentMinter", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newMinter", + "type": "address" + } + ], + "name": "MinterProposed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "NewFixedRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "poolAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "ssContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "basetokenAddress", + "type": "address" + } + ], + "name": "NewPool", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "consumer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "serviceId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "publishMarketAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "consumeFeeMarketAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "OrderStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "RemovedFeeManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "RemovedMinter", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "BASE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BASE_COMMUNITY_FEE_PERCENTAGE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_feeManager", + "type": "address" + } + ], + "name": "addFeeManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_minter", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "authERC20", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "cleanFrom721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cleanPermissions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dispenser", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "withMint", + "type": "bool" + }, + { + "internalType": "address", + "name": "allowedSwapper", + "type": "address" + } + ], + "name": "createDispenser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fixedPriceAddress", + "type": "address" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + } + ], + "name": "createFixedRate", + "outputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "ssParams", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "swapFees", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + } + ], + "name": "deployPool", + "outputs": [ + { + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getFeeCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getId", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getPublishingMarketFee", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string[]", + "name": "strings_", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "addresses_", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "factoryAddresses_", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints_", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "bytes_", + "type": "bytes[]" + } + ], + "name": "initialize", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isInitialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "permissions", + "outputs": [ + { + "internalType": "bool", + "name": "minter", + "type": "bool" + }, + { + "internalType": "bool", + "name": "feeManager", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_feeManager", + "type": "address" + } + ], + "name": "removeFeeManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "_value", + "type": "bytes" + } + ], + "name": "setData", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newFeeCollector", + "type": "address" + } + ], + "name": "setFeeCollector", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_publishMarketFeeAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_publishMarketFeeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_publishMarketFeeAmount", + "type": "uint256" + } + ], + "name": "setPublishingMarketFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "consumer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "consumeFeeAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "consumeFeeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "consumeFeeAmount", + "type": "uint256" + } + ], + "name": "startOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x6080604052600a805460ff60a01b191690553480156200001e57600080fd5b5060408051808201825260048152631d195cdd60e21b60208083019182528351808501909452600a8452691d195cdd14de5b589bdb60b21b9084015281519192916200006d916003916200008c565b508051620000839060049060208401906200008c565b5050506200016f565b8280546200009a9062000132565b90600052602060002090601f016020900481019282620000be576000855562000109565b82601f10620000d957805160ff191683800117855562000109565b8280016001018555821562000109579182015b8281111562000109578251825591602001919060010190620000ec565b50620001179291506200011b565b5090565b5b808211156200011757600081556001016200011c565b600181811c908216806200014757607f821691505b602082108114156200016957634e487b7160e01b600052602260045260246000fd5b50919050565b613f07806200017f6000396000f3fe6080604052600436106102525760003560e01c806370a0823111610138578063aa271e1a116100b0578063dd62ed3e11610077578063dd62ed3e14610787578063e086e5ec146107cd578063ec342ad0146107d5578063ef867ff4146107f1578063f887ea4014610811578063fda9dae71461083157005b8063aa271e1a146106d9578063ab62f0e114610712578063b2263a5d14610732578063b3998be014610747578063d505accf1461076757005b80638b96412b116100ff5780638b96412b1461062457806395d89b4114610644578063983b2d5614610659578063a42dce8014610679578063a457c2d714610699578063a9059cbb146106b957005b806370a082311461056c57806379cc6790146105a25780637ecebe00146105c25780638115c9cc146105ef57806382c03da51461060f57005b8063355274ea116101cb57806340c10f191161019257806340c10f19146104c357806342966c68146104e35780634f189cb21461050357806357ad5ff6146105185780635bfe4da0146105385780635d1ca6311461055857005b8063355274ea1461041d5780633644e51514610432578063392e53cd146104485780633950935114610467578063397b37431461048757005b8063191c918a1161021a578063191c918a146103475780631f2d32c31461036757806323b872dd146103875780633092afd5146103a757806330adf81f146103c7578063313ce567146103fb57005b806301e882081461025457806306fdde03146102a9578063095ea7b3146102cb57806312fde4b7146102fb57806318160ddd14610328575b005b34801561026057600080fd5b5061028d61026f366004613496565b60056020526000908152604090205460ff8082169161010090041682565b6040805192151583529015156020830152015b60405180910390f35b3480156102b557600080fd5b506102be610851565b6040516102a09190613bda565b3480156102d757600080fd5b506102eb6102e6366004613637565b6108e3565b60405190151581526020016102a0565b34801561030757600080fd5b506103106108f9565b6040516001600160a01b0390911681526020016102a0565b34801561033457600080fd5b506002545b6040519081526020016102a0565b34801561035357600080fd5b506102526103623660046136ca565b61099d565b34801561037357600080fd5b50610252610382366004613496565b610ae4565b34801561039357600080fd5b506102eb6103a2366004613509565b610b92565b3480156103b357600080fd5b506102526103c2366004613496565b610c3c565b3480156103d357600080fd5b506103397f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b34801561040757600080fd5b5060125b60405160ff90911681526020016102a0565b34801561042957600080fd5b50600954610339565b34801561043e57600080fd5b5061033960105481565b34801561045457600080fd5b50600a54600160a01b900460ff166102eb565b34801561047357600080fd5b506102eb610482366004613637565b610ce7565b34801561049357600080fd5b50600d54600e54600f54604080516001600160a01b039485168152939092166020840152908201526060016102a0565b3480156104cf57600080fd5b506102526104de366004613637565b610d23565b3480156104ef57600080fd5b506102526104fe3660046139c5565b610df9565b34801561050f57600080fd5b50610252610e03565b34801561052457600080fd5b50610252610533366004613509565b610ef9565b34801561054457600080fd5b5061031061055336600461381a565b610f9b565b34801561056457600080fd5b50600161040b565b34801561057857600080fd5b50610339610587366004613496565b6001600160a01b031660009081526020819052604090205490565b3480156105ae57600080fd5b506102526105bd366004613637565b6112a4565b3480156105ce57600080fd5b506103396105dd366004613496565b60116020526000908152604090205481565b3480156105fb57600080fd5b5061025261060a366004613496565b61132a565b34801561061b57600080fd5b506102526113d5565b34801561063057600080fd5b5061033961063f3660046135c1565b61142f565b34801561065057600080fd5b506102be6115f2565b34801561066557600080fd5b50610252610674366004613496565b611601565b34801561068557600080fd5b50610252610694366004613496565b6116ac565b3480156106a557600080fd5b506102eb6106b4366004613637565b611738565b3480156106c557600080fd5b506102eb6106d4366004613637565b6117d1565b3480156106e557600080fd5b506102eb6106f4366004613496565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561071e57600080fd5b5061025261072d3660046138ce565b6117de565b34801561073e57600080fd5b50610339611923565b34801561075357600080fd5b506102eb610762366004613729565b611939565b34801561077357600080fd5b5061025261078236600461354a565b611a73565b34801561079357600080fd5b506103396107a23660046134d0565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610252611c85565b3480156107e157600080fd5b50610339670de0b6b3a764000081565b3480156107fd57600080fd5b5061031061080c3660046139c5565b611cc5565b34801561081d57600080fd5b50601254610310906001600160a01b031681565b34801561083d57600080fd5b5061025261084c366004613663565b611cef565b60606007805461086090613e16565b80601f016020809104026020016040519081016040528092919081815260200182805461088c90613e16565b80156108d95780601f106108ae576101008083540402835291602001916108d9565b820191906000526020600020905b8154815290600101906020018083116108bc57829003601f168201915b5050505050905090565b60006108f0338484612548565b50600192915050565b600c546000906001600160a01b031661098d57600b546040516331a9108f60e11b8152600160048201526001600160a01b0390911690636352211e9060240160206040518083038186803b15801561095057600080fd5b505afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098891906134b3565b905090565b50600c546001600160a01b031690565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b1580156109e257600080fd5b505af11580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1a9190613940565b602001511515600114610a485760405162461bcd60e51b8152600401610a3f90613c2f565b60405180910390fd5b601254604051636b14d00560e11b81526001600160a01b038781166004830152306024830152604482018790526064820186905233608483015283811660a48301529091169063d629a00a9060c401600060405180830381600087803b158015610ab157600080fd5b505af1158015610ac5573d6000803e3d6000fd5b5050505081151560011415610add57610add8561266c565b5050505050565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b158015610b2957600080fd5b505af1158015610b3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b619190613940565b602001511515600114610b865760405162461bcd60e51b8152600401610a3f90613c2f565b610b8f8161276e565b50565b6000610b9f84848461287c565b6001600160a01b038416600090815260016020908152604080832033845290915290205482811015610c245760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401610a3f565b610c318533858403612548565b506001949350505050565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b158015610c8157600080fd5b505af1158015610c95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb99190613940565b602001511515600114610cde5760405162461bcd60e51b8152600401610a3f90613c2f565b610b8f81612a4b565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916108f0918590610d1e908690613cb9565b612548565b3360009081526005602052604090205460ff161515600114610d875760405162461bcd60e51b815260206004820152601960248201527f455243323054656d706c6174653a204e4f54204d494e544552000000000000006044820152606401610a3f565b600954610d9d82610d9760025490565b90612aab565b1115610deb5760405162461bcd60e51b815260206004820152601f60248201527f44617461546f6b656e54656d706c6174653a20636170206578636565646564006044820152606401610a3f565b610df58282612abe565b5050565b610b8f3382612b9d565b600b546040516331a9108f60e11b8152600160048201526001600160a01b0390911690636352211e9060240160206040518083038186803b158015610e4757600080fd5b505afa158015610e5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7f91906134b3565b6001600160a01b0316336001600160a01b031614610edf5760405162461bcd60e51b815260206004820152601b60248201527f455243323054656d706c6174653a206e6f74204e46544f776e657200000000006044820152606401610a3f565b610ee7612ceb565b600c80546001600160a01b0319169055565b600d546001600160a01b03163314610f665760405162461bcd60e51b815260206004820152602a60248201527f455243323054656d706c6174653a206e6f74207075626c6973684d61726b65746044820152694665654164647265737360b01b6064820152608401610a3f565b600d80546001600160a01b039485166001600160a01b031991821617909155600e805493909416921691909117909155600f55565b600b5460405163160a792560e01b81523360048201526000916001600160a01b03169063160a792590602401608060405180830381600087803b158015610fe157600080fd5b505af1158015610ff5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110199190613940565b60200151151560011461103e5760405162461bcd60e51b8152600401610a3f90613c2f565b6002541561109a5760405162461bcd60e51b8152602060048201526024808201527f455243323054656d706c6174653a20746f6b656e7320616c7265616479206d696044820152631b9d195960e21b6064820152608401610a3f565b6110bd826000815181106110b0576110b0613e82565b602002602001015161266c565b62250490846003815181106110d4576110d4613e82565b60200260200101511161113b5760405162461bcd60e51b815260206004820152602960248201527f455243323054656d706c6174653a206d696e696d756d20626c6f636b73206e6f6044820152681d081c995858da195960ba1b6064820152608401610a3f565b60006040518060400160405280306001600160a01b03166001600160a01b031681526020018460018151811061117357611173613e82565b60209081029190910101516001600160a01b0390811690915260125460405163ee3bc63560e01b8152929350169063ee3bc635906111bb908490899089908990600401613b2e565b602060405180830381600087803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906134b3565b91507fd02da1bec30f7f750aa0a131745dfb9ce96767c45a192dc26409f5d690e0b967828460008151811061124457611244613e82565b60200260200101518560018151811061125f5761125f613e82565b6020026020010151604051611294939291906001600160a01b0393841681529183166020830152909116604082015260600190565b60405180910390a1509392505050565b60006112b083336107a2565b90508181101561130e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b6064820152608401610a3f565b61131b8333848403612548565b6113258383612b9d565b505050565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b15801561136f57600080fd5b505af1158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a79190613940565b6020015115156001146113cc5760405162461bcd60e51b8152600401610a3f90613c2f565b610b8f81612d9a565b600b546001600160a01b03163314610edf5760405162461bcd60e51b815260206004820152601f60248201527f455243323054656d706c6174653a204e4f542037323120436f6e7472616374006044820152606401610a3f565b600b5460405163160a792560e01b81523360048201526000916001600160a01b03169063160a792590602401608060405180830381600087803b15801561147557600080fd5b505af1158015611489573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ad9190613940565b6020015115156001146114d25760405162461bcd60e51b8152600401610a3f90613c2f565b601254604051638244937560e01b81526001600160a01b039091169063824493759061150690879087908790600401613aee565b602060405180830381600087803b15801561152057600080fd5b505af1158015611534573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155891906138b5565b905060008260048151811061156f5761156f613e82565b60200260200101511115611586576115868461266c565b7f195d202f33578769e120c3041341554af3193e67ee004175095bc9c06e6e616581846000815181106115bb576115bb613e82565b60200260200101516040516115e39291909182526001600160a01b0316602082015260400190565b60405180910390a19392505050565b60606008805461086090613e16565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b15801561164657600080fd5b505af115801561165a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167e9190613940565b6020015115156001146116a35760405162461bcd60e51b8152600401610a3f90613c2f565b610b8f8161266c565b3360009081526005602052604090205460ff6101009091041615156001146117165760405162461bcd60e51b815260206004820152601e60248201527f455243323054656d706c6174653a204e4f5420464545204d414e4147455200006044820152606401610a3f565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156117ba5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610a3f565b6117c73385858403612548565b5060019392505050565b60006108f033848461287c565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b15801561182357600080fd5b505af1158015611837573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185b9190613940565b6020015115156001146118805760405162461bcd60e51b8152600401610a3f90613c2f565b6040516bffffffffffffffffffffffff193060601b16602082015260009060340160408051601f19818403018152908290528051602090910120600b546301caf8fd60e31b83529092506001600160a01b031690630e57c7e8906118ec90849087908790600401613ba4565b600060405180830381600087803b15801561190657600080fd5b505af115801561191a573d6000803e3d6000fd5b50505050505050565b6119366064670de0b6b3a7640000613cd1565b81565b600a54600090600160a01b900460ff16156119b05760405162461bcd60e51b815260206004820152603160248201527f455243323054656d706c6174653a20746f6b656e20696e7374616e636520616c6044820152701c9958591e481a5b9a5d1a585b1a5e9959607a1b6064820152608401610a3f565b611a646119bd8b8d613d96565b8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b918291850190849080828437600092019190915250611a5f92508991508a9050613d0a565b612dfb565b9b9a5050505050505050505050565b42841015611ab65760405162461bcd60e51b815260206004820152601060248201526f115490cc8c11150e881156141254915160821b6044820152606401610a3f565b6010546001600160a01b038816600090815260116020526040812080549192917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611b0983613e51565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611b8292919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611bed573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611c235750886001600160a01b0316816001600160a01b0316145b611c6f5760405162461bcd60e51b815260206004820152601a60248201527f455243323044543a20494e56414c49445f5349474e41545552450000000000006044820152606401610a3f565b611c7a898989612548565b505050505050505050565b611c8d6108f9565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015610b8f573d6000803e3d6000fd5b60068181548110611cd557600080fd5b6000918252602090912001546001600160a01b0316905081565b336000908152602081905260408120548190871115611d5e5760405162461bcd60e51b815260206004820152602560248201527f4e6f7420656e6f756768204461746120546f6b656e7320746f2073746172742060448201526427b93232b960d91b6064820152608401610a3f565b6000600f54118015611d7a5750600e546001600160a01b031615155b8015611d905750600d546001600160a01b031615155b15611f9957600e54600f546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015611deb57600080fd5b505af1158015611dff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e239190613898565b611e7b5760405162461bcd60e51b815260206004820152602360248201527f4661696c656420746f207472616e73666572207075626c6973684d61726b657460448201526246656560e81b6064820152608401610a3f565b600f54611e89906064613248565b600e54600d54600f549293506001600160a01b039182169263a9059cbb9290911690611eb59085613254565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f339190613898565b611f995760405162461bcd60e51b815260206004820152603160248201527f4661696c656420746f207472616e736665722066656520746f207075626c6973604482015270684d61726b65744665654164647265737360781b6064820152608401610a3f565b600083118015611fb157506001600160a01b03841615155b8015611fc557506001600160a01b03851615155b156121a1576040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b038516906323b872dd90606401602060405180830381600087803b15801561201857600080fd5b505af115801561202c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120509190613898565b61209c5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f207472616e7366657220636f6e73756d654665650000006044820152606401610a3f565b6120a7836064613248565b91506001600160a01b03841663a9059cbb866120c38686613254565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561210957600080fd5b505af115801561211d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121419190613898565b6121a15760405162461bcd60e51b815260206004820152602b60248201527f4661696c656420746f207472616e736665722066656520746f20636f6e73756d60448201526a654665654164647265737360a81b6064820152608401610a3f565b6000811180156121b15750600082115b80156121ca5750600e546001600160a01b038581169116145b156122ca57600a546001600160a01b038086169163a9059cbb91166121ef8486612aab565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561223557600080fd5b505af1158015612249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226d9190613898565b6122c55760405162461bcd60e51b815260206004820152602360248201527f4661696c656420746f207472616e7366657220626f7468206665657320746f2060448201526227a82360e91b6064820152608401610a3f565b6124c9565b6000811180156122e45750600e546001600160a01b031615155b156123cc57600e54600a5460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b15801561233957600080fd5b505af115801561234d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123719190613898565b6123cc5760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f207472616e73666572207075626c6973682066656573206044820152653a379027a82360d11b6064820152608401610a3f565b6000821180156123e457506001600160a01b03841615155b156124c957600a5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018490529085169063a9059cbb90604401602060405180830381600087803b15801561243757600080fd5b505af115801561244b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061246f9190613898565b6124c95760405162461bcd60e51b815260206004820152602560248201527f4661696c656420746f207472616e7366657220636f6e73756d65206665652074604482015264379027a82360d91b6064820152608401610a3f565b6124da6124d46108f9565b886117d1565b50600d5460408051338152602081018a90529081018890524260608201524360808201526001600160a01b0387811692811691908b16907fb07adb6a34680ecbbc7935971c45a07b9baf67ce5dc57332d51e3a5745c9e9639060a00160405180910390a45050505050505050565b6001600160a01b0383166125aa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610a3f565b6001600160a01b03821661260b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610a3f565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0381166000908152600560205260409020805460ff16156126d65760405162461bcd60e51b815260206004820152601d60248201527f4552433230526f6c65733a2020414c52454144592041204d494e5445520000006044820152606401610a3f565b8054600160ff19909116811782556006805491820181556000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319166001600160a01b038416908117909155604080514281524360208201523392917f4f7e100eb1ee13e903798bd0d6aa854152e07eb05544f392b9409c12935c809591015b60405180910390a35050565b6001600160a01b03811660009081526005602052604090208054610100900460ff16156127e85760405162461bcd60e51b815260206004820152602260248201527f4552433230526f6c65733a2020414c5245414459204120464545204d414e414760448201526122a960f11b6064820152608401610a3f565b805461ff001916610100178155600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0384166001600160a01b03199091168117909155604080514281524360208201523392917f5b0831b6bc7ca878cadad8a6b96869b9db121df456a859f03261d13f4d08204b9101612762565b6001600160a01b0383166128e05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610a3f565b6001600160a01b0382166129425760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610a3f565b6001600160a01b038316600090815260208190526040902054818110156129ba5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610a3f565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906129f1908490613cb9565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612a3d91815260200190565b60405180910390a350505050565b6001600160a01b03811660008181526005602052604090819020805460ff191681559051909133917fefa2735987005aaa89c050c0ff8cc9ae7d9079d19382081c429130f98c52d480906127629042904390918252602082015260400190565b6000612ab78284613cb9565b9392505050565b6001600160a01b038216612b145760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610a3f565b8060026000828254612b269190613cb9565b90915550506001600160a01b03821660009081526020819052604081208054839290612b53908490613cb9565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216612bfd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610a3f565b6001600160a01b03821660009081526020819052604090205481811015612c715760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610a3f565b6001600160a01b0383166000908152602081905260408120838303905560028054849290612ca0908490613cf3565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60005b600654811015612d515760006005600060068481548110612d1157612d11613e82565b60009182526020808320909101546001600160a01b031683528201929092526040019020805461ffff191690555080612d4981613e51565b915050612cee565b50612d5e60066000613260565b6040805142815243602082015233917f712bc71db81927a76b8bf1ea346247bb0ad58f18e4e5c1bd4aa0ec6573e02a2b910160405180910390a2565b6001600160a01b03811660008181526005602052604090819020805461ff00191681559051909133917fc6148ac08e050e2098c5d953dffbbf54d7eae1a56b8d894015268bfc2dff5b6a906127629042904390918252602082015260400190565b60008084600081518110612e1157612e11613e82565b60200260200101519050600085600181518110612e3057612e30613e82565b6020026020010151905060006001600160a01b0316826001600160a01b03161415612eb25760405162461bcd60e51b815260206004820152602c60248201527f455243323054656d706c6174653a20496e76616c6964206d696e7465722c202060448201526b7a65726f206164647265737360a01b6064820152608401610a3f565b6001600160a01b038116612f2e5760405162461bcd60e51b815260206004820152603c60248201527f455243323054656d706c6174653a20496e76616c696420636f6d6d756e69747960448201527f2066656520636f6c6c6563746f722c207a65726f2061646472657373000000006064820152608401610a3f565b84600081518110612f4157612f41613e82565b602002602001015160001415612fa55760405162461bcd60e51b8152602060048201526024808201527f44617461546f6b656e54656d706c6174653a20496e76616c6964206361702076604482015263616c756560e01b6064820152608401610a3f565b84600081518110612fb857612fb8613e82565b602002602001015160098190555087600081518110612fd957612fd9613e82565b602002602001015160079080519060200190612ff692919061327e565b508760018151811061300a5761300a613e82565b60200260200101516008908051906020019061302792919061327e565b50600b80546001600160a01b0319166001600160a01b03841617905585518690600290811061305857613058613e82565b6020908102919091010151601280546001600160a01b039283166001600160a01b0319909116179055600a80546001600160a81b03191691831691909117600160a01b17905586516130b59088906000906110b0576110b0613e82565b6130d8876001815181106130cb576130cb613e82565b602002602001015161276e565b866002815181106130eb576130eb613e82565b6020026020010151600d60006101000a8154816001600160a01b0302191690836001600160a01b031602179055508660038151811061312c5761312c613e82565b6020026020010151600e60006101000a8154816001600160a01b0302191690836001600160a01b031602179055508460018151811061316d5761316d613e82565b6020026020010151600f8190555060004690507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60076040516131b09190613a52565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018290523060a082015260c00160408051808303601f1901815291905280516020909101206010555050600a54600160a01b900460ff16979650505050505050565b6000612ab78284613cd1565b6000612ab78284613cf3565b5080546000825590600052602060002090810190610b8f9190613302565b82805461328a90613e16565b90600052602060002090601f0160209004810192826132ac57600085556132f2565b82601f106132c557805160ff19168380011785556132f2565b828001600101855582156132f2579182015b828111156132f25782518255916020019190600101906132d7565b506132fe929150613302565b5090565b5b808211156132fe5760008155600101613303565b600067ffffffffffffffff83111561333157613331613e98565b613344601f8401601f1916602001613c64565b905082815283838301111561335857600080fd5b828260208301376000602084830101529392505050565b60008083601f84011261338157600080fd5b50813567ffffffffffffffff81111561339957600080fd5b6020830191508360208260051b85010111156133b457600080fd5b9250929050565b600082601f8301126133cc57600080fd5b813560206133e16133dc83613c95565b613c64565b80838252828201915082860187848660051b890101111561340157600080fd5b60005b8581101561342957813561341781613eae565b84529284019290840190600101613404565b5090979650505050505050565b600082601f83011261344757600080fd5b813560206134576133dc83613c95565b80838252828201915082860187848660051b890101111561347757600080fd5b60005b858110156134295781358452928401929084019060010161347a565b6000602082840312156134a857600080fd5b8135612ab781613eae565b6000602082840312156134c557600080fd5b8151612ab781613eae565b600080604083850312156134e357600080fd5b82356134ee81613eae565b915060208301356134fe81613eae565b809150509250929050565b60008060006060848603121561351e57600080fd5b833561352981613eae565b9250602084013561353981613eae565b929592945050506040919091013590565b600080600080600080600060e0888a03121561356557600080fd5b873561357081613eae565b9650602088013561358081613eae565b95506040880135945060608801359350608088013560ff811681146135a457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806000606084860312156135d657600080fd5b83356135e181613eae565b9250602084013567ffffffffffffffff808211156135fe57600080fd5b61360a878388016133bb565b9350604086013591508082111561362057600080fd5b5061362d86828701613436565b9150509250925092565b6000806040838503121561364a57600080fd5b823561365581613eae565b946020939093013593505050565b60008060008060008060c0878903121561367c57600080fd5b863561368781613eae565b9550602087013594506040870135935060608701356136a581613eae565b925060808701356136b581613eae565b8092505060a087013590509295509295509295565b600080600080600060a086880312156136e257600080fd5b85356136ed81613eae565b94506020860135935060408601359250606086013561370b81613ec3565b9150608086013561371b81613eae565b809150509295509295909350565b60008060008060008060008060008060a08b8d03121561374857600080fd5b8a3567ffffffffffffffff8082111561376057600080fd5b61376c8e838f0161336f565b909c509a5060208d013591508082111561378557600080fd5b6137918e838f0161336f565b909a50985060408d01359150808211156137aa57600080fd5b6137b68e838f0161336f565b909850965060608d01359150808211156137cf57600080fd5b6137db8e838f0161336f565b909650945060808d01359150808211156137f457600080fd5b506138018d828e0161336f565b915080935050809150509295989b9194979a5092959850565b60008060006060848603121561382f57600080fd5b833567ffffffffffffffff8082111561384757600080fd5b61385387838801613436565b9450602086013591508082111561386957600080fd5b61387587838801613436565b9350604086013591508082111561388b57600080fd5b5061362d868287016133bb565b6000602082840312156138aa57600080fd5b8151612ab781613ec3565b6000602082840312156138c757600080fd5b5051919050565b600080602083850312156138e157600080fd5b823567ffffffffffffffff808211156138f957600080fd5b818501915085601f83011261390d57600080fd5b81358181111561391c57600080fd5b86602082850101111561392e57600080fd5b60209290920196919550909350505050565b60006080828403121561395257600080fd5b6040516080810181811067ffffffffffffffff8211171561397557613975613e98565b604052825161398381613ec3565b8152602083015161399381613ec3565b602082015260408301516139a681613ec3565b604082015260608301516139b981613ec3565b60608201529392505050565b6000602082840312156139d757600080fd5b5035919050565b600081518084526020808501945080840160005b83811015613a175781516001600160a01b0316875295820195908201906001016139f2565b509495945050505050565b600081518084526020808501945080840160005b83811015613a1757815187529582019590820190600101613a36565b600080835481600182811c915080831680613a6e57607f831692505b6020808410821415613a8e57634e487b7160e01b86526022600452602486fd5b818015613aa25760018114613ab357613ae0565b60ff19861689528489019650613ae0565b60008a81526020902060005b86811015613ad85781548b820152908501908301613abf565b505084890196505b509498975050505050505050565b6001600160a01b0384168152606060208201819052600090613b12908301856139de565b8281036040840152613b248185613a22565b9695505050505050565b60008186825b6002811015613b5c5781516001600160a01b0316835260209283019290910190600101613b34565b50505060a06040830152613b7360a0830186613a22565b8281036060840152613b858186613a22565b90508281036080840152613b9981856139de565b979650505050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208083528351808285015260005b81811015613c0757858101830151858201604001528201613beb565b81811115613c19576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f455243323054656d706c6174653a204e4f54204445504c4f59455220524f4c45604082015260600190565b604051601f8201601f1916810167ffffffffffffffff81118282101715613c8d57613c8d613e98565b604052919050565b600067ffffffffffffffff821115613caf57613caf613e98565b5060051b60200190565b60008219821115613ccc57613ccc613e6c565b500190565b600082613cee57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015613d0557613d05613e6c565b500390565b6000613d186133dc84613c95565b808482526020808301925084368760051b87011115613d3657600080fd5b60005b87811015613d8a57813567ffffffffffffffff811115613d5857600080fd5b870136601f820112613d6957600080fd5b613d77368235868401613317565b8652509382019390820190600101613d39565b50919695505050505050565b6000613da46133dc84613c95565b808482526020808301925084368760051b87011115613dc257600080fd5b60005b87811015613d8a57813567ffffffffffffffff811115613de457600080fd5b870136601f820112613df557600080fd5b613e03368235868401613317565b8652509382019390820190600101613dc5565b600181811c90821680613e2a57607f821691505b60208210811415613e4b57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613e6557613e65613e6c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b8f57600080fd5b8015158114610b8f57600080fdfea2646970667358221220168b31cc6fab32fdd684bd93720e0104e156ada91ff56e4fb12452539769f78964736f6c63430008070033", + "deployedBytecode": "0x6080604052600436106102525760003560e01c806370a0823111610138578063aa271e1a116100b0578063dd62ed3e11610077578063dd62ed3e14610787578063e086e5ec146107cd578063ec342ad0146107d5578063ef867ff4146107f1578063f887ea4014610811578063fda9dae71461083157005b8063aa271e1a146106d9578063ab62f0e114610712578063b2263a5d14610732578063b3998be014610747578063d505accf1461076757005b80638b96412b116100ff5780638b96412b1461062457806395d89b4114610644578063983b2d5614610659578063a42dce8014610679578063a457c2d714610699578063a9059cbb146106b957005b806370a082311461056c57806379cc6790146105a25780637ecebe00146105c25780638115c9cc146105ef57806382c03da51461060f57005b8063355274ea116101cb57806340c10f191161019257806340c10f19146104c357806342966c68146104e35780634f189cb21461050357806357ad5ff6146105185780635bfe4da0146105385780635d1ca6311461055857005b8063355274ea1461041d5780633644e51514610432578063392e53cd146104485780633950935114610467578063397b37431461048757005b8063191c918a1161021a578063191c918a146103475780631f2d32c31461036757806323b872dd146103875780633092afd5146103a757806330adf81f146103c7578063313ce567146103fb57005b806301e882081461025457806306fdde03146102a9578063095ea7b3146102cb57806312fde4b7146102fb57806318160ddd14610328575b005b34801561026057600080fd5b5061028d61026f366004613496565b60056020526000908152604090205460ff8082169161010090041682565b6040805192151583529015156020830152015b60405180910390f35b3480156102b557600080fd5b506102be610851565b6040516102a09190613bda565b3480156102d757600080fd5b506102eb6102e6366004613637565b6108e3565b60405190151581526020016102a0565b34801561030757600080fd5b506103106108f9565b6040516001600160a01b0390911681526020016102a0565b34801561033457600080fd5b506002545b6040519081526020016102a0565b34801561035357600080fd5b506102526103623660046136ca565b61099d565b34801561037357600080fd5b50610252610382366004613496565b610ae4565b34801561039357600080fd5b506102eb6103a2366004613509565b610b92565b3480156103b357600080fd5b506102526103c2366004613496565b610c3c565b3480156103d357600080fd5b506103397f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b34801561040757600080fd5b5060125b60405160ff90911681526020016102a0565b34801561042957600080fd5b50600954610339565b34801561043e57600080fd5b5061033960105481565b34801561045457600080fd5b50600a54600160a01b900460ff166102eb565b34801561047357600080fd5b506102eb610482366004613637565b610ce7565b34801561049357600080fd5b50600d54600e54600f54604080516001600160a01b039485168152939092166020840152908201526060016102a0565b3480156104cf57600080fd5b506102526104de366004613637565b610d23565b3480156104ef57600080fd5b506102526104fe3660046139c5565b610df9565b34801561050f57600080fd5b50610252610e03565b34801561052457600080fd5b50610252610533366004613509565b610ef9565b34801561054457600080fd5b5061031061055336600461381a565b610f9b565b34801561056457600080fd5b50600161040b565b34801561057857600080fd5b50610339610587366004613496565b6001600160a01b031660009081526020819052604090205490565b3480156105ae57600080fd5b506102526105bd366004613637565b6112a4565b3480156105ce57600080fd5b506103396105dd366004613496565b60116020526000908152604090205481565b3480156105fb57600080fd5b5061025261060a366004613496565b61132a565b34801561061b57600080fd5b506102526113d5565b34801561063057600080fd5b5061033961063f3660046135c1565b61142f565b34801561065057600080fd5b506102be6115f2565b34801561066557600080fd5b50610252610674366004613496565b611601565b34801561068557600080fd5b50610252610694366004613496565b6116ac565b3480156106a557600080fd5b506102eb6106b4366004613637565b611738565b3480156106c557600080fd5b506102eb6106d4366004613637565b6117d1565b3480156106e557600080fd5b506102eb6106f4366004613496565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561071e57600080fd5b5061025261072d3660046138ce565b6117de565b34801561073e57600080fd5b50610339611923565b34801561075357600080fd5b506102eb610762366004613729565b611939565b34801561077357600080fd5b5061025261078236600461354a565b611a73565b34801561079357600080fd5b506103396107a23660046134d0565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610252611c85565b3480156107e157600080fd5b50610339670de0b6b3a764000081565b3480156107fd57600080fd5b5061031061080c3660046139c5565b611cc5565b34801561081d57600080fd5b50601254610310906001600160a01b031681565b34801561083d57600080fd5b5061025261084c366004613663565b611cef565b60606007805461086090613e16565b80601f016020809104026020016040519081016040528092919081815260200182805461088c90613e16565b80156108d95780601f106108ae576101008083540402835291602001916108d9565b820191906000526020600020905b8154815290600101906020018083116108bc57829003601f168201915b5050505050905090565b60006108f0338484612548565b50600192915050565b600c546000906001600160a01b031661098d57600b546040516331a9108f60e11b8152600160048201526001600160a01b0390911690636352211e9060240160206040518083038186803b15801561095057600080fd5b505afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098891906134b3565b905090565b50600c546001600160a01b031690565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b1580156109e257600080fd5b505af11580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1a9190613940565b602001511515600114610a485760405162461bcd60e51b8152600401610a3f90613c2f565b60405180910390fd5b601254604051636b14d00560e11b81526001600160a01b038781166004830152306024830152604482018790526064820186905233608483015283811660a48301529091169063d629a00a9060c401600060405180830381600087803b158015610ab157600080fd5b505af1158015610ac5573d6000803e3d6000fd5b5050505081151560011415610add57610add8561266c565b5050505050565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b158015610b2957600080fd5b505af1158015610b3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b619190613940565b602001511515600114610b865760405162461bcd60e51b8152600401610a3f90613c2f565b610b8f8161276e565b50565b6000610b9f84848461287c565b6001600160a01b038416600090815260016020908152604080832033845290915290205482811015610c245760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b6064820152608401610a3f565b610c318533858403612548565b506001949350505050565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b158015610c8157600080fd5b505af1158015610c95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb99190613940565b602001511515600114610cde5760405162461bcd60e51b8152600401610a3f90613c2f565b610b8f81612a4b565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916108f0918590610d1e908690613cb9565b612548565b3360009081526005602052604090205460ff161515600114610d875760405162461bcd60e51b815260206004820152601960248201527f455243323054656d706c6174653a204e4f54204d494e544552000000000000006044820152606401610a3f565b600954610d9d82610d9760025490565b90612aab565b1115610deb5760405162461bcd60e51b815260206004820152601f60248201527f44617461546f6b656e54656d706c6174653a20636170206578636565646564006044820152606401610a3f565b610df58282612abe565b5050565b610b8f3382612b9d565b600b546040516331a9108f60e11b8152600160048201526001600160a01b0390911690636352211e9060240160206040518083038186803b158015610e4757600080fd5b505afa158015610e5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7f91906134b3565b6001600160a01b0316336001600160a01b031614610edf5760405162461bcd60e51b815260206004820152601b60248201527f455243323054656d706c6174653a206e6f74204e46544f776e657200000000006044820152606401610a3f565b610ee7612ceb565b600c80546001600160a01b0319169055565b600d546001600160a01b03163314610f665760405162461bcd60e51b815260206004820152602a60248201527f455243323054656d706c6174653a206e6f74207075626c6973684d61726b65746044820152694665654164647265737360b01b6064820152608401610a3f565b600d80546001600160a01b039485166001600160a01b031991821617909155600e805493909416921691909117909155600f55565b600b5460405163160a792560e01b81523360048201526000916001600160a01b03169063160a792590602401608060405180830381600087803b158015610fe157600080fd5b505af1158015610ff5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110199190613940565b60200151151560011461103e5760405162461bcd60e51b8152600401610a3f90613c2f565b6002541561109a5760405162461bcd60e51b8152602060048201526024808201527f455243323054656d706c6174653a20746f6b656e7320616c7265616479206d696044820152631b9d195960e21b6064820152608401610a3f565b6110bd826000815181106110b0576110b0613e82565b602002602001015161266c565b62250490846003815181106110d4576110d4613e82565b60200260200101511161113b5760405162461bcd60e51b815260206004820152602960248201527f455243323054656d706c6174653a206d696e696d756d20626c6f636b73206e6f6044820152681d081c995858da195960ba1b6064820152608401610a3f565b60006040518060400160405280306001600160a01b03166001600160a01b031681526020018460018151811061117357611173613e82565b60209081029190910101516001600160a01b0390811690915260125460405163ee3bc63560e01b8152929350169063ee3bc635906111bb908490899089908990600401613b2e565b602060405180830381600087803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120d91906134b3565b91507fd02da1bec30f7f750aa0a131745dfb9ce96767c45a192dc26409f5d690e0b967828460008151811061124457611244613e82565b60200260200101518560018151811061125f5761125f613e82565b6020026020010151604051611294939291906001600160a01b0393841681529183166020830152909116604082015260600190565b60405180910390a1509392505050565b60006112b083336107a2565b90508181101561130e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b6064820152608401610a3f565b61131b8333848403612548565b6113258383612b9d565b505050565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b15801561136f57600080fd5b505af1158015611383573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a79190613940565b6020015115156001146113cc5760405162461bcd60e51b8152600401610a3f90613c2f565b610b8f81612d9a565b600b546001600160a01b03163314610edf5760405162461bcd60e51b815260206004820152601f60248201527f455243323054656d706c6174653a204e4f542037323120436f6e7472616374006044820152606401610a3f565b600b5460405163160a792560e01b81523360048201526000916001600160a01b03169063160a792590602401608060405180830381600087803b15801561147557600080fd5b505af1158015611489573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ad9190613940565b6020015115156001146114d25760405162461bcd60e51b8152600401610a3f90613c2f565b601254604051638244937560e01b81526001600160a01b039091169063824493759061150690879087908790600401613aee565b602060405180830381600087803b15801561152057600080fd5b505af1158015611534573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155891906138b5565b905060008260048151811061156f5761156f613e82565b60200260200101511115611586576115868461266c565b7f195d202f33578769e120c3041341554af3193e67ee004175095bc9c06e6e616581846000815181106115bb576115bb613e82565b60200260200101516040516115e39291909182526001600160a01b0316602082015260400190565b60405180910390a19392505050565b60606008805461086090613e16565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b15801561164657600080fd5b505af115801561165a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167e9190613940565b6020015115156001146116a35760405162461bcd60e51b8152600401610a3f90613c2f565b610b8f8161266c565b3360009081526005602052604090205460ff6101009091041615156001146117165760405162461bcd60e51b815260206004820152601e60248201527f455243323054656d706c6174653a204e4f5420464545204d414e4147455200006044820152606401610a3f565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156117ba5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610a3f565b6117c73385858403612548565b5060019392505050565b60006108f033848461287c565b600b5460405163160a792560e01b81523360048201526001600160a01b039091169063160a792590602401608060405180830381600087803b15801561182357600080fd5b505af1158015611837573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185b9190613940565b6020015115156001146118805760405162461bcd60e51b8152600401610a3f90613c2f565b6040516bffffffffffffffffffffffff193060601b16602082015260009060340160408051601f19818403018152908290528051602090910120600b546301caf8fd60e31b83529092506001600160a01b031690630e57c7e8906118ec90849087908790600401613ba4565b600060405180830381600087803b15801561190657600080fd5b505af115801561191a573d6000803e3d6000fd5b50505050505050565b6119366064670de0b6b3a7640000613cd1565b81565b600a54600090600160a01b900460ff16156119b05760405162461bcd60e51b815260206004820152603160248201527f455243323054656d706c6174653a20746f6b656e20696e7374616e636520616c6044820152701c9958591e481a5b9a5d1a585b1a5e9959607a1b6064820152608401610a3f565b611a646119bd8b8d613d96565b8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b918291850190849080828437600092019190915250611a5f92508991508a9050613d0a565b612dfb565b9b9a5050505050505050505050565b42841015611ab65760405162461bcd60e51b815260206004820152601060248201526f115490cc8c11150e881156141254915160821b6044820152606401610a3f565b6010546001600160a01b038816600090815260116020526040812080549192917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611b0983613e51565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e00160405160208183030381529060405280519060200120604051602001611b8292919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa158015611bed573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611c235750886001600160a01b0316816001600160a01b0316145b611c6f5760405162461bcd60e51b815260206004820152601a60248201527f455243323044543a20494e56414c49445f5349474e41545552450000000000006044820152606401610a3f565b611c7a898989612548565b505050505050505050565b611c8d6108f9565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015610b8f573d6000803e3d6000fd5b60068181548110611cd557600080fd5b6000918252602090912001546001600160a01b0316905081565b336000908152602081905260408120548190871115611d5e5760405162461bcd60e51b815260206004820152602560248201527f4e6f7420656e6f756768204461746120546f6b656e7320746f2073746172742060448201526427b93232b960d91b6064820152608401610a3f565b6000600f54118015611d7a5750600e546001600160a01b031615155b8015611d905750600d546001600160a01b031615155b15611f9957600e54600f546040516323b872dd60e01b815233600482015230602482015260448101919091526001600160a01b03909116906323b872dd90606401602060405180830381600087803b158015611deb57600080fd5b505af1158015611dff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e239190613898565b611e7b5760405162461bcd60e51b815260206004820152602360248201527f4661696c656420746f207472616e73666572207075626c6973684d61726b657460448201526246656560e81b6064820152608401610a3f565b600f54611e89906064613248565b600e54600d54600f549293506001600160a01b039182169263a9059cbb9290911690611eb59085613254565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f339190613898565b611f995760405162461bcd60e51b815260206004820152603160248201527f4661696c656420746f207472616e736665722066656520746f207075626c6973604482015270684d61726b65744665654164647265737360781b6064820152608401610a3f565b600083118015611fb157506001600160a01b03841615155b8015611fc557506001600160a01b03851615155b156121a1576040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b038516906323b872dd90606401602060405180830381600087803b15801561201857600080fd5b505af115801561202c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120509190613898565b61209c5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f207472616e7366657220636f6e73756d654665650000006044820152606401610a3f565b6120a7836064613248565b91506001600160a01b03841663a9059cbb866120c38686613254565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561210957600080fd5b505af115801561211d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121419190613898565b6121a15760405162461bcd60e51b815260206004820152602b60248201527f4661696c656420746f207472616e736665722066656520746f20636f6e73756d60448201526a654665654164647265737360a81b6064820152608401610a3f565b6000811180156121b15750600082115b80156121ca5750600e546001600160a01b038581169116145b156122ca57600a546001600160a01b038086169163a9059cbb91166121ef8486612aab565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561223557600080fd5b505af1158015612249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226d9190613898565b6122c55760405162461bcd60e51b815260206004820152602360248201527f4661696c656420746f207472616e7366657220626f7468206665657320746f2060448201526227a82360e91b6064820152608401610a3f565b6124c9565b6000811180156122e45750600e546001600160a01b031615155b156123cc57600e54600a5460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b15801561233957600080fd5b505af115801561234d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123719190613898565b6123cc5760405162461bcd60e51b815260206004820152602660248201527f4661696c656420746f207472616e73666572207075626c6973682066656573206044820152653a379027a82360d11b6064820152608401610a3f565b6000821180156123e457506001600160a01b03841615155b156124c957600a5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018490529085169063a9059cbb90604401602060405180830381600087803b15801561243757600080fd5b505af115801561244b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061246f9190613898565b6124c95760405162461bcd60e51b815260206004820152602560248201527f4661696c656420746f207472616e7366657220636f6e73756d65206665652074604482015264379027a82360d91b6064820152608401610a3f565b6124da6124d46108f9565b886117d1565b50600d5460408051338152602081018a90529081018890524260608201524360808201526001600160a01b0387811692811691908b16907fb07adb6a34680ecbbc7935971c45a07b9baf67ce5dc57332d51e3a5745c9e9639060a00160405180910390a45050505050505050565b6001600160a01b0383166125aa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610a3f565b6001600160a01b03821661260b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610a3f565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0381166000908152600560205260409020805460ff16156126d65760405162461bcd60e51b815260206004820152601d60248201527f4552433230526f6c65733a2020414c52454144592041204d494e5445520000006044820152606401610a3f565b8054600160ff19909116811782556006805491820181556000527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319166001600160a01b038416908117909155604080514281524360208201523392917f4f7e100eb1ee13e903798bd0d6aa854152e07eb05544f392b9409c12935c809591015b60405180910390a35050565b6001600160a01b03811660009081526005602052604090208054610100900460ff16156127e85760405162461bcd60e51b815260206004820152602260248201527f4552433230526f6c65733a2020414c5245414459204120464545204d414e414760448201526122a960f11b6064820152608401610a3f565b805461ff001916610100178155600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0384166001600160a01b03199091168117909155604080514281524360208201523392917f5b0831b6bc7ca878cadad8a6b96869b9db121df456a859f03261d13f4d08204b9101612762565b6001600160a01b0383166128e05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610a3f565b6001600160a01b0382166129425760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610a3f565b6001600160a01b038316600090815260208190526040902054818110156129ba5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610a3f565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906129f1908490613cb9565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612a3d91815260200190565b60405180910390a350505050565b6001600160a01b03811660008181526005602052604090819020805460ff191681559051909133917fefa2735987005aaa89c050c0ff8cc9ae7d9079d19382081c429130f98c52d480906127629042904390918252602082015260400190565b6000612ab78284613cb9565b9392505050565b6001600160a01b038216612b145760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610a3f565b8060026000828254612b269190613cb9565b90915550506001600160a01b03821660009081526020819052604081208054839290612b53908490613cb9565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216612bfd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610a3f565b6001600160a01b03821660009081526020819052604090205481811015612c715760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610a3f565b6001600160a01b0383166000908152602081905260408120838303905560028054849290612ca0908490613cf3565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60005b600654811015612d515760006005600060068481548110612d1157612d11613e82565b60009182526020808320909101546001600160a01b031683528201929092526040019020805461ffff191690555080612d4981613e51565b915050612cee565b50612d5e60066000613260565b6040805142815243602082015233917f712bc71db81927a76b8bf1ea346247bb0ad58f18e4e5c1bd4aa0ec6573e02a2b910160405180910390a2565b6001600160a01b03811660008181526005602052604090819020805461ff00191681559051909133917fc6148ac08e050e2098c5d953dffbbf54d7eae1a56b8d894015268bfc2dff5b6a906127629042904390918252602082015260400190565b60008084600081518110612e1157612e11613e82565b60200260200101519050600085600181518110612e3057612e30613e82565b6020026020010151905060006001600160a01b0316826001600160a01b03161415612eb25760405162461bcd60e51b815260206004820152602c60248201527f455243323054656d706c6174653a20496e76616c6964206d696e7465722c202060448201526b7a65726f206164647265737360a01b6064820152608401610a3f565b6001600160a01b038116612f2e5760405162461bcd60e51b815260206004820152603c60248201527f455243323054656d706c6174653a20496e76616c696420636f6d6d756e69747960448201527f2066656520636f6c6c6563746f722c207a65726f2061646472657373000000006064820152608401610a3f565b84600081518110612f4157612f41613e82565b602002602001015160001415612fa55760405162461bcd60e51b8152602060048201526024808201527f44617461546f6b656e54656d706c6174653a20496e76616c6964206361702076604482015263616c756560e01b6064820152608401610a3f565b84600081518110612fb857612fb8613e82565b602002602001015160098190555087600081518110612fd957612fd9613e82565b602002602001015160079080519060200190612ff692919061327e565b508760018151811061300a5761300a613e82565b60200260200101516008908051906020019061302792919061327e565b50600b80546001600160a01b0319166001600160a01b03841617905585518690600290811061305857613058613e82565b6020908102919091010151601280546001600160a01b039283166001600160a01b0319909116179055600a80546001600160a81b03191691831691909117600160a01b17905586516130b59088906000906110b0576110b0613e82565b6130d8876001815181106130cb576130cb613e82565b602002602001015161276e565b866002815181106130eb576130eb613e82565b6020026020010151600d60006101000a8154816001600160a01b0302191690836001600160a01b031602179055508660038151811061312c5761312c613e82565b6020026020010151600e60006101000a8154816001600160a01b0302191690836001600160a01b031602179055508460018151811061316d5761316d613e82565b6020026020010151600f8190555060004690507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60076040516131b09190613a52565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018290523060a082015260c00160408051808303601f1901815291905280516020909101206010555050600a54600160a01b900460ff16979650505050505050565b6000612ab78284613cd1565b6000612ab78284613cf3565b5080546000825590600052602060002090810190610b8f9190613302565b82805461328a90613e16565b90600052602060002090601f0160209004810192826132ac57600085556132f2565b82601f106132c557805160ff19168380011785556132f2565b828001600101855582156132f2579182015b828111156132f25782518255916020019190600101906132d7565b506132fe929150613302565b5090565b5b808211156132fe5760008155600101613303565b600067ffffffffffffffff83111561333157613331613e98565b613344601f8401601f1916602001613c64565b905082815283838301111561335857600080fd5b828260208301376000602084830101529392505050565b60008083601f84011261338157600080fd5b50813567ffffffffffffffff81111561339957600080fd5b6020830191508360208260051b85010111156133b457600080fd5b9250929050565b600082601f8301126133cc57600080fd5b813560206133e16133dc83613c95565b613c64565b80838252828201915082860187848660051b890101111561340157600080fd5b60005b8581101561342957813561341781613eae565b84529284019290840190600101613404565b5090979650505050505050565b600082601f83011261344757600080fd5b813560206134576133dc83613c95565b80838252828201915082860187848660051b890101111561347757600080fd5b60005b858110156134295781358452928401929084019060010161347a565b6000602082840312156134a857600080fd5b8135612ab781613eae565b6000602082840312156134c557600080fd5b8151612ab781613eae565b600080604083850312156134e357600080fd5b82356134ee81613eae565b915060208301356134fe81613eae565b809150509250929050565b60008060006060848603121561351e57600080fd5b833561352981613eae565b9250602084013561353981613eae565b929592945050506040919091013590565b600080600080600080600060e0888a03121561356557600080fd5b873561357081613eae565b9650602088013561358081613eae565b95506040880135945060608801359350608088013560ff811681146135a457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806000606084860312156135d657600080fd5b83356135e181613eae565b9250602084013567ffffffffffffffff808211156135fe57600080fd5b61360a878388016133bb565b9350604086013591508082111561362057600080fd5b5061362d86828701613436565b9150509250925092565b6000806040838503121561364a57600080fd5b823561365581613eae565b946020939093013593505050565b60008060008060008060c0878903121561367c57600080fd5b863561368781613eae565b9550602087013594506040870135935060608701356136a581613eae565b925060808701356136b581613eae565b8092505060a087013590509295509295509295565b600080600080600060a086880312156136e257600080fd5b85356136ed81613eae565b94506020860135935060408601359250606086013561370b81613ec3565b9150608086013561371b81613eae565b809150509295509295909350565b60008060008060008060008060008060a08b8d03121561374857600080fd5b8a3567ffffffffffffffff8082111561376057600080fd5b61376c8e838f0161336f565b909c509a5060208d013591508082111561378557600080fd5b6137918e838f0161336f565b909a50985060408d01359150808211156137aa57600080fd5b6137b68e838f0161336f565b909850965060608d01359150808211156137cf57600080fd5b6137db8e838f0161336f565b909650945060808d01359150808211156137f457600080fd5b506138018d828e0161336f565b915080935050809150509295989b9194979a5092959850565b60008060006060848603121561382f57600080fd5b833567ffffffffffffffff8082111561384757600080fd5b61385387838801613436565b9450602086013591508082111561386957600080fd5b61387587838801613436565b9350604086013591508082111561388b57600080fd5b5061362d868287016133bb565b6000602082840312156138aa57600080fd5b8151612ab781613ec3565b6000602082840312156138c757600080fd5b5051919050565b600080602083850312156138e157600080fd5b823567ffffffffffffffff808211156138f957600080fd5b818501915085601f83011261390d57600080fd5b81358181111561391c57600080fd5b86602082850101111561392e57600080fd5b60209290920196919550909350505050565b60006080828403121561395257600080fd5b6040516080810181811067ffffffffffffffff8211171561397557613975613e98565b604052825161398381613ec3565b8152602083015161399381613ec3565b602082015260408301516139a681613ec3565b604082015260608301516139b981613ec3565b60608201529392505050565b6000602082840312156139d757600080fd5b5035919050565b600081518084526020808501945080840160005b83811015613a175781516001600160a01b0316875295820195908201906001016139f2565b509495945050505050565b600081518084526020808501945080840160005b83811015613a1757815187529582019590820190600101613a36565b600080835481600182811c915080831680613a6e57607f831692505b6020808410821415613a8e57634e487b7160e01b86526022600452602486fd5b818015613aa25760018114613ab357613ae0565b60ff19861689528489019650613ae0565b60008a81526020902060005b86811015613ad85781548b820152908501908301613abf565b505084890196505b509498975050505050505050565b6001600160a01b0384168152606060208201819052600090613b12908301856139de565b8281036040840152613b248185613a22565b9695505050505050565b60008186825b6002811015613b5c5781516001600160a01b0316835260209283019290910190600101613b34565b50505060a06040830152613b7360a0830186613a22565b8281036060840152613b858186613a22565b90508281036080840152613b9981856139de565b979650505050505050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208083528351808285015260005b81811015613c0757858101830151858201604001528201613beb565b81811115613c19576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f455243323054656d706c6174653a204e4f54204445504c4f59455220524f4c45604082015260600190565b604051601f8201601f1916810167ffffffffffffffff81118282101715613c8d57613c8d613e98565b604052919050565b600067ffffffffffffffff821115613caf57613caf613e98565b5060051b60200190565b60008219821115613ccc57613ccc613e6c565b500190565b600082613cee57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015613d0557613d05613e6c565b500390565b6000613d186133dc84613c95565b808482526020808301925084368760051b87011115613d3657600080fd5b60005b87811015613d8a57813567ffffffffffffffff811115613d5857600080fd5b870136601f820112613d6957600080fd5b613d77368235868401613317565b8652509382019390820190600101613d39565b50919695505050505050565b6000613da46133dc84613c95565b808482526020808301925084368760051b87011115613dc257600080fd5b60005b87811015613d8a57813567ffffffffffffffff811115613de457600080fd5b870136601f820112613df557600080fd5b613e03368235868401613317565b8652509382019390820190600101613dc5565b600181811c90821680613e2a57607f821691505b60208210811415613e4b57634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613e6557613e65613e6c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610b8f57600080fd5b8015158114610b8f57600080fdfea2646970667358221220168b31cc6fab32fdd684bd93720e0104e156ada91ff56e4fb12452539769f78964736f6c63430008070033", + "linkReferences": {}, + "deployedLinkReferences": {} + } \ No newline at end of file diff --git a/abis/ERC721Factory.json b/abis/ERC721Factory.json new file mode 100644 index 0000000..2bb66b4 --- /dev/null +++ b/abis/ERC721Factory.json @@ -0,0 +1,1095 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ERC721Factory", + "sourceName": "contracts/ERC721Factory.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_template721", + "type": "address" + }, + { + "internalType": "address", + "name": "_template", + "type": "address" + }, + { + "internalType": "address", + "name": "_collector", + "type": "address" + }, + { + "internalType": "address", + "name": "_router", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "datatokenAddress", + "type": "address" + } + ], + "name": "DispenserCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "instance", + "type": "address" + } + ], + "name": "InstanceDeployed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newTokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "templateAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "string", + "name": "tokenName", + "type": "string" + }, + { + "indexed": false, + "internalType": "address", + "name": "admin", + "type": "address" + } + ], + "name": "NFTCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "NewFixedRate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "poolAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "ssContract", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "basetokenAddress", + "type": "address" + } + ], + "name": "NewPool", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_templateAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "nftTemplateCount", + "type": "uint256" + } + ], + "name": "Template20Added", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_templateAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "nftTemplateCount", + "type": "uint256" + } + ], + "name": "Template721Added", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newTokenAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "templateAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "string", + "name": "tokenName", + "type": "string" + } + ], + "name": "TokenCreated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_templateAddress", + "type": "address" + } + ], + "name": "add721TokenTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_templateAddress", + "type": "address" + } + ], + "name": "addTokenTemplate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "templateIndex", + "type": "uint256" + }, + { + "internalType": "string", + "name": "baseURI", + "type": "string" + } + ], + "internalType": "struct ERC721Factory.NftCreateData", + "name": "_NftCreateData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "templateIndex", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "strings", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "bytess", + "type": "bytes[]" + } + ], + "internalType": "struct ERC721Factory.ErcCreateData", + "name": "_ErcCreateData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "dispenserAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "withMint", + "type": "bool" + }, + { + "internalType": "address", + "name": "allowedSwapper", + "type": "address" + } + ], + "internalType": "struct ERC721Factory.DispenserData", + "name": "_DispenserData", + "type": "tuple" + } + ], + "name": "createNftErcWithDispenser", + "outputs": [ + { + "internalType": "address", + "name": "erc721Address", + "type": "address" + }, + { + "internalType": "address", + "name": "erc20Address", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "templateIndex", + "type": "uint256" + }, + { + "internalType": "string", + "name": "baseURI", + "type": "string" + } + ], + "internalType": "struct ERC721Factory.NftCreateData", + "name": "_NftCreateData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "templateIndex", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "strings", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "bytess", + "type": "bytes[]" + } + ], + "internalType": "struct ERC721Factory.ErcCreateData", + "name": "_ErcCreateData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "fixedPriceAddress", + "type": "address" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + } + ], + "internalType": "struct ERC721Factory.FixedData", + "name": "_FixedData", + "type": "tuple" + } + ], + "name": "createNftErcWithFixedRate", + "outputs": [ + { + "internalType": "address", + "name": "erc721Address", + "type": "address" + }, + { + "internalType": "address", + "name": "erc20Address", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "templateIndex", + "type": "uint256" + }, + { + "internalType": "string", + "name": "baseURI", + "type": "string" + } + ], + "internalType": "struct ERC721Factory.NftCreateData", + "name": "_NftCreateData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "templateIndex", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "strings", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "bytess", + "type": "bytes[]" + } + ], + "internalType": "struct ERC721Factory.ErcCreateData", + "name": "_ErcCreateData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "ssParams", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "swapFees", + "type": "uint256[]" + } + ], + "internalType": "struct ERC721Factory.PoolData", + "name": "_PoolData", + "type": "tuple" + } + ], + "name": "createNftErcWithPool", + "outputs": [ + { + "internalType": "address", + "name": "erc721Address", + "type": "address" + }, + { + "internalType": "address", + "name": "erc20Address", + "type": "address" + }, + { + "internalType": "address", + "name": "poolAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "templateIndex", + "type": "uint256" + }, + { + "internalType": "string", + "name": "baseURI", + "type": "string" + } + ], + "internalType": "struct ERC721Factory.NftCreateData", + "name": "_NftCreateData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "templateIndex", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "strings", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "bytess", + "type": "bytes[]" + } + ], + "internalType": "struct ERC721Factory.ErcCreateData", + "name": "_ErcCreateData", + "type": "tuple" + } + ], + "name": "createNftWithErc", + "outputs": [ + { + "internalType": "address", + "name": "erc721Address", + "type": "address" + }, + { + "internalType": "address", + "name": "erc20Address", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_templateIndex", + "type": "uint256" + }, + { + "internalType": "string[]", + "name": "strings", + "type": "string[]" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "bytess", + "type": "bytes[]" + } + ], + "name": "createToken", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_templateIndex", + "type": "uint256" + }, + { + "internalType": "address", + "name": "additionalERC20Deployer", + "type": "address" + }, + { + "internalType": "string", + "name": "baseURI", + "type": "string" + } + ], + "name": "deployERC721Contract", + "outputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "disable721TokenTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "disableTokenTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "erc20List", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "erc721List", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentNFTCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentNFTTemplateCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentTemplateCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentTokenCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "getNFTTemplate", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "templateAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "internalType": "struct ERC721Factory.Template", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "getTokenTemplate", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "templateAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "internalType": "struct ERC721Factory.Template", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "nftTemplateList", + "outputs": [ + { + "internalType": "address", + "name": "templateAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "reactivate721TokenTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_index", + "type": "uint256" + } + ], + "name": "reactivateTokenTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "consumer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "serviceId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "consumeFeeAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "consumeFeeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "consumeFeeAmount", + "type": "uint256" + } + ], + "internalType": "struct ERC721Factory.tokenOrder[]", + "name": "orders", + "type": "tuple[]" + } + ], + "name": "startMultipleTokenOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "templateCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "templateList", + "outputs": [ + { + "internalType": "address", + "name": "templateAddress", + "type": "address" + }, + { + "internalType": "bool", + "name": "isActive", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405260006009553480156200001657600080fd5b50604051620038163803806200381683398101604081905262000039916200053f565b620000443362000152565b6001600160a01b038316158015906200006557506001600160a01b03821615155b80156200007a57506001600160a01b03841615155b620001025760405162461bcd60e51b815260206004820152604760248201527f4552433732314454466163746f72793a20496e76616c69642074656d706c617460448201527f6520746f6b656e2f636f6d6d756e6974792066656520636f6c6c6563746f72206064820152666164647265737360c81b608482015260a4015b60405180910390fd5b6200010d84620001a2565b50620001198362000365565b50600b80546001600160a01b039283166001600160a01b0319918216179091556001805493909216921691909117905550620005c39050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080546001600160a01b03163314620001ee5760405162461bcd60e51b81526020600482018190526024820152600080516020620037f68339815191526044820152606401620000f9565b6001600160a01b0382166200026c5760405162461bcd60e51b815260206004820152603760248201527f4552433732314454466163746f72793a204552433732312074656d706c61746560448201527f2061646472657373283029204e4f5420414c4c4f5745440000000000000000006064820152608401620000f9565b813b620002bc5760405162461bcd60e51b815260206004820152601b60248201527f455243373231466163746f72793a204e4f5420434f4e545241435400000000006044820152606401620000f9565b600160046000828254620002d191906200059c565b90915550506040805180820182526001600160a01b038085168083526001602080850191825260048054600090815260059092528682208651815494511515600160a01b026001600160a81b03199095169616959095179290921790935554935192939290917fc0167b92c8eb4a2bad2c05e0134f076fba5d3cd54671a3e8edf13d2e61443bd991a350506004545b919050565b600080546001600160a01b03163314620003b15760405162461bcd60e51b81526020600482018190526024820152600080516020620037f68339815191526044820152606401620000f9565b6001600160a01b0382166200042f5760405162461bcd60e51b815260206004820152603460248201527f4552433230466163746f72793a204552433732312074656d706c61746520616460448201527f6472657373283029204e4f5420414c4c4f5745440000000000000000000000006064820152608401620000f9565b813b6200047f5760405162461bcd60e51b815260206004820152601a60248201527f4552433230466163746f72793a204e4f5420434f4e54524143540000000000006044820152606401620000f9565b6001600a60008282546200049491906200059c565b90915550506040805180820182526001600160a01b0380851680835260016020808501918252600a8054600090815260069092528682208651815494511515600160a01b026001600160a81b03199095169616959095179290921790935554935192939290917fdcd16da87b60cea6dbd55a83f73b8a4bf9a54655db58ae0f35b82a2373fc150d91a35050600a54919050565b80516001600160a01b03811681146200036057600080fd5b600080600080608085870312156200055657600080fd5b620005618562000527565b9350620005716020860162000527565b9250620005816040860162000527565b9150620005916060860162000527565b905092959194509250565b60008219821115620005be57634e487b7160e01b600052601160045260246000fd5b500190565b61322380620005d36000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80638da5cb5b116100f9578063c6cf868a11610097578063e5fc01f011610071578063e5fc01f0146104e8578063f2fde38b146104f0578063f887ea4014610503578063fd024d6a1461051657600080fd5b8063c6cf868a14610470578063ca4abc6914610478578063e3491099146104b557600080fd5b806395c60305116100d357806395c6030514610420578063a33ef2a614610428578063b9cd22641461043b578063bbf8d71f1461045d57600080fd5b80638da5cb5b146103c75780638f6051af146103d857806394051699146103eb57600080fd5b80636bbd2f3f116101665780637b20bccf116101405780637b20bccf1461033a578063809d81051461034d57806382c442041461036057806389898869146103b457600080fd5b80636bbd2f3f146102f6578063715018a61461030957806372f670f01461031157600080fd5b806326705c3c116101a257806326705c3c1461024f5780633315efd114610266578063557fcfb0146102c35780635c705982146102ee57600080fd5b8063042ab9b3146101c95780630ffda88714610207578063226e76151461021c575b600080fd5b6101dc6101d7366004612b16565b610529565b6040805182516001600160a01b03168152602092830151151592810192909252015b60405180910390f35b61021a610215366004612b16565b6105b0565b005b61023f61022a366004612734565b60086020526000908152604090205460ff1681565b60405190151581526020016101fe565b610258600a5481565b6040519081526020016101fe565b6101dc610274366004612b16565b6040805180820190915260008082526020820152506000908152600560209081526040918290208251808401909352546001600160a01b0381168352600160a01b900460ff1615159082015290565b6102d66102d1366004612b2f565b6105f5565b6040516001600160a01b0390911681526020016101fe565b600254610258565b61021a6103043660046127b1565b610696565b61021a610e04565b6102d661031f366004612734565b6007602052600090815260409020546001600160a01b031681565b610258610348366004612734565b610e3a565b61021a61035b366004612b16565b610fcc565b61039561036e366004612b16565b6005602052600090815260409020546001600160a01b03811690600160a01b900460ff1682565b604080516001600160a01b0390931683529015156020830152016101fe565b6102d66103c2366004612912565b61103e565b6000546001600160a01b03166102d6565b6102586103e6366004612734565b611326565b6103956103f9366004612b16565b6006602052600090815260409020546001600160a01b03811690600160a01b900460ff1682565b600a54610258565b61021a610436366004612b16565b6114c1565b61044e610449366004612a8f565b611539565b6040516101fe93929190612d74565b61021a61046b366004612b16565b611779565b600954610258565b61048b610486366004612a8f565b611835565b604080516001600160a01b03948516815292841660208401529216918101919091526060016101fe565b6104c86104c33660046129b8565b611b2b565b604080516001600160a01b039384168152929091166020830152016101fe565b600454610258565b61021a6104fe366004612734565b611c85565b600b546102d6906001600160a01b031681565b6104c8610524366004612a1b565b611d20565b60408051808201909152600080825260208201526000828152600660209081526040918290208251808401909352546001600160a01b0381168352600160a01b900460ff16151590820152600a54831180159061058557508215155b6105aa5760405162461bcd60e51b81526004016105a190612f34565b60405180910390fd5b92915050565b6000546001600160a01b031633146105da5760405162461bcd60e51b81526004016105a190612fc9565b6000908152600660205260409020805460ff60a01b19169055565b3360008181526007602052604081205490916001600160a01b039091161461067e5760405162461bcd60e51b815260206004820152603660248201527f455243373231466163746f72793a204f4e4c592045524337323120494e5354416044820152754e43452046524f4d20455243373231464143544f525960501b60648201526084016105a1565b61068c868686868633611f29565b9695505050505050565b805160005b81811015610dff5760008060008584815181106106ba576106ba61319e565b6020026020010151600001516001600160a01b031663397b37436040518163ffffffff1660e01b815260040160606040518083038186803b1580156106fe57600080fd5b505afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610736919061276e565b92509250925060008111801561075457506001600160a01b03821615155b801561076857506001600160a01b03831615155b156108ea576040516323b872dd60e01b81526001600160a01b038316906323b872dd9061079d90339030908690600401612d74565b602060405180830381600087803b1580156107b757600080fd5b505af11580156107cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ef91906128dc565b61083b5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f207472616e73666572207075626c69736846656500000060448201526064016105a1565b816001600160a01b031663095ea7b387868151811061085c5761085c61319e565b6020908102919091010151516040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156108b057600080fd5b505af11580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e891906128dc565b505b60008685815181106108fe576108fe61319e565b602002602001015160c00151118015610947575060006001600160a01b031686858151811061092f5761092f61319e565b602002602001015160a001516001600160a01b031614155b8015610983575060006001600160a01b031686858151811061096b5761096b61319e565b6020026020010151608001516001600160a01b031614155b15610b7d5785848151811061099a5761099a61319e565b602002602001015160a001516001600160a01b03166323b872dd33308988815181106109c8576109c861319e565b602002602001015160c001516040518463ffffffff1660e01b81526004016109f293929190612d74565b602060405180830381600087803b158015610a0c57600080fd5b505af1158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4491906128dc565b610a905760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f207472616e7366657220636f6e73756d6546656500000060448201526064016105a1565b858481518110610aa257610aa261319e565b602002602001015160a001516001600160a01b031663095ea7b3878681518110610ace57610ace61319e565b602002602001015160000151888781518110610aec57610aec61319e565b602002602001015160c001516040518363ffffffff1660e01b8152600401610b299291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b158015610b4357600080fd5b505af1158015610b57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7b91906128dc565b505b858481518110610b8f57610b8f61319e565b6020026020010151600001516001600160a01b03166323b872dd3330898881518110610bbd57610bbd61319e565b6020026020010151604001516040518463ffffffff1660e01b8152600401610be793929190612d74565b602060405180830381600087803b158015610c0157600080fd5b505af1158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3991906128dc565b610c855760405162461bcd60e51b815260206004820152601c60248201527f4661696c656420746f207472616e736665722064617461746f6b656e0000000060448201526064016105a1565b858481518110610c9757610c9761319e565b6020026020010151600001516001600160a01b031663fda9dae7878681518110610cc357610cc361319e565b602002602001015160200151888781518110610ce157610ce161319e565b602002602001015160400151898881518110610cff57610cff61319e565b6020026020010151606001518a8981518110610d1d57610d1d61319e565b6020026020010151608001518b8a81518110610d3b57610d3b61319e565b602002602001015160a001518c8b81518110610d5957610d5961319e565b602090810291909101015160c0015160405160e088901b6001600160e01b03191681526001600160a01b039687166004820152602481019590955260448501939093529084166064840152909216608482015260a481019190915260c401600060405180830381600087803b158015610dd157600080fd5b505af1158015610de5573d6000803e3d6000fd5b505050505050508080610df79061316d565b91505061069b565b505050565b6000546001600160a01b03163314610e2e5760405162461bcd60e51b81526004016105a190612fc9565b610e3860006121d8565b565b600080546001600160a01b03163314610e655760405162461bcd60e51b81526004016105a190612fc9565b6001600160a01b038216610ed85760405162461bcd60e51b815260206004820152603460248201527f4552433230466163746f72793a204552433732312074656d706c617465206164604482015273191c995cdcca0c0a481393d50810531313d5d15160621b60648201526084016105a1565b813b610f265760405162461bcd60e51b815260206004820152601a60248201527f4552433230466163746f72793a204e4f5420434f4e545241435400000000000060448201526064016105a1565b6001600a6000828254610f39919061310f565b90915550506040805180820182526001600160a01b0380851680835260016020808501918252600a8054600090815260069092528682208651815494511515600160a01b026001600160a81b03199095169616959095179290921790935554935192939290917fdcd16da87b60cea6dbd55a83f73b8a4bf9a54655db58ae0f35b82a2373fc150d91a35050600a54919050565b6000546001600160a01b03163314610ff65760405162461bcd60e51b81526004016105a190612fc9565b600454811115801561100757508015155b6110235760405162461bcd60e51b81526004016105a190612f7d565b6000908152600560205260409020805460ff60a01b19169055565b6000600454841115801561105157508315155b61106d5760405162461bcd60e51b81526004016105a190612f7d565b6000848152600560209081526040918290208251808401909352546001600160a01b0381168352600160a01b900460ff16151590820181905260011461110c5760405162461bcd60e51b815260206004820152602e60248201527f4552433732314454466163746f72793a20455243373231546f6b656e2054656d60448201526d1c1b185d1948191a5cd8589b195960921b60648201526084016105a1565b805161111790612228565b91506001600160a01b038216611197576040805162461bcd60e51b81526020600482015260248101919091527f4552433732314454466163746f72793a204661696c656420746f20706572666f60448201527f726d206d696e696d616c206465706c6f79206f662061206e657720746f6b656e60648201526084016105a1565b6001600160a01b0382166000818152600760205260409081902080546001600160a01b03191683179055516370c166d760e01b81528391906370c166d7906111ed9033908c908c9030908c908c90600401612ddc565b602060405180830381600087803b15801561120757600080fd5b505af115801561121b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123f91906128dc565b6112a85760405162461bcd60e51b815260206004820152603460248201527f4552433732314454466163746f72793a20556e61626c6520746f20696e697469604482015273616c697a6520746f6b656e20696e7374616e636560601b60648201526084016105a1565b876040516112b69190612d58565b604051908190038120835133835290916001600160a01b03918216918616907fab79f3a133194dac43d8f36c89aabc54656acb3d2a780060ac9006812e4655659060200160405180910390a4600160026000828254611315919061310f565b909155509298975050505050505050565b600080546001600160a01b031633146113515760405162461bcd60e51b81526004016105a190612fc9565b6001600160a01b0382166113cd5760405162461bcd60e51b815260206004820152603760248201527f4552433732314454466163746f72793a204552433732312074656d706c61746560448201527f2061646472657373283029204e4f5420414c4c4f57454400000000000000000060648201526084016105a1565b813b61141b5760405162461bcd60e51b815260206004820152601b60248201527f455243373231466163746f72793a204e4f5420434f4e5452414354000000000060448201526064016105a1565b60016004600082825461142e919061310f565b90915550506040805180820182526001600160a01b038085168083526001602080850191825260048054600090815260059092528682208651815494511515600160a01b026001600160a81b03199095169616959095179290921790935554935192939290917fc0167b92c8eb4a2bad2c05e0134f076fba5d3cd54671a3e8edf13d2e61443bd991a35050600454919050565b6000546001600160a01b031633146114eb5760405162461bcd60e51b81526004016105a190612fc9565b60045481111580156114fc57508015155b6115185760405162461bcd60e51b81526004016105a190612f7d565b6000908152600560205260409020805460ff60a01b1916600160a01b179055565b6000808061160d61154a878061304e565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061158c92505050602089018961304e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506040890135306115d360608c018c61304e565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061103e92505050565b92506116c485356116216020880188612ffe565b61162a91613134565b6116376040890189612ffe565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506116769250505060608a018a612ffe565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506116b59250505060808b018b612ffe565b6116be91613127565b88611f29565b91506001600160a01b038216638b96412b6116e26020870187612734565b6116ef6020880188612ffe565b6116fc60408a018a612ffe565b6040518663ffffffff1660e01b815260040161171c959493929190612d98565b602060405180830381600087803b15801561173657600080fd5b505af115801561174a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176e91906128f9565b905093509350939050565b6000546001600160a01b031633146117a35760405162461bcd60e51b81526004016105a190612fc9565b600a5481111580156117b457508015155b6118145760405162461bcd60e51b815260206004820152602b60248201527f45524332304454466163746f72793a2054656d706c61746520696e646578206460448201526a1bd95cdb9d08195e1a5cdd60aa1b60648201526084016105a1565b6000908152600660205260409020805460ff60a01b1916600160a01b179055565b600080806118438480612ffe565b60018181106118545761185461319e565b90506020020160208101906118699190612734565b6001600160a01b03166323b872dd33306118866020890189612ffe565b60048181106118975761189761319e565b905060200201356040518463ffffffff1660e01b81526004016118bc93929190612d74565b602060405180830381600087803b1580156118d657600080fd5b505af11580156118ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190e91906128dc565b6119765760405162461bcd60e51b815260206004820152603360248201527f4661696c656420746f207472616e7366657220696e697469616c20706f6f6c2060448201527262617365746f6b656e206c697175696469747960681b60648201526084016105a1565b61198361154a878061304e565b925061199785356116216020880188612ffe565b91506119a38480612ffe565b60018181106119b4576119b461319e565b90506020020160208101906119c99190612734565b600b546001600160a01b039182169163095ea7b391166119ec6020880188612ffe565b60048181106119fd576119fd61319e565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401602060405180830381600087803b158015611a4c57600080fd5b505af1158015611a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8491906128dc565b506001600160a01b038216635bfe4da0611aa16020870187612ffe565b611aae6040890189612ffe565b611ab88a80612ffe565b6040518763ffffffff1660e01b8152600401611ad996959493929190612eeb565b602060405180830381600087803b158015611af357600080fd5b505af1158015611b07573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176e9190612751565b600080611bc5611b3b858061304e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b7d92505050602087018761304e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408b0135935091506115d3905060608a018a61304e565b9150611c7c8335611bd96020860186612ffe565b611be291613134565b611bef6040870187612ffe565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611c2e925050506060880188612ffe565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611c6d925050506080890189612ffe565b611c7691613127565b87611f29565b90509250929050565b6000546001600160a01b03163314611caf5760405162461bcd60e51b81526004016105a190612fc9565b6001600160a01b038116611d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a1565b611d1d816121d8565b50565b600080611db9611d30868061304e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d7292505050602088018861304e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506040880135306115d360608b018b61304e565b9150611e618435611dcd6020870187612ffe565b611dd691613134565b611de36040880188612ffe565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e22925050506060890189612ffe565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611c6d9250505060808a018a612ffe565b90506001600160a01b03811663191c918a611e7f6020860186612734565b60208601356040870135611e996080890160608a016128bf565b611ea960a08a0160808b01612734565b60405160e087901b6001600160e01b03191681526001600160a01b0395861660048201526024810194909452604484019290925215156064830152909116608482015260a401600060405180830381600087803b158015611f0957600080fd5b505af1158015611f1d573d6000803e3d6000fd5b50505050935093915050565b600083600081518110611f3e57611f3e61319e565b602002602001015160001415611fa45760405162461bcd60e51b815260206004820152602560248201527f4552433230466163746f72793a207a65726f20636170206973206e6f7420616c6044820152641b1bddd95960da1b60648201526084016105a1565b600a548711158015611fb557508615155b611fd15760405162461bcd60e51b81526004016105a190612f34565b6000878152600660209081526040918290208251808401909352546001600160a01b0381168352600160a01b900460ff16151590820181905260011461206d5760405162461bcd60e51b815260206004820152602b60248201527f4552433230466163746f72793a20455243373231546f6b656e2054656d706c6160448201526a1d1948191a5cd8589b195960aa1b60648201526084016105a1565b805161207890612228565b6001600160a01b0381166000818152600860205260409020805460ff191660011790559092506121105760405162461bcd60e51b815260206004820152603e60248201527f455243373231466163746f72793a204661696c656420746f20706572666f726d60448201527f206d696e696d616c206465706c6f79206f662061206e657720746f6b656e000060648201526084016105a1565b866000815181106121235761212361319e565b60200260200101516040516121389190612d58565b604051908190038120825190916001600160a01b03918216918516907fb51c8cbe199ffe8b0d1d39b62d473569750653cb18b165f77ae423b3900180ad90600090a460016009600082825461218d919061310f565b90915550506040805160a081018252888152602081018890529081018690526001600160a01b0384166080820152606081018590526121cc83826122b8565b50509695505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f06040516001600160a01b03821681529093507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c915060200160405180910390a150919050565b60408051600380825260808201909252839160009190602082016060803683370190505090508260800151816000815181106122f6576122f661319e565b6001600160a01b03928316602091820292909201015260018054835192169183919081106123265761232661319e565b6001600160a01b039283166020918202929092010152600b548251911690829060029081106123575761235761319e565b60200260200101906001600160a01b031690816001600160a01b031681525050816001600160a01b031663b3998be08460000151856020015184876040015188606001516040518663ffffffff1660e01b81526004016123bb959493929190612e42565b602060405180830381600087803b1580156123d557600080fd5b505af11580156123e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240d91906128dc565b6124735760405162461bcd60e51b815260206004820152603160248201527f4552433230466163746f72793a20556e61626c6520746f20696e697469616c696044820152707a6520746f6b656e20696e7374616e636560781b60648201526084016105a1565b50505050565b600061248c612487846130ec565b6130bc565b9050808382526020808301915083868660051b860111156124ac57600080fd5b60005b868110156124ff5781356001600160401b038111156124cd57600080fd5b8601601f810189136124de57600080fd5b6124ec898235868401612584565b85525092820192908201906001016124af565b505050509392505050565b6000612518612487846130ec565b9050808382526020808301915083868660051b8601111561253857600080fd5b6000805b878110156125785782356001600160401b03811115612559578283fd5b6125658a828a016126d8565b865250938301939183019160010161253c565b50505050509392505050565b60006001600160401b0383111561259d5761259d6131b4565b6125b0601f8401601f19166020016130bc565b90508281528383830111156125c457600080fd5b828260208301376000602084830101529392505050565b600082601f8301126125ec57600080fd5b813560206125fc612487836130ec565b80838252828201915082860187848660051b890101111561261c57600080fd5b60005b85811015612644578135612632816131ca565b8452928401929084019060010161261f565b5090979650505050505050565b600082601f83011261266257600080fd5b61267183833560208501612479565b9392505050565b600082601f83011261268957600080fd5b81356020612699612487836130ec565b80838252828201915082860187848660051b89010111156126b957600080fd5b60005b85811015612644578135845292840192908401906001016126bc565b600082601f8301126126e957600080fd5b61267183833560208501612584565b600060a0828403121561270a57600080fd5b50919050565b60006060828403121561270a57600080fd5b60006080828403121561270a57600080fd5b60006020828403121561274657600080fd5b8135612671816131ca565b60006020828403121561276357600080fd5b8151612671816131ca565b60008060006060848603121561278357600080fd5b835161278e816131ca565b602085015190935061279f816131ca565b80925050604084015190509250925092565b600060208083850312156127c457600080fd5b82356001600160401b038111156127da57600080fd5b8301601f810185136127eb57600080fd5b80356127f9612487826130ec565b8181528381019083850160e0808502860187018a101561281857600080fd5b60009550855b858110156128b05781838c031215612834578687fd5b61283c613094565b8335612847816131ca565b815283890135612856816131ca565b818a0152604084810135908201526060808501359082015260808085013561287d816131ca565b9082015260a084810135612890816131ca565b9082015260c084810135908201528552938701939181019160010161281e565b50919998505050505050505050565b6000602082840312156128d157600080fd5b8135612671816131df565b6000602082840312156128ee57600080fd5b8151612671816131df565b60006020828403121561290b57600080fd5b5051919050565b600080600080600060a0868803121561292a57600080fd5b85356001600160401b038082111561294157600080fd5b61294d89838a016126d8565b9650602088013591508082111561296357600080fd5b61296f89838a016126d8565b95506040880135945060608801359150612988826131ca565b9092506080870135908082111561299e57600080fd5b506129ab888289016126d8565b9150509295509295909350565b600080604083850312156129cb57600080fd5b82356001600160401b03808211156129e257600080fd5b6129ee86838701612722565b93506020850135915080821115612a0457600080fd5b50612a11858286016126f8565b9150509250929050565b600080600060e08486031215612a3057600080fd5b83356001600160401b0380821115612a4757600080fd5b612a5387838801612722565b94506020860135915080821115612a6957600080fd5b50612a76868287016126f8565b925050612a8685604086016126f8565b90509250925092565b600080600060608486031215612aa457600080fd5b83356001600160401b0380821115612abb57600080fd5b612ac787838801612722565b94506020860135915080821115612add57600080fd5b612ae9878388016126f8565b93506040860135915080821115612aff57600080fd5b50612b0c86828701612710565b9150509250925092565b600060208284031215612b2857600080fd5b5035919050565b600080600080600060a08688031215612b4757600080fd5b8535945060208601356001600160401b0380821115612b6557600080fd5b818801915088601f830112612b7957600080fd5b612b888983356020850161250a565b95506040880135915080821115612b9e57600080fd5b612baa89838a016125db565b94506060880135915080821115612bc057600080fd5b612bcc89838a01612678565b93506080880135915080821115612be257600080fd5b506129ab88828901612651565b8183526000602080850194508260005b85811015612c2d578135612c12816131ca565b6001600160a01b031687529582019590820190600101612bff565b509495945050505050565b600081518084526020808501945080840160005b83811015612c2d5781516001600160a01b031687529582019590820190600101612c4c565b600081518084526020808501808196508360051b8101915082860160005b85811015612cb9578284038952612ca7848351612d2c565b98850198935090840190600101612c8f565b5091979650505050505050565b81835260006001600160fb1b03831115612cdf57600080fd5b8260051b8083602087013760009401602001938452509192915050565b600081518084526020808501945080840160005b83811015612c2d57815187529582019590820190600101612d10565b60008151808452612d44816020860160208601613141565b601f01601f19169290920160200192915050565b60008251612d6a818460208701613141565b9190910192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0386168152606060208201819052600090612dbd9083018688612bef565b8281036040840152612dd0818587612cc6565b98975050505050505050565b600060018060a01b03808916835260c06020840152612dfe60c0840189612d2c565b8381036040850152612e108189612d2c565b90508187166060850152818616608085015283810360a0850152612e348186612d2c565b9a9950505050505050505050565b600060a0820160a0835280885180835260c08501915060c08160051b86010192506020808b0160005b83811015612e995760bf19888703018552612e87868351612d2c565b95509382019390820190600101612e6b565b505085840381870152505050612eaf8188612c38565b90508281036040840152612ec38187612c38565b90508281036060840152612ed78186612cfc565b90508281036080840152612dd08185612c71565b606081526000612eff60608301888a612cc6565b8281036020840152612f12818789612cc6565b90508281036040840152612f27818587612bef565b9998505050505050505050565b60208082526029908201527f4552433230466163746f72793a2054656d706c61746520696e64657820646f656040820152681cdb9d08195e1a5cdd60ba1b606082015260800190565b6020808252602c908201527f4552433732314454466163746f72793a2054656d706c61746520696e6465782060408201526b191bd95cdb9d08195e1a5cdd60a21b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000808335601e1984360301811261301557600080fd5b8301803591506001600160401b0382111561302f57600080fd5b6020019150600581901b360382131561304757600080fd5b9250929050565b6000808335601e1984360301811261306557600080fd5b8301803591506001600160401b0382111561307f57600080fd5b60200191503681900382131561304757600080fd5b60405160e081016001600160401b03811182821017156130b6576130b66131b4565b60405290565b604051601f8201601f191681016001600160401b03811182821017156130e4576130e46131b4565b604052919050565b60006001600160401b03821115613105576131056131b4565b5060051b60200190565b6000821982111561312257613122613188565b500190565b6000612671368484612479565b600061267136848461250a565b60005b8381101561315c578181015183820152602001613144565b838111156124735750506000910152565b600060001982141561318157613181613188565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611d1d57600080fd5b8015158114611d1d57600080fdfea26469706673582212204933c40b5800cdecd947e8b4af5b5f63da323f86944a19f5076cc2922094e3eb64736f6c634300080700334f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80638da5cb5b116100f9578063c6cf868a11610097578063e5fc01f011610071578063e5fc01f0146104e8578063f2fde38b146104f0578063f887ea4014610503578063fd024d6a1461051657600080fd5b8063c6cf868a14610470578063ca4abc6914610478578063e3491099146104b557600080fd5b806395c60305116100d357806395c6030514610420578063a33ef2a614610428578063b9cd22641461043b578063bbf8d71f1461045d57600080fd5b80638da5cb5b146103c75780638f6051af146103d857806394051699146103eb57600080fd5b80636bbd2f3f116101665780637b20bccf116101405780637b20bccf1461033a578063809d81051461034d57806382c442041461036057806389898869146103b457600080fd5b80636bbd2f3f146102f6578063715018a61461030957806372f670f01461031157600080fd5b806326705c3c116101a257806326705c3c1461024f5780633315efd114610266578063557fcfb0146102c35780635c705982146102ee57600080fd5b8063042ab9b3146101c95780630ffda88714610207578063226e76151461021c575b600080fd5b6101dc6101d7366004612b16565b610529565b6040805182516001600160a01b03168152602092830151151592810192909252015b60405180910390f35b61021a610215366004612b16565b6105b0565b005b61023f61022a366004612734565b60086020526000908152604090205460ff1681565b60405190151581526020016101fe565b610258600a5481565b6040519081526020016101fe565b6101dc610274366004612b16565b6040805180820190915260008082526020820152506000908152600560209081526040918290208251808401909352546001600160a01b0381168352600160a01b900460ff1615159082015290565b6102d66102d1366004612b2f565b6105f5565b6040516001600160a01b0390911681526020016101fe565b600254610258565b61021a6103043660046127b1565b610696565b61021a610e04565b6102d661031f366004612734565b6007602052600090815260409020546001600160a01b031681565b610258610348366004612734565b610e3a565b61021a61035b366004612b16565b610fcc565b61039561036e366004612b16565b6005602052600090815260409020546001600160a01b03811690600160a01b900460ff1682565b604080516001600160a01b0390931683529015156020830152016101fe565b6102d66103c2366004612912565b61103e565b6000546001600160a01b03166102d6565b6102586103e6366004612734565b611326565b6103956103f9366004612b16565b6006602052600090815260409020546001600160a01b03811690600160a01b900460ff1682565b600a54610258565b61021a610436366004612b16565b6114c1565b61044e610449366004612a8f565b611539565b6040516101fe93929190612d74565b61021a61046b366004612b16565b611779565b600954610258565b61048b610486366004612a8f565b611835565b604080516001600160a01b03948516815292841660208401529216918101919091526060016101fe565b6104c86104c33660046129b8565b611b2b565b604080516001600160a01b039384168152929091166020830152016101fe565b600454610258565b61021a6104fe366004612734565b611c85565b600b546102d6906001600160a01b031681565b6104c8610524366004612a1b565b611d20565b60408051808201909152600080825260208201526000828152600660209081526040918290208251808401909352546001600160a01b0381168352600160a01b900460ff16151590820152600a54831180159061058557508215155b6105aa5760405162461bcd60e51b81526004016105a190612f34565b60405180910390fd5b92915050565b6000546001600160a01b031633146105da5760405162461bcd60e51b81526004016105a190612fc9565b6000908152600660205260409020805460ff60a01b19169055565b3360008181526007602052604081205490916001600160a01b039091161461067e5760405162461bcd60e51b815260206004820152603660248201527f455243373231466163746f72793a204f4e4c592045524337323120494e5354416044820152754e43452046524f4d20455243373231464143544f525960501b60648201526084016105a1565b61068c868686868633611f29565b9695505050505050565b805160005b81811015610dff5760008060008584815181106106ba576106ba61319e565b6020026020010151600001516001600160a01b031663397b37436040518163ffffffff1660e01b815260040160606040518083038186803b1580156106fe57600080fd5b505afa158015610712573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610736919061276e565b92509250925060008111801561075457506001600160a01b03821615155b801561076857506001600160a01b03831615155b156108ea576040516323b872dd60e01b81526001600160a01b038316906323b872dd9061079d90339030908690600401612d74565b602060405180830381600087803b1580156107b757600080fd5b505af11580156107cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ef91906128dc565b61083b5760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f207472616e73666572207075626c69736846656500000060448201526064016105a1565b816001600160a01b031663095ea7b387868151811061085c5761085c61319e565b6020908102919091010151516040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156108b057600080fd5b505af11580156108c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e891906128dc565b505b60008685815181106108fe576108fe61319e565b602002602001015160c00151118015610947575060006001600160a01b031686858151811061092f5761092f61319e565b602002602001015160a001516001600160a01b031614155b8015610983575060006001600160a01b031686858151811061096b5761096b61319e565b6020026020010151608001516001600160a01b031614155b15610b7d5785848151811061099a5761099a61319e565b602002602001015160a001516001600160a01b03166323b872dd33308988815181106109c8576109c861319e565b602002602001015160c001516040518463ffffffff1660e01b81526004016109f293929190612d74565b602060405180830381600087803b158015610a0c57600080fd5b505af1158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4491906128dc565b610a905760405162461bcd60e51b815260206004820152601d60248201527f4661696c656420746f207472616e7366657220636f6e73756d6546656500000060448201526064016105a1565b858481518110610aa257610aa261319e565b602002602001015160a001516001600160a01b031663095ea7b3878681518110610ace57610ace61319e565b602002602001015160000151888781518110610aec57610aec61319e565b602002602001015160c001516040518363ffffffff1660e01b8152600401610b299291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b158015610b4357600080fd5b505af1158015610b57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7b91906128dc565b505b858481518110610b8f57610b8f61319e565b6020026020010151600001516001600160a01b03166323b872dd3330898881518110610bbd57610bbd61319e565b6020026020010151604001516040518463ffffffff1660e01b8152600401610be793929190612d74565b602060405180830381600087803b158015610c0157600080fd5b505af1158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3991906128dc565b610c855760405162461bcd60e51b815260206004820152601c60248201527f4661696c656420746f207472616e736665722064617461746f6b656e0000000060448201526064016105a1565b858481518110610c9757610c9761319e565b6020026020010151600001516001600160a01b031663fda9dae7878681518110610cc357610cc361319e565b602002602001015160200151888781518110610ce157610ce161319e565b602002602001015160400151898881518110610cff57610cff61319e565b6020026020010151606001518a8981518110610d1d57610d1d61319e565b6020026020010151608001518b8a81518110610d3b57610d3b61319e565b602002602001015160a001518c8b81518110610d5957610d5961319e565b602090810291909101015160c0015160405160e088901b6001600160e01b03191681526001600160a01b039687166004820152602481019590955260448501939093529084166064840152909216608482015260a481019190915260c401600060405180830381600087803b158015610dd157600080fd5b505af1158015610de5573d6000803e3d6000fd5b505050505050508080610df79061316d565b91505061069b565b505050565b6000546001600160a01b03163314610e2e5760405162461bcd60e51b81526004016105a190612fc9565b610e3860006121d8565b565b600080546001600160a01b03163314610e655760405162461bcd60e51b81526004016105a190612fc9565b6001600160a01b038216610ed85760405162461bcd60e51b815260206004820152603460248201527f4552433230466163746f72793a204552433732312074656d706c617465206164604482015273191c995cdcca0c0a481393d50810531313d5d15160621b60648201526084016105a1565b813b610f265760405162461bcd60e51b815260206004820152601a60248201527f4552433230466163746f72793a204e4f5420434f4e545241435400000000000060448201526064016105a1565b6001600a6000828254610f39919061310f565b90915550506040805180820182526001600160a01b0380851680835260016020808501918252600a8054600090815260069092528682208651815494511515600160a01b026001600160a81b03199095169616959095179290921790935554935192939290917fdcd16da87b60cea6dbd55a83f73b8a4bf9a54655db58ae0f35b82a2373fc150d91a35050600a54919050565b6000546001600160a01b03163314610ff65760405162461bcd60e51b81526004016105a190612fc9565b600454811115801561100757508015155b6110235760405162461bcd60e51b81526004016105a190612f7d565b6000908152600560205260409020805460ff60a01b19169055565b6000600454841115801561105157508315155b61106d5760405162461bcd60e51b81526004016105a190612f7d565b6000848152600560209081526040918290208251808401909352546001600160a01b0381168352600160a01b900460ff16151590820181905260011461110c5760405162461bcd60e51b815260206004820152602e60248201527f4552433732314454466163746f72793a20455243373231546f6b656e2054656d60448201526d1c1b185d1948191a5cd8589b195960921b60648201526084016105a1565b805161111790612228565b91506001600160a01b038216611197576040805162461bcd60e51b81526020600482015260248101919091527f4552433732314454466163746f72793a204661696c656420746f20706572666f60448201527f726d206d696e696d616c206465706c6f79206f662061206e657720746f6b656e60648201526084016105a1565b6001600160a01b0382166000818152600760205260409081902080546001600160a01b03191683179055516370c166d760e01b81528391906370c166d7906111ed9033908c908c9030908c908c90600401612ddc565b602060405180830381600087803b15801561120757600080fd5b505af115801561121b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123f91906128dc565b6112a85760405162461bcd60e51b815260206004820152603460248201527f4552433732314454466163746f72793a20556e61626c6520746f20696e697469604482015273616c697a6520746f6b656e20696e7374616e636560601b60648201526084016105a1565b876040516112b69190612d58565b604051908190038120835133835290916001600160a01b03918216918616907fab79f3a133194dac43d8f36c89aabc54656acb3d2a780060ac9006812e4655659060200160405180910390a4600160026000828254611315919061310f565b909155509298975050505050505050565b600080546001600160a01b031633146113515760405162461bcd60e51b81526004016105a190612fc9565b6001600160a01b0382166113cd5760405162461bcd60e51b815260206004820152603760248201527f4552433732314454466163746f72793a204552433732312074656d706c61746560448201527f2061646472657373283029204e4f5420414c4c4f57454400000000000000000060648201526084016105a1565b813b61141b5760405162461bcd60e51b815260206004820152601b60248201527f455243373231466163746f72793a204e4f5420434f4e5452414354000000000060448201526064016105a1565b60016004600082825461142e919061310f565b90915550506040805180820182526001600160a01b038085168083526001602080850191825260048054600090815260059092528682208651815494511515600160a01b026001600160a81b03199095169616959095179290921790935554935192939290917fc0167b92c8eb4a2bad2c05e0134f076fba5d3cd54671a3e8edf13d2e61443bd991a35050600454919050565b6000546001600160a01b031633146114eb5760405162461bcd60e51b81526004016105a190612fc9565b60045481111580156114fc57508015155b6115185760405162461bcd60e51b81526004016105a190612f7d565b6000908152600560205260409020805460ff60a01b1916600160a01b179055565b6000808061160d61154a878061304e565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061158c92505050602089018961304e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506040890135306115d360608c018c61304e565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061103e92505050565b92506116c485356116216020880188612ffe565b61162a91613134565b6116376040890189612ffe565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506116769250505060608a018a612ffe565b808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506116b59250505060808b018b612ffe565b6116be91613127565b88611f29565b91506001600160a01b038216638b96412b6116e26020870187612734565b6116ef6020880188612ffe565b6116fc60408a018a612ffe565b6040518663ffffffff1660e01b815260040161171c959493929190612d98565b602060405180830381600087803b15801561173657600080fd5b505af115801561174a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176e91906128f9565b905093509350939050565b6000546001600160a01b031633146117a35760405162461bcd60e51b81526004016105a190612fc9565b600a5481111580156117b457508015155b6118145760405162461bcd60e51b815260206004820152602b60248201527f45524332304454466163746f72793a2054656d706c61746520696e646578206460448201526a1bd95cdb9d08195e1a5cdd60aa1b60648201526084016105a1565b6000908152600660205260409020805460ff60a01b1916600160a01b179055565b600080806118438480612ffe565b60018181106118545761185461319e565b90506020020160208101906118699190612734565b6001600160a01b03166323b872dd33306118866020890189612ffe565b60048181106118975761189761319e565b905060200201356040518463ffffffff1660e01b81526004016118bc93929190612d74565b602060405180830381600087803b1580156118d657600080fd5b505af11580156118ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190e91906128dc565b6119765760405162461bcd60e51b815260206004820152603360248201527f4661696c656420746f207472616e7366657220696e697469616c20706f6f6c2060448201527262617365746f6b656e206c697175696469747960681b60648201526084016105a1565b61198361154a878061304e565b925061199785356116216020880188612ffe565b91506119a38480612ffe565b60018181106119b4576119b461319e565b90506020020160208101906119c99190612734565b600b546001600160a01b039182169163095ea7b391166119ec6020880188612ffe565b60048181106119fd576119fd61319e565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401602060405180830381600087803b158015611a4c57600080fd5b505af1158015611a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8491906128dc565b506001600160a01b038216635bfe4da0611aa16020870187612ffe565b611aae6040890189612ffe565b611ab88a80612ffe565b6040518763ffffffff1660e01b8152600401611ad996959493929190612eeb565b602060405180830381600087803b158015611af357600080fd5b505af1158015611b07573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176e9190612751565b600080611bc5611b3b858061304e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b7d92505050602087018761304e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525060408b0135935091506115d3905060608a018a61304e565b9150611c7c8335611bd96020860186612ffe565b611be291613134565b611bef6040870187612ffe565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611c2e925050506060880188612ffe565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611c6d925050506080890189612ffe565b611c7691613127565b87611f29565b90509250929050565b6000546001600160a01b03163314611caf5760405162461bcd60e51b81526004016105a190612fc9565b6001600160a01b038116611d145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105a1565b611d1d816121d8565b50565b600080611db9611d30868061304e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611d7292505050602088018861304e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505050506040880135306115d360608b018b61304e565b9150611e618435611dcd6020870187612ffe565b611dd691613134565b611de36040880188612ffe565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611e22925050506060890189612ffe565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611c6d9250505060808a018a612ffe565b90506001600160a01b03811663191c918a611e7f6020860186612734565b60208601356040870135611e996080890160608a016128bf565b611ea960a08a0160808b01612734565b60405160e087901b6001600160e01b03191681526001600160a01b0395861660048201526024810194909452604484019290925215156064830152909116608482015260a401600060405180830381600087803b158015611f0957600080fd5b505af1158015611f1d573d6000803e3d6000fd5b50505050935093915050565b600083600081518110611f3e57611f3e61319e565b602002602001015160001415611fa45760405162461bcd60e51b815260206004820152602560248201527f4552433230466163746f72793a207a65726f20636170206973206e6f7420616c6044820152641b1bddd95960da1b60648201526084016105a1565b600a548711158015611fb557508615155b611fd15760405162461bcd60e51b81526004016105a190612f34565b6000878152600660209081526040918290208251808401909352546001600160a01b0381168352600160a01b900460ff16151590820181905260011461206d5760405162461bcd60e51b815260206004820152602b60248201527f4552433230466163746f72793a20455243373231546f6b656e2054656d706c6160448201526a1d1948191a5cd8589b195960aa1b60648201526084016105a1565b805161207890612228565b6001600160a01b0381166000818152600860205260409020805460ff191660011790559092506121105760405162461bcd60e51b815260206004820152603e60248201527f455243373231466163746f72793a204661696c656420746f20706572666f726d60448201527f206d696e696d616c206465706c6f79206f662061206e657720746f6b656e000060648201526084016105a1565b866000815181106121235761212361319e565b60200260200101516040516121389190612d58565b604051908190038120825190916001600160a01b03918216918516907fb51c8cbe199ffe8b0d1d39b62d473569750653cb18b165f77ae423b3900180ad90600090a460016009600082825461218d919061310f565b90915550506040805160a081018252888152602081018890529081018690526001600160a01b0384166080820152606081018590526121cc83826122b8565b50509695505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f06040516001600160a01b03821681529093507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c915060200160405180910390a150919050565b60408051600380825260808201909252839160009190602082016060803683370190505090508260800151816000815181106122f6576122f661319e565b6001600160a01b03928316602091820292909201015260018054835192169183919081106123265761232661319e565b6001600160a01b039283166020918202929092010152600b548251911690829060029081106123575761235761319e565b60200260200101906001600160a01b031690816001600160a01b031681525050816001600160a01b031663b3998be08460000151856020015184876040015188606001516040518663ffffffff1660e01b81526004016123bb959493929190612e42565b602060405180830381600087803b1580156123d557600080fd5b505af11580156123e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061240d91906128dc565b6124735760405162461bcd60e51b815260206004820152603160248201527f4552433230466163746f72793a20556e61626c6520746f20696e697469616c696044820152707a6520746f6b656e20696e7374616e636560781b60648201526084016105a1565b50505050565b600061248c612487846130ec565b6130bc565b9050808382526020808301915083868660051b860111156124ac57600080fd5b60005b868110156124ff5781356001600160401b038111156124cd57600080fd5b8601601f810189136124de57600080fd5b6124ec898235868401612584565b85525092820192908201906001016124af565b505050509392505050565b6000612518612487846130ec565b9050808382526020808301915083868660051b8601111561253857600080fd5b6000805b878110156125785782356001600160401b03811115612559578283fd5b6125658a828a016126d8565b865250938301939183019160010161253c565b50505050509392505050565b60006001600160401b0383111561259d5761259d6131b4565b6125b0601f8401601f19166020016130bc565b90508281528383830111156125c457600080fd5b828260208301376000602084830101529392505050565b600082601f8301126125ec57600080fd5b813560206125fc612487836130ec565b80838252828201915082860187848660051b890101111561261c57600080fd5b60005b85811015612644578135612632816131ca565b8452928401929084019060010161261f565b5090979650505050505050565b600082601f83011261266257600080fd5b61267183833560208501612479565b9392505050565b600082601f83011261268957600080fd5b81356020612699612487836130ec565b80838252828201915082860187848660051b89010111156126b957600080fd5b60005b85811015612644578135845292840192908401906001016126bc565b600082601f8301126126e957600080fd5b61267183833560208501612584565b600060a0828403121561270a57600080fd5b50919050565b60006060828403121561270a57600080fd5b60006080828403121561270a57600080fd5b60006020828403121561274657600080fd5b8135612671816131ca565b60006020828403121561276357600080fd5b8151612671816131ca565b60008060006060848603121561278357600080fd5b835161278e816131ca565b602085015190935061279f816131ca565b80925050604084015190509250925092565b600060208083850312156127c457600080fd5b82356001600160401b038111156127da57600080fd5b8301601f810185136127eb57600080fd5b80356127f9612487826130ec565b8181528381019083850160e0808502860187018a101561281857600080fd5b60009550855b858110156128b05781838c031215612834578687fd5b61283c613094565b8335612847816131ca565b815283890135612856816131ca565b818a0152604084810135908201526060808501359082015260808085013561287d816131ca565b9082015260a084810135612890816131ca565b9082015260c084810135908201528552938701939181019160010161281e565b50919998505050505050505050565b6000602082840312156128d157600080fd5b8135612671816131df565b6000602082840312156128ee57600080fd5b8151612671816131df565b60006020828403121561290b57600080fd5b5051919050565b600080600080600060a0868803121561292a57600080fd5b85356001600160401b038082111561294157600080fd5b61294d89838a016126d8565b9650602088013591508082111561296357600080fd5b61296f89838a016126d8565b95506040880135945060608801359150612988826131ca565b9092506080870135908082111561299e57600080fd5b506129ab888289016126d8565b9150509295509295909350565b600080604083850312156129cb57600080fd5b82356001600160401b03808211156129e257600080fd5b6129ee86838701612722565b93506020850135915080821115612a0457600080fd5b50612a11858286016126f8565b9150509250929050565b600080600060e08486031215612a3057600080fd5b83356001600160401b0380821115612a4757600080fd5b612a5387838801612722565b94506020860135915080821115612a6957600080fd5b50612a76868287016126f8565b925050612a8685604086016126f8565b90509250925092565b600080600060608486031215612aa457600080fd5b83356001600160401b0380821115612abb57600080fd5b612ac787838801612722565b94506020860135915080821115612add57600080fd5b612ae9878388016126f8565b93506040860135915080821115612aff57600080fd5b50612b0c86828701612710565b9150509250925092565b600060208284031215612b2857600080fd5b5035919050565b600080600080600060a08688031215612b4757600080fd5b8535945060208601356001600160401b0380821115612b6557600080fd5b818801915088601f830112612b7957600080fd5b612b888983356020850161250a565b95506040880135915080821115612b9e57600080fd5b612baa89838a016125db565b94506060880135915080821115612bc057600080fd5b612bcc89838a01612678565b93506080880135915080821115612be257600080fd5b506129ab88828901612651565b8183526000602080850194508260005b85811015612c2d578135612c12816131ca565b6001600160a01b031687529582019590820190600101612bff565b509495945050505050565b600081518084526020808501945080840160005b83811015612c2d5781516001600160a01b031687529582019590820190600101612c4c565b600081518084526020808501808196508360051b8101915082860160005b85811015612cb9578284038952612ca7848351612d2c565b98850198935090840190600101612c8f565b5091979650505050505050565b81835260006001600160fb1b03831115612cdf57600080fd5b8260051b8083602087013760009401602001938452509192915050565b600081518084526020808501945080840160005b83811015612c2d57815187529582019590820190600101612d10565b60008151808452612d44816020860160208601613141565b601f01601f19169290920160200192915050565b60008251612d6a818460208701613141565b9190910192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0386168152606060208201819052600090612dbd9083018688612bef565b8281036040840152612dd0818587612cc6565b98975050505050505050565b600060018060a01b03808916835260c06020840152612dfe60c0840189612d2c565b8381036040850152612e108189612d2c565b90508187166060850152818616608085015283810360a0850152612e348186612d2c565b9a9950505050505050505050565b600060a0820160a0835280885180835260c08501915060c08160051b86010192506020808b0160005b83811015612e995760bf19888703018552612e87868351612d2c565b95509382019390820190600101612e6b565b505085840381870152505050612eaf8188612c38565b90508281036040840152612ec38187612c38565b90508281036060840152612ed78186612cfc565b90508281036080840152612dd08185612c71565b606081526000612eff60608301888a612cc6565b8281036020840152612f12818789612cc6565b90508281036040840152612f27818587612bef565b9998505050505050505050565b60208082526029908201527f4552433230466163746f72793a2054656d706c61746520696e64657820646f656040820152681cdb9d08195e1a5cdd60ba1b606082015260800190565b6020808252602c908201527f4552433732314454466163746f72793a2054656d706c61746520696e6465782060408201526b191bd95cdb9d08195e1a5cdd60a21b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000808335601e1984360301811261301557600080fd5b8301803591506001600160401b0382111561302f57600080fd5b6020019150600581901b360382131561304757600080fd5b9250929050565b6000808335601e1984360301811261306557600080fd5b8301803591506001600160401b0382111561307f57600080fd5b60200191503681900382131561304757600080fd5b60405160e081016001600160401b03811182821017156130b6576130b66131b4565b60405290565b604051601f8201601f191681016001600160401b03811182821017156130e4576130e46131b4565b604052919050565b60006001600160401b03821115613105576131056131b4565b5060051b60200190565b6000821982111561312257613122613188565b500190565b6000612671368484612479565b600061267136848461250a565b60005b8381101561315c578181015183820152602001613144565b838111156124735750506000910152565b600060001982141561318157613181613188565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611d1d57600080fd5b8015158114611d1d57600080fdfea26469706673582212204933c40b5800cdecd947e8b4af5b5f63da323f86944a19f5076cc2922094e3eb64736f6c63430008070033", + "linkReferences": {}, + "deployedLinkReferences": {} + } \ No newline at end of file diff --git a/abis/FactoryRouter.json b/abis/FactoryRouter.json new file mode 100644 index 0000000..2f73c3c --- /dev/null +++ b/abis/FactoryRouter.json @@ -0,0 +1,790 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "FactoryRouter", + "sourceName": "contracts/pools/FactoryRouter.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_routerOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "_oceanToken", + "type": "address" + }, + { + "internalType": "address", + "name": "_bpoolTemplate", + "type": "address" + }, + { + "internalType": "address", + "name": "_opfCollector", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_preCreatedPools", + "type": "address[]" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newBPoolAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "registeredBy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "datatokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "basetokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "bpoolTemplateAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "ssAddress", + "type": "address" + } + ], + "name": "BPoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "instance", + "type": "address" + } + ], + "name": "InstanceDeployed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "poolAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isOcean", + "type": "bool" + } + ], + "name": "NewPool", + "type": "event" + }, + { + "inputs": [], + "name": "BONE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "BPOW_PRECISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "EXIT_FEE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "INIT_POOL_SUPPLY", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_BOUND_TOKENS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_BPOW_BASE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_FEE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_IN_RATIO", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_OUT_RATIO", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_TOTAL_WEIGHT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_WEIGHT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_BALANCE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_BOUND_TOKENS", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_BPOW_BASE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_FEE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MIN_WEIGHT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dispenser", + "type": "address" + } + ], + "name": "addDispenserContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_factory", + "type": "address" + } + ], + "name": "addFactory", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_fixedRate", + "type": "address" + } + ], + "name": "addFixedRateContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oceanTokenAddress", + "type": "address" + } + ], + "name": "addOceanToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "poolTemplate", + "type": "address" + } + ], + "name": "addPoolTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_ssContract", + "type": "address" + } + ], + "name": "addSSContract", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "exchangeIds", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "source", + "type": "address" + }, + { + "internalType": "enum FactoryRouter.operationType", + "name": "operation", + "type": "uint8" + }, + { + "internalType": "address", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountsIn", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amountsOut", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPrice", + "type": "uint256" + } + ], + "internalType": "struct FactoryRouter.Operations[]", + "name": "_operations", + "type": "tuple[]" + } + ], + "name": "buyDTBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_routerOwner", + "type": "address" + } + ], + "name": "changeRouterOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_dispenser", + "type": "address" + }, + { + "internalType": "address", + "name": "datatoken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBalance", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "allowedSwapper", + "type": "address" + } + ], + "name": "deployDispenser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fixedPriceAddress", + "type": "address" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + } + ], + "name": "deployFixedRate", + "outputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[2]", + "name": "tokens", + "type": "address[2]" + }, + { + "internalType": "uint256[]", + "name": "ssParams", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "swapFees", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + } + ], + "name": "deployPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "dispenser", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "factory", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "fixedPrice", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "fixedRate", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baseToken", + "type": "address" + } + ], + "name": "getOPFFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "poolTemplate", + "type": "address" + } + ], + "name": "isPoolTemplate", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "oceanTokens", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "opfCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oceanTokenAddress", + "type": "address" + } + ], + "name": "removeOceanToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "poolTemplate", + "type": "address" + } + ], + "name": "removePoolTemplate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "routerOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "ssContracts", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "swapOceanFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_newSwapOceanFee", + "type": "uint256" + } + ], + "name": "updateOPFFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x608060405266038d7ea4c680006005553480156200001c57600080fd5b50604051620030c4380380620030c48339810160408190526200003f9162000273565b8282826001600160a01b038316620000b45760405162461bcd60e51b815260206004820152602d60248201527f42466163746f72793a20696e76616c69642062706f6f6c2074656d706c61746560448201526c207a65726f206164647265737360981b60648201526084015b60405180910390fd5b6001600160a01b0382166200010c5760405162461bcd60e51b815260206004820152601660248201527f42466163746f72793a207a65726f2061646472657373000000000000000000006044820152606401620000ab565b600080546001600160a01b0319166001600160a01b03841617905562000153836001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b805115620002025760005b8151811015620002005760006001600160a01b0316336001600160a01b0316838381518110620001925762000192620003c4565b602090810291909101810151604080516000808252938101849052908101929092526001600160a01b0316907fbb6121447d29a04cc37bfd93cdf6a9dd08229f2d941116c1528f04698c4e790e9060600160405180910390a480620001f7816200039a565b9150506200015e565b505b5050600280546001600160a01b03199081166001600160a01b0398891617909155600080549091169387169390931783555050919092168152600660205260409020805460ff1916600117905550620003f0565b80516001600160a01b03811681146200026e57600080fd5b919050565b600080600080600060a086880312156200028c57600080fd5b620002978662000256565b94506020620002a881880162000256565b9450620002b86040880162000256565b9350620002c86060880162000256565b60808801519093506001600160401b0380821115620002e657600080fd5b818901915089601f830112620002fb57600080fd5b815181811115620003105762000310620003da565b8060051b604051601f19603f83011681018181108582111715620003385762000338620003da565b604052828152858101935084860182860187018e10156200035857600080fd5b600095505b838610156200038657620003718162000256565b8552600195909501949386019386016200035d565b508096505050505050509295509295909350565b6000600019821415620003bd57634e487b7160e01b600052601160045260246000fd5b5060010190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b612cc480620004006000396000f3fe608060405234801561001057600080fd5b50600436106102535760003560e01c8063b7b800a411610146578063d86850cc116100c3578063e525f99c11610087578063e525f99c146104b7578063ec093021146104ca578063ee3bc635146104d2578063ee661f67146104e5578063f4d9e1e414610508578063f8154aee1461051b57600080fd5b8063d86850cc14610465578063de9a95a714610488578063e183fb3f1461049b578063e193faad146104a4578063e4a28a521461026d57600080fd5b8063c1c436a51161010a578063c1c436a514610424578063c36596a6146102a3578063c45a015514610437578063c6580d121461044a578063d629a00a1461045257600080fd5b8063b7b800a4146103c5578063ba019dab146103e0578063bc063e1a146103e8578063bc694ea2146103f0578063c07c00fe146103f857600080fd5b806382449375116101d45780639cdfa6ad116101985780639cdfa6ad1461037c5780639f587d4d1461038f578063a28f78f1146103b2578063b0e0d136146103c5578063b19aaac6146103cd57600080fd5b8063824493751461033e5780638552730a14610351578063867378c5146103645780639381cd2b1461036c578063992e2a921461037457600080fd5b806329ce1ec51161021b57806329ce1ec5146102b25780636c9fb612146102c557806376c7a3c7146102d857806379463a0e146102e0578063802d14221461031357600080fd5b80630318ad661461025857806309a3bbe41461026d57806316d9cb3d14610288578063189d00ca1461029b578063218b5382146102a3575b600080fd5b61026b6102663660046125ac565b61052e565b005b610275610585565b6040519081526020015b60405180910390f35b61026b6102963660046125ac565b61059b565b6102756105e9565b610275670de0b6b3a764000081565b61026b6102c03660046125ac565b610600565b61026b6102d33660046125ac565b61069b565b6102756106e9565b6103036102ee3660046125ac565b60066020526000908152604090205460ff1681565b604051901515815260200161027f565b600454610326906001600160a01b031681565b6040516001600160a01b03909116815260200161027f565b61027561034c3660046126f4565b6106fe565b600254610326906001600160a01b031681565b6102756108ab565b6102756108c2565b6102756108d5565b61026b61038a3660046125ac565b6108f3565b61030361039d3660046125ac565b60086020526000908152604090205460ff1681565b600054610326906001600160a01b031681565b610275600281565b61026b6103db3660046125ac565b61093e565b610275600181565b610275610996565b6102756109a9565b6103036104063660046125ac565b6001600160a01b031660009081526001602052604090205460ff1690565b61026b6104323660046128f1565b6109c8565b600354610326906001600160a01b031681565b610275600081565b61026b610460366004612684565b6109f7565b6103036104733660046125ac565b60096020526000908152604090205460ff1681565b61026b6104963660046125ac565b610b93565b61027560055481565b61026b6104b23660046125ac565b610be1565b61026b6104c53660046125ac565b610c30565b610275610cd2565b6103266104e0366004612777565b610ce5565b6103036104f33660046125ac565b60076020526000908152604090205460ff1681565b61026b610516366004612827565b611189565b6102756105293660046125ac565b612157565b6002546001600160a01b031633146105615760405162461bcd60e51b815260040161055890612b7c565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b610598670de0b6b3a76400006032612be6565b81565b6002546001600160a01b031633146105c55760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b6105986402540be400670de0b6b3a7640000612bc4565b6002546001600160a01b0316331461062a5760405162461bcd60e51b815260040161055890612b7c565b6003546001600160a01b0316156106795760405162461bcd60e51b8152602060048201526013602482015272119050d513d49648105314915051164814d155606a1b6044820152606401610558565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146106c55760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b610598620f4240670de0b6b3a7640000612bc4565b60035460405163226e761560e01b81523360048201526000916001600160a01b03169063226e76159060240160206040518083038186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a919061289c565b151560011461079b5760405162461bcd60e51b815260040161055890612b31565b6001600160a01b03861660009081526008602052604090205460ff16151560011461081b5760405162461bcd60e51b815260206004820152602a60248201527f464143544f525920524f555445523a20496e76616c696420466978656450726960448201526918d950dbdb9d1c9858dd60b21b6064820152608401610558565b60405163012c327560e01b81526001600160a01b0387169063012c32759061084f9033908990899089908990600401612aa2565b602060405180830381600087803b15801561086957600080fd5b505af115801561087d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a191906128b7565b9695505050505050565b61059864e8d4a51000670de0b6b3a7640000612bc4565b610598670de0b6b3a76400006064612be6565b6108e86003670de0b6b3a7640000612bc4565b610598906001612bac565b6002546001600160a01b0316331461091d5760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6002546001600160a01b031633146109685760405162461bcd60e51b815260040161055890612b7c565b610993816001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b50565b610598600a670de0b6b3a7640000612bc4565b60016109be670de0b6b3a76400006002612be6565b6105989190612c05565b6002546001600160a01b031633146109f25760405162461bcd60e51b815260040161055890612b7c565b600555565b60035460405163226e761560e01b81523360048201526001600160a01b039091169063226e76159060240160206040518083038186803b158015610a3a57600080fd5b505afa158015610a4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a72919061289c565b1515600114610a935760405162461bcd60e51b815260040161055890612b31565b6001600160a01b03861660009081526009602052604090205460ff161515600114610b125760405162461bcd60e51b815260206004820152602960248201527f464143544f525920524f555445523a20496e76616c69642044697370656e73656044820152681c90dbdb9d1c9858dd60ba1b6064820152608401610558565b6040516324ce291760e01b81526001600160a01b0386811660048301526024820186905260448201859052838116606483015282811660848301528716906324ce29179060a401600060405180830381600087803b158015610b7357600080fd5b505af1158015610b87573d6000803e3d6000fd5b50505050505050505050565b6002546001600160a01b03163314610bbd5760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b6002546001600160a01b03163314610c0b5760405162461bcd60e51b815260040161055890612b7c565b610993816001600160a01b03166000908152600160205260409020805460ff19169055565b6002546001600160a01b03163314610c5a5760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b038116610cb05760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964206e657720726f75746572206f776e657200000000000000006044820152606401610558565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6105986002670de0b6b3a7640000612bc4565b60035460405163226e761560e01b81523360048201526000916001600160a01b03169063226e76159060240160206040518083038186803b158015610d2957600080fd5b505afa158015610d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d61919061289c565b1515600114610d825760405162461bcd60e51b815260040161055890612b31565b6007600084846000818110610d9957610d99612c63565b9050602002016020810190610dae91906125ac565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610e275760405162461bcd60e51b815260206004820152602260248201527f464143544f525920524f555445523a20696e76616c6964207373436f6e74726160448201526118dd60f21b6064820152608401610558565b600087876001818110610e3c57610e3c612c63565b9050602002013511610e815760405162461bcd60e51b815260206004820152600e60248201526d57726f6e6720646563696d616c7360901b6044820152606401610558565b6000600681610e9660408c0160208d016125ac565b6001600160a01b0316815260208101919091526040016000205460ff16151560011415610ec1575060015b6000610ed360408b0160208c016125ac565b9050806001600160a01b03166323b872dd86866002818110610ef757610ef7612c63565b9050602002016020810190610f0c91906125ac565b87876000818110610f1f57610f1f612c63565b9050602002016020810190610f3491906125ac565b8c8c6004818110610f4757610f47612c63565b905060200201356040518463ffffffff1660e01b8152600401610f6c93929190612a7e565b602060405180830381600087803b158015610f8657600080fd5b505af1158015610f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbe919061289c565b6110235760405162461bcd60e51b815260206004820152603060248201527f4465706c6f79506f6f6c3a204661696c656420746f207472616e73666572206960448201526f6e697469616c206c697175696469747960801b6064820152608401610558565b6040805180820182526000916110e691908d90600290839083908082843760009201919091525050604080516020808f0282810182019093528e82529092508e918e9182919085019084908082843760009201919091525050604080516020808f0282810182019093528e82529093508e92508d91829185019084908082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525061219292505050565b90506001600160a01b0381166111365760405162461bcd60e51b8152602060048201526015602482015274119052531151081513c81111541313d6481413d3d3605a1b6044820152606401610558565b806001600160a01b03167f90279d7790471e260411db76079630dfaa838fc987d29ae7aa7dc1bcd773ef2e84604051611173911515815260200190565b60405180910390a29a9950505050505050505050565b60005b818110156121525760008383838181106111a8576111a8612c63565b9050610100020160400160208101906111c191906128d0565b60038111156111d2576111d2612c4d565b141561161b578282828181106111ea576111ea612c63565b90506101000201606001602081019061120391906125ac565b6001600160a01b03166323b872dd333086868681811061122557611225612c63565b90506101000201608001356040518463ffffffff1660e01b815260040161124e93929190612a7e565b602060405180830381600087803b15801561126857600080fd5b505af115801561127c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a0919061289c565b508282828181106112b3576112b3612c63565b9050610100020160600160208101906112cc91906125ac565b6001600160a01b031663095ea7b38484848181106112ec576112ec612c63565b90506101000201602001602081019061130591906125ac565b85858581811061131757611317612c63565b90506101000201608001356040518363ffffffff1660e01b81526004016113539291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561136d57600080fd5b505af1158015611381573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a5919061289c565b5060008383838181106113ba576113ba612c63565b9050610100020160200160208101906113d391906125ac565b6001600160a01b0316638201aa3f8585858181106113f3576113f3612c63565b90506101000201606001602081019061140c91906125ac565b86868681811061141e5761141e612c63565b905061010002016080013587878781811061143b5761143b612c63565b9050610100020160a001602081019061145491906125ac565b88888881811061146657611466612c63565b9050610100020160c0013589898981811061148357611483612c63565b60405160e089811b6001600160e01b03191682526001600160a01b03988916600483015260248201979097529490961660448501525060648301919091526101009093029092010135608482015260a4016040805180830381600087803b1580156114ed57600080fd5b505af1158015611501573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611525919061290a565b50905083838381811061153a5761153a612c63565b9050610100020160a001602081019061155391906125ac565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b03919091169063a9059cbb906044015b602060405180830381600087803b15801561159e57600080fd5b505af11580156115b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d6919061289c565b6116155760405162461bcd60e51b815260206004820152601060248201526f04661696c6564204d756c7469537761760841b6044820152606401610558565b50612140565b600183838381811061162f5761162f612c63565b90506101000201604001602081019061164891906128d0565b600381111561165957611659612c4d565b1415611b1657600083838381811061167357611673612c63565b90506101000201602001602081019061168c91906125ac565b6001600160a01b0316632ea07d8a8585858181106116ac576116ac612c63565b9050610100020160600160208101906116c591906125ac565b8686868181106116d7576116d7612c63565b9050610100020160a00160208101906116f091906125ac565b87878781811061170257611702612c63565b9050610100020160c001356040518463ffffffff1660e01b815260040161172b93929190612a7e565b60206040518083038186803b15801561174357600080fd5b505afa158015611757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177b91906128b7565b905083838381811061178f5761178f612c63565b9050610100020160600160208101906117a891906125ac565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b81526004016117d793929190612a7e565b602060405180830381600087803b1580156117f157600080fd5b505af1158015611805573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611829919061289c565b5083838381811061183c5761183c612c63565b90506101000201606001602081019061185591906125ac565b6001600160a01b031663095ea7b385858581811061187557611875612c63565b90506101000201602001602081019061188e91906125ac565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156118d657600080fd5b505af11580156118ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190e919061289c565b5083838381811061192157611921612c63565b90506101000201602001602081019061193a91906125ac565b6001600160a01b0316637c5e9ea485858581811061195a5761195a612c63565b90506101000201606001602081019061197391906125ac565b86868681811061198557611985612c63565b90506101000201608001358787878181106119a2576119a2612c63565b9050610100020160a00160208101906119bb91906125ac565b8888888181106119cd576119cd612c63565b9050610100020160c001358989898181106119ea576119ea612c63565b60405160e089811b6001600160e01b03191682526001600160a01b03988916600483015260248201979097529490961660448501525060648301919091526101009093029092010135608482015260a4016040805180830381600087803b158015611a5457600080fd5b505af1158015611a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8c919061290a565b5050838383818110611aa057611aa0612c63565b9050610100020160a0016020810190611ab991906125ac565b6001600160a01b031663a9059cbb33868686818110611ada57611ada612c63565b9050610100020160c001356040518363ffffffff1660e01b81526004016115849291906001600160a01b03929092168252602082015260400190565b6002838383818110611b2a57611b2a612c63565b905061010002016040016020810190611b4391906128d0565b6003811115611b5457611b54612c4d565b1415612057576000838383818110611b6e57611b6e612c63565b905061010002016020016020810190611b8791906125ac565b6001600160a01b0316634c87087d858585818110611ba757611ba7612c63565b90506101000201600001356040518263ffffffff1660e01b8152600401611bd091815260200190565b6101806040518083038186803b158015611be957600080fd5b505afa158015611bfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2191906125d0565b505050505050505050509150506000848484818110611c4257611c42612c63565b905061010002016020016020810190611c5b91906125ac565b6001600160a01b031663c99733a7868686818110611c7b57611c7b612c63565b9050610100020160000135878787818110611c9857611c98612c63565b9050610100020160c001356040518363ffffffff1660e01b8152600401611cc9929190918252602082015260400190565b60806040518083038186803b158015611ce157600080fd5b505afa158015611cf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d19919061292e565b5050509050848484818110611d3057611d30612c63565b905061010002016060016020810190611d4991906125ac565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b8152600401611d7893929190612a7e565b602060405180830381600087803b158015611d9257600080fd5b505af1158015611da6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dca919061289c565b50848484818110611ddd57611ddd612c63565b905061010002016060016020810190611df691906125ac565b6001600160a01b031663095ea7b3868686818110611e1657611e16612c63565b905061010002016020016020810190611e2f91906125ac565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b158015611e7757600080fd5b505af1158015611e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eaf919061289c565b50848484818110611ec257611ec2612c63565b905061010002016020016020810190611edb91906125ac565b6001600160a01b031663825b5cd6868686818110611efb57611efb612c63565b9050610100020160000135878787818110611f1857611f18612c63565b9050610100020160c00135888888818110611f3557611f35612c63565b6040516001600160e01b031960e088901b168152600481019590955260248501939093525060806101009092020101356044820152606401600060405180830381600087803b158015611f8757600080fd5b505af1158015611f9b573d6000803e3d6000fd5b50505050816001600160a01b031663a9059cbb33878787818110611fc157611fc1612c63565b9050610100020160c001356040518363ffffffff1660e01b8152600401611ffd9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561201757600080fd5b505af115801561202b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061204f919061289c565b505050612140565b82828281811061206957612069612c63565b90506101000201602001602081019061208291906125ac565b6001600160a01b0316631d746d838484848181106120a2576120a2612c63565b9050610100020160a00160208101906120bb91906125ac565b8585858181106120cd576120cd612c63565b60405160e086901b6001600160e01b03191681526001600160a01b03949094166004850152610100029190910160c00135602483015250336044820152606401600060405180830381600087803b15801561212757600080fd5b505af115801561213b573d6000803e3d6000fd5b505050505b8061214a81612c1c565b91505061118c565b505050565b6001600160a01b03811660009081526006602052604081205460ff1615156001141561218557506000919050565b505060055490565b919050565b600060016000836005815181106121ab576121ab612c63565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1615156001146122235760405162461bcd60e51b815260206004820152601d60248201527f42466163746f72793a2057726f6e6720506f6f6c2054656d706c6174650000006044820152606401610558565b600060405180604001604052808460048151811061224357612243612c63565b6020908102919091018101516001600160a01b03908116835260005416910152835190915061228c908490600590811061227f5761227f612c63565b60200260200101516124c0565b91506001600160a01b0382166122f05760405162461bcd60e51b8152602060048201526024808201527f42466163746f72793a20696e76616c69642062706f6f6c207a65726f206164646044820152637265737360e01b6064820152608401610558565b6000829050806001600160a01b031663c070a6d88560008151811061231757612317612c63565b602002602001015130886000808d896040518863ffffffff1660e01b81526004016123489796959493929190612a18565b602060405180830381600087803b15801561236257600080fd5b505af1158015612376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239a919061289c565b6123dd5760405162461bcd60e51b815260206004820152601460248201527311549497d253925512505312569157d09413d3d360621b6044820152606401610558565b836000815181106123f0576123f0612c63565b60200260200101516001600160a01b03166353f0c3b48860006002811061241957612419612c63565b60200201518960016020020151868860038151811061243a5761243a612c63565b60200260200101518b6040518663ffffffff1660e01b81526004016124639594939291906129d1565b602060405180830381600087803b15801561247d57600080fd5b505af1158015612491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b5919061289c565b505050949350505050565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f06040516001600160a01b03821681529093507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c915060200160405180910390a150919050565b60008083601f84011261256257600080fd5b50813567ffffffffffffffff81111561257a57600080fd5b6020830191508360208260051b850101111561259557600080fd5b9250929050565b8051801515811461218d57600080fd5b6000602082840312156125be57600080fd5b81356125c981612c79565b9392505050565b6000806000806000806000806000806000806101808d8f0312156125f357600080fd5b8c516125fe81612c79565b60208e0151909c5061260f81612c79565b60408e015160608f0151919c509a5061262781612c79565b60808e015160a08f0151919a509850965061264460c08e0161259c565b955060e08d015194506101008d015193506101208d015192506101408d015191506126726101608e0161259c565b90509295989b509295989b509295989b565b60008060008060008060c0878903121561269d57600080fd5b86356126a881612c79565b955060208701356126b881612c79565b9450604087013593506060870135925060808701356126d681612c79565b915060a08701356126e681612c79565b809150509295509295509295565b60008060008060006060868803121561270c57600080fd5b853561271781612c79565b9450602086013567ffffffffffffffff8082111561273457600080fd5b61274089838a01612550565b9096509450604088013591508082111561275957600080fd5b5061276688828901612550565b969995985093965092949392505050565b600080600080600080600060a0888a03121561279257600080fd5b60408801898111156127a357600080fd5b8897503567ffffffffffffffff808211156127bd57600080fd5b6127c98b838c01612550565b909850965060608a01359150808211156127e257600080fd5b6127ee8b838c01612550565b909650945060808a013591508082111561280757600080fd5b506128148a828b01612550565b989b979a50959850939692959293505050565b6000806020838503121561283a57600080fd5b823567ffffffffffffffff8082111561285257600080fd5b818501915085601f83011261286657600080fd5b81358181111561287557600080fd5b8660208260081b850101111561288a57600080fd5b60209290920196919550909350505050565b6000602082840312156128ae57600080fd5b6125c98261259c565b6000602082840312156128c957600080fd5b5051919050565b6000602082840312156128e257600080fd5b8135600481106125c957600080fd5b60006020828403121561290357600080fd5b5035919050565b6000806040838503121561291d57600080fd5b505080516020909101519092909150565b6000806000806080858703121561294457600080fd5b505082516020840151604085015160609095015191969095509092509050565b8060005b60028110156129905781516001600160a01b0316845260209384019390910190600101612968565b50505050565b600081518084526020808501945080840160005b838110156129c6578151875295820195908201906001016129aa565b509495945050505050565b6001600160a01b038681168252858116602083015284811660408301528316606082015260a060808201819052600090612a0d90830184612996565b979650505050505050565b6001600160a01b0388811682528716602082015261012060408201819052600090612a4583820189612996565b91505085151560608301528415156080830152612a6560a0830185612964565b612a7260e0830184612964565b98975050505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03868116825260606020808401829052908301869052600091879160808501845b89811015612af1578435612add81612c79565b841682529382019390820190600101612aca565b5085810360408701528681526001600160fb1b03871115612b1157600080fd5b8660051b9350838883830137600093010191825250979650505050505050565b6020808252602b908201527f464143544f525920524f555445523a204e4f54204f524947494e414c2045524360408201526a32302054454d504c41544560a81b606082015260800190565b60208082526016908201527527b1b2b0b72937baba32b91d102727aa1027aba722a960511b604082015260600190565b60008219821115612bbf57612bbf612c37565b500190565b600082612be157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612c0057612c00612c37565b500290565b600082821015612c1757612c17612c37565b500390565b6000600019821415612c3057612c30612c37565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461099357600080fdfea2646970667358221220d362b2704ac43cd4791f2cc83390abb1640d17f5dd830921bfe6b85390ae230c64736f6c63430008070033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102535760003560e01c8063b7b800a411610146578063d86850cc116100c3578063e525f99c11610087578063e525f99c146104b7578063ec093021146104ca578063ee3bc635146104d2578063ee661f67146104e5578063f4d9e1e414610508578063f8154aee1461051b57600080fd5b8063d86850cc14610465578063de9a95a714610488578063e183fb3f1461049b578063e193faad146104a4578063e4a28a521461026d57600080fd5b8063c1c436a51161010a578063c1c436a514610424578063c36596a6146102a3578063c45a015514610437578063c6580d121461044a578063d629a00a1461045257600080fd5b8063b7b800a4146103c5578063ba019dab146103e0578063bc063e1a146103e8578063bc694ea2146103f0578063c07c00fe146103f857600080fd5b806382449375116101d45780639cdfa6ad116101985780639cdfa6ad1461037c5780639f587d4d1461038f578063a28f78f1146103b2578063b0e0d136146103c5578063b19aaac6146103cd57600080fd5b8063824493751461033e5780638552730a14610351578063867378c5146103645780639381cd2b1461036c578063992e2a921461037457600080fd5b806329ce1ec51161021b57806329ce1ec5146102b25780636c9fb612146102c557806376c7a3c7146102d857806379463a0e146102e0578063802d14221461031357600080fd5b80630318ad661461025857806309a3bbe41461026d57806316d9cb3d14610288578063189d00ca1461029b578063218b5382146102a3575b600080fd5b61026b6102663660046125ac565b61052e565b005b610275610585565b6040519081526020015b60405180910390f35b61026b6102963660046125ac565b61059b565b6102756105e9565b610275670de0b6b3a764000081565b61026b6102c03660046125ac565b610600565b61026b6102d33660046125ac565b61069b565b6102756106e9565b6103036102ee3660046125ac565b60066020526000908152604090205460ff1681565b604051901515815260200161027f565b600454610326906001600160a01b031681565b6040516001600160a01b03909116815260200161027f565b61027561034c3660046126f4565b6106fe565b600254610326906001600160a01b031681565b6102756108ab565b6102756108c2565b6102756108d5565b61026b61038a3660046125ac565b6108f3565b61030361039d3660046125ac565b60086020526000908152604090205460ff1681565b600054610326906001600160a01b031681565b610275600281565b61026b6103db3660046125ac565b61093e565b610275600181565b610275610996565b6102756109a9565b6103036104063660046125ac565b6001600160a01b031660009081526001602052604090205460ff1690565b61026b6104323660046128f1565b6109c8565b600354610326906001600160a01b031681565b610275600081565b61026b610460366004612684565b6109f7565b6103036104733660046125ac565b60096020526000908152604090205460ff1681565b61026b6104963660046125ac565b610b93565b61027560055481565b61026b6104b23660046125ac565b610be1565b61026b6104c53660046125ac565b610c30565b610275610cd2565b6103266104e0366004612777565b610ce5565b6103036104f33660046125ac565b60076020526000908152604090205460ff1681565b61026b610516366004612827565b611189565b6102756105293660046125ac565b612157565b6002546001600160a01b031633146105615760405162461bcd60e51b815260040161055890612b7c565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b610598670de0b6b3a76400006032612be6565b81565b6002546001600160a01b031633146105c55760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b03166000908152600860205260409020805460ff19166001179055565b6105986402540be400670de0b6b3a7640000612bc4565b6002546001600160a01b0316331461062a5760405162461bcd60e51b815260040161055890612b7c565b6003546001600160a01b0316156106795760405162461bcd60e51b8152602060048201526013602482015272119050d513d49648105314915051164814d155606a1b6044820152606401610558565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031633146106c55760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b610598620f4240670de0b6b3a7640000612bc4565b60035460405163226e761560e01b81523360048201526000916001600160a01b03169063226e76159060240160206040518083038186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a919061289c565b151560011461079b5760405162461bcd60e51b815260040161055890612b31565b6001600160a01b03861660009081526008602052604090205460ff16151560011461081b5760405162461bcd60e51b815260206004820152602a60248201527f464143544f525920524f555445523a20496e76616c696420466978656450726960448201526918d950dbdb9d1c9858dd60b21b6064820152608401610558565b60405163012c327560e01b81526001600160a01b0387169063012c32759061084f9033908990899089908990600401612aa2565b602060405180830381600087803b15801561086957600080fd5b505af115801561087d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a191906128b7565b9695505050505050565b61059864e8d4a51000670de0b6b3a7640000612bc4565b610598670de0b6b3a76400006064612be6565b6108e86003670de0b6b3a7640000612bc4565b610598906001612bac565b6002546001600160a01b0316331461091d5760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6002546001600160a01b031633146109685760405162461bcd60e51b815260040161055890612b7c565b610993816001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b50565b610598600a670de0b6b3a7640000612bc4565b60016109be670de0b6b3a76400006002612be6565b6105989190612c05565b6002546001600160a01b031633146109f25760405162461bcd60e51b815260040161055890612b7c565b600555565b60035460405163226e761560e01b81523360048201526001600160a01b039091169063226e76159060240160206040518083038186803b158015610a3a57600080fd5b505afa158015610a4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a72919061289c565b1515600114610a935760405162461bcd60e51b815260040161055890612b31565b6001600160a01b03861660009081526009602052604090205460ff161515600114610b125760405162461bcd60e51b815260206004820152602960248201527f464143544f525920524f555445523a20496e76616c69642044697370656e73656044820152681c90dbdb9d1c9858dd60ba1b6064820152608401610558565b6040516324ce291760e01b81526001600160a01b0386811660048301526024820186905260448201859052838116606483015282811660848301528716906324ce29179060a401600060405180830381600087803b158015610b7357600080fd5b505af1158015610b87573d6000803e3d6000fd5b50505050505050505050565b6002546001600160a01b03163314610bbd5760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b6002546001600160a01b03163314610c0b5760405162461bcd60e51b815260040161055890612b7c565b610993816001600160a01b03166000908152600160205260409020805460ff19169055565b6002546001600160a01b03163314610c5a5760405162461bcd60e51b815260040161055890612b7c565b6001600160a01b038116610cb05760405162461bcd60e51b815260206004820152601860248201527f496e76616c6964206e657720726f75746572206f776e657200000000000000006044820152606401610558565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6105986002670de0b6b3a7640000612bc4565b60035460405163226e761560e01b81523360048201526000916001600160a01b03169063226e76159060240160206040518083038186803b158015610d2957600080fd5b505afa158015610d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d61919061289c565b1515600114610d825760405162461bcd60e51b815260040161055890612b31565b6007600084846000818110610d9957610d99612c63565b9050602002016020810190610dae91906125ac565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610e275760405162461bcd60e51b815260206004820152602260248201527f464143544f525920524f555445523a20696e76616c6964207373436f6e74726160448201526118dd60f21b6064820152608401610558565b600087876001818110610e3c57610e3c612c63565b9050602002013511610e815760405162461bcd60e51b815260206004820152600e60248201526d57726f6e6720646563696d616c7360901b6044820152606401610558565b6000600681610e9660408c0160208d016125ac565b6001600160a01b0316815260208101919091526040016000205460ff16151560011415610ec1575060015b6000610ed360408b0160208c016125ac565b9050806001600160a01b03166323b872dd86866002818110610ef757610ef7612c63565b9050602002016020810190610f0c91906125ac565b87876000818110610f1f57610f1f612c63565b9050602002016020810190610f3491906125ac565b8c8c6004818110610f4757610f47612c63565b905060200201356040518463ffffffff1660e01b8152600401610f6c93929190612a7e565b602060405180830381600087803b158015610f8657600080fd5b505af1158015610f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbe919061289c565b6110235760405162461bcd60e51b815260206004820152603060248201527f4465706c6f79506f6f6c3a204661696c656420746f207472616e73666572206960448201526f6e697469616c206c697175696469747960801b6064820152608401610558565b6040805180820182526000916110e691908d90600290839083908082843760009201919091525050604080516020808f0282810182019093528e82529092508e918e9182919085019084908082843760009201919091525050604080516020808f0282810182019093528e82529093508e92508d91829185019084908082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c91829185019084908082843760009201919091525061219292505050565b90506001600160a01b0381166111365760405162461bcd60e51b8152602060048201526015602482015274119052531151081513c81111541313d6481413d3d3605a1b6044820152606401610558565b806001600160a01b03167f90279d7790471e260411db76079630dfaa838fc987d29ae7aa7dc1bcd773ef2e84604051611173911515815260200190565b60405180910390a29a9950505050505050505050565b60005b818110156121525760008383838181106111a8576111a8612c63565b9050610100020160400160208101906111c191906128d0565b60038111156111d2576111d2612c4d565b141561161b578282828181106111ea576111ea612c63565b90506101000201606001602081019061120391906125ac565b6001600160a01b03166323b872dd333086868681811061122557611225612c63565b90506101000201608001356040518463ffffffff1660e01b815260040161124e93929190612a7e565b602060405180830381600087803b15801561126857600080fd5b505af115801561127c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a0919061289c565b508282828181106112b3576112b3612c63565b9050610100020160600160208101906112cc91906125ac565b6001600160a01b031663095ea7b38484848181106112ec576112ec612c63565b90506101000201602001602081019061130591906125ac565b85858581811061131757611317612c63565b90506101000201608001356040518363ffffffff1660e01b81526004016113539291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561136d57600080fd5b505af1158015611381573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a5919061289c565b5060008383838181106113ba576113ba612c63565b9050610100020160200160208101906113d391906125ac565b6001600160a01b0316638201aa3f8585858181106113f3576113f3612c63565b90506101000201606001602081019061140c91906125ac565b86868681811061141e5761141e612c63565b905061010002016080013587878781811061143b5761143b612c63565b9050610100020160a001602081019061145491906125ac565b88888881811061146657611466612c63565b9050610100020160c0013589898981811061148357611483612c63565b60405160e089811b6001600160e01b03191682526001600160a01b03988916600483015260248201979097529490961660448501525060648301919091526101009093029092010135608482015260a4016040805180830381600087803b1580156114ed57600080fd5b505af1158015611501573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611525919061290a565b50905083838381811061153a5761153a612c63565b9050610100020160a001602081019061155391906125ac565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b03919091169063a9059cbb906044015b602060405180830381600087803b15801561159e57600080fd5b505af11580156115b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d6919061289c565b6116155760405162461bcd60e51b815260206004820152601060248201526f04661696c6564204d756c7469537761760841b6044820152606401610558565b50612140565b600183838381811061162f5761162f612c63565b90506101000201604001602081019061164891906128d0565b600381111561165957611659612c4d565b1415611b1657600083838381811061167357611673612c63565b90506101000201602001602081019061168c91906125ac565b6001600160a01b0316632ea07d8a8585858181106116ac576116ac612c63565b9050610100020160600160208101906116c591906125ac565b8686868181106116d7576116d7612c63565b9050610100020160a00160208101906116f091906125ac565b87878781811061170257611702612c63565b9050610100020160c001356040518463ffffffff1660e01b815260040161172b93929190612a7e565b60206040518083038186803b15801561174357600080fd5b505afa158015611757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177b91906128b7565b905083838381811061178f5761178f612c63565b9050610100020160600160208101906117a891906125ac565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b81526004016117d793929190612a7e565b602060405180830381600087803b1580156117f157600080fd5b505af1158015611805573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611829919061289c565b5083838381811061183c5761183c612c63565b90506101000201606001602081019061185591906125ac565b6001600160a01b031663095ea7b385858581811061187557611875612c63565b90506101000201602001602081019061188e91906125ac565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156118d657600080fd5b505af11580156118ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190e919061289c565b5083838381811061192157611921612c63565b90506101000201602001602081019061193a91906125ac565b6001600160a01b0316637c5e9ea485858581811061195a5761195a612c63565b90506101000201606001602081019061197391906125ac565b86868681811061198557611985612c63565b90506101000201608001358787878181106119a2576119a2612c63565b9050610100020160a00160208101906119bb91906125ac565b8888888181106119cd576119cd612c63565b9050610100020160c001358989898181106119ea576119ea612c63565b60405160e089811b6001600160e01b03191682526001600160a01b03988916600483015260248201979097529490961660448501525060648301919091526101009093029092010135608482015260a4016040805180830381600087803b158015611a5457600080fd5b505af1158015611a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8c919061290a565b5050838383818110611aa057611aa0612c63565b9050610100020160a0016020810190611ab991906125ac565b6001600160a01b031663a9059cbb33868686818110611ada57611ada612c63565b9050610100020160c001356040518363ffffffff1660e01b81526004016115849291906001600160a01b03929092168252602082015260400190565b6002838383818110611b2a57611b2a612c63565b905061010002016040016020810190611b4391906128d0565b6003811115611b5457611b54612c4d565b1415612057576000838383818110611b6e57611b6e612c63565b905061010002016020016020810190611b8791906125ac565b6001600160a01b0316634c87087d858585818110611ba757611ba7612c63565b90506101000201600001356040518263ffffffff1660e01b8152600401611bd091815260200190565b6101806040518083038186803b158015611be957600080fd5b505afa158015611bfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2191906125d0565b505050505050505050509150506000848484818110611c4257611c42612c63565b905061010002016020016020810190611c5b91906125ac565b6001600160a01b031663c99733a7868686818110611c7b57611c7b612c63565b9050610100020160000135878787818110611c9857611c98612c63565b9050610100020160c001356040518363ffffffff1660e01b8152600401611cc9929190918252602082015260400190565b60806040518083038186803b158015611ce157600080fd5b505afa158015611cf5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d19919061292e565b5050509050848484818110611d3057611d30612c63565b905061010002016060016020810190611d4991906125ac565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b8152600401611d7893929190612a7e565b602060405180830381600087803b158015611d9257600080fd5b505af1158015611da6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dca919061289c565b50848484818110611ddd57611ddd612c63565b905061010002016060016020810190611df691906125ac565b6001600160a01b031663095ea7b3868686818110611e1657611e16612c63565b905061010002016020016020810190611e2f91906125ac565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b158015611e7757600080fd5b505af1158015611e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eaf919061289c565b50848484818110611ec257611ec2612c63565b905061010002016020016020810190611edb91906125ac565b6001600160a01b031663825b5cd6868686818110611efb57611efb612c63565b9050610100020160000135878787818110611f1857611f18612c63565b9050610100020160c00135888888818110611f3557611f35612c63565b6040516001600160e01b031960e088901b168152600481019590955260248501939093525060806101009092020101356044820152606401600060405180830381600087803b158015611f8757600080fd5b505af1158015611f9b573d6000803e3d6000fd5b50505050816001600160a01b031663a9059cbb33878787818110611fc157611fc1612c63565b9050610100020160c001356040518363ffffffff1660e01b8152600401611ffd9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561201757600080fd5b505af115801561202b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061204f919061289c565b505050612140565b82828281811061206957612069612c63565b90506101000201602001602081019061208291906125ac565b6001600160a01b0316631d746d838484848181106120a2576120a2612c63565b9050610100020160a00160208101906120bb91906125ac565b8585858181106120cd576120cd612c63565b60405160e086901b6001600160e01b03191681526001600160a01b03949094166004850152610100029190910160c00135602483015250336044820152606401600060405180830381600087803b15801561212757600080fd5b505af115801561213b573d6000803e3d6000fd5b505050505b8061214a81612c1c565b91505061118c565b505050565b6001600160a01b03811660009081526006602052604081205460ff1615156001141561218557506000919050565b505060055490565b919050565b600060016000836005815181106121ab576121ab612c63565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1615156001146122235760405162461bcd60e51b815260206004820152601d60248201527f42466163746f72793a2057726f6e6720506f6f6c2054656d706c6174650000006044820152606401610558565b600060405180604001604052808460048151811061224357612243612c63565b6020908102919091018101516001600160a01b03908116835260005416910152835190915061228c908490600590811061227f5761227f612c63565b60200260200101516124c0565b91506001600160a01b0382166122f05760405162461bcd60e51b8152602060048201526024808201527f42466163746f72793a20696e76616c69642062706f6f6c207a65726f206164646044820152637265737360e01b6064820152608401610558565b6000829050806001600160a01b031663c070a6d88560008151811061231757612317612c63565b602002602001015130886000808d896040518863ffffffff1660e01b81526004016123489796959493929190612a18565b602060405180830381600087803b15801561236257600080fd5b505af1158015612376573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061239a919061289c565b6123dd5760405162461bcd60e51b815260206004820152601460248201527311549497d253925512505312569157d09413d3d360621b6044820152606401610558565b836000815181106123f0576123f0612c63565b60200260200101516001600160a01b03166353f0c3b48860006002811061241957612419612c63565b60200201518960016020020151868860038151811061243a5761243a612c63565b60200260200101518b6040518663ffffffff1660e01b81526004016124639594939291906129d1565b602060405180830381600087803b15801561247d57600080fd5b505af1158015612491573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b5919061289c565b505050949350505050565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f06040516001600160a01b03821681529093507f117c72e6c25f0a072e36e148df71468ce2f3dbe7defec5b2c257a6e3eb65278c915060200160405180910390a150919050565b60008083601f84011261256257600080fd5b50813567ffffffffffffffff81111561257a57600080fd5b6020830191508360208260051b850101111561259557600080fd5b9250929050565b8051801515811461218d57600080fd5b6000602082840312156125be57600080fd5b81356125c981612c79565b9392505050565b6000806000806000806000806000806000806101808d8f0312156125f357600080fd5b8c516125fe81612c79565b60208e0151909c5061260f81612c79565b60408e015160608f0151919c509a5061262781612c79565b60808e015160a08f0151919a509850965061264460c08e0161259c565b955060e08d015194506101008d015193506101208d015192506101408d015191506126726101608e0161259c565b90509295989b509295989b509295989b565b60008060008060008060c0878903121561269d57600080fd5b86356126a881612c79565b955060208701356126b881612c79565b9450604087013593506060870135925060808701356126d681612c79565b915060a08701356126e681612c79565b809150509295509295509295565b60008060008060006060868803121561270c57600080fd5b853561271781612c79565b9450602086013567ffffffffffffffff8082111561273457600080fd5b61274089838a01612550565b9096509450604088013591508082111561275957600080fd5b5061276688828901612550565b969995985093965092949392505050565b600080600080600080600060a0888a03121561279257600080fd5b60408801898111156127a357600080fd5b8897503567ffffffffffffffff808211156127bd57600080fd5b6127c98b838c01612550565b909850965060608a01359150808211156127e257600080fd5b6127ee8b838c01612550565b909650945060808a013591508082111561280757600080fd5b506128148a828b01612550565b989b979a50959850939692959293505050565b6000806020838503121561283a57600080fd5b823567ffffffffffffffff8082111561285257600080fd5b818501915085601f83011261286657600080fd5b81358181111561287557600080fd5b8660208260081b850101111561288a57600080fd5b60209290920196919550909350505050565b6000602082840312156128ae57600080fd5b6125c98261259c565b6000602082840312156128c957600080fd5b5051919050565b6000602082840312156128e257600080fd5b8135600481106125c957600080fd5b60006020828403121561290357600080fd5b5035919050565b6000806040838503121561291d57600080fd5b505080516020909101519092909150565b6000806000806080858703121561294457600080fd5b505082516020840151604085015160609095015191969095509092509050565b8060005b60028110156129905781516001600160a01b0316845260209384019390910190600101612968565b50505050565b600081518084526020808501945080840160005b838110156129c6578151875295820195908201906001016129aa565b509495945050505050565b6001600160a01b038681168252858116602083015284811660408301528316606082015260a060808201819052600090612a0d90830184612996565b979650505050505050565b6001600160a01b0388811682528716602082015261012060408201819052600090612a4583820189612996565b91505085151560608301528415156080830152612a6560a0830185612964565b612a7260e0830184612964565b98975050505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03868116825260606020808401829052908301869052600091879160808501845b89811015612af1578435612add81612c79565b841682529382019390820190600101612aca565b5085810360408701528681526001600160fb1b03871115612b1157600080fd5b8660051b9350838883830137600093010191825250979650505050505050565b6020808252602b908201527f464143544f525920524f555445523a204e4f54204f524947494e414c2045524360408201526a32302054454d504c41544560a81b606082015260800190565b60208082526016908201527527b1b2b0b72937baba32b91d102727aa1027aba722a960511b604082015260600190565b60008219821115612bbf57612bbf612c37565b500190565b600082612be157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615612c0057612c00612c37565b500290565b600082821015612c1757612c17612c37565b500390565b6000600019821415612c3057612c30612c37565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461099357600080fdfea2646970667358221220d362b2704ac43cd4791f2cc83390abb1640d17f5dd830921bfe6b85390ae230c64736f6c63430008070033", + "linkReferences": {}, + "deployedLinkReferences": {} + } \ No newline at end of file diff --git a/abis/FixedRateExchange.json b/abis/FixedRateExchange.json index 969ca8e..01254db 100644 --- a/abis/FixedRateExchange.json +++ b/abis/FixedRateExchange.json @@ -1,15576 +1,918 @@ + { - "contractName": "FixedRateExchange", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "exchangeId", - "type": "bytes32" - }, - { - "indexed": true, - "name": "baseToken", - "type": "address" - }, - { - "indexed": true, - "name": "dataToken", - "type": "address" - }, - { - "indexed": false, - "name": "exchangeOwner", - "type": "address" - }, - { - "indexed": false, - "name": "fixedRate", - "type": "uint256" - } - ], - "name": "ExchangeCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "exchangeId", - "type": "bytes32" - }, - { - "indexed": true, - "name": "exchangeOwner", - "type": "address" - }, - { - "indexed": false, - "name": "newRate", - "type": "uint256" - } - ], - "name": "ExchangeRateChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "exchangeId", - "type": "bytes32" - }, - { - "indexed": true, - "name": "exchangeOwner", - "type": "address" - } - ], - "name": "ExchangeActivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "exchangeId", - "type": "bytes32" - }, - { - "indexed": true, - "name": "exchangeOwner", - "type": "address" - } - ], - "name": "ExchangeDeactivated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "exchangeId", - "type": "bytes32" - }, - { - "indexed": true, - "name": "by", - "type": "address" - }, - { - "indexed": false, - "name": "baseTokenSwappedAmount", - "type": "uint256" - }, - { - "indexed": false, - "name": "dataTokenSwappedAmount", - "type": "uint256" - } - ], - "name": "Swapped", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "baseToken", - "type": "address" - }, - { - "name": "dataToken", - "type": "address" - }, - { - "name": "fixedRate", - "type": "uint256" - } - ], - "name": "create", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "baseToken", - "type": "address" - }, - { - "name": "dataToken", - "type": "address" - }, - { - "name": "exchangeOwner", - "type": "address" - } - ], - "name": "generateExchangeId", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "exchangeId", - "type": "bytes32" - }, - { - "name": "dataTokenAmount", - "type": "uint256" - } - ], - "name": "CalcInGivenOut", - "outputs": [ - { - "name": "baseTokenAmount", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "exchangeId", - "type": "bytes32" - }, - { - "name": "dataTokenAmount", - "type": "uint256" - } - ], - "name": "swap", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getNumberOfExchanges", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "exchangeId", - "type": "bytes32" - }, - { - "name": "newRate", - "type": "uint256" - } - ], - "name": "setRate", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "exchangeId", - "type": "bytes32" - } - ], - "name": "toggleExchangeState", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "exchangeId", - "type": "bytes32" - } - ], - "name": "getRate", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "exchangeId", - "type": "bytes32" - } - ], - "name": "getSupply", - "outputs": [ - { - "name": "supply", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "exchangeId", - "type": "bytes32" - } - ], - "name": "getExchange", - "outputs": [ - { - "name": "exchangeOwner", - "type": "address" - }, - { - "name": "dataToken", - "type": "address" - }, - { - "name": "baseToken", - "type": "address" - }, - { - "name": "fixedRate", - "type": "uint256" - }, - { - "name": "active", - "type": "bool" - }, - { - "name": "supply", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getExchanges", - "outputs": [ - { - "name": "", - "type": "bytes32[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "exchangeId", - "type": "bytes32" - } - ], - "name": "isActive", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.7+commit.6da8b019\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"getExchanges\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"exchangeId\",\"type\":\"bytes32\"}],\"name\":\"toggleExchangeState\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"exchangeId\",\"type\":\"bytes32\"}],\"name\":\"getExchange\",\"outputs\":[{\"name\":\"exchangeOwner\",\"type\":\"address\"},{\"name\":\"dataToken\",\"type\":\"address\"},{\"name\":\"baseToken\",\"type\":\"address\"},{\"name\":\"fixedRate\",\"type\":\"uint256\"},{\"name\":\"active\",\"type\":\"bool\"},{\"name\":\"supply\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"exchangeId\",\"type\":\"bytes32\"}],\"name\":\"getSupply\",\"outputs\":[{\"name\":\"supply\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"exchangeId\",\"type\":\"bytes32\"}],\"name\":\"isActive\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"exchangeId\",\"type\":\"bytes32\"},{\"name\":\"newRate\",\"type\":\"uint256\"}],\"name\":\"setRate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"exchangeId\",\"type\":\"bytes32\"}],\"name\":\"getRate\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNumberOfExchanges\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"exchangeId\",\"type\":\"bytes32\"},{\"name\":\"dataTokenAmount\",\"type\":\"uint256\"}],\"name\":\"CalcInGivenOut\",\"outputs\":[{\"name\":\"baseTokenAmount\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"baseToken\",\"type\":\"address\"},{\"name\":\"dataToken\",\"type\":\"address\"},{\"name\":\"exchangeOwner\",\"type\":\"address\"}],\"name\":\"generateExchangeId\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"exchangeId\",\"type\":\"bytes32\"},{\"name\":\"dataTokenAmount\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"baseToken\",\"type\":\"address\"},{\"name\":\"dataToken\",\"type\":\"address\"},{\"name\":\"fixedRate\",\"type\":\"uint256\"}],\"name\":\"create\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"exchangeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"baseToken\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"dataToken\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"exchangeOwner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"fixedRate\",\"type\":\"uint256\"}],\"name\":\"ExchangeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"exchangeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"exchangeOwner\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"newRate\",\"type\":\"uint256\"}],\"name\":\"ExchangeRateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"exchangeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"exchangeOwner\",\"type\":\"address\"}],\"name\":\"ExchangeActivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"exchangeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"exchangeOwner\",\"type\":\"address\"}],\"name\":\"ExchangeDeactivated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"exchangeId\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"by\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"baseTokenSwappedAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"dataTokenSwappedAmount\",\"type\":\"uint256\"}],\"name\":\"Swapped\",\"type\":\"event\"}],\"devdoc\":{\"details\":\"FixedRateExchange is a fixed rate exchange Contract Marketplaces uses this contract to allow consumers exchanging datatokens with ocean token using a fixed exchange rate.\",\"methods\":{\"CalcInGivenOut(bytes32,uint256)\":{\"details\":\"CalcInGivenOut Calculates how many basetokens are needed to get specifyed amount of datatokens\",\"params\":{\"dataTokenAmount\":\"the amount of data tokens to be exchanged\",\"exchangeId\":\"a unique exchange idnetifier \"}},\"create(address,address,uint256)\":{\"details\":\"create creates new exchange pairs between base token (ocean token) and data tokens.\",\"params\":{\"baseToken\":\"refers to a ocean token contract address\",\"dataToken\":\"refers to a data token contract address\",\"fixedRate\":\"refers to the exact fixed exchange rate in wei\"}},\"generateExchangeId(address,address,address)\":{\"details\":\"generateExchangeId creates unique exchange identifier for two token pairs.\",\"params\":{\"baseToken\":\"refers to a ocean token contract address\",\"dataToken\":\"refers to a data token contract address\",\"exchangeOwner\":\"exchange owner address\"}},\"getExchange(bytes32)\":{\"details\":\"getExchange gets all the exchange details\",\"params\":{\"exchangeId\":\"a unique exchange idnetifier\"},\"return\":\"all the exchange details including the exchange Owner the dataToken contract address, the base token address, the fixed rate, whether the exchange is active and the supply or the the current data token liquidity.\"},\"getExchanges()\":{\"details\":\"getExchanges gets all the exchanges list\",\"return\":\"a list of all registered exchange Ids\"},\"getNumberOfExchanges()\":{\"details\":\"getNumberOfExchanges gets the total number of registered exchanges\",\"return\":\"total number of registered exchange IDs\"},\"getRate(bytes32)\":{\"details\":\"getRate gets the current fixed rate for an exchange\",\"params\":{\"exchangeId\":\"a unique exchange idnetifier\"},\"return\":\"fixed rate value\"},\"getSupply(bytes32)\":{\"details\":\"getSupply gets the current supply of datatokens in an fixed rate exchagne\",\"params\":{\"exchangeId\":\"the exchange ID\"},\"return\":\"supply\"},\"isActive(bytes32)\":{\"details\":\"isActive checks whether exchange is active\",\"params\":{\"exchangeId\":\"a unique exchange idnetifier\"},\"return\":\"true if exchange is true, otherwise returns false\"},\"setRate(bytes32,uint256)\":{\"details\":\"setRate changes the fixed rate for an exchange with a new rate\",\"params\":{\"exchangeId\":\"a unique exchange idnetifier\",\"newRate\":\"new fixed rate value\"}},\"swap(bytes32,uint256)\":{\"details\":\"swap atomic swap between two registered fixed rate exchange.\",\"params\":{\"dataTokenAmount\":\"the amount of data tokens to be exchanged\",\"exchangeId\":\"a unique exchange idnetifier \"}},\"toggleExchangeState(bytes32)\":{\"details\":\"toggleExchangeState toggles the active state of an existing exchange\",\"params\":{\"exchangeId\":\"a unique exchange idnetifier\"}}},\"title\":\"FixedRateExchange\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/ocean/ocean-contracts/contracts/fixedRate/FixedRateExchange.sol\":\"FixedRateExchange\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/ocean/ocean-contracts/contracts/fixedRate/FixedRateExchange.sol\":{\"keccak256\":\"0xff9de548d8fc2ed7f3ba9ec63f839e164152b48f9ca0e50b8c8e31c8d4de14c4\",\"urls\":[\"bzzr://fcff28f27252fc99900599258b20062220c7084b5efec438cedde9bb47723377\"]},\"/ocean/ocean-contracts/contracts/interfaces/IERC20Template.sol\":{\"keccak256\":\"0x022ebed2ba4949e96a05cc394cf690d8fd3190a4733cebe8cbe930ac25cfde18\",\"urls\":[\"bzzr://2fa3d5cae14f0af7d78f6e1d13bc41854082c03ab2f86462ebb09afda88ee6e9\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzzr://292843005e754e752644f767477ec5ad7a1ffc91ddb18c38b8079c62f3993cad\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50611243806100206000396000f3fe608060405234801561001057600080fd5b50600436106100d1576000357c010000000000000000000000000000000000000000000000000000000090048063b32b56f91161008e578063b32b56f914610231578063b42414291461024e578063c030023114610256578063c1f6572e14610279578063de060743146102b1578063ffe5725f146102d4576100d1565b80631e2e3a6b146100d657806324cb477e1461012e5780634c87087d1461014d57806354d9be59146101ae5780635c36901c146101dd578063680819eb1461020e575b600080fd5b6100de61030a565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561011a578181015183820152602001610102565b505050509050019250505060405180910390f35b61014b6004803603602081101561014457600080fd5b5035610362565b005b61016a6004803603602081101561016357600080fd5b5035610465565b60408051600160a060020a0397881681529587166020870152939095168484015260608401919091521515608083015260a082019290925290519081900360c00190f35b6101cb600480360360208110156101c457600080fd5b50356104fc565b60408051918252519081900360200190f35b6101fa600480360360208110156101f357600080fd5b5035610689565b604080519115158252519081900360200190f35b61014b6004803603604081101561022457600080fd5b508035906020013561069e565b6101cb6004803603602081101561024757600080fd5b503561078b565b6101cb6107a0565b6101cb6004803603604081101561026c57600080fd5b50803590602001356107a6565b6101cb6004803603606081101561028f57600080fd5b50600160a060020a03813581169160208101358216916040909101351661085e565b61014b600480360360408110156102c757600080fd5b50803590602001356108a4565b61014b600480360360608110156102ea57600080fd5b50600160a060020a03813581169160208101359091169060400135610b8a565b6060600180548060200260200160405190810160405280929190818152602001828054801561035857602002820191906000526020600020905b815481526020019060010190808311610344575b5050505050905090565b60008181526020819052604090205481906101009004600160a060020a031633146103c15760405160e560020a62461bcd0281526004018080602001828103825260298152602001806110886029913960400191505060405180910390fd5b60008281526020819052604090205460ff161561041d57600082815260208190526040808220805460ff1916905551339184917f03da9148e1de78fba22de63c573465562ebf6ef878a1d3ea83790a560229984c9190a3610461565b600082815260208190526040808220805460ff1916600117905551339184917fc7344c45124818d1d3a4c24ccb9b86d8b88d3bd05209b2a42b494cb32a5035299190a35b5050565b600080600080600080610476610fb2565b5060008781526020818152604091829020825160a081018452815460ff81161515808352610100909104600160a060020a03908116948301859052600184015481169583018690526002840154166060830181905260039093015460808301819052939a509398509096509094509092506104f0886104fc565b91505091939550919395565b60008181526020819052604081205460ff1661051a57506000610684565b6000828152602081815260408083206001810154905482517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a036101009092048216600482015292519116926370a082319260248082019391829003018186803b15801561059057600080fd5b505afa1580156105a4573d6000803e3d6000fd5b505050506040513d60208110156105ba57600080fd5b50516000848152602081815260408083206001810154905482517fdd62ed3e000000000000000000000000000000000000000000000000000000008152610100909104600160a060020a0390811660048301523060248301529251959650939491169263dd62ed3e926044808301939192829003018186803b15801561063f57600080fd5b505afa158015610653573d6000803e3d6000fd5b505050506040513d602081101561066957600080fd5b505190508082101561067d57819250610681565b8092505b50505b919050565b60009081526020819052604090205460ff1690565b60008281526020819052604090205482906101009004600160a060020a031633146106fd5760405160e560020a62461bcd0281526004018080602001828103825260298152602001806110886029913960400191505060405180910390fd5b8161073c5760405160e560020a62461bcd02815260040180806020018281038252602381526020018061103a6023913960400191505060405180910390fd5b6000838152602081815260409182902060030184905581518481529151339286927fe50f9919fdc524004a4ee0cb934f4734f144bec0713a52e5483b753f5de0f08c92918290030190a3505050565b60009081526020819052604090206003015490565b60015490565b6000828152602081905260408120600301548390158015906107db575060008181526020819052604090205460ff1615156001145b6108195760405160e560020a62461bcd02815260040180806020018281038252602b81526020018061100f602b913960400191505060405180910390fd5b60008481526020819052604090206003015461085690670de0b6b3a76400009061084a90869063ffffffff610e6b16565b9063ffffffff610ed016565b949350505050565b60408051600160a060020a039485166020808301919091529385168183015291909316606080830191909152835180830390910181526080909101909252815191012090565b6000828152602081905260409020600301548290158015906108d9575060008181526020819052604090205460ff1615156001145b6109175760405160e560020a62461bcd02815260040180806020018281038252602b81526020018061100f602b913960400191505060405180910390fd5b816109565760405160e560020a62461bcd0281526004018080602001828103825260298152602001806111ef6029913960400191505060405180910390fd5b600061096284846107a6565b6000858152602081815260408083206002810154905482517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a036101009092048216602482015260448101879052925195965016936323b872dd93606480840194938390030190829087803b1580156109e957600080fd5b505af11580156109fd573d6000803e3d6000fd5b505050506040513d6020811015610a1357600080fd5b5051610a535760405160e560020a62461bcd0281526004018080602001828103825260408152602001806110b16040913960400191505060405180910390fd5b6000848152602081815260408083206001810154905482517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a03610100909204821660048201523360248201526044810189905292519116936323b872dd93606480850194919392918390030190829087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b505050506040513d6020811015610b0557600080fd5b5051610b455760405160e560020a62461bcd02815260040180806020018281038252604081526020018061117c6040913960400191505060405180910390fd5b60408051828152602081018590528151339287927f816ecef7c59c8574653ab4522960d26a6d2987e94d760cd775b6c9273ef81f23929081900390910190a350505050565b600160a060020a038316610bd25760405160e560020a62461bcd0281526004018080602001828103825260338152602001806111496033913960400191505060405180910390fd5b600160a060020a038216610c1a5760405160e560020a62461bcd0281526004018080602001828103825260338152602001806111bc6033913960400191505060405180910390fd5b81600160a060020a031683600160a060020a03161415610c6e5760405160e560020a62461bcd0281526004018080602001828103825260378152602001806110f16037913960400191505060405180910390fd5b80610cad5760405160e560020a62461bcd02815260040180806020018281038252602e815260200180610fe1602e913960400191505060405180910390fd5b6000610cba84843361085e565b60008181526020819052604090206003015490915015610d0e5760405160e560020a62461bcd02815260040180806020018281038252602b81526020018061105d602b913960400191505060405180910390fd5b6040805160a0810182526001808252336020808401828152600160a060020a038981168688018181528c83166060890181815260808a018d815260008d81528089528c81209b518c54985188166101000274ffffffffffffffffffffffffffffffffffffffff001991151560ff19909a169990991716979097178b5592518a8a01805491871673ffffffffffffffffffffffffffffffffffffffff19928316179055905160028b018054919096169116179093555160039097019690965584548086018655949091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf69093018690558451918252810186905283519293919285927feb7a353641f7d3cc54b497ef1553fdc292b64d9cc3be8587c23dfba01f310b19928290030190a4604051339082907fc7344c45124818d1d3a4c24ccb9b86d8b88d3bd05209b2a42b494cb32a50352990600090a350505050565b600082610e7a57506000610eca565b82820282848281610e8757fe5b0414610ec75760405160e560020a62461bcd0281526004018080602001828103825260218152602001806111286021913960400191505060405180910390fd5b90505b92915050565b6000610ec783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060008183610f9c5760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f61578181015183820152602001610f49565b50505050905090810190601f168015610f8e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610fa857fe5b0495945050505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe46697865645261746545786368616e67653a20496e76616c69642065786368616e676520726174652076616c756546697865645261746545786368616e67653a2045786368616e676520646f6573206e6f742065786973742146697865645261746545786368616e67653a20526174696f206d757374206265203e3046697865645261746545786368616e67653a2045786368616e676520616c7265616479206578697374732146697865645261746545786368616e67653a20696e76616c69642065786368616e6765206f776e657246697865645261746545786368616e67653a207472616e7366657246726f6d206661696c656420696e207468652062617365546f6b656e20636f6e747261637446697865645261746545786368616e67653a20496e76616c69642064617461746f6b656e2c2020657175616c732062617365746f6b656e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7746697865645261746545786368616e67653a20496e76616c69642062617365746f6b656e2c20207a65726f206164647265737346697865645261746545786368616e67653a207472616e7366657246726f6d206661696c656420696e207468652064617461546f6b656e20636f6e747261637446697865645261746545786368616e67653a20496e76616c69642064617461746f6b656e2c20207a65726f206164647265737346697865645261746545786368616e67653a207a65726f206461746120746f6b656e20616d6f756e74a165627a7a723058200ebd6ad886857ade222027637bd88eb2d0c925a0614640e8be3b53efead00de50029", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d1576000357c010000000000000000000000000000000000000000000000000000000090048063b32b56f91161008e578063b32b56f914610231578063b42414291461024e578063c030023114610256578063c1f6572e14610279578063de060743146102b1578063ffe5725f146102d4576100d1565b80631e2e3a6b146100d657806324cb477e1461012e5780634c87087d1461014d57806354d9be59146101ae5780635c36901c146101dd578063680819eb1461020e575b600080fd5b6100de61030a565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561011a578181015183820152602001610102565b505050509050019250505060405180910390f35b61014b6004803603602081101561014457600080fd5b5035610362565b005b61016a6004803603602081101561016357600080fd5b5035610465565b60408051600160a060020a0397881681529587166020870152939095168484015260608401919091521515608083015260a082019290925290519081900360c00190f35b6101cb600480360360208110156101c457600080fd5b50356104fc565b60408051918252519081900360200190f35b6101fa600480360360208110156101f357600080fd5b5035610689565b604080519115158252519081900360200190f35b61014b6004803603604081101561022457600080fd5b508035906020013561069e565b6101cb6004803603602081101561024757600080fd5b503561078b565b6101cb6107a0565b6101cb6004803603604081101561026c57600080fd5b50803590602001356107a6565b6101cb6004803603606081101561028f57600080fd5b50600160a060020a03813581169160208101358216916040909101351661085e565b61014b600480360360408110156102c757600080fd5b50803590602001356108a4565b61014b600480360360608110156102ea57600080fd5b50600160a060020a03813581169160208101359091169060400135610b8a565b6060600180548060200260200160405190810160405280929190818152602001828054801561035857602002820191906000526020600020905b815481526020019060010190808311610344575b5050505050905090565b60008181526020819052604090205481906101009004600160a060020a031633146103c15760405160e560020a62461bcd0281526004018080602001828103825260298152602001806110886029913960400191505060405180910390fd5b60008281526020819052604090205460ff161561041d57600082815260208190526040808220805460ff1916905551339184917f03da9148e1de78fba22de63c573465562ebf6ef878a1d3ea83790a560229984c9190a3610461565b600082815260208190526040808220805460ff1916600117905551339184917fc7344c45124818d1d3a4c24ccb9b86d8b88d3bd05209b2a42b494cb32a5035299190a35b5050565b600080600080600080610476610fb2565b5060008781526020818152604091829020825160a081018452815460ff81161515808352610100909104600160a060020a03908116948301859052600184015481169583018690526002840154166060830181905260039093015460808301819052939a509398509096509094509092506104f0886104fc565b91505091939550919395565b60008181526020819052604081205460ff1661051a57506000610684565b6000828152602081815260408083206001810154905482517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a036101009092048216600482015292519116926370a082319260248082019391829003018186803b15801561059057600080fd5b505afa1580156105a4573d6000803e3d6000fd5b505050506040513d60208110156105ba57600080fd5b50516000848152602081815260408083206001810154905482517fdd62ed3e000000000000000000000000000000000000000000000000000000008152610100909104600160a060020a0390811660048301523060248301529251959650939491169263dd62ed3e926044808301939192829003018186803b15801561063f57600080fd5b505afa158015610653573d6000803e3d6000fd5b505050506040513d602081101561066957600080fd5b505190508082101561067d57819250610681565b8092505b50505b919050565b60009081526020819052604090205460ff1690565b60008281526020819052604090205482906101009004600160a060020a031633146106fd5760405160e560020a62461bcd0281526004018080602001828103825260298152602001806110886029913960400191505060405180910390fd5b8161073c5760405160e560020a62461bcd02815260040180806020018281038252602381526020018061103a6023913960400191505060405180910390fd5b6000838152602081815260409182902060030184905581518481529151339286927fe50f9919fdc524004a4ee0cb934f4734f144bec0713a52e5483b753f5de0f08c92918290030190a3505050565b60009081526020819052604090206003015490565b60015490565b6000828152602081905260408120600301548390158015906107db575060008181526020819052604090205460ff1615156001145b6108195760405160e560020a62461bcd02815260040180806020018281038252602b81526020018061100f602b913960400191505060405180910390fd5b60008481526020819052604090206003015461085690670de0b6b3a76400009061084a90869063ffffffff610e6b16565b9063ffffffff610ed016565b949350505050565b60408051600160a060020a039485166020808301919091529385168183015291909316606080830191909152835180830390910181526080909101909252815191012090565b6000828152602081905260409020600301548290158015906108d9575060008181526020819052604090205460ff1615156001145b6109175760405160e560020a62461bcd02815260040180806020018281038252602b81526020018061100f602b913960400191505060405180910390fd5b816109565760405160e560020a62461bcd0281526004018080602001828103825260298152602001806111ef6029913960400191505060405180910390fd5b600061096284846107a6565b6000858152602081815260408083206002810154905482517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152600160a060020a036101009092048216602482015260448101879052925195965016936323b872dd93606480840194938390030190829087803b1580156109e957600080fd5b505af11580156109fd573d6000803e3d6000fd5b505050506040513d6020811015610a1357600080fd5b5051610a535760405160e560020a62461bcd0281526004018080602001828103825260408152602001806110b16040913960400191505060405180910390fd5b6000848152602081815260408083206001810154905482517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a03610100909204821660048201523360248201526044810189905292519116936323b872dd93606480850194919392918390030190829087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b505050506040513d6020811015610b0557600080fd5b5051610b455760405160e560020a62461bcd02815260040180806020018281038252604081526020018061117c6040913960400191505060405180910390fd5b60408051828152602081018590528151339287927f816ecef7c59c8574653ab4522960d26a6d2987e94d760cd775b6c9273ef81f23929081900390910190a350505050565b600160a060020a038316610bd25760405160e560020a62461bcd0281526004018080602001828103825260338152602001806111496033913960400191505060405180910390fd5b600160a060020a038216610c1a5760405160e560020a62461bcd0281526004018080602001828103825260338152602001806111bc6033913960400191505060405180910390fd5b81600160a060020a031683600160a060020a03161415610c6e5760405160e560020a62461bcd0281526004018080602001828103825260378152602001806110f16037913960400191505060405180910390fd5b80610cad5760405160e560020a62461bcd02815260040180806020018281038252602e815260200180610fe1602e913960400191505060405180910390fd5b6000610cba84843361085e565b60008181526020819052604090206003015490915015610d0e5760405160e560020a62461bcd02815260040180806020018281038252602b81526020018061105d602b913960400191505060405180910390fd5b6040805160a0810182526001808252336020808401828152600160a060020a038981168688018181528c83166060890181815260808a018d815260008d81528089528c81209b518c54985188166101000274ffffffffffffffffffffffffffffffffffffffff001991151560ff19909a169990991716979097178b5592518a8a01805491871673ffffffffffffffffffffffffffffffffffffffff19928316179055905160028b018054919096169116179093555160039097019690965584548086018655949091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf69093018690558451918252810186905283519293919285927feb7a353641f7d3cc54b497ef1553fdc292b64d9cc3be8587c23dfba01f310b19928290030190a4604051339082907fc7344c45124818d1d3a4c24ccb9b86d8b88d3bd05209b2a42b494cb32a50352990600090a350505050565b600082610e7a57506000610eca565b82820282848281610e8757fe5b0414610ec75760405160e560020a62461bcd0281526004018080602001828103825260218152602001806111286021913960400191505060405180910390fd5b90505b92915050565b6000610ec783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060008183610f9c5760405160e560020a62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f61578181015183820152602001610f49565b50505050905090810190601f168015610f8e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610fa857fe5b0495945050505050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe46697865645261746545786368616e67653a20496e76616c69642065786368616e676520726174652076616c756546697865645261746545786368616e67653a2045786368616e676520646f6573206e6f742065786973742146697865645261746545786368616e67653a20526174696f206d757374206265203e3046697865645261746545786368616e67653a2045786368616e676520616c7265616479206578697374732146697865645261746545786368616e67653a20696e76616c69642065786368616e6765206f776e657246697865645261746545786368616e67653a207472616e7366657246726f6d206661696c656420696e207468652062617365546f6b656e20636f6e747261637446697865645261746545786368616e67653a20496e76616c69642064617461746f6b656e2c2020657175616c732062617365746f6b656e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7746697865645261746545786368616e67653a20496e76616c69642062617365746f6b656e2c20207a65726f206164647265737346697865645261746545786368616e67653a207472616e7366657246726f6d206661696c656420696e207468652064617461546f6b656e20636f6e747261637446697865645261746545786368616e67653a20496e76616c69642064617461746f6b656e2c20207a65726f206164647265737346697865645261746545786368616e67653a207a65726f206461746120746f6b656e20616d6f756e74a165627a7a723058200ebd6ad886857ade222027637bd88eb2d0c925a0614640e8be3b53efead00de50029", - "sourceMap": "530:10457:9:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;530:10457:9;;;;;;;", - "deployedSourceMap": "530:10457:9:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;530:10457:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10486:130;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;10486:130:9;;;;;;;;;;;;;;;;;7632:511;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7632:511:9;;:::i;:::-;;9742:604;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;9742:604:9;;:::i;:::-;;;;-1:-1:-1;;;;;9742:604:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8688:636;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8688:636:9;;:::i;:::-;;;;;;;;;;;;;;;;10824:161;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;10824:161:9;;:::i;:::-;;;;;;;;;;;;;;;;;;7051:411;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;7051:411:9;;;;;;;:::i;8327:165::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8327:165:9;;:::i;6711:134::-;;;:::i;4846:336::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4846:336:9;;;;;;;:::i;4231:343::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;4231:343:9;;;;;;;;;;;;;;;;;;;:::i;5420:1123::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5420:1123:9;;;;;;;:::i;2512:1418::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;2512:1418:9;;;;;;;;;;;;;;;;;:::i;10486:130::-;10559:16;10598:11;10591:18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10486:130;:::o;7632:511::-;1306:9;:21;;;;;;;;;;:35;7738:10;;1306:35;;;-1:-1:-1;;;;;1306:35:9;1345:10;1306:49;1285:137;;;;-1:-1:-1;;;;;1285:137:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7767:9;:21;;;;;;;;;;:28;;;7764:373;;;7841:5;7810:21;;;;;;;;;;;:36;;-1:-1:-1;;7810:36:9;;;7865:89;7930:10;;7820;;7865:89;;7841:5;7865:89;7764:373;;;7985:9;:21;;;;;;;;;;;:35;;-1:-1:-1;;7985:35:9;8016:4;7985:35;;;8039:87;8102:10;;7995;;8039:87;;7985:9;8039:87;7764:373;7632:511;;:::o;9742:604::-;9857:21;9892:17;9923;9954;9985:11;10010:14;10049:24;;:::i;:::-;-1:-1:-1;10076:9:9;:21;;;;;;;;;;;;10049:48;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;10049:48:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10049:48:9;;-1:-1:-1;10049:48:9;;-1:-1:-1;10049:48:9;;-1:-1:-1;10049:48:9;;-1:-1:-1;10318:21:9;10076;10318:9;:21::i;:::-;10309:30;;9742:604;;;;;;;;:::o;8688:636::-;8772:14;8805:21;;;;;;;;;;:28;;;8802:516;;-1:-1:-1;8865:1:9;8802:516;;;8895:15;8928:21;;;;;;;;;;;:31;;;;8988:35;;8913:111;;;;;-1:-1:-1;;;;;8928:31:9;8988:35;;;;;8913:111;;;;;;8928:31;;;8913:74;;:111;;;;;;;;;;;8928:31;8913:111;;;5:2:-1;;;;30:1;27;20:12;5:2;8913:111:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8913:111:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8913:111:9;9038:17;9073:21;;;8913:111;9073:21;;;;;;;:31;;;;9133:35;;9058:126;;;;;9073:31;9133:35;;;-1:-1:-1;;;;;9133:35:9;;;9058:126;;;;9178:4;9058:126;;;;;;8913:111;;-1:-1:-1;9038:17:9;;9073:31;;;9058:74;;:126;;;;;8913:111;;9058:126;;;;;9073:31;9058:126;;;5:2:-1;;;;30:1;27;20:12;5:2;9058:126:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9058:126:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;9058:126:9;;-1:-1:-1;9201:19:9;;;9198:109;;;9247:7;9238:16;;9198:109;;;9298:9;9289:18;;9198:109;8802:516;;;8688:636;;;:::o;10824:161::-;10923:4;10950:21;;;;;;;;;;:28;;;;10824:161::o;7051:411::-;1306:9;:21;;;;;;;;;;:35;7170:10;;1306:35;;;-1:-1:-1;;;;;1306:35:9;1345:10;1306:49;1285:137;;;;-1:-1:-1;;;;;1285:137:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7217:12;7196:94;;;;-1:-1:-1;;;;;7196:94:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7301:9;:21;;;;;;;;;;;;:31;;:41;;;7357:98;;;;;;;7414:10;;7311;;7357:98;;;;;;;;;7051:411;;;:::o;8327:165::-;8424:7;8454:21;;;;;;;;;;:31;;;;8327:165::o;6711:134::-;6820:11;:18;6711:134;:::o;4846:336::-;5043:23;1029:21;;;;;;;;;;:31;;;5005:10;;1029:36;;;;:88;;-1:-1:-1;1081:9:9;:21;;;;;;;;;;:28;;;:36;;:28;:36;1029:88;1008:178;;;;-1:-1:-1;;;;;1008:178:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5133:9;:21;;;;;;;;;;:31;;;5100:75;;627:8;;5100:65;;:15;;:65;:19;:65;:::i;:::-;:69;:75;:69;:75;:::i;:::-;5082:93;4846:336;-1:-1:-1;;;;4846:336:9:o;4231:343::-;4448:109;;;-1:-1:-1;;;;;4448:109:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;4448:109:9;;;;;;;4425:142;;;;;;4231:343::o;5420:1123::-;1029:9;:21;;;;;;;;;;:31;;;5558:10;;1029:36;;;;:88;;-1:-1:-1;1081:9:9;:21;;;;;;;;;;:28;;;:36;;:28;:36;1029:88;1008:178;;;;-1:-1:-1;;;;;1008:178:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5614:20;5593:108;;;;-1:-1:-1;;;;;5593:108:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5711:23;5737:42;5752:10;5763:15;5737:14;:42::i;:::-;5825:9;:21;;;;;;;;;;;:31;;;;5916:35;;5810:188;;;;;5888:10;5810:188;;;;-1:-1:-1;;;;;5825:31:9;5916:35;;;;;5810:188;;;;;;;;;;;;;;-1:-1:-1;5825:31:9;;5810:60;;:188;;;;;5825:21;5810:188;;;;;;;5825:31;5810:188;;;5:2:-1;;;;30:1;27;20:12;5:2;5810:188:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5810:188:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5810:188:9;5789:299;;;;-1:-1:-1;;;;;5789:299:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6134:9;:21;;;;;;;;;;;:31;;;;6197:35;;6119:188;;;;;-1:-1:-1;;;;;6134:31:9;6197:35;;;;;6119:188;;;;6250:10;6119:188;;;;;;;;;;;;6134:31;;;6119:60;;:188;;;;;6134:21;;6119:188;;;;;;;;;6134:31;6119:188;;;5:2:-1;;;;30:1;27;20:12;5:2;6119:188:9;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6119:188:9;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6119:188:9;6098:299;;;;-1:-1:-1;;;;;6098:299:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6413:123;;;;;;;;;;;;;;6458:10;;6434;;6413:123;;;;;;;;;;;1196:1;5420:1123;;;:::o;2512:1418::-;-1:-1:-1;;;;;2667:23:9;;2646:121;;;;-1:-1:-1;;;;;2646:121:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2798:23:9;;2777:121;;;;-1:-1:-1;;;;;2777:121:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2942:9;-1:-1:-1;;;;;2929:22:9;:9;-1:-1:-1;;;;;2929:22:9;;;2908:124;;;;-1:-1:-1;;;;;2908:124:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3063:14;3042:108;;;;-1:-1:-1;;;;;3042:108:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3160:18;3181:98;3213:9;3236;3259:10;3181:18;:98::i;:::-;3310:9;:21;;;;;;;;;;:31;;;3160:119;;-1:-1:-1;3310:36:9;3289:126;;;;-1:-1:-1;;;;;3289:126:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3449:187;;;;;;;;3480:4;3449:187;;;3513:10;3449:187;;;;;;;-1:-1:-1;;;;;3449:187:9;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3425:21:9;;;;;;;;;:211;;;;;;;;;;-1:-1:-1;;3425:211:9;;;-1:-1:-1;;3425:211:9;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3425:211:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;23:18;;;45:23;;3646:28:9;;;;;;;;;;;3690:142;;;;;;;;;;;;3449:187;;;;3435:10;;3690:142;;;;;;;;3848:75;;3903:10;;3879;;3848:75;;;;;2512:1418;;;;:::o;2159:459:15:-;2217:7;2458:6;2454:45;;-1:-1:-1;2487:1:15;2480:8;;2454:45;2521:5;;;2525:1;2521;:5;:1;2544:5;;;;;:10;2536:56;;;;-1:-1:-1;;;;;2536:56:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2610:1;-1:-1:-1;2159:459:15;;;;;:::o;3073:130::-;3131:7;3157:39;3161:1;3164;3157:39;;;;;;;;;;;;;;;;;3804:7;3904:12;3897:5;3889:28;;;;-1:-1:-1;;;;;3889:28:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;3889:28:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3927:9;3943:1;3939;:5;;;;;;;3718:338;-1:-1:-1;;;;;3718:338:15:o;530:10457:9:-;;;;;;;;;-1:-1:-1;530:10457:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::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 '../interfaces/IERC20Template.sol';\nimport 'openzeppelin-solidity/contracts/math/SafeMath.sol';\n\n/**\n * @title FixedRateExchange\n * @dev FixedRateExchange is a fixed rate exchange Contract\n * Marketplaces uses this contract to allow consumers \n * exchanging datatokens with ocean token using a fixed \n * exchange rate.\n */\ncontract FixedRateExchange {\n using SafeMath for uint256;\n uint256 private constant BASE = 10 ** 18;\n struct Exchange {\n bool active;\n address exchangeOwner;\n address dataToken;\n address baseToken;\n uint256 fixedRate;\n }\n\n // maps an exchangeId to an exchange\n mapping(bytes32 => Exchange) private exchanges;\n bytes32[] private exchangeIds;\n\n modifier onlyActiveExchange(\n bytes32 exchangeId\n )\n {\n require(\n exchanges[exchangeId].fixedRate != 0 &&\n exchanges[exchangeId].active == true,\n 'FixedRateExchange: Exchange does not exist!'\n );\n _;\n }\n\n modifier onlyExchangeOwner(\n bytes32 exchangeId\n )\n {\n require(\n exchanges[exchangeId].exchangeOwner == msg.sender,\n 'FixedRateExchange: invalid exchange owner'\n );\n _;\n }\n\n event ExchangeCreated(\n bytes32 indexed exchangeId,\n address indexed baseToken,\n address indexed dataToken,\n address exchangeOwner,\n uint256 fixedRate\n );\n\n event ExchangeRateChanged(\n bytes32 indexed exchangeId,\n address indexed exchangeOwner,\n uint256 newRate\n );\n\n event ExchangeActivated(\n bytes32 indexed exchangeId,\n address indexed exchangeOwner\n );\n\n event ExchangeDeactivated(\n bytes32 indexed exchangeId,\n address indexed exchangeOwner\n );\n\n event Swapped(\n bytes32 indexed exchangeId,\n address indexed by,\n uint256 baseTokenSwappedAmount,\n uint256 dataTokenSwappedAmount\n );\n\n /**\n * @dev create\n * creates new exchange pairs between base token\n * (ocean token) and data tokens.\n * @param baseToken refers to a ocean token contract address\n * @param dataToken refers to a data token contract address\n * @param fixedRate refers to the exact fixed exchange rate in wei\n */\n function create(\n address baseToken,\n address dataToken,\n uint256 fixedRate\n )\n external\n {\n require(\n baseToken != address(0),\n 'FixedRateExchange: Invalid basetoken, zero address'\n );\n require(\n dataToken != address(0),\n 'FixedRateExchange: Invalid datatoken, zero address'\n );\n require(\n baseToken != dataToken,\n 'FixedRateExchange: Invalid datatoken, equals basetoken'\n );\n require(\n fixedRate != 0, \n 'FixedRateExchange: Invalid exchange rate value'\n );\n bytes32 exchangeId = generateExchangeId(\n baseToken,\n dataToken,\n msg.sender\n );\n require(\n exchanges[exchangeId].fixedRate == 0,\n 'FixedRateExchange: Exchange already exists!'\n );\n exchanges[exchangeId] = Exchange({\n active: true,\n exchangeOwner: msg.sender,\n dataToken: dataToken,\n baseToken: baseToken,\n fixedRate: fixedRate\n });\n exchangeIds.push(exchangeId);\n\n emit ExchangeCreated(\n exchangeId,\n baseToken,\n dataToken,\n msg.sender,\n fixedRate\n );\n\n emit ExchangeActivated(\n exchangeId,\n msg.sender\n );\n }\n\n /**\n * @dev generateExchangeId\n * creates unique exchange identifier for two token pairs.\n * @param baseToken refers to a ocean token contract address\n * @param dataToken refers to a data token contract address\n * @param exchangeOwner exchange owner address\n */\n function generateExchangeId(\n address baseToken,\n address dataToken,\n address exchangeOwner\n )\n public\n pure\n returns (bytes32)\n {\n return keccak256(\n abi.encode(\n baseToken,\n dataToken,\n exchangeOwner\n )\n );\n }\n \n /**\n * @dev CalcInGivenOut\n * Calculates how many basetokens are needed to get specifyed amount of datatokens\n * @param exchangeId a unique exchange idnetifier \n * @param dataTokenAmount the amount of data tokens to be exchanged\n */\n function CalcInGivenOut(\n bytes32 exchangeId,\n uint256 dataTokenAmount\n )\n public\n view\n onlyActiveExchange(\n exchangeId\n )\n returns (uint256 baseTokenAmount)\n {\n baseTokenAmount = dataTokenAmount.mul(\n exchanges[exchangeId].fixedRate).div(BASE);\n }\n \n /**\n * @dev swap\n * atomic swap between two registered fixed rate exchange.\n * @param exchangeId a unique exchange idnetifier \n * @param dataTokenAmount the amount of data tokens to be exchanged\n */\n function swap(\n bytes32 exchangeId,\n uint256 dataTokenAmount\n )\n external\n onlyActiveExchange(\n exchangeId\n )\n {\n require(\n dataTokenAmount != 0,\n 'FixedRateExchange: zero data token amount'\n );\n uint256 baseTokenAmount = CalcInGivenOut(exchangeId,dataTokenAmount);\n require(\n IERC20Template(exchanges[exchangeId].baseToken).transferFrom(\n msg.sender,\n exchanges[exchangeId].exchangeOwner,\n baseTokenAmount\n ),\n 'FixedRateExchange: transferFrom failed in the baseToken contract'\n );\n require(\n IERC20Template(exchanges[exchangeId].dataToken).transferFrom(\n exchanges[exchangeId].exchangeOwner,\n msg.sender,\n dataTokenAmount\n ),\n 'FixedRateExchange: transferFrom failed in the dataToken contract'\n );\n\n emit Swapped(\n exchangeId,\n msg.sender,\n baseTokenAmount,\n dataTokenAmount\n );\n }\n\n /**\n * @dev getNumberOfExchanges\n * gets the total number of registered exchanges\n * @return total number of registered exchange IDs\n */\n function getNumberOfExchanges()\n external\n view\n returns (uint256)\n {\n return exchangeIds.length;\n }\n\n /**\n * @dev setRate\n * changes the fixed rate for an exchange with a new rate\n * @param exchangeId a unique exchange idnetifier\n * @param newRate new fixed rate value\n */\n function setRate(\n bytes32 exchangeId,\n uint256 newRate\n )\n external\n onlyExchangeOwner(exchangeId)\n {\n require(\n newRate != 0,\n 'FixedRateExchange: Ratio must be >0'\n );\n\n exchanges[exchangeId].fixedRate = newRate;\n emit ExchangeRateChanged(\n exchangeId,\n msg.sender,\n newRate\n );\n }\n\n /**\n * @dev toggleExchangeState\n * toggles the active state of an existing exchange\n * @param exchangeId a unique exchange idnetifier\n */\n function toggleExchangeState(\n bytes32 exchangeId\n )\n external\n onlyExchangeOwner(exchangeId)\n {\n if(exchanges[exchangeId].active){\n exchanges[exchangeId].active = false;\n emit ExchangeDeactivated(\n exchangeId,\n msg.sender\n );\n } else {\n exchanges[exchangeId].active = true;\n emit ExchangeActivated(\n exchangeId,\n msg.sender\n );\n }\n }\n\n /**\n * @dev getRate\n * gets the current fixed rate for an exchange\n * @param exchangeId a unique exchange idnetifier\n * @return fixed rate value\n */\n function getRate(\n bytes32 exchangeId\n )\n external\n view\n returns(uint256)\n {\n return exchanges[exchangeId].fixedRate;\n }\n\n /**\n * @dev getSupply\n * gets the current supply of datatokens in an fixed\n * rate exchagne\n * @param exchangeId the exchange ID\n * @return supply\n */\n function getSupply(bytes32 exchangeId)\n public\n view\n returns (uint256 supply)\n {\n if(exchanges[exchangeId].active == false)\n supply = 0;\n else {\n uint256 balance = IERC20Template(exchanges[exchangeId].dataToken)\n .balanceOf(exchanges[exchangeId].exchangeOwner);\n uint256 allowance = IERC20Template(exchanges[exchangeId].dataToken)\n .allowance(exchanges[exchangeId].exchangeOwner, address(this));\n if(balance < allowance)\n supply = balance;\n else\n supply = allowance;\n }\n }\n\n /**\n * @dev getExchange\n * gets all the exchange details\n * @param exchangeId a unique exchange idnetifier\n * @return all the exchange details including the exchange Owner\n * the dataToken contract address, the base token address, the \n * fixed rate, whether the exchange is active and the supply or the \n * the current data token liquidity.\n */\n function getExchange(\n bytes32 exchangeId\n )\n external\n view\n returns (\n address exchangeOwner,\n address dataToken,\n address baseToken,\n uint256 fixedRate,\n bool active,\n uint256 supply\n )\n {\n Exchange memory exchange = exchanges[exchangeId];\n exchangeOwner = exchange.exchangeOwner;\n dataToken = exchange.dataToken;\n baseToken = exchange.baseToken;\n fixedRate = exchange.fixedRate;\n active = exchange.active;\n supply = getSupply(exchangeId);\n }\n\n /**\n * @dev getExchanges\n * gets all the exchanges list\n * @return a list of all registered exchange Ids\n */\n function getExchanges()\n external \n view \n returns (bytes32[] memory)\n {\n return exchangeIds;\n }\n\n /**\n * @dev isActive\n * checks whether exchange is active\n * @param exchangeId a unique exchange idnetifier\n * @return true if exchange is true, otherwise returns false\n */\n function isActive(\n bytes32 exchangeId\n )\n external\n view\n returns (bool)\n {\n return exchanges[exchangeId].active;\n }\n}\n", - "sourcePath": "/ocean/ocean-contracts/contracts/fixedRate/FixedRateExchange.sol", - "ast": { - "absolutePath": "/ocean/ocean-contracts/contracts/fixedRate/FixedRateExchange.sol", - "exportedSymbols": { - "FixedRateExchange": [4962] - }, - "id": 4963, - "nodeType": "SourceUnit", - "nodes": [ + "_format": "hh-sol-artifact-1", + "contractName": "FixedRateExchange", + "sourceName": "contracts/pools/fixedRate/FixedRateExchange.sol", + "abi": [ { - "id": 4400, - "literals": ["solidity", "0.5", ".7"], - "nodeType": "PragmaDirective", - "src": "0:22:9" - }, - { - "absolutePath": "/ocean/ocean-contracts/contracts/interfaces/IERC20Template.sol", - "file": "../interfaces/IERC20Template.sol", - "id": 4401, - "nodeType": "ImportDirective", - "scope": 4963, - "sourceUnit": 5071, - "src": "185:42:9", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 4402, - "nodeType": "ImportDirective", - "scope": 4963, - "sourceUnit": 5927, - "src": "228:59:9", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": "@title FixedRateExchange\n@dev FixedRateExchange is a fixed rate exchange Contract\n Marketplaces uses this contract to allow consumers \n exchanging datatokens with ocean token using a fixed \n exchange rate.", - "fullyImplemented": true, - "id": 4962, - "linearizedBaseContracts": [4962], - "name": "FixedRateExchange", - "nodeType": "ContractDefinition", - "nodes": [ + "inputs": [ { - "id": 4405, - "libraryName": { - "contractScope": null, - "id": 4403, - "name": "SafeMath", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5926, - "src": "569:8:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SafeMath_$5926", - "typeString": "library SafeMath" - } - }, - "nodeType": "UsingForDirective", - "src": "563:27:9", - "typeName": { - "id": 4404, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "582:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } + "internalType": "address", + "name": "_router", + "type": "address" }, { - "constant": true, - "id": 4410, - "name": "BASE", - "nodeType": "VariableDeclaration", - "scope": 4962, - "src": "595:40:9", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4406, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "595:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "id": 4409, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 4407, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "627:2:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3138", - "id": 4408, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "633:2:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_18_by_1", - "typeString": "int_const 18" - }, - "value": "18" - }, - "src": "627:8:9", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - } - }, - "visibility": "private" - }, - { - "canonicalName": "FixedRateExchange.Exchange", - "id": 4421, - "members": [ - { - "constant": false, - "id": 4412, - "name": "active", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "667:11:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4411, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "667:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4414, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "688:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4413, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "688:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4416, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "719:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4415, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "719:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4418, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "746:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4417, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "746:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4420, - "name": "fixedRate", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "773:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4419, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "773:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Exchange", - "nodeType": "StructDefinition", - "scope": 4962, - "src": "641:156:9", - "visibility": "public" - }, - { - "constant": false, - "id": 4425, - "name": "exchanges", - "nodeType": "VariableDeclaration", - "scope": 4962, - "src": "844:46:9", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange)" - }, - "typeName": { - "id": 4424, - "keyType": { - "id": 4422, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "852:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "844:28:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange)" - }, - "valueType": { - "contractScope": null, - "id": 4423, - "name": "Exchange", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 4421, - "src": "863:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage_ptr", - "typeString": "struct FixedRateExchange.Exchange" - } - } - }, - "value": null, - "visibility": "private" - }, - { - "constant": false, - "id": 4428, - "name": "exchangeIds", - "nodeType": "VariableDeclaration", - "scope": 4962, - "src": "896:29:9", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 4426, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "896:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 4427, - "length": null, - "nodeType": "ArrayTypeName", - "src": "896:9:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "private" - }, - { - "body": { - "id": 4450, - "nodeType": "Block", - "src": "998:206:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4445, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4438, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4433, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "1029:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4435, - "indexExpression": { - "argumentTypes": null, - "id": 4434, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4430, - "src": "1039:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1029:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4436, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "1029:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4437, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1064:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1029:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4444, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4439, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "1081:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4441, - "indexExpression": { - "argumentTypes": null, - "id": 4440, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4430, - "src": "1091:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1081:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4442, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "1081:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4443, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1113:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "1081:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "1029:88:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a2045786368616e676520646f6573206e6f7420657869737421", - "id": 4446, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1131:45:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_33934cff4a0fa610a47c77876602b176c21576f21e0c00dbe89561d0224d4982", - "typeString": "literal_string \"FixedRateExchange: Exchange does not exist!\"" - }, - "value": "FixedRateExchange: Exchange does not exist!" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_33934cff4a0fa610a47c77876602b176c21576f21e0c00dbe89561d0224d4982", - "typeString": "literal_string \"FixedRateExchange: Exchange does not exist!\"" - } - ], - "id": 4432, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "1008:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1008:178:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4448, - "nodeType": "ExpressionStatement", - "src": "1008:178:9" - }, - { - "id": 4449, - "nodeType": "PlaceholderStatement", - "src": "1196:1:9" - } - ] - }, - "documentation": null, - "id": 4451, - "name": "onlyActiveExchange", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 4431, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4430, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4451, - "src": "969:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4429, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "969:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "959:34:9" - }, - "src": "932:272:9", - "visibility": "internal" - }, - { - "body": { - "id": 4467, - "nodeType": "Block", - "src": "1275:165:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4462, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4456, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "1306:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4458, - "indexExpression": { - "argumentTypes": null, - "id": 4457, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4453, - "src": "1316:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1306:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4459, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "1306:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4460, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "1345:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4461, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1345:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1306:49:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20696e76616c69642065786368616e6765206f776e6572", - "id": 4463, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1369:43:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6953f2de142c64f34f94b55c4652873748f95f81c631ff9f1f451ebbfe788b37", - "typeString": "literal_string \"FixedRateExchange: invalid exchange owner\"" - }, - "value": "FixedRateExchange: invalid exchange owner" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6953f2de142c64f34f94b55c4652873748f95f81c631ff9f1f451ebbfe788b37", - "typeString": "literal_string \"FixedRateExchange: invalid exchange owner\"" - } - ], - "id": 4455, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "1285:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4464, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1285:137:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4465, - "nodeType": "ExpressionStatement", - "src": "1285:137:9" - }, - { - "id": 4466, - "nodeType": "PlaceholderStatement", - "src": "1432:1:9" - } - ] - }, - "documentation": null, - "id": 4468, - "name": "onlyExchangeOwner", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 4454, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4453, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4468, - "src": "1246:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4452, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1246:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1236:34:9" - }, - "src": "1210:230:9", - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 4480, - "name": "ExchangeCreated", - "nodeType": "EventDefinition", - "parameters": { - "id": 4479, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4470, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1477:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4469, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1477:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4472, - "indexed": true, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1513:25:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4471, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1513:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4474, - "indexed": true, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1548:25:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4473, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1548:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4476, - "indexed": false, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1583:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4475, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1583:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4478, - "indexed": false, - "name": "fixedRate", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1614:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4477, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1614:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1467:170:9" - }, - "src": "1446:192:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4488, - "name": "ExchangeRateChanged", - "nodeType": "EventDefinition", - "parameters": { - "id": 4487, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4482, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4488, - "src": "1679:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4481, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1679:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4484, - "indexed": true, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4488, - "src": "1715:29:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4483, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1715:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4486, - "indexed": false, - "name": "newRate", - "nodeType": "VariableDeclaration", - "scope": 4488, - "src": "1754:15:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4485, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1754:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1669:106:9" - }, - "src": "1644:132:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4494, - "name": "ExchangeActivated", - "nodeType": "EventDefinition", - "parameters": { - "id": 4493, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4490, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4494, - "src": "1815:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4489, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1815:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4492, - "indexed": true, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4494, - "src": "1851:29:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4491, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1851:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1805:81:9" - }, - "src": "1782:105:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4500, - "name": "ExchangeDeactivated", - "nodeType": "EventDefinition", - "parameters": { - "id": 4499, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4496, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4500, - "src": "1928:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4495, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1928:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4498, - "indexed": true, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4500, - "src": "1964:29:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4497, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1964:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1918:81:9" - }, - "src": "1893:107:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4510, - "name": "Swapped", - "nodeType": "EventDefinition", - "parameters": { - "id": 4509, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4502, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4510, - "src": "2029:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4501, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2029:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4504, - "indexed": true, - "name": "by", - "nodeType": "VariableDeclaration", - "scope": 4510, - "src": "2065:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4503, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2065:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4506, - "indexed": false, - "name": "baseTokenSwappedAmount", - "nodeType": "VariableDeclaration", - "scope": 4510, - "src": "2093:30:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4505, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2093:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4508, - "indexed": false, - "name": "dataTokenSwappedAmount", - "nodeType": "VariableDeclaration", - "scope": 4510, - "src": "2133:30:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4507, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2133:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2019:150:9" - }, - "src": "2006:164:9" - }, - { - "body": { - "id": 4604, - "nodeType": "Block", - "src": "2636:1294:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4520, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "2667:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4522, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2688:1:9", - "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": 4521, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2680:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4523, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2680:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "2667:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20496e76616c69642062617365746f6b656e2c20207a65726f2061646472657373", - "id": 4525, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2704:53:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9e4f79921714a9bf5dc580585dc440da8f598ce27caa8d87778cb9493126de16", - "typeString": "literal_string \"FixedRateExchange: Invalid basetoken, zero address\"" - }, - "value": "FixedRateExchange: Invalid basetoken, zero address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9e4f79921714a9bf5dc580585dc440da8f598ce27caa8d87778cb9493126de16", - "typeString": "literal_string \"FixedRateExchange: Invalid basetoken, zero address\"" - } - ], - "id": 4519, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "2646:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4526, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2646:121:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4527, - "nodeType": "ExpressionStatement", - "src": "2646:121:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4533, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4529, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "2798:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4531, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2819:1:9", - "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": 4530, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2811:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4532, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2811:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "2798:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20496e76616c69642064617461746f6b656e2c20207a65726f2061646472657373", - "id": 4534, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2835:53:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c4a0d6c9d74c4e7b7eb600c681c94f357f46a1a17500afc03636322ac0a63c22", - "typeString": "literal_string \"FixedRateExchange: Invalid datatoken, zero address\"" - }, - "value": "FixedRateExchange: Invalid datatoken, zero address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_c4a0d6c9d74c4e7b7eb600c681c94f357f46a1a17500afc03636322ac0a63c22", - "typeString": "literal_string \"FixedRateExchange: Invalid datatoken, zero address\"" - } - ], - "id": 4528, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "2777:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2777:121:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4536, - "nodeType": "ExpressionStatement", - "src": "2777:121:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4540, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4538, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "2929:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "id": 4539, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "2942:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "2929:22:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20496e76616c69642064617461746f6b656e2c2020657175616c732062617365746f6b656e", - "id": 4541, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2965:57:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8088a8876b7d943bb58f3202d91bc395f378f8d33e9c768b1a854016f72d0175", - "typeString": "literal_string \"FixedRateExchange: Invalid datatoken, equals basetoken\"" - }, - "value": "FixedRateExchange: Invalid datatoken, equals basetoken" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8088a8876b7d943bb58f3202d91bc395f378f8d33e9c768b1a854016f72d0175", - "typeString": "literal_string \"FixedRateExchange: Invalid datatoken, equals basetoken\"" - } - ], - "id": 4537, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "2908:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4542, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2908:124:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4543, - "nodeType": "ExpressionStatement", - "src": "2908:124:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4547, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4545, - "name": "fixedRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4516, - "src": "3063:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4546, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3076:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3063:14:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20496e76616c69642065786368616e676520726174652076616c7565", - "id": 4548, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3092:48:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_049c41558b20e3ef0c501ffa5f229a463d9c10ba2b6e269ac1d736dfd92adbc2", - "typeString": "literal_string \"FixedRateExchange: Invalid exchange rate value\"" - }, - "value": "FixedRateExchange: Invalid exchange rate value" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_049c41558b20e3ef0c501ffa5f229a463d9c10ba2b6e269ac1d736dfd92adbc2", - "typeString": "literal_string \"FixedRateExchange: Invalid exchange rate value\"" - } - ], - "id": 4544, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "3042:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4549, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3042:108:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4550, - "nodeType": "ExpressionStatement", - "src": "3042:108:9" - }, - { - "assignments": [4552], - "declarations": [ - { - "constant": false, - "id": 4552, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4604, - "src": "3160:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4551, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3160:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4559, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4554, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "3213:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4555, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "3236:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4556, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "3259:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4557, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3259:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 4553, - "name": "generateExchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4626, - "src": "3181:18:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_address_$_t_address_$_t_address_$returns$_t_bytes32_$", - "typeString": "function (address,address,address) pure returns (bytes32)" - } - }, - "id": 4558, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3181:98:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3160:119:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4566, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4561, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "3310:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4563, - "indexExpression": { - "argumentTypes": null, - "id": 4562, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3320:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3310:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4564, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "3310:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4565, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3345:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3310:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a2045786368616e676520616c72656164792065786973747321", - "id": 4567, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3360:45:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_4cbdfa87b7259677de1d4b2bb2aef7a46adf4ea65536670792826c014ead7938", - "typeString": "literal_string \"FixedRateExchange: Exchange already exists!\"" - }, - "value": "FixedRateExchange: Exchange already exists!" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_4cbdfa87b7259677de1d4b2bb2aef7a46adf4ea65536670792826c014ead7938", - "typeString": "literal_string \"FixedRateExchange: Exchange already exists!\"" - } - ], - "id": 4560, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "3289:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4568, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3289:126:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4569, - "nodeType": "ExpressionStatement", - "src": "3289:126:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4581, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4570, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "3425:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4572, - "indexExpression": { - "argumentTypes": null, - "id": 4571, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3435:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3425:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4574, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3480:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4575, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "3513:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4576, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3513:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4577, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "3548:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4578, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "3582:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4579, - "name": "fixedRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4516, - "src": "3616:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4573, - "name": "Exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4421, - "src": "3449:8:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Exchange_$4421_storage_ptr_$", - "typeString": "type(struct FixedRateExchange.Exchange storage pointer)" - } - }, - "id": 4580, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [ - "active", - "exchangeOwner", - "dataToken", - "baseToken", - "fixedRate" - ], - "nodeType": "FunctionCall", - "src": "3449:187:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "src": "3425:211:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4582, - "nodeType": "ExpressionStatement", - "src": "3425:211:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4586, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3663:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 4583, - "name": "exchangeIds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4428, - "src": "3646:11:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 4585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3646:16:9", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) returns (uint256)" - } - }, - "id": 4587, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3646:28:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4588, - "nodeType": "ExpressionStatement", - "src": "3646:28:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4590, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3719:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 4591, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "3743:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4592, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "3766:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4593, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "3789:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4594, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3789:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4595, - "name": "fixedRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4516, - "src": "3813:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4589, - "name": "ExchangeCreated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4480, - "src": "3690:15:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,address,address,uint256)" - } - }, - "id": 4596, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3690:142:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4597, - "nodeType": "EmitStatement", - "src": "3685:147:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4599, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3879:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4600, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "3903:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4601, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3903:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 4598, - "name": "ExchangeActivated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4494, - "src": "3848:17:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$returns$__$", - "typeString": "function (bytes32,address)" - } - }, - "id": 4602, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3848:75:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4603, - "nodeType": "EmitStatement", - "src": "3843:80:9" - } - ] - }, - "documentation": "@dev create\n creates new exchange pairs between base token\n (ocean token) and data tokens.\n@param baseToken refers to a ocean token contract address\n@param dataToken refers to a data token contract address\n@param fixedRate refers to the exact fixed exchange rate in wei", - "id": 4605, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "create", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4517, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4512, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4605, - "src": "2537:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4511, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2537:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4514, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4605, - "src": "2564:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4513, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2564:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4516, - "name": "fixedRate", - "nodeType": "VariableDeclaration", - "scope": 4605, - "src": "2591:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4515, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2591:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2527:87:9" - }, - "returnParameters": { - "id": 4518, - "nodeType": "ParameterList", - "parameters": [], - "src": "2636:0:9" - }, - "scope": 4962, - "src": "2512:1418:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4625, - "nodeType": "Block", - "src": "4408:166:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4619, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4607, - "src": "4476:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4620, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4609, - "src": "4503:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4621, - "name": "exchangeOwner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4611, - "src": "4530:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 4617, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6520, - "src": "4448:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 4618, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encode", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4448:10:9", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 4622, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4448:109:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 4616, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6527, - "src": "4425:9:9", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 4623, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4425:142:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "functionReturnParameters": 4615, - "id": 4624, - "nodeType": "Return", - "src": "4418:149:9" - } - ] - }, - "documentation": "@dev generateExchangeId\n creates unique exchange identifier for two token pairs.\n@param baseToken refers to a ocean token contract address\n@param dataToken refers to a data token contract address\n@param exchangeOwner exchange owner address", - "id": 4626, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "generateExchangeId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4612, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4607, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4626, - "src": "4268:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4606, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4268:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4609, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4626, - "src": "4295:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4608, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4295:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4611, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4626, - "src": "4322:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4610, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4322:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4258:91:9" - }, - "returnParameters": { - "id": 4615, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4614, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4626, - "src": "4395:7:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4613, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4395:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4394:9:9" - }, - "scope": 4962, - "src": "4231:343:9", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4651, - "nodeType": "Block", - "src": "5072:110:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4638, - "name": "baseTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4636, - "src": "5082:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4647, - "name": "BASE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4410, - "src": "5170:4:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4641, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "5133:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4643, - "indexExpression": { - "argumentTypes": null, - "id": 4642, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4628, - "src": "5143:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5133:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4644, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "5133:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 4639, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4630, - "src": "5100:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4640, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 5843, - "src": "5100:19:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4645, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5100:65:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4646, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 5859, - "src": "5100:69:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4648, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5100:75:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5082:93:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4650, - "nodeType": "ExpressionStatement", - "src": "5082:93:9" - } - ] - }, - "documentation": "@dev CalcInGivenOut\n Calculates how many basetokens are needed to get specifyed amount of datatokens\n@param exchangeId a unique exchange idnetifier \n@param dataTokenAmount the amount of data tokens to be exchanged", - "id": 4652, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 4633, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4628, - "src": "5005:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "id": 4634, - "modifierName": { - "argumentTypes": null, - "id": 4632, - "name": "onlyActiveExchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4451, - "src": "4973:18:9", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_bytes32_$", - "typeString": "modifier (bytes32)" - } - }, - "nodeType": "ModifierInvocation", - "src": "4973:52:9" - } - ], - "name": "CalcInGivenOut", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4631, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4628, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4652, - "src": "4879:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4627, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4879:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4630, - "name": "dataTokenAmount", - "nodeType": "VariableDeclaration", - "scope": 4652, - "src": "4907:23:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4629, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4907:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4869:67:9" - }, - "returnParameters": { - "id": 4637, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4636, - "name": "baseTokenAmount", - "nodeType": "VariableDeclaration", - "scope": 4652, - "src": "5043:23:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4635, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5043:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5042:25:9" - }, - "scope": 4962, - "src": "4846:336:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4722, - "nodeType": "Block", - "src": "5583:960:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4665, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4663, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4656, - "src": "5614:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4664, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5633:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "5614:20:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a207a65726f206461746120746f6b656e20616d6f756e74", - "id": 4666, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5648:43:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_d2b293ef72dfab6f705b22246c532786cca882499f3fba3ae8114dc40951c5bc", - "typeString": "literal_string \"FixedRateExchange: zero data token amount\"" - }, - "value": "FixedRateExchange: zero data token amount" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_d2b293ef72dfab6f705b22246c532786cca882499f3fba3ae8114dc40951c5bc", - "typeString": "literal_string \"FixedRateExchange: zero data token amount\"" - } - ], - "id": 4662, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "5593:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4667, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5593:108:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4668, - "nodeType": "ExpressionStatement", - "src": "5593:108:9" - }, - { - "assignments": [4670], - "declarations": [ - { - "constant": false, - "id": 4670, - "name": "baseTokenAmount", - "nodeType": "VariableDeclaration", - "scope": 4722, - "src": "5711:23:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4669, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5711:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4675, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4672, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "5752:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 4673, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4656, - "src": "5763:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4671, - "name": "CalcInGivenOut", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4652, - "src": "5737:14:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" - } - }, - "id": 4674, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5737:42:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5711:68:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4684, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "5888:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5888:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4686, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "5916:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4688, - "indexExpression": { - "argumentTypes": null, - "id": 4687, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "5926:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5916:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4689, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "5916:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4690, - "name": "baseTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4670, - "src": "5969:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4678, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "5825:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4680, - "indexExpression": { - "argumentTypes": null, - "id": 4679, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "5835:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5825:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4681, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "baseToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4418, - "src": "5825:31:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4677, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "5810:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4682, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5810:47:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 4683, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 5045, - "src": "5810:60:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 4691, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5810:188:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a207472616e7366657246726f6d206661696c656420696e207468652062617365546f6b656e20636f6e7472616374", - "id": 4692, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6012:66:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_704d230adb0aeaaf731cbfcd3f10c77132039a7e2520db77d561e3ebcc5b16b9", - "typeString": "literal_string \"FixedRateExchange: transferFrom failed in the baseToken contract\"" - }, - "value": "FixedRateExchange: transferFrom failed in the baseToken contract" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_704d230adb0aeaaf731cbfcd3f10c77132039a7e2520db77d561e3ebcc5b16b9", - "typeString": "literal_string \"FixedRateExchange: transferFrom failed in the baseToken contract\"" - } - ], - "id": 4676, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "5789:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4693, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5789:299:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4694, - "nodeType": "ExpressionStatement", - "src": "5789:299:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4703, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "6197:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4705, - "indexExpression": { - "argumentTypes": null, - "id": 4704, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "6207:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6197:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4706, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "6197:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4707, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "6250:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6250:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4709, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4656, - "src": "6278:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4697, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "6134:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4699, - "indexExpression": { - "argumentTypes": null, - "id": 4698, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "6144:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6134:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4700, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "dataToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4416, - "src": "6134:31:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4696, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "6119:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4701, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6119:47:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 4702, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 5045, - "src": "6119:60:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 4710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6119:188:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a207472616e7366657246726f6d206661696c656420696e207468652064617461546f6b656e20636f6e7472616374", - "id": 4711, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6321:66:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c05b0f5b41acd20d6ba43aff2e398e9afe8f1d66a0a38aeff2f84a7867e95310", - "typeString": "literal_string \"FixedRateExchange: transferFrom failed in the dataToken contract\"" - }, - "value": "FixedRateExchange: transferFrom failed in the dataToken contract" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_c05b0f5b41acd20d6ba43aff2e398e9afe8f1d66a0a38aeff2f84a7867e95310", - "typeString": "literal_string \"FixedRateExchange: transferFrom failed in the dataToken contract\"" - } - ], - "id": 4695, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "6098:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4712, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6098:299:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4713, - "nodeType": "ExpressionStatement", - "src": "6098:299:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4715, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "6434:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4716, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "6458:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6458:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4718, - "name": "baseTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4670, - "src": "6482:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 4719, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4656, - "src": "6511:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4714, - "name": "Swapped", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4510, - "src": "6413:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256,uint256)" - } - }, - "id": 4720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6413:123:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4721, - "nodeType": "EmitStatement", - "src": "6408:128:9" - } - ] - }, - "documentation": "@dev swap\n atomic swap between two registered fixed rate exchange.\n@param exchangeId a unique exchange idnetifier \n@param dataTokenAmount the amount of data tokens to be exchanged", - "id": 4723, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 4659, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "5558:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "id": 4660, - "modifierName": { - "argumentTypes": null, - "id": 4658, - "name": "onlyActiveExchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4451, - "src": "5526:18:9", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_bytes32_$", - "typeString": "modifier (bytes32)" - } - }, - "nodeType": "ModifierInvocation", - "src": "5526:52:9" - } - ], - "name": "swap", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4657, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4654, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4723, - "src": "5443:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4653, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5443:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4656, - "name": "dataTokenAmount", - "nodeType": "VariableDeclaration", - "scope": 4723, - "src": "5471:23:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4655, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5471:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5433:67:9" - }, - "returnParameters": { - "id": 4661, - "nodeType": "ParameterList", - "parameters": [], - "src": "5583:0:9" - }, - "scope": 4962, - "src": "5420:1123:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4731, - "nodeType": "Block", - "src": "6803:42:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4728, - "name": "exchangeIds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4428, - "src": "6820:11:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 4729, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6820:18:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4727, - "id": 4730, - "nodeType": "Return", - "src": "6813:25:9" - } - ] - }, - "documentation": "@dev getNumberOfExchanges\n gets the total number of registered exchanges\n@return total number of registered exchange IDs", - "id": 4732, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNumberOfExchanges", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4724, - "nodeType": "ParameterList", - "parameters": [], - "src": "6740:2:9" - }, - "returnParameters": { - "id": 4727, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4726, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4732, - "src": "6790:7:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4725, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6790:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6789:9:9" - }, - "scope": 4962, - "src": "6711:134:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4763, - "nodeType": "Block", - "src": "7186:276:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4745, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4743, - "name": "newRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4736, - "src": "7217:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4744, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7228:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7217:12:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20526174696f206d757374206265203e30", - "id": 4746, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7243:37:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_36101f33c85b5f047dc985e5d24ae3bcf32f1d4b0a57ccd6a8c04d1cc8672d12", - "typeString": "literal_string \"FixedRateExchange: Ratio must be >0\"" - }, - "value": "FixedRateExchange: Ratio must be >0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_36101f33c85b5f047dc985e5d24ae3bcf32f1d4b0a57ccd6a8c04d1cc8672d12", - "typeString": "literal_string \"FixedRateExchange: Ratio must be >0\"" - } - ], - "id": 4742, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "7196:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4747, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7196:94:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4748, - "nodeType": "ExpressionStatement", - "src": "7196:94:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4754, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4749, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "7301:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4751, - "indexExpression": { - "argumentTypes": null, - "id": 4750, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4734, - "src": "7311:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7301:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4752, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "7301:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4753, - "name": "newRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4736, - "src": "7335:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7301:41:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4755, - "nodeType": "ExpressionStatement", - "src": "7301:41:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4757, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4734, - "src": "7390:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4758, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "7414:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4759, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7414:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4760, - "name": "newRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4736, - "src": "7438:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4756, - "name": "ExchangeRateChanged", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4488, - "src": "7357:19:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256)" - } - }, - "id": 4761, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7357:98:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4762, - "nodeType": "EmitStatement", - "src": "7352:103:9" - } - ] - }, - "documentation": "@dev setRate\n changes the fixed rate for an exchange with a new rate\n@param exchangeId a unique exchange idnetifier\n@param newRate new fixed rate value", - "id": 4764, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 4739, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4734, - "src": "7170:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "id": 4740, - "modifierName": { - "argumentTypes": null, - "id": 4738, - "name": "onlyExchangeOwner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4468, - "src": "7152:17:9", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_bytes32_$", - "typeString": "modifier (bytes32)" - } - }, - "nodeType": "ModifierInvocation", - "src": "7152:29:9" - } - ], - "name": "setRate", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4737, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4734, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4764, - "src": "7077:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4733, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7077:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4736, - "name": "newRate", - "nodeType": "VariableDeclaration", - "scope": 4764, - "src": "7105:15:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4735, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7105:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7067:59:9" - }, - "returnParameters": { - "id": 4741, - "nodeType": "ParameterList", - "parameters": [], - "src": "7186:0:9" - }, - "scope": 4962, - "src": "7051:411:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4805, - "nodeType": "Block", - "src": "7754:389:9", - "statements": [ - { - "condition": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4772, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "7767:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4774, - "indexExpression": { - "argumentTypes": null, - "id": 4773, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7777:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7767:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4775, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "7767:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 4803, - "nodeType": "Block", - "src": "7971:166:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4795, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4790, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "7985:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4792, - "indexExpression": { - "argumentTypes": null, - "id": 4791, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7995:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7985:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4793, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "7985:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4794, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8016:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "7985:35:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4796, - "nodeType": "ExpressionStatement", - "src": "7985:35:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4798, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "8074:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4799, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "8102:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4800, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8102:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 4797, - "name": "ExchangeActivated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4494, - "src": "8039:17:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$returns$__$", - "typeString": "function (bytes32,address)" - } - }, - "id": 4801, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8039:87:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4802, - "nodeType": "EmitStatement", - "src": "8034:92:9" - } - ] - }, - "id": 4804, - "nodeType": "IfStatement", - "src": "7764:373:9", - "trueBody": { - "id": 4789, - "nodeType": "Block", - "src": "7796:169:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4781, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4776, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "7810:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4778, - "indexExpression": { - "argumentTypes": null, - "id": 4777, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7820:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7810:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4779, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "7810:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 4780, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7841:5:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "7810:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4782, - "nodeType": "ExpressionStatement", - "src": "7810:36:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4784, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7902:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4785, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "7930:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4786, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7930:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 4783, - "name": "ExchangeDeactivated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4500, - "src": "7865:19:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$returns$__$", - "typeString": "function (bytes32,address)" - } - }, - "id": 4787, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7865:89:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4788, - "nodeType": "EmitStatement", - "src": "7860:94:9" - } - ] - } - } - ] - }, - "documentation": "@dev toggleExchangeState\n toggles the active state of an existing exchange\n@param exchangeId a unique exchange idnetifier", - "id": 4806, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 4769, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7738:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "id": 4770, - "modifierName": { - "argumentTypes": null, - "id": 4768, - "name": "onlyExchangeOwner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4468, - "src": "7720:17:9", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_bytes32_$", - "typeString": "modifier (bytes32)" - } - }, - "nodeType": "ModifierInvocation", - "src": "7720:29:9" - } - ], - "name": "toggleExchangeState", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4767, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4766, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4806, - "src": "7670:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4765, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7670:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7660:34:9" - }, - "returnParameters": { - "id": 4771, - "nodeType": "ParameterList", - "parameters": [], - "src": "7754:0:9" - }, - "scope": 4962, - "src": "7632:511:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4818, - "nodeType": "Block", - "src": "8437:55:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4813, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "8454:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4815, - "indexExpression": { - "argumentTypes": null, - "id": 4814, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4808, - "src": "8464:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8454:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4816, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "8454:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4812, - "id": 4817, - "nodeType": "Return", - "src": "8447:38:9" - } - ] - }, - "documentation": "@dev getRate\n gets the current fixed rate for an exchange\n@param exchangeId a unique exchange idnetifier\n@return fixed rate value", - "id": 4819, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRate", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4809, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4808, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4819, - "src": "8353:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4807, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8353:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8343:34:9" - }, - "returnParameters": { - "id": 4812, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4811, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4819, - "src": "8424:7:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4810, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8424:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8423:9:9" - }, - "scope": 4962, - "src": "8327:165:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4883, - "nodeType": "Block", - "src": "8792:532:9", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4831, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4826, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "8805:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4828, - "indexExpression": { - "argumentTypes": null, - "id": 4827, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "8815:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8805:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4829, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "8805:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 4830, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8837:5:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "8805:37:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 4881, - "nodeType": "Block", - "src": "8881:437:9", - "statements": [ - { - "assignments": [4837], - "declarations": [ - { - "constant": false, - "id": 4837, - "name": "balance", - "nodeType": "VariableDeclaration", - "scope": 4881, - "src": "8895:15:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4836, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8895:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4850, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4845, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "8988:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4847, - "indexExpression": { - "argumentTypes": null, - "id": 4846, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "8998:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8988:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4848, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "8988:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4839, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "8928:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4841, - "indexExpression": { - "argumentTypes": null, - "id": 4840, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "8938:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8928:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4842, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "dataToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4416, - "src": "8928:31:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4838, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "8913:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4843, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8913:47:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 4844, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 5052, - "src": "8913:74:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 4849, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8913:111:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8895:129:9" - }, - { - "assignments": [4852], - "declarations": [ - { - "constant": false, - "id": 4852, - "name": "allowance", - "nodeType": "VariableDeclaration", - "scope": 4881, - "src": "9038:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4851, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "9038:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4868, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4860, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "9133:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4862, - "indexExpression": { - "argumentTypes": null, - "id": 4861, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "9143:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9133:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4863, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "9133:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4865, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6579, - "src": "9178:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_FixedRateExchange_$4962", - "typeString": "contract FixedRateExchange" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_FixedRateExchange_$4962", - "typeString": "contract FixedRateExchange" - } - ], - "id": 4864, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "9170:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4866, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9170:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4854, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "9073:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4856, - "indexExpression": { - "argumentTypes": null, - "id": 4855, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "9083:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9073:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4857, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "dataToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4416, - "src": "9073:31:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4853, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "9058:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4858, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9058:47:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 4859, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "allowance", - "nodeType": "MemberAccess", - "referencedDeclaration": 5034, - "src": "9058:74:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", - "typeString": "function (address,address) view external returns (uint256)" - } - }, - "id": 4867, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9058:126:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9038:146:9" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4871, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4869, - "name": "balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4837, - "src": "9201:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 4870, - "name": "allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4852, - "src": "9211:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9201:19:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "expression": { - "argumentTypes": null, - "id": 4878, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4876, - "name": "supply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4824, - "src": "9289:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4877, - "name": "allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4852, - "src": "9298:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9289:18:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4879, - "nodeType": "ExpressionStatement", - "src": "9289:18:9" - }, - "id": 4880, - "nodeType": "IfStatement", - "src": "9198:109:9", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 4874, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4872, - "name": "supply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4824, - "src": "9238:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4873, - "name": "balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4837, - "src": "9247:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9238:16:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4875, - "nodeType": "ExpressionStatement", - "src": "9238:16:9" - } - } - ] - }, - "id": 4882, - "nodeType": "IfStatement", - "src": "8802:516:9", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 4834, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4832, - "name": "supply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4824, - "src": "8856:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 4833, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8865:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "8856:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4835, - "nodeType": "ExpressionStatement", - "src": "8856:10:9" - } - } - ] - }, - "documentation": "@dev getSupply\n gets the current supply of datatokens in an fixed\n rate exchagne\n@param exchangeId the exchange ID\n@return supply", - "id": 4884, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4822, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4821, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4884, - "src": "8707:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4820, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8707:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8706:20:9" - }, - "returnParameters": { - "id": 4825, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4824, - "name": "supply", - "nodeType": "VariableDeclaration", - "scope": 4884, - "src": "8772:14:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4823, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8772:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8771:16:9" - }, - "scope": 4962, - "src": "8688:636:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4938, - "nodeType": "Block", - "src": "10039:307:9", - "statements": [ - { - "assignments": [4902], - "declarations": [ - { - "constant": false, - "id": 4902, - "name": "exchange", - "nodeType": "VariableDeclaration", - "scope": 4938, - "src": "10049:24:9", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange" - }, - "typeName": { - "contractScope": null, - "id": 4901, - "name": "Exchange", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 4421, - "src": "10049:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage_ptr", - "typeString": "struct FixedRateExchange.Exchange" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4906, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4903, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "10076:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4905, - "indexExpression": { - "argumentTypes": null, - "id": 4904, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4886, - "src": "10086:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10076:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10049:48:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4910, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4907, - "name": "exchangeOwner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4889, - "src": "10107:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4908, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10123:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4909, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "10123:22:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "10107:38:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4911, - "nodeType": "ExpressionStatement", - "src": "10107:38:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4912, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4891, - "src": "10155:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4913, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10167:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4914, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "dataToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4416, - "src": "10167:18:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "10155:30:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4916, - "nodeType": "ExpressionStatement", - "src": "10155:30:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4920, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4917, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4893, - "src": "10195:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4918, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10207:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4919, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "baseToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4418, - "src": "10207:18:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "10195:30:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4921, - "nodeType": "ExpressionStatement", - "src": "10195:30:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4925, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4922, - "name": "fixedRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4895, - "src": "10235:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4923, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10247:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4924, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "10247:18:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10235:30:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4926, - "nodeType": "ExpressionStatement", - "src": "10235:30:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4930, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4927, - "name": "active", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4897, - "src": "10275:6:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4928, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10284:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4929, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "10284:15:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "10275:24:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4931, - "nodeType": "ExpressionStatement", - "src": "10275:24:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4936, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4932, - "name": "supply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4899, - "src": "10309:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4934, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4886, - "src": "10328:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 4933, - "name": "getSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4884, - "src": "10318:9:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) view returns (uint256)" - } - }, - "id": 4935, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10318:21:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10309:30:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4937, - "nodeType": "ExpressionStatement", - "src": "10309:30:9" - } - ] - }, - "documentation": "@dev getExchange\n gets all the exchange details\n@param exchangeId a unique exchange idnetifier\n@return all the exchange details including the exchange Owner\n the dataToken contract address, the base token address, the \n fixed rate, whether the exchange is active and the supply or the \n the current data token liquidity.", - "id": 4939, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getExchange", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4887, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4886, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9772:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4885, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9772:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9762:34:9" - }, - "returnParameters": { - "id": 4900, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4889, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9857:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4888, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9857:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4891, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9892:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4890, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9892:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4893, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9923:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4892, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9923:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4895, - "name": "fixedRate", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9954:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4894, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "9954:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4897, - "name": "active", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9985:11:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4896, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9985:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4899, - "name": "supply", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "10010:14:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4898, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10010:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9843:191:9" - }, - "scope": 4962, - "src": "9742:604:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4947, - "nodeType": "Block", - "src": "10581:35:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4945, - "name": "exchangeIds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4428, - "src": "10598:11:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "functionReturnParameters": 4944, - "id": 4946, - "nodeType": "Return", - "src": "10591:18:9" - } - ] - }, - "documentation": "@dev getExchanges\n gets all the exchanges list\n@return a list of all registered exchange Ids", - "id": 4948, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getExchanges", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4940, - "nodeType": "ParameterList", - "parameters": [], - "src": "10507:2:9" - }, - "returnParameters": { - "id": 4944, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4943, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4948, - "src": "10559:16:9", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 4941, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10559:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 4942, - "length": null, - "nodeType": "ArrayTypeName", - "src": "10559:9:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10558:18:9" - }, - "scope": 4962, - "src": "10486:130:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4960, - "nodeType": "Block", - "src": "10933:52:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4955, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "10950:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4957, - "indexExpression": { - "argumentTypes": null, - "id": 4956, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4950, - "src": "10960:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10950:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4958, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "10950:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 4954, - "id": 4959, - "nodeType": "Return", - "src": "10943:35:9" - } - ] - }, - "documentation": "@dev isActive\n checks whether exchange is active\n@param exchangeId a unique exchange idnetifier\n@return true if exchange is true, otherwise returns false", - "id": 4961, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "isActive", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4951, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4950, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4961, - "src": "10851:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4949, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10851:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10841:34:9" - }, - "returnParameters": { - "id": 4954, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4953, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4961, - "src": "10923:4:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4952, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10923:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10922:6:9" - }, - "scope": 4962, - "src": "10824:161:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" + "internalType": "address", + "name": "_opfCollector", + "type": "address" } ], - "scope": 4963, - "src": "530:10457:9" - } - ], - "src": "0:10988:9" - }, - "legacyAST": { - "absolutePath": "/ocean/ocean-contracts/contracts/fixedRate/FixedRateExchange.sol", - "exportedSymbols": { - "FixedRateExchange": [4962] - }, - "id": 4963, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 4400, - "literals": ["solidity", "0.5", ".7"], - "nodeType": "PragmaDirective", - "src": "0:22:9" + "stateMutability": "nonpayable", + "type": "constructor" }, { - "absolutePath": "/ocean/ocean-contracts/contracts/interfaces/IERC20Template.sol", - "file": "../interfaces/IERC20Template.sol", - "id": 4401, - "nodeType": "ImportDirective", - "scope": 4963, - "sourceUnit": 5071, - "src": "185:42:9", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 4402, - "nodeType": "ImportDirective", - "scope": 4963, - "sourceUnit": 5927, - "src": "228:59:9", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": "@title FixedRateExchange\n@dev FixedRateExchange is a fixed rate exchange Contract\n Marketplaces uses this contract to allow consumers \n exchanging datatokens with ocean token using a fixed \n exchange rate.", - "fullyImplemented": true, - "id": 4962, - "linearizedBaseContracts": [4962], - "name": "FixedRateExchange", - "nodeType": "ContractDefinition", - "nodes": [ + "anonymous": false, + "inputs": [ { - "id": 4405, - "libraryName": { - "contractScope": null, - "id": 4403, - "name": "SafeMath", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5926, - "src": "569:8:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SafeMath_$5926", - "typeString": "library SafeMath" - } - }, - "nodeType": "UsingForDirective", - "src": "563:27:9", - "typeName": { - "id": 4404, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "582:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" }, { - "constant": true, - "id": 4410, - "name": "BASE", - "nodeType": "VariableDeclaration", - "scope": 4962, - "src": "595:40:9", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4406, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "595:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "id": 4409, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 4407, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "627:2:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3138", - "id": 4408, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "633:2:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_18_by_1", - "typeString": "int_const 18" - }, - "value": "18" - }, - "src": "627:8:9", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - } - }, - "visibility": "private" - }, - { - "canonicalName": "FixedRateExchange.Exchange", - "id": 4421, - "members": [ - { - "constant": false, - "id": 4412, - "name": "active", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "667:11:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4411, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "667:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4414, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "688:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4413, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "688:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4416, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "719:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4415, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "719:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4418, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "746:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4417, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "746:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4420, - "name": "fixedRate", - "nodeType": "VariableDeclaration", - "scope": 4421, - "src": "773:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4419, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "773:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Exchange", - "nodeType": "StructDefinition", - "scope": 4962, - "src": "641:156:9", - "visibility": "public" - }, - { - "constant": false, - "id": 4425, - "name": "exchanges", - "nodeType": "VariableDeclaration", - "scope": 4962, - "src": "844:46:9", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange)" - }, - "typeName": { - "id": 4424, - "keyType": { - "id": 4422, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "852:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "844:28:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange)" - }, - "valueType": { - "contractScope": null, - "id": 4423, - "name": "Exchange", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 4421, - "src": "863:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage_ptr", - "typeString": "struct FixedRateExchange.Exchange" - } - } - }, - "value": null, - "visibility": "private" - }, - { - "constant": false, - "id": 4428, - "name": "exchangeIds", - "nodeType": "VariableDeclaration", - "scope": 4962, - "src": "896:29:9", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 4426, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "896:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 4427, - "length": null, - "nodeType": "ArrayTypeName", - "src": "896:9:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "private" - }, - { - "body": { - "id": 4450, - "nodeType": "Block", - "src": "998:206:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4445, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4438, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4433, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "1029:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4435, - "indexExpression": { - "argumentTypes": null, - "id": 4434, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4430, - "src": "1039:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1029:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4436, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "1029:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4437, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1064:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "1029:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4444, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4439, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "1081:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4441, - "indexExpression": { - "argumentTypes": null, - "id": 4440, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4430, - "src": "1091:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1081:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4442, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "1081:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4443, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1113:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "1081:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "1029:88:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a2045786368616e676520646f6573206e6f7420657869737421", - "id": 4446, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1131:45:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_33934cff4a0fa610a47c77876602b176c21576f21e0c00dbe89561d0224d4982", - "typeString": "literal_string \"FixedRateExchange: Exchange does not exist!\"" - }, - "value": "FixedRateExchange: Exchange does not exist!" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_33934cff4a0fa610a47c77876602b176c21576f21e0c00dbe89561d0224d4982", - "typeString": "literal_string \"FixedRateExchange: Exchange does not exist!\"" - } - ], - "id": 4432, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "1008:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1008:178:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4448, - "nodeType": "ExpressionStatement", - "src": "1008:178:9" - }, - { - "id": 4449, - "nodeType": "PlaceholderStatement", - "src": "1196:1:9" - } - ] - }, - "documentation": null, - "id": 4451, - "name": "onlyActiveExchange", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 4431, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4430, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4451, - "src": "969:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4429, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "969:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "959:34:9" - }, - "src": "932:272:9", - "visibility": "internal" - }, - { - "body": { - "id": 4467, - "nodeType": "Block", - "src": "1275:165:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4462, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4456, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "1306:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4458, - "indexExpression": { - "argumentTypes": null, - "id": 4457, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4453, - "src": "1316:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "1306:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4459, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "1306:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4460, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "1345:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4461, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1345:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1306:49:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20696e76616c69642065786368616e6765206f776e6572", - "id": 4463, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1369:43:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6953f2de142c64f34f94b55c4652873748f95f81c631ff9f1f451ebbfe788b37", - "typeString": "literal_string \"FixedRateExchange: invalid exchange owner\"" - }, - "value": "FixedRateExchange: invalid exchange owner" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6953f2de142c64f34f94b55c4652873748f95f81c631ff9f1f451ebbfe788b37", - "typeString": "literal_string \"FixedRateExchange: invalid exchange owner\"" - } - ], - "id": 4455, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "1285:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4464, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1285:137:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4465, - "nodeType": "ExpressionStatement", - "src": "1285:137:9" - }, - { - "id": 4466, - "nodeType": "PlaceholderStatement", - "src": "1432:1:9" - } - ] - }, - "documentation": null, - "id": 4468, - "name": "onlyExchangeOwner", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 4454, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4453, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4468, - "src": "1246:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4452, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1246:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1236:34:9" - }, - "src": "1210:230:9", - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 4480, - "name": "ExchangeCreated", - "nodeType": "EventDefinition", - "parameters": { - "id": 4479, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4470, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1477:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4469, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1477:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4472, - "indexed": true, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1513:25:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4471, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1513:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4474, - "indexed": true, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1548:25:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4473, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1548:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4476, - "indexed": false, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1583:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4475, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1583:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4478, - "indexed": false, - "name": "fixedRate", - "nodeType": "VariableDeclaration", - "scope": 4480, - "src": "1614:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4477, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1614:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1467:170:9" - }, - "src": "1446:192:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4488, - "name": "ExchangeRateChanged", - "nodeType": "EventDefinition", - "parameters": { - "id": 4487, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4482, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4488, - "src": "1679:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4481, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1679:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4484, - "indexed": true, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4488, - "src": "1715:29:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4483, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1715:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4486, - "indexed": false, - "name": "newRate", - "nodeType": "VariableDeclaration", - "scope": 4488, - "src": "1754:15:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4485, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1754:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1669:106:9" - }, - "src": "1644:132:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4494, - "name": "ExchangeActivated", - "nodeType": "EventDefinition", - "parameters": { - "id": 4493, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4490, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4494, - "src": "1815:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4489, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1815:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4492, - "indexed": true, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4494, - "src": "1851:29:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4491, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1851:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1805:81:9" - }, - "src": "1782:105:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4500, - "name": "ExchangeDeactivated", - "nodeType": "EventDefinition", - "parameters": { - "id": 4499, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4496, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4500, - "src": "1928:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4495, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1928:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4498, - "indexed": true, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4500, - "src": "1964:29:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4497, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1964:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1918:81:9" - }, - "src": "1893:107:9" - }, - { - "anonymous": false, - "documentation": null, - "id": 4510, - "name": "Swapped", - "nodeType": "EventDefinition", - "parameters": { - "id": 4509, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4502, - "indexed": true, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4510, - "src": "2029:26:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4501, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2029:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4504, - "indexed": true, - "name": "by", - "nodeType": "VariableDeclaration", - "scope": 4510, - "src": "2065:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4503, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2065:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4506, - "indexed": false, - "name": "baseTokenSwappedAmount", - "nodeType": "VariableDeclaration", - "scope": 4510, - "src": "2093:30:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4505, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2093:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4508, - "indexed": false, - "name": "dataTokenSwappedAmount", - "nodeType": "VariableDeclaration", - "scope": 4510, - "src": "2133:30:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4507, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2133:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2019:150:9" - }, - "src": "2006:164:9" - }, - { - "body": { - "id": 4604, - "nodeType": "Block", - "src": "2636:1294:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4520, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "2667:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4522, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2688:1:9", - "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": 4521, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2680:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4523, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2680:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "2667:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20496e76616c69642062617365746f6b656e2c20207a65726f2061646472657373", - "id": 4525, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2704:53:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9e4f79921714a9bf5dc580585dc440da8f598ce27caa8d87778cb9493126de16", - "typeString": "literal_string \"FixedRateExchange: Invalid basetoken, zero address\"" - }, - "value": "FixedRateExchange: Invalid basetoken, zero address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9e4f79921714a9bf5dc580585dc440da8f598ce27caa8d87778cb9493126de16", - "typeString": "literal_string \"FixedRateExchange: Invalid basetoken, zero address\"" - } - ], - "id": 4519, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "2646:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4526, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2646:121:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4527, - "nodeType": "ExpressionStatement", - "src": "2646:121:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4533, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4529, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "2798:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 4531, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2819:1:9", - "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": 4530, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2811:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4532, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2811:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "2798:23:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20496e76616c69642064617461746f6b656e2c20207a65726f2061646472657373", - "id": 4534, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2835:53:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c4a0d6c9d74c4e7b7eb600c681c94f357f46a1a17500afc03636322ac0a63c22", - "typeString": "literal_string \"FixedRateExchange: Invalid datatoken, zero address\"" - }, - "value": "FixedRateExchange: Invalid datatoken, zero address" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_c4a0d6c9d74c4e7b7eb600c681c94f357f46a1a17500afc03636322ac0a63c22", - "typeString": "literal_string \"FixedRateExchange: Invalid datatoken, zero address\"" - } - ], - "id": 4528, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "2777:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2777:121:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4536, - "nodeType": "ExpressionStatement", - "src": "2777:121:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 4540, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4538, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "2929:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "id": 4539, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "2942:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "2929:22:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20496e76616c69642064617461746f6b656e2c2020657175616c732062617365746f6b656e", - "id": 4541, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2965:57:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8088a8876b7d943bb58f3202d91bc395f378f8d33e9c768b1a854016f72d0175", - "typeString": "literal_string \"FixedRateExchange: Invalid datatoken, equals basetoken\"" - }, - "value": "FixedRateExchange: Invalid datatoken, equals basetoken" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8088a8876b7d943bb58f3202d91bc395f378f8d33e9c768b1a854016f72d0175", - "typeString": "literal_string \"FixedRateExchange: Invalid datatoken, equals basetoken\"" - } - ], - "id": 4537, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "2908:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4542, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2908:124:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4543, - "nodeType": "ExpressionStatement", - "src": "2908:124:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4547, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4545, - "name": "fixedRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4516, - "src": "3063:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4546, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3076:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3063:14:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20496e76616c69642065786368616e676520726174652076616c7565", - "id": 4548, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3092:48:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_049c41558b20e3ef0c501ffa5f229a463d9c10ba2b6e269ac1d736dfd92adbc2", - "typeString": "literal_string \"FixedRateExchange: Invalid exchange rate value\"" - }, - "value": "FixedRateExchange: Invalid exchange rate value" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_049c41558b20e3ef0c501ffa5f229a463d9c10ba2b6e269ac1d736dfd92adbc2", - "typeString": "literal_string \"FixedRateExchange: Invalid exchange rate value\"" - } - ], - "id": 4544, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "3042:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4549, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3042:108:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4550, - "nodeType": "ExpressionStatement", - "src": "3042:108:9" - }, - { - "assignments": [4552], - "declarations": [ - { - "constant": false, - "id": 4552, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4604, - "src": "3160:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4551, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3160:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4559, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4554, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "3213:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4555, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "3236:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4556, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "3259:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4557, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3259:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 4553, - "name": "generateExchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4626, - "src": "3181:18:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_address_$_t_address_$_t_address_$returns$_t_bytes32_$", - "typeString": "function (address,address,address) pure returns (bytes32)" - } - }, - "id": 4558, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3181:98:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3160:119:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4566, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4561, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "3310:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4563, - "indexExpression": { - "argumentTypes": null, - "id": 4562, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3320:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3310:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4564, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "3310:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4565, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3345:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3310:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a2045786368616e676520616c72656164792065786973747321", - "id": 4567, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3360:45:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_4cbdfa87b7259677de1d4b2bb2aef7a46adf4ea65536670792826c014ead7938", - "typeString": "literal_string \"FixedRateExchange: Exchange already exists!\"" - }, - "value": "FixedRateExchange: Exchange already exists!" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_4cbdfa87b7259677de1d4b2bb2aef7a46adf4ea65536670792826c014ead7938", - "typeString": "literal_string \"FixedRateExchange: Exchange already exists!\"" - } - ], - "id": 4560, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "3289:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4568, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3289:126:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4569, - "nodeType": "ExpressionStatement", - "src": "3289:126:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4581, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4570, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "3425:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4572, - "indexExpression": { - "argumentTypes": null, - "id": 4571, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3435:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "3425:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4574, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3480:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4575, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "3513:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4576, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3513:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4577, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "3548:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4578, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "3582:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4579, - "name": "fixedRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4516, - "src": "3616:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4573, - "name": "Exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4421, - "src": "3449:8:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Exchange_$4421_storage_ptr_$", - "typeString": "type(struct FixedRateExchange.Exchange storage pointer)" - } - }, - "id": 4580, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [ - "active", - "exchangeOwner", - "dataToken", - "baseToken", - "fixedRate" - ], - "nodeType": "FunctionCall", - "src": "3449:187:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "src": "3425:211:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4582, - "nodeType": "ExpressionStatement", - "src": "3425:211:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4586, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3663:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 4583, - "name": "exchangeIds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4428, - "src": "3646:11:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 4585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3646:16:9", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) returns (uint256)" - } - }, - "id": 4587, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3646:28:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4588, - "nodeType": "ExpressionStatement", - "src": "3646:28:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4590, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3719:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 4591, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4512, - "src": "3743:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4592, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4514, - "src": "3766:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4593, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "3789:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4594, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3789:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4595, - "name": "fixedRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4516, - "src": "3813:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4589, - "name": "ExchangeCreated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4480, - "src": "3690:15:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,address,address,uint256)" - } - }, - "id": 4596, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3690:142:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4597, - "nodeType": "EmitStatement", - "src": "3685:147:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4599, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4552, - "src": "3879:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4600, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "3903:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4601, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3903:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 4598, - "name": "ExchangeActivated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4494, - "src": "3848:17:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$returns$__$", - "typeString": "function (bytes32,address)" - } - }, - "id": 4602, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3848:75:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4603, - "nodeType": "EmitStatement", - "src": "3843:80:9" - } - ] - }, - "documentation": "@dev create\n creates new exchange pairs between base token\n (ocean token) and data tokens.\n@param baseToken refers to a ocean token contract address\n@param dataToken refers to a data token contract address\n@param fixedRate refers to the exact fixed exchange rate in wei", - "id": 4605, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "create", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4517, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4512, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4605, - "src": "2537:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4511, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2537:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4514, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4605, - "src": "2564:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4513, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2564:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4516, - "name": "fixedRate", - "nodeType": "VariableDeclaration", - "scope": 4605, - "src": "2591:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4515, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2591:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2527:87:9" - }, - "returnParameters": { - "id": 4518, - "nodeType": "ParameterList", - "parameters": [], - "src": "2636:0:9" - }, - "scope": 4962, - "src": "2512:1418:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4625, - "nodeType": "Block", - "src": "4408:166:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4619, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4607, - "src": "4476:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4620, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4609, - "src": "4503:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4621, - "name": "exchangeOwner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4611, - "src": "4530:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 4617, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6520, - "src": "4448:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 4618, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encode", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4448:10:9", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 4622, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4448:109:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 4616, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6527, - "src": "4425:9:9", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 4623, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4425:142:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "functionReturnParameters": 4615, - "id": 4624, - "nodeType": "Return", - "src": "4418:149:9" - } - ] - }, - "documentation": "@dev generateExchangeId\n creates unique exchange identifier for two token pairs.\n@param baseToken refers to a ocean token contract address\n@param dataToken refers to a data token contract address\n@param exchangeOwner exchange owner address", - "id": 4626, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "generateExchangeId", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4612, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4607, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4626, - "src": "4268:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4606, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4268:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4609, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4626, - "src": "4295:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4608, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4295:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4611, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4626, - "src": "4322:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4610, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4322:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4258:91:9" - }, - "returnParameters": { - "id": 4615, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4614, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4626, - "src": "4395:7:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4613, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4395:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4394:9:9" - }, - "scope": 4962, - "src": "4231:343:9", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4651, - "nodeType": "Block", - "src": "5072:110:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4638, - "name": "baseTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4636, - "src": "5082:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4647, - "name": "BASE", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4410, - "src": "5170:4:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4641, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "5133:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4643, - "indexExpression": { - "argumentTypes": null, - "id": 4642, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4628, - "src": "5143:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5133:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4644, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "5133:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 4639, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4630, - "src": "5100:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4640, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 5843, - "src": "5100:19:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4645, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5100:65:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4646, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 5859, - "src": "5100:69:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 4648, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5100:75:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5082:93:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4650, - "nodeType": "ExpressionStatement", - "src": "5082:93:9" - } - ] - }, - "documentation": "@dev CalcInGivenOut\n Calculates how many basetokens are needed to get specifyed amount of datatokens\n@param exchangeId a unique exchange idnetifier \n@param dataTokenAmount the amount of data tokens to be exchanged", - "id": 4652, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 4633, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4628, - "src": "5005:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "id": 4634, - "modifierName": { - "argumentTypes": null, - "id": 4632, - "name": "onlyActiveExchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4451, - "src": "4973:18:9", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_bytes32_$", - "typeString": "modifier (bytes32)" - } - }, - "nodeType": "ModifierInvocation", - "src": "4973:52:9" - } - ], - "name": "CalcInGivenOut", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4631, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4628, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4652, - "src": "4879:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4627, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "4879:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4630, - "name": "dataTokenAmount", - "nodeType": "VariableDeclaration", - "scope": 4652, - "src": "4907:23:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4629, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4907:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4869:67:9" - }, - "returnParameters": { - "id": 4637, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4636, - "name": "baseTokenAmount", - "nodeType": "VariableDeclaration", - "scope": 4652, - "src": "5043:23:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4635, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5043:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5042:25:9" - }, - "scope": 4962, - "src": "4846:336:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4722, - "nodeType": "Block", - "src": "5583:960:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4665, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4663, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4656, - "src": "5614:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4664, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5633:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "5614:20:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a207a65726f206461746120746f6b656e20616d6f756e74", - "id": 4666, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5648:43:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_d2b293ef72dfab6f705b22246c532786cca882499f3fba3ae8114dc40951c5bc", - "typeString": "literal_string \"FixedRateExchange: zero data token amount\"" - }, - "value": "FixedRateExchange: zero data token amount" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_d2b293ef72dfab6f705b22246c532786cca882499f3fba3ae8114dc40951c5bc", - "typeString": "literal_string \"FixedRateExchange: zero data token amount\"" - } - ], - "id": 4662, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "5593:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4667, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5593:108:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4668, - "nodeType": "ExpressionStatement", - "src": "5593:108:9" - }, - { - "assignments": [4670], - "declarations": [ - { - "constant": false, - "id": 4670, - "name": "baseTokenAmount", - "nodeType": "VariableDeclaration", - "scope": 4722, - "src": "5711:23:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4669, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5711:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4675, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4672, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "5752:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 4673, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4656, - "src": "5763:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4671, - "name": "CalcInGivenOut", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4652, - "src": "5737:14:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" - } - }, - "id": 4674, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5737:42:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5711:68:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4684, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "5888:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5888:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4686, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "5916:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4688, - "indexExpression": { - "argumentTypes": null, - "id": 4687, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "5926:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5916:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4689, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "5916:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 4690, - "name": "baseTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4670, - "src": "5969:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4678, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "5825:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4680, - "indexExpression": { - "argumentTypes": null, - "id": 4679, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "5835:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5825:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4681, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "baseToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4418, - "src": "5825:31:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4677, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "5810:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4682, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5810:47:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 4683, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 5045, - "src": "5810:60:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 4691, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5810:188:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a207472616e7366657246726f6d206661696c656420696e207468652062617365546f6b656e20636f6e7472616374", - "id": 4692, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6012:66:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_704d230adb0aeaaf731cbfcd3f10c77132039a7e2520db77d561e3ebcc5b16b9", - "typeString": "literal_string \"FixedRateExchange: transferFrom failed in the baseToken contract\"" - }, - "value": "FixedRateExchange: transferFrom failed in the baseToken contract" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_704d230adb0aeaaf731cbfcd3f10c77132039a7e2520db77d561e3ebcc5b16b9", - "typeString": "literal_string \"FixedRateExchange: transferFrom failed in the baseToken contract\"" - } - ], - "id": 4676, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "5789:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4693, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5789:299:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4694, - "nodeType": "ExpressionStatement", - "src": "5789:299:9" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4703, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "6197:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4705, - "indexExpression": { - "argumentTypes": null, - "id": 4704, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "6207:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6197:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4706, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "6197:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4707, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "6250:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6250:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4709, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4656, - "src": "6278:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4697, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "6134:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4699, - "indexExpression": { - "argumentTypes": null, - "id": 4698, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "6144:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6134:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4700, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "dataToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4416, - "src": "6134:31:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4696, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "6119:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4701, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6119:47:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 4702, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 5045, - "src": "6119:60:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 4710, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6119:188:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a207472616e7366657246726f6d206661696c656420696e207468652064617461546f6b656e20636f6e7472616374", - "id": 4711, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6321:66:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c05b0f5b41acd20d6ba43aff2e398e9afe8f1d66a0a38aeff2f84a7867e95310", - "typeString": "literal_string \"FixedRateExchange: transferFrom failed in the dataToken contract\"" - }, - "value": "FixedRateExchange: transferFrom failed in the dataToken contract" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_c05b0f5b41acd20d6ba43aff2e398e9afe8f1d66a0a38aeff2f84a7867e95310", - "typeString": "literal_string \"FixedRateExchange: transferFrom failed in the dataToken contract\"" - } - ], - "id": 4695, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "6098:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4712, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6098:299:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4713, - "nodeType": "ExpressionStatement", - "src": "6098:299:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4715, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "6434:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4716, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "6458:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6458:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4718, - "name": "baseTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4670, - "src": "6482:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 4719, - "name": "dataTokenAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4656, - "src": "6511:15:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4714, - "name": "Swapped", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4510, - "src": "6413:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256,uint256)" - } - }, - "id": 4720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6413:123:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4721, - "nodeType": "EmitStatement", - "src": "6408:128:9" - } - ] - }, - "documentation": "@dev swap\n atomic swap between two registered fixed rate exchange.\n@param exchangeId a unique exchange idnetifier \n@param dataTokenAmount the amount of data tokens to be exchanged", - "id": 4723, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 4659, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4654, - "src": "5558:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "id": 4660, - "modifierName": { - "argumentTypes": null, - "id": 4658, - "name": "onlyActiveExchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4451, - "src": "5526:18:9", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_bytes32_$", - "typeString": "modifier (bytes32)" - } - }, - "nodeType": "ModifierInvocation", - "src": "5526:52:9" - } - ], - "name": "swap", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4657, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4654, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4723, - "src": "5443:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4653, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5443:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4656, - "name": "dataTokenAmount", - "nodeType": "VariableDeclaration", - "scope": 4723, - "src": "5471:23:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4655, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "5471:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5433:67:9" - }, - "returnParameters": { - "id": 4661, - "nodeType": "ParameterList", - "parameters": [], - "src": "5583:0:9" - }, - "scope": 4962, - "src": "5420:1123:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4731, - "nodeType": "Block", - "src": "6803:42:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4728, - "name": "exchangeIds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4428, - "src": "6820:11:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 4729, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6820:18:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4727, - "id": 4730, - "nodeType": "Return", - "src": "6813:25:9" - } - ] - }, - "documentation": "@dev getNumberOfExchanges\n gets the total number of registered exchanges\n@return total number of registered exchange IDs", - "id": 4732, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getNumberOfExchanges", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4724, - "nodeType": "ParameterList", - "parameters": [], - "src": "6740:2:9" - }, - "returnParameters": { - "id": 4727, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4726, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4732, - "src": "6790:7:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4725, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6790:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6789:9:9" - }, - "scope": 4962, - "src": "6711:134:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4763, - "nodeType": "Block", - "src": "7186:276:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4745, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4743, - "name": "newRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4736, - "src": "7217:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 4744, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7228:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7217:12:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "46697865645261746545786368616e67653a20526174696f206d757374206265203e30", - "id": 4746, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7243:37:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_36101f33c85b5f047dc985e5d24ae3bcf32f1d4b0a57ccd6a8c04d1cc8672d12", - "typeString": "literal_string \"FixedRateExchange: Ratio must be >0\"" - }, - "value": "FixedRateExchange: Ratio must be >0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_36101f33c85b5f047dc985e5d24ae3bcf32f1d4b0a57ccd6a8c04d1cc8672d12", - "typeString": "literal_string \"FixedRateExchange: Ratio must be >0\"" - } - ], - "id": 4742, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "7196:7:9", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 4747, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7196:94:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4748, - "nodeType": "ExpressionStatement", - "src": "7196:94:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4754, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4749, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "7301:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4751, - "indexExpression": { - "argumentTypes": null, - "id": 4750, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4734, - "src": "7311:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7301:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4752, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "7301:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4753, - "name": "newRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4736, - "src": "7335:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7301:41:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4755, - "nodeType": "ExpressionStatement", - "src": "7301:41:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4757, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4734, - "src": "7390:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4758, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "7414:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4759, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7414:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 4760, - "name": "newRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4736, - "src": "7438:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 4756, - "name": "ExchangeRateChanged", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4488, - "src": "7357:19:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256)" - } - }, - "id": 4761, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7357:98:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4762, - "nodeType": "EmitStatement", - "src": "7352:103:9" - } - ] - }, - "documentation": "@dev setRate\n changes the fixed rate for an exchange with a new rate\n@param exchangeId a unique exchange idnetifier\n@param newRate new fixed rate value", - "id": 4764, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 4739, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4734, - "src": "7170:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "id": 4740, - "modifierName": { - "argumentTypes": null, - "id": 4738, - "name": "onlyExchangeOwner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4468, - "src": "7152:17:9", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_bytes32_$", - "typeString": "modifier (bytes32)" - } - }, - "nodeType": "ModifierInvocation", - "src": "7152:29:9" - } - ], - "name": "setRate", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4737, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4734, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4764, - "src": "7077:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4733, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7077:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4736, - "name": "newRate", - "nodeType": "VariableDeclaration", - "scope": 4764, - "src": "7105:15:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4735, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7105:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7067:59:9" - }, - "returnParameters": { - "id": 4741, - "nodeType": "ParameterList", - "parameters": [], - "src": "7186:0:9" - }, - "scope": 4962, - "src": "7051:411:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4805, - "nodeType": "Block", - "src": "7754:389:9", - "statements": [ - { - "condition": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4772, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "7767:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4774, - "indexExpression": { - "argumentTypes": null, - "id": 4773, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7777:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7767:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4775, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "7767:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 4803, - "nodeType": "Block", - "src": "7971:166:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4795, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4790, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "7985:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4792, - "indexExpression": { - "argumentTypes": null, - "id": 4791, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7995:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7985:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4793, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "7985:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 4794, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8016:4:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "7985:35:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4796, - "nodeType": "ExpressionStatement", - "src": "7985:35:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4798, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "8074:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4799, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "8102:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4800, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8102:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 4797, - "name": "ExchangeActivated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4494, - "src": "8039:17:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$returns$__$", - "typeString": "function (bytes32,address)" - } - }, - "id": 4801, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8039:87:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4802, - "nodeType": "EmitStatement", - "src": "8034:92:9" - } - ] - }, - "id": 4804, - "nodeType": "IfStatement", - "src": "7764:373:9", - "trueBody": { - "id": 4789, - "nodeType": "Block", - "src": "7796:169:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4781, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4776, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "7810:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4778, - "indexExpression": { - "argumentTypes": null, - "id": 4777, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7820:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7810:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4779, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "7810:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 4780, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7841:5:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "7810:36:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4782, - "nodeType": "ExpressionStatement", - "src": "7810:36:9" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4784, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7902:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4785, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "7930:3:9", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 4786, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7930:10:9", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 4783, - "name": "ExchangeDeactivated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4500, - "src": "7865:19:9", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$returns$__$", - "typeString": "function (bytes32,address)" - } - }, - "id": 4787, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7865:89:9", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 4788, - "nodeType": "EmitStatement", - "src": "7860:94:9" - } - ] - } - } - ] - }, - "documentation": "@dev toggleExchangeState\n toggles the active state of an existing exchange\n@param exchangeId a unique exchange idnetifier", - "id": 4806, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 4769, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4766, - "src": "7738:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "id": 4770, - "modifierName": { - "argumentTypes": null, - "id": 4768, - "name": "onlyExchangeOwner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4468, - "src": "7720:17:9", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_bytes32_$", - "typeString": "modifier (bytes32)" - } - }, - "nodeType": "ModifierInvocation", - "src": "7720:29:9" - } - ], - "name": "toggleExchangeState", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4767, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4766, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4806, - "src": "7670:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4765, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7670:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7660:34:9" - }, - "returnParameters": { - "id": 4771, - "nodeType": "ParameterList", - "parameters": [], - "src": "7754:0:9" - }, - "scope": 4962, - "src": "7632:511:9", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4818, - "nodeType": "Block", - "src": "8437:55:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4813, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "8454:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4815, - "indexExpression": { - "argumentTypes": null, - "id": 4814, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4808, - "src": "8464:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8454:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4816, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "8454:31:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 4812, - "id": 4817, - "nodeType": "Return", - "src": "8447:38:9" - } - ] - }, - "documentation": "@dev getRate\n gets the current fixed rate for an exchange\n@param exchangeId a unique exchange idnetifier\n@return fixed rate value", - "id": 4819, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getRate", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4809, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4808, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4819, - "src": "8353:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4807, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8353:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8343:34:9" - }, - "returnParameters": { - "id": 4812, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4811, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4819, - "src": "8424:7:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4810, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8424:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8423:9:9" - }, - "scope": 4962, - "src": "8327:165:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4883, - "nodeType": "Block", - "src": "8792:532:9", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 4831, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4826, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "8805:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4828, - "indexExpression": { - "argumentTypes": null, - "id": 4827, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "8815:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8805:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4829, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "8805:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 4830, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8837:5:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "8805:37:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 4881, - "nodeType": "Block", - "src": "8881:437:9", - "statements": [ - { - "assignments": [4837], - "declarations": [ - { - "constant": false, - "id": 4837, - "name": "balance", - "nodeType": "VariableDeclaration", - "scope": 4881, - "src": "8895:15:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4836, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8895:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4850, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4845, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "8988:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4847, - "indexExpression": { - "argumentTypes": null, - "id": 4846, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "8998:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8988:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4848, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "8988:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4839, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "8928:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4841, - "indexExpression": { - "argumentTypes": null, - "id": 4840, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "8938:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8928:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4842, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "dataToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4416, - "src": "8928:31:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4838, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "8913:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4843, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8913:47:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 4844, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 5052, - "src": "8913:74:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 4849, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8913:111:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8895:129:9" - }, - { - "assignments": [4852], - "declarations": [ - { - "constant": false, - "id": 4852, - "name": "allowance", - "nodeType": "VariableDeclaration", - "scope": 4881, - "src": "9038:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4851, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "9038:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4868, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4860, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "9133:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4862, - "indexExpression": { - "argumentTypes": null, - "id": 4861, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "9143:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9133:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4863, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "9133:35:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4865, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6579, - "src": "9178:4:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_FixedRateExchange_$4962", - "typeString": "contract FixedRateExchange" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_FixedRateExchange_$4962", - "typeString": "contract FixedRateExchange" - } - ], - "id": 4864, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "9170:7:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 4866, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9170:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4854, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "9073:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4856, - "indexExpression": { - "argumentTypes": null, - "id": 4855, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4821, - "src": "9083:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9073:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4857, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "dataToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4416, - "src": "9073:31:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 4853, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "9058:14:9", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 4858, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9058:47:9", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 4859, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "allowance", - "nodeType": "MemberAccess", - "referencedDeclaration": 5034, - "src": "9058:74:9", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", - "typeString": "function (address,address) view external returns (uint256)" - } - }, - "id": 4867, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9058:126:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9038:146:9" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 4871, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 4869, - "name": "balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4837, - "src": "9201:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 4870, - "name": "allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4852, - "src": "9211:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9201:19:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "expression": { - "argumentTypes": null, - "id": 4878, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4876, - "name": "supply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4824, - "src": "9289:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4877, - "name": "allowance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4852, - "src": "9298:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9289:18:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4879, - "nodeType": "ExpressionStatement", - "src": "9289:18:9" - }, - "id": 4880, - "nodeType": "IfStatement", - "src": "9198:109:9", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 4874, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4872, - "name": "supply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4824, - "src": "9238:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 4873, - "name": "balance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4837, - "src": "9247:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9238:16:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4875, - "nodeType": "ExpressionStatement", - "src": "9238:16:9" - } - } - ] - }, - "id": 4882, - "nodeType": "IfStatement", - "src": "8802:516:9", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 4834, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4832, - "name": "supply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4824, - "src": "8856:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 4833, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8865:1:9", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "8856:10:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4835, - "nodeType": "ExpressionStatement", - "src": "8856:10:9" - } - } - ] - }, - "documentation": "@dev getSupply\n gets the current supply of datatokens in an fixed\n rate exchagne\n@param exchangeId the exchange ID\n@return supply", - "id": 4884, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getSupply", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4822, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4821, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4884, - "src": "8707:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4820, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8707:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8706:20:9" - }, - "returnParameters": { - "id": 4825, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4824, - "name": "supply", - "nodeType": "VariableDeclaration", - "scope": 4884, - "src": "8772:14:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4823, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8772:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8771:16:9" - }, - "scope": 4962, - "src": "8688:636:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 4938, - "nodeType": "Block", - "src": "10039:307:9", - "statements": [ - { - "assignments": [4902], - "declarations": [ - { - "constant": false, - "id": 4902, - "name": "exchange", - "nodeType": "VariableDeclaration", - "scope": 4938, - "src": "10049:24:9", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange" - }, - "typeName": { - "contractScope": null, - "id": 4901, - "name": "Exchange", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 4421, - "src": "10049:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage_ptr", - "typeString": "struct FixedRateExchange.Exchange" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 4906, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4903, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "10076:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4905, - "indexExpression": { - "argumentTypes": null, - "id": 4904, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4886, - "src": "10086:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10076:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10049:48:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4910, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4907, - "name": "exchangeOwner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4889, - "src": "10107:13:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4908, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10123:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4909, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "exchangeOwner", - "nodeType": "MemberAccess", - "referencedDeclaration": 4414, - "src": "10123:22:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "10107:38:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4911, - "nodeType": "ExpressionStatement", - "src": "10107:38:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4915, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4912, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4891, - "src": "10155:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4913, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10167:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4914, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "dataToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4416, - "src": "10167:18:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "10155:30:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4916, - "nodeType": "ExpressionStatement", - "src": "10155:30:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4920, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4917, - "name": "baseToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4893, - "src": "10195:9:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4918, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10207:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4919, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "baseToken", - "nodeType": "MemberAccess", - "referencedDeclaration": 4418, - "src": "10207:18:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "10195:30:9", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 4921, - "nodeType": "ExpressionStatement", - "src": "10195:30:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4925, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4922, - "name": "fixedRate", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4895, - "src": "10235:9:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4923, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10247:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4924, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "fixedRate", - "nodeType": "MemberAccess", - "referencedDeclaration": 4420, - "src": "10247:18:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10235:30:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4926, - "nodeType": "ExpressionStatement", - "src": "10235:30:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4930, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4927, - "name": "active", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4897, - "src": "10275:6:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 4928, - "name": "exchange", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4902, - "src": "10284:8:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_memory_ptr", - "typeString": "struct FixedRateExchange.Exchange memory" - } - }, - "id": 4929, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "10284:15:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "10275:24:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 4931, - "nodeType": "ExpressionStatement", - "src": "10275:24:9" - }, - { - "expression": { - "argumentTypes": null, - "id": 4936, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 4932, - "name": "supply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4899, - "src": "10309:6:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 4934, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4886, - "src": "10328:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 4933, - "name": "getSupply", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4884, - "src": "10318:9:9", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) view returns (uint256)" - } - }, - "id": 4935, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10318:21:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10309:30:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 4937, - "nodeType": "ExpressionStatement", - "src": "10309:30:9" - } - ] - }, - "documentation": "@dev getExchange\n gets all the exchange details\n@param exchangeId a unique exchange idnetifier\n@return all the exchange details including the exchange Owner\n the dataToken contract address, the base token address, the \n fixed rate, whether the exchange is active and the supply or the \n the current data token liquidity.", - "id": 4939, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getExchange", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4887, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4886, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9772:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4885, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9772:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9762:34:9" - }, - "returnParameters": { - "id": 4900, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4889, - "name": "exchangeOwner", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9857:21:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4888, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9857:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4891, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9892:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4890, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9892:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4893, - "name": "baseToken", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9923:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4892, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "9923:7:9", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4895, - "name": "fixedRate", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9954:17:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4894, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "9954:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4897, - "name": "active", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "9985:11:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4896, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9985:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 4899, - "name": "supply", - "nodeType": "VariableDeclaration", - "scope": 4939, - "src": "10010:14:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 4898, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10010:7:9", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "9843:191:9" - }, - "scope": 4962, - "src": "9742:604:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4947, - "nodeType": "Block", - "src": "10581:35:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 4945, - "name": "exchangeIds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4428, - "src": "10598:11:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "functionReturnParameters": 4944, - "id": 4946, - "nodeType": "Return", - "src": "10591:18:9" - } - ] - }, - "documentation": "@dev getExchanges\n gets all the exchanges list\n@return a list of all registered exchange Ids", - "id": 4948, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getExchanges", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4940, - "nodeType": "ParameterList", - "parameters": [], - "src": "10507:2:9" - }, - "returnParameters": { - "id": 4944, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4943, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4948, - "src": "10559:16:9", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 4941, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10559:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 4942, - "length": null, - "nodeType": "ArrayTypeName", - "src": "10559:9:9", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10558:18:9" - }, - "scope": 4962, - "src": "10486:130:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 4960, - "nodeType": "Block", - "src": "10933:52:9", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 4955, - "name": "exchanges", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4425, - "src": "10950:9:9", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_Exchange_$4421_storage_$", - "typeString": "mapping(bytes32 => struct FixedRateExchange.Exchange storage ref)" - } - }, - "id": 4957, - "indexExpression": { - "argumentTypes": null, - "id": 4956, - "name": "exchangeId", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 4950, - "src": "10960:10:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10950:21:9", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Exchange_$4421_storage", - "typeString": "struct FixedRateExchange.Exchange storage ref" - } - }, - "id": 4958, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "active", - "nodeType": "MemberAccess", - "referencedDeclaration": 4412, - "src": "10950:28:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 4954, - "id": 4959, - "nodeType": "Return", - "src": "10943:35:9" - } - ] - }, - "documentation": "@dev isActive\n checks whether exchange is active\n@param exchangeId a unique exchange idnetifier\n@return true if exchange is true, otherwise returns false", - "id": 4961, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "isActive", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 4951, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4950, - "name": "exchangeId", - "nodeType": "VariableDeclaration", - "scope": 4961, - "src": "10851:18:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 4949, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10851:7:9", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10841:34:9" - }, - "returnParameters": { - "id": 4954, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 4953, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 4961, - "src": "10923:4:9", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 4952, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10923:4:9", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10922:6:9" - }, - "scope": 4962, - "src": "10824:161:9", - "stateMutability": "view", - "superFunction": null, - "visibility": "external" + "indexed": true, + "internalType": "address", + "name": "exchangeOwner", + "type": "address" } ], - "scope": 4963, - "src": "530:10457:9" + "name": "ExchangeActivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "allowedSwapper", + "type": "address" + } + ], + "name": "ExchangeAllowedSwapperChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "baseToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "dataToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "exchangeOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fixedRate", + "type": "uint256" + } + ], + "name": "ExchangeCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "exchangeOwner", + "type": "address" + } + ], + "name": "ExchangeDeactivated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "exchangeOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "withMint", + "type": "bool" + } + ], + "name": "ExchangeMintStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "exchangeOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newRate", + "type": "uint256" + } + ], + "name": "ExchangeRateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "MarketFeeCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "OceanFeeCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "by", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "baseTokenSwappedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "dataTokenSwappedAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenOutAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "marketFeeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oceanFeeAmount", + "type": "uint256" + } + ], + "name": "Swapped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenCollected", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "dataTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxBaseTokenAmount", + "type": "uint256" + } + ], + "name": "buyDT", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "dataTokenAmount", + "type": "uint256" + } + ], + "name": "calcBaseInGivenOutDT", + "outputs": [ + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseTokenAmountBeforeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "oceanFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketFeeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "dataTokenAmount", + "type": "uint256" + } + ], + "name": "calcBaseOutGivenInDT", + "outputs": [ + { + "internalType": "uint256", + "name": "baseTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseTokenAmountBeforeFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "oceanFeeAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketFeeAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "collectBT", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "collectDT", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "collectMarketFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "collectOceanFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "dataToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "addresses", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "uints", + "type": "uint256[]" + } + ], + "name": "createWithDecimals", + "outputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baseToken", + "type": "address" + }, + { + "internalType": "address", + "name": "dataToken", + "type": "address" + }, + { + "internalType": "address", + "name": "exchangeOwner", + "type": "address" + } + ], + "name": "generateExchangeId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "getAllowedSwapper", + "outputs": [ + { + "internalType": "address", + "name": "allowedSwapper", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "getBTSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "supply", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "getDTSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "supply", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "getExchange", + "outputs": [ + { + "internalType": "address", + "name": "exchangeOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "dataToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "dtDecimals", + "type": "uint256" + }, + { + "internalType": "address", + "name": "baseToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "btDecimals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fixedRate", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "active", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "dtSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "btSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "dtBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "btBalance", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "withMint", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getExchanges", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "getFeesInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "marketFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "marketFeeCollector", + "type": "address" + }, + { + "internalType": "uint256", + "name": "opfFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "marketFeeAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "oceanFeeAvailable", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNumberOfExchanges", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "basetokenAddress", + "type": "address" + } + ], + "name": "getOPFFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "getRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "isActive", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "opfCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "dataTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minBaseTokenAmount", + "type": "uint256" + } + ], + "name": "sellDT", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "newAllowedSwapper", + "type": "address" + } + ], + "name": "setAllowedSwapper", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "newRate", + "type": "uint256" + } + ], + "name": "setRate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + } + ], + "name": "toggleExchangeState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "bool", + "name": "withMint", + "type": "bool" + } + ], + "name": "toggleMintState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_newMarketFee", + "type": "uint256" + } + ], + "name": "updateMarketFee", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "exchangeId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "_newMarketCollector", + "type": "address" + } + ], + "name": "updateMarketFeeCollector", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ], - "src": "0:10988:9" - }, - "compiler": { - "name": "solc", - "version": "0.5.7+commit.6da8b019.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.2.4", - "updatedAt": "2021-02-18T06:54:49.611Z", - "devdoc": { - "details": "FixedRateExchange is a fixed rate exchange Contract Marketplaces uses this contract to allow consumers exchanging datatokens with ocean token using a fixed exchange rate.", - "methods": { - "CalcInGivenOut(bytes32,uint256)": { - "details": "CalcInGivenOut Calculates how many basetokens are needed to get specifyed amount of datatokens", - "params": { - "dataTokenAmount": "the amount of data tokens to be exchanged", - "exchangeId": "a unique exchange idnetifier " - } - }, - "create(address,address,uint256)": { - "details": "create creates new exchange pairs between base token (ocean token) and data tokens.", - "params": { - "baseToken": "refers to a ocean token contract address", - "dataToken": "refers to a data token contract address", - "fixedRate": "refers to the exact fixed exchange rate in wei" - } - }, - "generateExchangeId(address,address,address)": { - "details": "generateExchangeId creates unique exchange identifier for two token pairs.", - "params": { - "baseToken": "refers to a ocean token contract address", - "dataToken": "refers to a data token contract address", - "exchangeOwner": "exchange owner address" - } - }, - "getExchange(bytes32)": { - "details": "getExchange gets all the exchange details", - "params": { - "exchangeId": "a unique exchange idnetifier" - }, - "return": "all the exchange details including the exchange Owner the dataToken contract address, the base token address, the fixed rate, whether the exchange is active and the supply or the the current data token liquidity." - }, - "getExchanges()": { - "details": "getExchanges gets all the exchanges list", - "return": "a list of all registered exchange Ids" - }, - "getNumberOfExchanges()": { - "details": "getNumberOfExchanges gets the total number of registered exchanges", - "return": "total number of registered exchange IDs" - }, - "getRate(bytes32)": { - "details": "getRate gets the current fixed rate for an exchange", - "params": { - "exchangeId": "a unique exchange idnetifier" - }, - "return": "fixed rate value" - }, - "getSupply(bytes32)": { - "details": "getSupply gets the current supply of datatokens in an fixed rate exchagne", - "params": { - "exchangeId": "the exchange ID" - }, - "return": "supply" - }, - "isActive(bytes32)": { - "details": "isActive checks whether exchange is active", - "params": { - "exchangeId": "a unique exchange idnetifier" - }, - "return": "true if exchange is true, otherwise returns false" - }, - "setRate(bytes32,uint256)": { - "details": "setRate changes the fixed rate for an exchange with a new rate", - "params": { - "exchangeId": "a unique exchange idnetifier", - "newRate": "new fixed rate value" - } - }, - "swap(bytes32,uint256)": { - "details": "swap atomic swap between two registered fixed rate exchange.", - "params": { - "dataTokenAmount": "the amount of data tokens to be exchanged", - "exchangeId": "a unique exchange idnetifier " - } - }, - "toggleExchangeState(bytes32)": { - "details": "toggleExchangeState toggles the active state of an existing exchange", - "params": { - "exchangeId": "a unique exchange idnetifier" - } - } - }, - "title": "FixedRateExchange" - }, - "userdoc": { - "methods": {} - } -} + "bytecode": "0x60806040523480156200001157600080fd5b506040516200337b3803806200337b833981016040819052620000349162000153565b6001600160a01b038216620000a05760405162461bcd60e51b815260206004820152602760248201527f46697865645261746545786368616e67653a2057726f6e6720526f75746572206044820152666164647265737360c81b60648201526084015b60405180910390fd5b6001600160a01b038116620001045760405162461bcd60e51b8152602060048201526024808201527f46697865645261746545786368616e67653a2057726f6e67204f5046206164646044820152637265737360e01b606482015260840162000097565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556200018b565b80516001600160a01b03811681146200014e57600080fd5b919050565b600080604083850312156200016757600080fd5b620001728362000136565b9150620001826020840162000136565b90509250929050565b6131e0806200019b6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c8063825b5cd6116100f9578063b686bcaf11610097578063c99733a711610071578063c99733a714610575578063f532129e14610588578063f8154aee1461059b578063f887ea40146105ae57600080fd5b8063b686bcaf1461053c578063c1f6572e1461054f578063c66274ea1461056257600080fd5b806388823872116100d357806388823872146104eb578063a28f78f1146104fe578063b32b56f914610511578063b42414291461053457600080fd5b8063825b5cd6146103c5578063855058dd146103d857806385fcbc2f146104d857600080fd5b80635c36901c116101665780636e4c6269116101405780636e4c62691461035957806371dc14b21461036c57806379dd28361461039f5780637c82ebe9146103b257600080fd5b80635c36901c1461030057806360311e9514610333578063680819eb1461034657600080fd5b806324cb477e116101a257806324cb477e14610247578063450dccc31461025c5780634c87087d1461026f5780635acfedc7146102ed57600080fd5b8063012c3275146101c95780630b3b430d146101ef5780631e2e3a6b14610232575b600080fd5b6101dc6101d7366004612b7e565b6105c1565b6040519081526020015b60405180910390f35b6102026101fd366004612c74565b610d31565b604080519586526001600160a01b039094166020860152928401919091526060830152608082015260a0016101e6565b61023a610e3b565b6040516101e69190612d74565b61025a610255366004612c74565b610e93565b005b61025a61026a366004612c74565b610f72565b61028261027d366004612c74565b6110bb565b604080516001600160a01b039d8e1681529b8d1660208d01528b0199909952999096166060890152608088019490945260a0870192909252151560c086015260e0850152610100840152610120830152610140820192909252901515610160820152610180016101e6565b61025a6102fb366004612c74565b6111e4565b61032361030e366004612c74565b60009081526002602052604090205460ff1690565b60405190151581526020016101e6565b61025a610341366004612c8d565b6112e0565b61025a610354366004612ce9565b611382565b61025a610367366004612d0b565b61146f565b61037f61037a366004612ce9565b6118cd565b6040805194855260208501939093529183015260608201526080016101e6565b61025a6103ad366004612cb9565b611a3c565b61025a6103c0366004612c8d565b611ace565b61025a6103d3366004612d0b565b611b61565b6104c06103e6366004612c74565b60009081526002602081815260409283902083516101e081018552815460ff808216151583526001600160a01b03610100928390048116958401959095526001840154851696830196909652938201548316606082015260038201546080820152600482015460a0820152600582015460c0820152600682015460e0820152600782015484820152600882015461012082015260098201548316610140820152600a820154610160820152600b820154610180820152600c9091015493841615156101a0820152919092049091166101c090910181905290565b6040516001600160a01b0390911681526020016101e6565b6101dc6104e6366004612c74565b6120d6565b61025a6104f9366004612ce9565b61227d565b6001546104c0906001600160a01b031681565b6101dc61051f366004612c74565b60009081526002602052604090206003015490565b6003546101dc565b61025a61054a366004612c74565b6122f4565b6101dc61055d366004612b3b565b6123eb565b6101dc610570366004612c74565b612436565b61037f610583366004612ce9565b61279e565b61025a610596366004612c74565b6128a2565b6101dc6105a9366004612b20565b6129e2565b6000546104c0906001600160a01b031681565b600080546001600160a01b031633146106215760405162461bcd60e51b815260206004820152601e60248201527f46697865645261746545786368616e67653a206f6e6c7920726f75746572000060448201526064015b60405180910390fd5b60006001600160a01b03168360008151811061063f5761063f61316d565b60200260200101516001600160a01b031614156106ba5760405162461bcd60e51b815260206004820152603360248201527f46697865645261746545786368616e67653a20496e76616c69642062617365746044820152726f6b656e2c20207a65726f206164647265737360681b6064820152608401610618565b6001600160a01b03841661072c5760405162461bcd60e51b815260206004820152603360248201527f46697865645261746545786368616e67653a20496e76616c69642064617461746044820152726f6b656e2c20207a65726f206164647265737360681b6064820152608401610618565b836001600160a01b0316836000815181106107495761074961316d565b60200260200101516001600160a01b031614156107ce5760405162461bcd60e51b815260206004820152603760248201527f46697865645261746545786368616e67653a20496e76616c696420646174617460448201527f6f6b656e2c2020657175616c732062617365746f6b656e0000000000000000006064820152608401610618565b816002815181106107e1576107e161316d565b6020026020010151600014156108505760405162461bcd60e51b815260206004820152602e60248201527f46697865645261746545786368616e67653a20496e76616c696420657863686160448201526d6e676520726174652076616c756560901b6064820152608401610618565b61088f836000815181106108665761086661316d565b602002602001015185856001815181106108825761088261316d565b60200260200101516123eb565b600081815260026020526040902060030154909150156109055760405162461bcd60e51b815260206004820152602b60248201527f46697865645261746545786368616e67653a2045786368616e676520616c726560448201526a616479206578697374732160a81b6064820152608401610618565b6000600190508260048151811061091e5761091e61316d565b602002602001015160001415610932575060005b604051806101e001604052806001151581526020018560018151811061095a5761095a61316d565b60200260200101516001600160a01b03168152602001866001600160a01b03168152602001856000815181106109925761099261316d565b60200260200101516001600160a01b03168152602001846002815181106109bb576109bb61316d565b60200260200101518152602001846001815181106109db576109db61316d565b60200260200101518152602001846000815181106109fb576109fb61316d565b60200260200101518152602001600081526020016000815260200184600381518110610a2957610a2961316d565b6020026020010151815260200185600281518110610a4957610a4961316d565b60200260200101516001600160a01b031681526020016000815260200160008152602001821515815260200185600381518110610a8857610a8861316d565b6020908102919091018101516001600160a01b0390811690925260008581526002808352604080832086518154958801518716610100908102610100600160a81b031992151583166001600160a81b0319988916171783559288015160018084018054928a166001600160a01b031993841617905560608a01519584018054968a1696831696909617909555608089015160038085019190915560a08a0151600485015560c08a0151600585015560e08a01516006850155848a015160078501556101208a015160088501556101408a0151600985018054918b169190931617909155610160890151600a840155610180890151600b8401556101a0890151600c90930180546101c0909a01518916909402921515909116979095169690961795909517909455815493840182559081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9092018490558551908716918691610bf457610bf461316d565b60200260200101516001600160a01b0316837feb7a353641f7d3cc54b497ef1553fdc292b64d9cc3be8587c23dfba01f310b1987600181518110610c3a57610c3a61316d565b602002602001015187600281518110610c5557610c5561316d565b6020026020010151604051610c7f9291906001600160a01b03929092168252602082015260400190565b60405180910390a483600181518110610c9a57610c9a61316d565b60200260200101516001600160a01b0316827fc7344c45124818d1d3a4c24ccb9b86d8b88d3bd05209b2a42b494cb32a50352960405160405180910390a383600381518110610ceb57610ceb61316d565b60200260200101516001600160a01b0316827fcc1b4af8292e6b938f6743c78a62317c9a2d60e0d46b77776a027e53ce617c0c60405160405180910390a3509392505050565b600081815260026020818152604080842081516101e081018352815460ff808216151583526001600160a01b036101009283900481168488015260018501548116958401959095528387015485166060840181905260038501546080850152600485015460a0850152600585015460c0850152600685015460e085015260078501548385015260088501546101208501819052600986015487166101408601819052600a870154610160870152600b870154610180870152600c9096015492831615156101a0860152929091049094166101c0830152878752949093529293918291829190610e1f906129e2565b9350806101600151925080610180015191505091939590929450565b60606003805480602002602001604051908101604052809291908181526020018280548015610e8957602002820191906000526020600020905b815481526020019060010190808311610e75575b5050505050905090565b600081815260026020526040902054819061010090046001600160a01b03163314610ed05760405162461bcd60e51b815260040161061890612e59565b60008281526002602052604090205460ff1615610f2b57600082815260026020526040808220805460ff1916905551339184917f03da9148e1de78fba22de63c573465562ebf6ef878a1d3ea83790a560229984c9190a35050565b600082815260026020526040808220805460ff1916600117905551339184917fc7344c45124818d1d3a4c24ccb9b86d8b88d3bd05209b2a42b494cb32a5035299190a35050565b600081815260026020526040902054819061010090046001600160a01b03163314610faf5760405162461bcd60e51b815260040161061890612e59565b60008281526002602052604080822060068101805493905560018101549054915163a9059cbb60e01b81526101009092046001600160a01b03908116600484015260248301849052169063a9059cbb90604401602060405180830381600087803b15801561101c57600080fd5b505af1158015611030573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110549190612c57565b506000838152600260209081526040918290206001810154905492518481526001600160a01b039182169361010090049091169186917fecc75f4464886bee0a1c5eae61c0cb4b99c64c5e9cdebe3696217d266f8b163691015b60405180910390a4505050565b600081815260026020818152604080842081516101e081018352815460ff80821615158084526001600160a01b036101009384900481169785018890526001860154811696850187905297850154881660608501819052600386015460808601819052600487015460a08701819052600588015460c08801819052600689015460e0890152600789015487890152600889015461012089015260098901548c16610140890152600a890154610160890152600b890154610180890152600c9098015494851615156101a0880152949093049098166101c08501529597949691959194909281908190819081906111b08e612436565b95506111bb8e6120d6565b94508060e0015193508061010001519250806101a0015191505091939597999b5091939597999b565b6000818152600260208190526040808320600b8101805494905590910154600154915163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b15801561124e57600080fd5b505af1158015611262573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112869190612c57565b506000828152600260208181526040928390209091015491518381526001600160a01b039092169184917f457b44fd47c33fc65bfbd58d0202ad97fbed1bbc9881f56441d05fe9ebd58acf91015b60405180910390a35050565b600082815260026020526040902054829061010090046001600160a01b0316331461131d5760405162461bcd60e51b815260040161061890612e59565b600083815260026020526040808220600c018054610100600160a81b0319166101006001600160a01b038716908102919091179091559051909185917fcc1b4af8292e6b938f6743c78a62317c9a2d60e0d46b77776a027e53ce617c0c9190a3505050565b600082815260026020526040902054829061010090046001600160a01b031633146113bf5760405162461bcd60e51b815260040161061890612e59565b816114185760405162461bcd60e51b815260206004820152602360248201527f46697865645261746545786368616e67653a20526174696f206d7573742062656044820152620203e360ec1b6064820152608401610618565b6000838152600260205260409081902060030183905551339084907fe50f9919fdc524004a4ee0cb934f4734f144bec0713a52e5483b753f5de0f08c906114629086815260200190565b60405180910390a3505050565b600083815260026020526040902054839060ff1615156001146114a45760405162461bcd60e51b815260040161061890612e0e565b826114c15760405162461bcd60e51b815260040161061890612f5e565b6000848152600260205260409020600c015461010090046001600160a01b031615611524576000848152600260205260409020600c015461010090046001600160a01b031633146115245760405162461bcd60e51b815260040161061890612db8565b60008060008061153488886118cd565b93509350935093508584101561159b5760405162461bcd60e51b815260206004820152602660248201527f46697865645261746545786368616e67653a20546f6f20666577206261736520604482015265746f6b656e7360d01b6064820152608401610618565b6000888152600260205260409020600b01546115b79083612a60565b6000898152600260205260409020600b810191909155600a01546115db9082612a60565b60008981526002602052604090819020600a81019290925560019091015490516323b872dd60e01b81526001600160a01b03909116906323b872dd9061162990339030908c90600401612d50565b602060405180830381600087803b15801561164357600080fd5b505af1158015611657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167b9190612c57565b6116975760405162461bcd60e51b815260040161061890612f00565b6000888152600260205260409020600601546116b39088612a60565b60008981526002602052604090206006810191909155600701548411156117955760008881526002602081905260409182902090810154905491516323b872dd60e01b81526001600160a01b03918216926323b872dd9261172292610100909204169033908990600401612d50565b602060405180830381600087803b15801561173c57600080fd5b505af1158015611750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117749190612c57565b6117905760405162461bcd60e51b815260040161061890612ea2565b611852565b6000888152600260205260409020600701546117b19084612a73565b60008981526002602081905260409182902060078101939093559190910154905163a9059cbb60e01b8152336004820152602481018690526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561181857600080fd5b505af115801561182c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118509190612c57565b505b6000888152600260208181526040928390209091015482518781529182018a90526001600160a01b0316918101919091526060810182905260808101839052339089907f71999bcde73cf4958b3a13dcbc60ff31366318eb6e67b45c93725aa07f89cbd29060a0015b60405180910390a35050505050505050565b600082815260026020526040812054819081908190869060ff1615156001146119085760405162461bcd60e51b815260040161061890612e0e565b6000878152600260205260409020600401546119819061192990600a613079565b6000898152600260205260409020600501546119759061194a90600a613079565b60008b81526002602052604090206003015461197b90670de0b6b3a764000090611975908d90612a7f565b90612a8b565b90612a7f565b600088815260026020819052604090912001549094506119a9906001600160a01b03166129e2565b156119ef57600087815260026020819052604090912001546119ec90670de0b6b3a764000090611975906119e5906001600160a01b03166129e2565b8790612a7f565b92505b600087815260026020526040902060080154611a1a90670de0b6b3a764000090611975908790612a7f565b9150611a3083611a2a8685612a73565b90612a73565b94505092959194509250565b600082815260026020526040902054829061010090046001600160a01b03163314611a795760405162461bcd60e51b815260040161061890612e59565b600083815260026020908152604091829020600c01805460ff19168515159081179091559151918252339185917fe28e899e0f5d6fba0c8d73d1888083bcc62d4d9806d2e26fcf1f607c3ed52f539101611462565b6000828152600260205260409020600901546001600160a01b03163314611b305760405162461bcd60e51b81526020600482015260166024820152753737ba1036b0b935b2ba2332b2a1b7b63632b1ba37b960511b6044820152606401610618565b60009182526002602052604090912060090180546001600160a01b0319166001600160a01b03909216919091179055565b600083815260026020526040902054839060ff161515600114611b965760405162461bcd60e51b815260040161061890612e0e565b82611bb35760405162461bcd60e51b815260040161061890612f5e565b6000848152600260205260409020600c015461010090046001600160a01b031615611c16576000848152600260205260409020600c015461010090046001600160a01b03163314611c165760405162461bcd60e51b815260040161061890612db8565b600080600080611c26888861279e565b935093509350935085841115611c8e5760405162461bcd60e51b815260206004820152602760248201527f46697865645261746545786368616e67653a20546f6f206d616e79206261736560448201526620746f6b656e7360c81b6064820152608401610618565b6000888152600260205260409020600b0154611caa9083612a60565b6000898152600260205260409020600b810191909155600a0154611cce9082612a60565b600089815260026020819052604091829020600a810193909355919091015490516323b872dd60e01b81526001600160a01b03909116906323b872dd90611d1d90339030908990600401612d50565b602060405180830381600087803b158015611d3757600080fd5b505af1158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6f9190612c57565b611d8b5760405162461bcd60e51b815260040161061890612ea2565b600088815260026020526040902060070154611da79084612a60565b6000898152600260205260409020600781019190915560060154871115611fad576000888152600260205260409020600c015460ff168015611e6f5750600088815260026020526040908190206001015490516355138f0d60e11b81523060048201526001600160a01b039091169063aa271e1a9060240160206040518083038186803b158015611e3757600080fd5b505afa158015611e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6f9190612c57565b15611eed57600088815260026020526040908190206001015490516340c10f1960e01b8152336004820152602481018990526001600160a01b03909116906340c10f1990604401600060405180830381600087803b158015611ed057600080fd5b505af1158015611ee4573d6000803e3d6000fd5b50505050612069565b600088815260026020526040908190206001810154905491516323b872dd60e01b81526001600160a01b03918216926323b872dd92611f3a92610100909204169033908c90600401612d50565b602060405180830381600087803b158015611f5457600080fd5b505af1158015611f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8c9190612c57565b611fa85760405162461bcd60e51b815260040161061890612f00565b612069565b600088815260026020526040902060060154611fc99088612a73565b600089815260026020526040908190206006810192909255600190910154905163a9059cbb60e01b8152336004820152602481018990526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561202f57600080fd5b505af1158015612043573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120679190612c57565b505b6000888152600260209081526040918290206001015482518781529182018a90526001600160a01b0316918101919091526060810182905260808101839052339089907f71999bcde73cf4958b3a13dcbc60ff31366318eb6e67b45c93725aa07f89cbd29060a0016118bb565b60008181526002602052604081205460ff166120f457506000919050565b600082815260026020819052604080832091820154915490516370a0823160e01b81526001600160a01b03610100909204821660048201529116906370a082319060240160206040518083038186803b15801561215057600080fd5b505afa158015612164573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121889190612d37565b60008481526002602081905260408083209182015491549051636eb1769f60e11b81526101009091046001600160a01b0390811660048301523060248301529394509192169063dd62ed3e9060440160206040518083038186803b1580156121ef57600080fd5b505afa158015612203573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122279190612d37565b9050808210156122555760008481526002602052604090206007015461224e908390612a60565b9250612275565b600084815260026020526040902060070154612272908290612a60565b92505b50505b919050565b6000828152600260205260409020600901546001600160a01b031633146122df5760405162461bcd60e51b81526020600482015260166024820152753737ba1036b0b935b2ba2332b2a1b7b63632b1ba37b960511b6044820152606401610618565b60009182526002602052604090912060080155565b6000818152600260208190526040808320600a8101805494905591820154600990920154905163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b15801561236157600080fd5b505af1158015612375573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123999190612c57565b506000828152600260208181526040928390209091015491518381526001600160a01b039092169184917f192a3cd95e40313e0e12c28b398e31633936e38d134419161f883c8d6407905591016112d4565b604080516001600160a01b0380861660208301528085169282019290925290821660608201526000906080016040516020818303038152906040528051906020012090509392505050565b60008181526002602052604081205460ff1661245457506000919050565b6000828152600260205260409020600c015460ff16151560011480156125005750600082815260026020526040908190206001015490516355138f0d60e11b81523060048201526001600160a01b039091169063aa271e1a9060240160206040518083038186803b1580156124c857600080fd5b505afa1580156124dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125009190612c57565b15612629576000828152600260209081526040918290206001015482516318160ddd60e01b815292516001600160a01b03909116926318160ddd926004808301939192829003018186803b15801561255757600080fd5b505afa15801561256b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258f9190612d37565b600083815260026020908152604091829020600101548251631aa93a7560e11b815292516001600160a01b039091169263355274ea926004808301939192829003018186803b1580156125e157600080fd5b505afa1580156125f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126199190612d37565b6126239190613140565b92915050565b6000828152600260205260408082206001810154905491516370a0823160e01b81526101009092046001600160a01b03908116600484015216906370a082319060240160206040518083038186803b15801561268457600080fd5b505afa158015612698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126bc9190612d37565b600084815260026020526040808220600181015490549151636eb1769f60e11b81526001600160a01b0361010090930483166004820152306024820152939450919291169063dd62ed3e9060440160206040518083038186803b15801561272257600080fd5b505afa158015612736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061275a9190612d37565b9050808210156127815760008481526002602052604090206006015461224e908390612a60565b600084815260026020526040902060060154612272908290612a60565b600082815260026020526040812054819081908190869060ff1615156001146127d95760405162461bcd60e51b815260040161061890612e0e565b6000878152600260205260409020600401546127fa9061192990600a613079565b60008881526002602081905260409091200154909450612822906001600160a01b03166129e2565b15612861576000878152600260208190526040909120015461285e90670de0b6b3a764000090611975906119e5906001600160a01b03166129e2565b92505b60008781526002602052604090206008015461288c90670de0b6b3a764000090611975908790612a7f565b9150611a308361289c8685612a60565b90612a60565b600081815260026020526040902054819061010090046001600160a01b031633146128df5760405162461bcd60e51b815260040161061890612e59565b6000828152600260208190526040808320600781018054949055918201549154905163a9059cbb60e01b81526001600160a01b03610100909204821660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129859190612c57565b5060008381526002602081815260409283902091820154915492518481526001600160a01b039283169361010090049092169186917fecc75f4464886bee0a1c5eae61c0cb4b99c64c5e9cdebe3696217d266f8b163691016110ae565b60008054604051637c0aa57760e11b81526001600160a01b0384811660048301529091169063f8154aee9060240160206040518083038186803b158015612a2857600080fd5b505afa158015612a3c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126239190612d37565b6000612a6c8284612ffc565b9392505050565b6000612a6c8284613140565b6000612a6c8284613121565b6000612a6c8284613014565b80356001600160a01b038116811461227857600080fd5b600082601f830112612abf57600080fd5b81356020612ad4612acf83612fd8565b612fa7565b80838252828201915082860187848660051b8901011115612af457600080fd5b60005b85811015612b1357813584529284019290840190600101612af7565b5090979650505050505050565b600060208284031215612b3257600080fd5b612a6c82612a97565b600080600060608486031215612b5057600080fd5b612b5984612a97565b9250612b6760208501612a97565b9150612b7560408501612a97565b90509250925092565b600080600060608486031215612b9357600080fd5b612b9c84612a97565b925060208085013567ffffffffffffffff80821115612bba57600080fd5b818701915087601f830112612bce57600080fd5b8135612bdc612acf82612fd8565b8082825285820191508585018b878560051b8801011115612bfc57600080fd5b600095505b83861015612c2657612c1281612a97565b835260019590950194918601918601612c01565b50965050506040870135925080831115612c3f57600080fd5b5050612c4d86828701612aae565b9150509250925092565b600060208284031215612c6957600080fd5b8151612a6c81613199565b600060208284031215612c8657600080fd5b5035919050565b60008060408385031215612ca057600080fd5b82359150612cb060208401612a97565b90509250929050565b60008060408385031215612ccc57600080fd5b823591506020830135612cde81613199565b809150509250929050565b60008060408385031215612cfc57600080fd5b50508035926020909101359150565b600080600060608486031215612d2057600080fd5b505081359360208301359350604090920135919050565b600060208284031215612d4957600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6020808252825182820181905260009190848201906040850190845b81811015612dac57835183529284019291840191600101612d90565b50909695505050505050565b60208082526036908201527f46697865645261746545786368616e67653a205468697320616464726573732060408201527506973206e6f7420616c6c6f77656420746f20737761760541b606082015260800190565b6020808252602b908201527f46697865645261746545786368616e67653a2045786368616e676520646f657360408201526a206e6f742065786973742160a81b606082015260800190565b60208082526029908201527f46697865645261746545786368616e67653a20696e76616c69642065786368616040820152683733b29037bbb732b960b91b606082015260800190565b602080825260409082018190527f46697865645261746545786368616e67653a207472616e7366657246726f6d20908201527f6661696c656420696e207468652062617365546f6b656e20636f6e7472616374606082015260800190565b602080825260409082018190527f46697865645261746545786368616e67653a207472616e7366657246726f6d20908201527f6661696c656420696e207468652064617461546f6b656e20636f6e7472616374606082015260800190565b60208082526029908201527f46697865645261746545786368616e67653a207a65726f206461746120746f6b604082015268195b88185b5bdd5b9d60ba1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff81118282101715612fd057612fd0613183565b604052919050565b600067ffffffffffffffff821115612ff257612ff2613183565b5060051b60200190565b6000821982111561300f5761300f613157565b500190565b60008261303157634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111561307157816000190482111561305757613057613157565b8085161561306457918102915b93841c939080029061303b565b509250929050565b6000612a6c838360008261308f57506001612623565b8161309c57506000612623565b81600181146130b257600281146130bc576130d8565b6001915050612623565b60ff8411156130cd576130cd613157565b50506001821b612623565b5060208310610133831016604e8410600b84101617156130fb575081810a612623565b6131058383613036565b806000190482111561311957613119613157565b029392505050565b600081600019048311821515161561313b5761313b613157565b500290565b60008282101561315257613152613157565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146131a757600080fd5b5056fea2646970667358221220ce5268baa624f044ea145410a459d6d1e6ca8dbfb90eb82914fc12914514595664736f6c63430008070033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c45760003560e01c8063825b5cd6116100f9578063b686bcaf11610097578063c99733a711610071578063c99733a714610575578063f532129e14610588578063f8154aee1461059b578063f887ea40146105ae57600080fd5b8063b686bcaf1461053c578063c1f6572e1461054f578063c66274ea1461056257600080fd5b806388823872116100d357806388823872146104eb578063a28f78f1146104fe578063b32b56f914610511578063b42414291461053457600080fd5b8063825b5cd6146103c5578063855058dd146103d857806385fcbc2f146104d857600080fd5b80635c36901c116101665780636e4c6269116101405780636e4c62691461035957806371dc14b21461036c57806379dd28361461039f5780637c82ebe9146103b257600080fd5b80635c36901c1461030057806360311e9514610333578063680819eb1461034657600080fd5b806324cb477e116101a257806324cb477e14610247578063450dccc31461025c5780634c87087d1461026f5780635acfedc7146102ed57600080fd5b8063012c3275146101c95780630b3b430d146101ef5780631e2e3a6b14610232575b600080fd5b6101dc6101d7366004612b7e565b6105c1565b6040519081526020015b60405180910390f35b6102026101fd366004612c74565b610d31565b604080519586526001600160a01b039094166020860152928401919091526060830152608082015260a0016101e6565b61023a610e3b565b6040516101e69190612d74565b61025a610255366004612c74565b610e93565b005b61025a61026a366004612c74565b610f72565b61028261027d366004612c74565b6110bb565b604080516001600160a01b039d8e1681529b8d1660208d01528b0199909952999096166060890152608088019490945260a0870192909252151560c086015260e0850152610100840152610120830152610140820192909252901515610160820152610180016101e6565b61025a6102fb366004612c74565b6111e4565b61032361030e366004612c74565b60009081526002602052604090205460ff1690565b60405190151581526020016101e6565b61025a610341366004612c8d565b6112e0565b61025a610354366004612ce9565b611382565b61025a610367366004612d0b565b61146f565b61037f61037a366004612ce9565b6118cd565b6040805194855260208501939093529183015260608201526080016101e6565b61025a6103ad366004612cb9565b611a3c565b61025a6103c0366004612c8d565b611ace565b61025a6103d3366004612d0b565b611b61565b6104c06103e6366004612c74565b60009081526002602081815260409283902083516101e081018552815460ff808216151583526001600160a01b03610100928390048116958401959095526001840154851696830196909652938201548316606082015260038201546080820152600482015460a0820152600582015460c0820152600682015460e0820152600782015484820152600882015461012082015260098201548316610140820152600a820154610160820152600b820154610180820152600c9091015493841615156101a0820152919092049091166101c090910181905290565b6040516001600160a01b0390911681526020016101e6565b6101dc6104e6366004612c74565b6120d6565b61025a6104f9366004612ce9565b61227d565b6001546104c0906001600160a01b031681565b6101dc61051f366004612c74565b60009081526002602052604090206003015490565b6003546101dc565b61025a61054a366004612c74565b6122f4565b6101dc61055d366004612b3b565b6123eb565b6101dc610570366004612c74565b612436565b61037f610583366004612ce9565b61279e565b61025a610596366004612c74565b6128a2565b6101dc6105a9366004612b20565b6129e2565b6000546104c0906001600160a01b031681565b600080546001600160a01b031633146106215760405162461bcd60e51b815260206004820152601e60248201527f46697865645261746545786368616e67653a206f6e6c7920726f75746572000060448201526064015b60405180910390fd5b60006001600160a01b03168360008151811061063f5761063f61316d565b60200260200101516001600160a01b031614156106ba5760405162461bcd60e51b815260206004820152603360248201527f46697865645261746545786368616e67653a20496e76616c69642062617365746044820152726f6b656e2c20207a65726f206164647265737360681b6064820152608401610618565b6001600160a01b03841661072c5760405162461bcd60e51b815260206004820152603360248201527f46697865645261746545786368616e67653a20496e76616c69642064617461746044820152726f6b656e2c20207a65726f206164647265737360681b6064820152608401610618565b836001600160a01b0316836000815181106107495761074961316d565b60200260200101516001600160a01b031614156107ce5760405162461bcd60e51b815260206004820152603760248201527f46697865645261746545786368616e67653a20496e76616c696420646174617460448201527f6f6b656e2c2020657175616c732062617365746f6b656e0000000000000000006064820152608401610618565b816002815181106107e1576107e161316d565b6020026020010151600014156108505760405162461bcd60e51b815260206004820152602e60248201527f46697865645261746545786368616e67653a20496e76616c696420657863686160448201526d6e676520726174652076616c756560901b6064820152608401610618565b61088f836000815181106108665761086661316d565b602002602001015185856001815181106108825761088261316d565b60200260200101516123eb565b600081815260026020526040902060030154909150156109055760405162461bcd60e51b815260206004820152602b60248201527f46697865645261746545786368616e67653a2045786368616e676520616c726560448201526a616479206578697374732160a81b6064820152608401610618565b6000600190508260048151811061091e5761091e61316d565b602002602001015160001415610932575060005b604051806101e001604052806001151581526020018560018151811061095a5761095a61316d565b60200260200101516001600160a01b03168152602001866001600160a01b03168152602001856000815181106109925761099261316d565b60200260200101516001600160a01b03168152602001846002815181106109bb576109bb61316d565b60200260200101518152602001846001815181106109db576109db61316d565b60200260200101518152602001846000815181106109fb576109fb61316d565b60200260200101518152602001600081526020016000815260200184600381518110610a2957610a2961316d565b6020026020010151815260200185600281518110610a4957610a4961316d565b60200260200101516001600160a01b031681526020016000815260200160008152602001821515815260200185600381518110610a8857610a8861316d565b6020908102919091018101516001600160a01b0390811690925260008581526002808352604080832086518154958801518716610100908102610100600160a81b031992151583166001600160a81b0319988916171783559288015160018084018054928a166001600160a01b031993841617905560608a01519584018054968a1696831696909617909555608089015160038085019190915560a08a0151600485015560c08a0151600585015560e08a01516006850155848a015160078501556101208a015160088501556101408a0151600985018054918b169190931617909155610160890151600a840155610180890151600b8401556101a0890151600c90930180546101c0909a01518916909402921515909116979095169690961795909517909455815493840182559081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9092018490558551908716918691610bf457610bf461316d565b60200260200101516001600160a01b0316837feb7a353641f7d3cc54b497ef1553fdc292b64d9cc3be8587c23dfba01f310b1987600181518110610c3a57610c3a61316d565b602002602001015187600281518110610c5557610c5561316d565b6020026020010151604051610c7f9291906001600160a01b03929092168252602082015260400190565b60405180910390a483600181518110610c9a57610c9a61316d565b60200260200101516001600160a01b0316827fc7344c45124818d1d3a4c24ccb9b86d8b88d3bd05209b2a42b494cb32a50352960405160405180910390a383600381518110610ceb57610ceb61316d565b60200260200101516001600160a01b0316827fcc1b4af8292e6b938f6743c78a62317c9a2d60e0d46b77776a027e53ce617c0c60405160405180910390a3509392505050565b600081815260026020818152604080842081516101e081018352815460ff808216151583526001600160a01b036101009283900481168488015260018501548116958401959095528387015485166060840181905260038501546080850152600485015460a0850152600585015460c0850152600685015460e085015260078501548385015260088501546101208501819052600986015487166101408601819052600a870154610160870152600b870154610180870152600c9096015492831615156101a0860152929091049094166101c0830152878752949093529293918291829190610e1f906129e2565b9350806101600151925080610180015191505091939590929450565b60606003805480602002602001604051908101604052809291908181526020018280548015610e8957602002820191906000526020600020905b815481526020019060010190808311610e75575b5050505050905090565b600081815260026020526040902054819061010090046001600160a01b03163314610ed05760405162461bcd60e51b815260040161061890612e59565b60008281526002602052604090205460ff1615610f2b57600082815260026020526040808220805460ff1916905551339184917f03da9148e1de78fba22de63c573465562ebf6ef878a1d3ea83790a560229984c9190a35050565b600082815260026020526040808220805460ff1916600117905551339184917fc7344c45124818d1d3a4c24ccb9b86d8b88d3bd05209b2a42b494cb32a5035299190a35050565b600081815260026020526040902054819061010090046001600160a01b03163314610faf5760405162461bcd60e51b815260040161061890612e59565b60008281526002602052604080822060068101805493905560018101549054915163a9059cbb60e01b81526101009092046001600160a01b03908116600484015260248301849052169063a9059cbb90604401602060405180830381600087803b15801561101c57600080fd5b505af1158015611030573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110549190612c57565b506000838152600260209081526040918290206001810154905492518481526001600160a01b039182169361010090049091169186917fecc75f4464886bee0a1c5eae61c0cb4b99c64c5e9cdebe3696217d266f8b163691015b60405180910390a4505050565b600081815260026020818152604080842081516101e081018352815460ff80821615158084526001600160a01b036101009384900481169785018890526001860154811696850187905297850154881660608501819052600386015460808601819052600487015460a08701819052600588015460c08801819052600689015460e0890152600789015487890152600889015461012089015260098901548c16610140890152600a890154610160890152600b890154610180890152600c9098015494851615156101a0880152949093049098166101c08501529597949691959194909281908190819081906111b08e612436565b95506111bb8e6120d6565b94508060e0015193508061010001519250806101a0015191505091939597999b5091939597999b565b6000818152600260208190526040808320600b8101805494905590910154600154915163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b15801561124e57600080fd5b505af1158015611262573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112869190612c57565b506000828152600260208181526040928390209091015491518381526001600160a01b039092169184917f457b44fd47c33fc65bfbd58d0202ad97fbed1bbc9881f56441d05fe9ebd58acf91015b60405180910390a35050565b600082815260026020526040902054829061010090046001600160a01b0316331461131d5760405162461bcd60e51b815260040161061890612e59565b600083815260026020526040808220600c018054610100600160a81b0319166101006001600160a01b038716908102919091179091559051909185917fcc1b4af8292e6b938f6743c78a62317c9a2d60e0d46b77776a027e53ce617c0c9190a3505050565b600082815260026020526040902054829061010090046001600160a01b031633146113bf5760405162461bcd60e51b815260040161061890612e59565b816114185760405162461bcd60e51b815260206004820152602360248201527f46697865645261746545786368616e67653a20526174696f206d7573742062656044820152620203e360ec1b6064820152608401610618565b6000838152600260205260409081902060030183905551339084907fe50f9919fdc524004a4ee0cb934f4734f144bec0713a52e5483b753f5de0f08c906114629086815260200190565b60405180910390a3505050565b600083815260026020526040902054839060ff1615156001146114a45760405162461bcd60e51b815260040161061890612e0e565b826114c15760405162461bcd60e51b815260040161061890612f5e565b6000848152600260205260409020600c015461010090046001600160a01b031615611524576000848152600260205260409020600c015461010090046001600160a01b031633146115245760405162461bcd60e51b815260040161061890612db8565b60008060008061153488886118cd565b93509350935093508584101561159b5760405162461bcd60e51b815260206004820152602660248201527f46697865645261746545786368616e67653a20546f6f20666577206261736520604482015265746f6b656e7360d01b6064820152608401610618565b6000888152600260205260409020600b01546115b79083612a60565b6000898152600260205260409020600b810191909155600a01546115db9082612a60565b60008981526002602052604090819020600a81019290925560019091015490516323b872dd60e01b81526001600160a01b03909116906323b872dd9061162990339030908c90600401612d50565b602060405180830381600087803b15801561164357600080fd5b505af1158015611657573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167b9190612c57565b6116975760405162461bcd60e51b815260040161061890612f00565b6000888152600260205260409020600601546116b39088612a60565b60008981526002602052604090206006810191909155600701548411156117955760008881526002602081905260409182902090810154905491516323b872dd60e01b81526001600160a01b03918216926323b872dd9261172292610100909204169033908990600401612d50565b602060405180830381600087803b15801561173c57600080fd5b505af1158015611750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117749190612c57565b6117905760405162461bcd60e51b815260040161061890612ea2565b611852565b6000888152600260205260409020600701546117b19084612a73565b60008981526002602081905260409182902060078101939093559190910154905163a9059cbb60e01b8152336004820152602481018690526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561181857600080fd5b505af115801561182c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118509190612c57565b505b6000888152600260208181526040928390209091015482518781529182018a90526001600160a01b0316918101919091526060810182905260808101839052339089907f71999bcde73cf4958b3a13dcbc60ff31366318eb6e67b45c93725aa07f89cbd29060a0015b60405180910390a35050505050505050565b600082815260026020526040812054819081908190869060ff1615156001146119085760405162461bcd60e51b815260040161061890612e0e565b6000878152600260205260409020600401546119819061192990600a613079565b6000898152600260205260409020600501546119759061194a90600a613079565b60008b81526002602052604090206003015461197b90670de0b6b3a764000090611975908d90612a7f565b90612a8b565b90612a7f565b600088815260026020819052604090912001549094506119a9906001600160a01b03166129e2565b156119ef57600087815260026020819052604090912001546119ec90670de0b6b3a764000090611975906119e5906001600160a01b03166129e2565b8790612a7f565b92505b600087815260026020526040902060080154611a1a90670de0b6b3a764000090611975908790612a7f565b9150611a3083611a2a8685612a73565b90612a73565b94505092959194509250565b600082815260026020526040902054829061010090046001600160a01b03163314611a795760405162461bcd60e51b815260040161061890612e59565b600083815260026020908152604091829020600c01805460ff19168515159081179091559151918252339185917fe28e899e0f5d6fba0c8d73d1888083bcc62d4d9806d2e26fcf1f607c3ed52f539101611462565b6000828152600260205260409020600901546001600160a01b03163314611b305760405162461bcd60e51b81526020600482015260166024820152753737ba1036b0b935b2ba2332b2a1b7b63632b1ba37b960511b6044820152606401610618565b60009182526002602052604090912060090180546001600160a01b0319166001600160a01b03909216919091179055565b600083815260026020526040902054839060ff161515600114611b965760405162461bcd60e51b815260040161061890612e0e565b82611bb35760405162461bcd60e51b815260040161061890612f5e565b6000848152600260205260409020600c015461010090046001600160a01b031615611c16576000848152600260205260409020600c015461010090046001600160a01b03163314611c165760405162461bcd60e51b815260040161061890612db8565b600080600080611c26888861279e565b935093509350935085841115611c8e5760405162461bcd60e51b815260206004820152602760248201527f46697865645261746545786368616e67653a20546f6f206d616e79206261736560448201526620746f6b656e7360c81b6064820152608401610618565b6000888152600260205260409020600b0154611caa9083612a60565b6000898152600260205260409020600b810191909155600a0154611cce9082612a60565b600089815260026020819052604091829020600a810193909355919091015490516323b872dd60e01b81526001600160a01b03909116906323b872dd90611d1d90339030908990600401612d50565b602060405180830381600087803b158015611d3757600080fd5b505af1158015611d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6f9190612c57565b611d8b5760405162461bcd60e51b815260040161061890612ea2565b600088815260026020526040902060070154611da79084612a60565b6000898152600260205260409020600781019190915560060154871115611fad576000888152600260205260409020600c015460ff168015611e6f5750600088815260026020526040908190206001015490516355138f0d60e11b81523060048201526001600160a01b039091169063aa271e1a9060240160206040518083038186803b158015611e3757600080fd5b505afa158015611e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e6f9190612c57565b15611eed57600088815260026020526040908190206001015490516340c10f1960e01b8152336004820152602481018990526001600160a01b03909116906340c10f1990604401600060405180830381600087803b158015611ed057600080fd5b505af1158015611ee4573d6000803e3d6000fd5b50505050612069565b600088815260026020526040908190206001810154905491516323b872dd60e01b81526001600160a01b03918216926323b872dd92611f3a92610100909204169033908c90600401612d50565b602060405180830381600087803b158015611f5457600080fd5b505af1158015611f68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8c9190612c57565b611fa85760405162461bcd60e51b815260040161061890612f00565b612069565b600088815260026020526040902060060154611fc99088612a73565b600089815260026020526040908190206006810192909255600190910154905163a9059cbb60e01b8152336004820152602481018990526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b15801561202f57600080fd5b505af1158015612043573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120679190612c57565b505b6000888152600260209081526040918290206001015482518781529182018a90526001600160a01b0316918101919091526060810182905260808101839052339089907f71999bcde73cf4958b3a13dcbc60ff31366318eb6e67b45c93725aa07f89cbd29060a0016118bb565b60008181526002602052604081205460ff166120f457506000919050565b600082815260026020819052604080832091820154915490516370a0823160e01b81526001600160a01b03610100909204821660048201529116906370a082319060240160206040518083038186803b15801561215057600080fd5b505afa158015612164573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121889190612d37565b60008481526002602081905260408083209182015491549051636eb1769f60e11b81526101009091046001600160a01b0390811660048301523060248301529394509192169063dd62ed3e9060440160206040518083038186803b1580156121ef57600080fd5b505afa158015612203573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122279190612d37565b9050808210156122555760008481526002602052604090206007015461224e908390612a60565b9250612275565b600084815260026020526040902060070154612272908290612a60565b92505b50505b919050565b6000828152600260205260409020600901546001600160a01b031633146122df5760405162461bcd60e51b81526020600482015260166024820152753737ba1036b0b935b2ba2332b2a1b7b63632b1ba37b960511b6044820152606401610618565b60009182526002602052604090912060080155565b6000818152600260208190526040808320600a8101805494905591820154600990920154905163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b15801561236157600080fd5b505af1158015612375573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123999190612c57565b506000828152600260208181526040928390209091015491518381526001600160a01b039092169184917f192a3cd95e40313e0e12c28b398e31633936e38d134419161f883c8d6407905591016112d4565b604080516001600160a01b0380861660208301528085169282019290925290821660608201526000906080016040516020818303038152906040528051906020012090509392505050565b60008181526002602052604081205460ff1661245457506000919050565b6000828152600260205260409020600c015460ff16151560011480156125005750600082815260026020526040908190206001015490516355138f0d60e11b81523060048201526001600160a01b039091169063aa271e1a9060240160206040518083038186803b1580156124c857600080fd5b505afa1580156124dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125009190612c57565b15612629576000828152600260209081526040918290206001015482516318160ddd60e01b815292516001600160a01b03909116926318160ddd926004808301939192829003018186803b15801561255757600080fd5b505afa15801561256b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061258f9190612d37565b600083815260026020908152604091829020600101548251631aa93a7560e11b815292516001600160a01b039091169263355274ea926004808301939192829003018186803b1580156125e157600080fd5b505afa1580156125f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126199190612d37565b6126239190613140565b92915050565b6000828152600260205260408082206001810154905491516370a0823160e01b81526101009092046001600160a01b03908116600484015216906370a082319060240160206040518083038186803b15801561268457600080fd5b505afa158015612698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126bc9190612d37565b600084815260026020526040808220600181015490549151636eb1769f60e11b81526001600160a01b0361010090930483166004820152306024820152939450919291169063dd62ed3e9060440160206040518083038186803b15801561272257600080fd5b505afa158015612736573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061275a9190612d37565b9050808210156127815760008481526002602052604090206006015461224e908390612a60565b600084815260026020526040902060060154612272908290612a60565b600082815260026020526040812054819081908190869060ff1615156001146127d95760405162461bcd60e51b815260040161061890612e0e565b6000878152600260205260409020600401546127fa9061192990600a613079565b60008881526002602081905260409091200154909450612822906001600160a01b03166129e2565b15612861576000878152600260208190526040909120015461285e90670de0b6b3a764000090611975906119e5906001600160a01b03166129e2565b92505b60008781526002602052604090206008015461288c90670de0b6b3a764000090611975908790612a7f565b9150611a308361289c8685612a60565b90612a60565b600081815260026020526040902054819061010090046001600160a01b031633146128df5760405162461bcd60e51b815260040161061890612e59565b6000828152600260208190526040808320600781018054949055918201549154905163a9059cbb60e01b81526001600160a01b03610100909204821660048201526024810184905291169063a9059cbb90604401602060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129859190612c57565b5060008381526002602081815260409283902091820154915492518481526001600160a01b039283169361010090049092169186917fecc75f4464886bee0a1c5eae61c0cb4b99c64c5e9cdebe3696217d266f8b163691016110ae565b60008054604051637c0aa57760e11b81526001600160a01b0384811660048301529091169063f8154aee9060240160206040518083038186803b158015612a2857600080fd5b505afa158015612a3c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126239190612d37565b6000612a6c8284612ffc565b9392505050565b6000612a6c8284613140565b6000612a6c8284613121565b6000612a6c8284613014565b80356001600160a01b038116811461227857600080fd5b600082601f830112612abf57600080fd5b81356020612ad4612acf83612fd8565b612fa7565b80838252828201915082860187848660051b8901011115612af457600080fd5b60005b85811015612b1357813584529284019290840190600101612af7565b5090979650505050505050565b600060208284031215612b3257600080fd5b612a6c82612a97565b600080600060608486031215612b5057600080fd5b612b5984612a97565b9250612b6760208501612a97565b9150612b7560408501612a97565b90509250925092565b600080600060608486031215612b9357600080fd5b612b9c84612a97565b925060208085013567ffffffffffffffff80821115612bba57600080fd5b818701915087601f830112612bce57600080fd5b8135612bdc612acf82612fd8565b8082825285820191508585018b878560051b8801011115612bfc57600080fd5b600095505b83861015612c2657612c1281612a97565b835260019590950194918601918601612c01565b50965050506040870135925080831115612c3f57600080fd5b5050612c4d86828701612aae565b9150509250925092565b600060208284031215612c6957600080fd5b8151612a6c81613199565b600060208284031215612c8657600080fd5b5035919050565b60008060408385031215612ca057600080fd5b82359150612cb060208401612a97565b90509250929050565b60008060408385031215612ccc57600080fd5b823591506020830135612cde81613199565b809150509250929050565b60008060408385031215612cfc57600080fd5b50508035926020909101359150565b600080600060608486031215612d2057600080fd5b505081359360208301359350604090920135919050565b600060208284031215612d4957600080fd5b5051919050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6020808252825182820181905260009190848201906040850190845b81811015612dac57835183529284019291840191600101612d90565b50909695505050505050565b60208082526036908201527f46697865645261746545786368616e67653a205468697320616464726573732060408201527506973206e6f7420616c6c6f77656420746f20737761760541b606082015260800190565b6020808252602b908201527f46697865645261746545786368616e67653a2045786368616e676520646f657360408201526a206e6f742065786973742160a81b606082015260800190565b60208082526029908201527f46697865645261746545786368616e67653a20696e76616c69642065786368616040820152683733b29037bbb732b960b91b606082015260800190565b602080825260409082018190527f46697865645261746545786368616e67653a207472616e7366657246726f6d20908201527f6661696c656420696e207468652062617365546f6b656e20636f6e7472616374606082015260800190565b602080825260409082018190527f46697865645261746545786368616e67653a207472616e7366657246726f6d20908201527f6661696c656420696e207468652064617461546f6b656e20636f6e7472616374606082015260800190565b60208082526029908201527f46697865645261746545786368616e67653a207a65726f206461746120746f6b604082015268195b88185b5bdd5b9d60ba1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff81118282101715612fd057612fd0613183565b604052919050565b600067ffffffffffffffff821115612ff257612ff2613183565b5060051b60200190565b6000821982111561300f5761300f613157565b500190565b60008261303157634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111561307157816000190482111561305757613057613157565b8085161561306457918102915b93841c939080029061303b565b509250929050565b6000612a6c838360008261308f57506001612623565b8161309c57506000612623565b81600181146130b257600281146130bc576130d8565b6001915050612623565b60ff8411156130cd576130cd613157565b50506001821b612623565b5060208310610133831016604e8410600b84101617156130fb575081810a612623565b6131058383613036565b806000190482111561311957613119613157565b029392505050565b600081600019048311821515161561313b5761313b613157565b500290565b60008282101561315257613152613157565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146131a757600080fd5b5056fea2646970667358221220ce5268baa624f044ea145410a459d6d1e6ca8dbfb90eb82914fc12914514595664736f6c63430008070033", + "linkReferences": {}, + "deployedLinkReferences": {} + } \ No newline at end of file diff --git a/abis/Metadata.json b/abis/Metadata.json deleted file mode 100644 index c5ef3c3..0000000 --- a/abis/Metadata.json +++ /dev/null @@ -1,2392 +0,0 @@ -{ - "contractName": "Metadata", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "dataToken", - "type": "address" - }, - { - "indexed": true, - "name": "createdBy", - "type": "address" - }, - { - "indexed": false, - "name": "flags", - "type": "bytes" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - } - ], - "name": "MetadataCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "dataToken", - "type": "address" - }, - { - "indexed": true, - "name": "updatedBy", - "type": "address" - }, - { - "indexed": false, - "name": "flags", - "type": "bytes" - }, - { - "indexed": false, - "name": "data", - "type": "bytes" - } - ], - "name": "MetadataUpdated", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "dataToken", - "type": "address" - }, - { - "name": "flags", - "type": "bytes" - }, - { - "name": "data", - "type": "bytes" - } - ], - "name": "create", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "dataToken", - "type": "address" - }, - { - "name": "flags", - "type": "bytes" - }, - { - "name": "data", - "type": "bytes" - } - ], - "name": "update", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.7+commit.6da8b019\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"name\":\"dataToken\",\"type\":\"address\"},{\"name\":\"flags\",\"type\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"create\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"dataToken\",\"type\":\"address\"},{\"name\":\"flags\",\"type\":\"bytes\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"update\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"dataToken\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"createdBy\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"flags\",\"type\":\"bytes\"},{\"indexed\":false,\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"MetadataCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"dataToken\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"updatedBy\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"flags\",\"type\":\"bytes\"},{\"indexed\":false,\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"MetadataUpdated\",\"type\":\"event\"}],\"devdoc\":{\"details\":\"Metadata stands for Decentralized Document. It allows publishers to publish their dataset metadata in decentralized way. It follows the Ocean DID Document standard: https://github.com/oceanprotocol/OEPs/blob/master/7/v0.2/README.md\",\"methods\":{\"create(address,bytes,bytes)\":{\"details\":\"create creates/publishes new metadata/DDO document on-chain. \",\"params\":{\"data\":\"referes to the actual metadata\",\"dataToken\":\"refers to data token address\",\"flags\":\"special flags associated with metadata\"}},\"update(address,bytes,bytes)\":{\"details\":\"update allows only datatoken minter(s) to update the DDO/metadata content\",\"params\":{\"data\":\"referes to the actual metadata\",\"dataToken\":\"refers to data token address\",\"flags\":\"special flags associated with metadata\"}}},\"title\":\"Metadata \"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/ocean/ocean-contracts/contracts/metadata/Metadata.sol\":\"Metadata\"},\"evmVersion\":\"byzantium\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/ocean/ocean-contracts/contracts/interfaces/IERC20Template.sol\":{\"keccak256\":\"0x022ebed2ba4949e96a05cc394cf690d8fd3190a4733cebe8cbe930ac25cfde18\",\"urls\":[\"bzzr://2fa3d5cae14f0af7d78f6e1d13bc41854082c03ab2f86462ebb09afda88ee6e9\"]},\"/ocean/ocean-contracts/contracts/metadata/Metadata.sol\":{\"keccak256\":\"0x6deddfdc2e45d81e50d58cf216908c18bdbc0c84a1dad53ca2995f14d0217d7d\",\"urls\":[\"bzzr://be7a7be0d067cedb6d2f4acc7457e89dd7c9dbbf2b77725784ed0e9bb67bd64a\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50610531806100206000396000f3fe608060405234801561001057600080fd5b50600436106100395760e060020a600035046382743814811461003e578063f89b1f3614610112575b600080fd5b6101106004803603606081101561005457600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561007f57600080fd5b82018360208201111561009157600080fd5b803590602001918460018302840111640100000000831117156100b357600080fd5b9193909290916020810190356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184600183028401116401000000008311171561010557600080fd5b5090925090506101e4565b005b6101106004803603606081101561012857600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561015357600080fd5b82018360208201111561016557600080fd5b8035906020019184600183028401116401000000008311171561018757600080fd5b9193909290916020810190356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b509092509050610363565b84600081905033600160a060020a031681600160a060020a031663075461726040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561023057600080fd5b505afa158015610244573d6000803e3d6000fd5b505050506040513d602081101561025a57600080fd5b5051600160a060020a0316146102bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806104e46022913960400191505060405180910390fd5b33600160a060020a031687600160a060020a03167ee7283fcf5726344ed567dc39b1822ff824bc90f96c137b622781d3570b81ef888888886040518080602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600083820152604051601f909101601f19169092018290039850909650505050505050a350505050505050565b84600081905033600160a060020a031681600160a060020a031663075461726040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156103af57600080fd5b505afa1580156103c3573d6000803e3d6000fd5b505050506040513d60208110156103d957600080fd5b5051600160a060020a03161461043a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806104e46022913960400191505060405180910390fd5b33600160a060020a031687600160a060020a03167fb8c028de5d50845d8e50bbc36728f4e9d523e16a1a431a299e8b216c7b2f5584888888886040518080602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600083820152604051601f909101601f19169092018290039850909650505050505050a35050505050505056fe4d657461646174613a20496e76616c69642044617461546f6b656e204d696e746572a165627a7a723058207a5eb572cfeb0cc4f5d7d0b881e5f9322cc352e56a1851de5e7d84d4c6ab12f20029", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100395760e060020a600035046382743814811461003e578063f89b1f3614610112575b600080fd5b6101106004803603606081101561005457600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561007f57600080fd5b82018360208201111561009157600080fd5b803590602001918460018302840111640100000000831117156100b357600080fd5b9193909290916020810190356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184600183028401116401000000008311171561010557600080fd5b5090925090506101e4565b005b6101106004803603606081101561012857600080fd5b600160a060020a03823516919081019060408101602082013564010000000081111561015357600080fd5b82018360208201111561016557600080fd5b8035906020019184600183028401116401000000008311171561018757600080fd5b9193909290916020810190356401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460018302840111640100000000831117156101d957600080fd5b509092509050610363565b84600081905033600160a060020a031681600160a060020a031663075461726040518163ffffffff1660e060020a02815260040160206040518083038186803b15801561023057600080fd5b505afa158015610244573d6000803e3d6000fd5b505050506040513d602081101561025a57600080fd5b5051600160a060020a0316146102bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806104e46022913960400191505060405180910390fd5b33600160a060020a031687600160a060020a03167ee7283fcf5726344ed567dc39b1822ff824bc90f96c137b622781d3570b81ef888888886040518080602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600083820152604051601f909101601f19169092018290039850909650505050505050a350505050505050565b84600081905033600160a060020a031681600160a060020a031663075461726040518163ffffffff1660e060020a02815260040160206040518083038186803b1580156103af57600080fd5b505afa1580156103c3573d6000803e3d6000fd5b505050506040513d60208110156103d957600080fd5b5051600160a060020a03161461043a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806104e46022913960400191505060405180910390fd5b33600160a060020a031687600160a060020a03167fb8c028de5d50845d8e50bbc36728f4e9d523e16a1a431a299e8b216c7b2f5584888888886040518080602001806020018381038352878782818152602001925080828437600083820152601f01601f191690910184810383528581526020019050858580828437600083820152604051601f909101601f19169092018290039850909650505050505050a35050505050505056fe4d657461646174613a20496e76616c69642044617461546f6b656e204d696e746572a165627a7a723058207a5eb572cfeb0cc4f5d7d0b881e5f9322cc352e56a1851de5e7d84d4c6ab12f20029", - "sourceMap": "520:1715:11:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;520:1715:11;;;;;;;", - "deployedSourceMap": "520:1715:11:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;520:1715:11;;;;;;-1:-1:-1;;;520:1715:11;;;;;;;;;;;;;;;;;1351:300;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;1351:300:11;;;;;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;1351:300:11;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1351:300:11;;;;;;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;1351:300:11;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;1351:300:11;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1351:300:11;;;;;;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;-1:-1;1351:300:11;;-1:-1:-1;1351:300:11;-1:-1:-1;1351:300:11;:::i;:::-;;1933;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;1933:300:11;;;;;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;1933:300:11;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1933:300:11;;;;;;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;1933:300:11;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;1933:300:11;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1933:300:11;;;;;;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;-1:-1;1933:300:11;;-1:-1:-1;1933:300:11;-1:-1:-1;1933:300:11;:::i;1351:::-;1505:9;896:20;934:9;896:48;;993:10;-1:-1:-1;;;;;975:28:11;:5;-1:-1:-1;;;;;975:12:11;;:14;;;;;-1:-1:-1;;;975:14:11;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;975:14:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;975:14:11;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;975:14:11;-1:-1:-1;;;;;975:28:11;;954:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1587:10;-1:-1:-1;;;;;1535:109:11;1564:9;-1:-1:-1;;;;;1535:109:11;;1611:5;;1630:4;;1535:109;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;;74:27;137:4;117:14;-1:-1;;113:30;157:16;;;1535:109:11;;;;;;;;;;;-1:-1:-1;1535:109:11;;;;;1:33:-1;99:1;81:16;;;74:27;1535:109:11;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;1535:109:11;;;;-1:-1:-1;1535:109:11;;-1:-1:-1;;;;;;;1535:109:11;1351:300;;;;;;;:::o;1933:::-;2087:9;896:20;934:9;896:48;;993:10;-1:-1:-1;;;;;975:28:11;:5;-1:-1:-1;;;;;975:12:11;;:14;;;;;-1:-1:-1;;;975:14:11;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;975:14:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;975:14:11;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;975:14:11;-1:-1:-1;;;;;975:28:11;;954:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2169:10;-1:-1:-1;;;;;2117:109:11;2146:9;-1:-1:-1;;;;;2117:109:11;;2193:5;;2212:4;;2117:109;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;;74:27;137:4;117:14;-1:-1;;113:30;157:16;;;2117:109:11;;;;;;;;;;;-1:-1:-1;2117:109:11;;;;;1:33:-1;99:1;81:16;;;74:27;2117:109:11;;137:4:-1;117:14;;;-1:-1;;113:30;157:16;;;2117:109:11;;;;-1:-1:-1;2117:109:11;;-1:-1:-1;;;;;;;2117:109:11;1933:300;;;;;;;:::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 '../interfaces/IERC20Template.sol';\n\n\n/**\n* @title Metadata\n* \n* @dev Metadata stands for Decentralized Document. It allows publishers\n* to publish their dataset metadata in decentralized way.\n* It follows the Ocean DID Document standard: \n* https://github.com/oceanprotocol/OEPs/blob/master/7/v0.2/README.md\n*/\ncontract Metadata {\n\n event MetadataCreated(\n address indexed dataToken,\n address indexed createdBy,\n bytes flags,\n bytes data\n );\n event MetadataUpdated(\n address indexed dataToken,\n address indexed updatedBy,\n bytes flags,\n bytes data\n );\n\n modifier onlyDataTokenMinter(address dataToken)\n {\n IERC20Template token = IERC20Template(dataToken);\n require(\n token.minter() == msg.sender,\n 'Metadata: Invalid DataToken Minter'\n );\n _;\n }\n\n /**\n * @dev create\n * creates/publishes new metadata/DDO document on-chain. \n * @param dataToken refers to data token address\n * @param flags special flags associated with metadata\n * @param data referes to the actual metadata\n */\n function create(\n address dataToken,\n bytes calldata flags,\n bytes calldata data\n ) \n external\n onlyDataTokenMinter(dataToken)\n {\n emit MetadataCreated(\n dataToken,\n msg.sender,\n flags,\n data\n );\n }\n\n /**\n * @dev update\n * allows only datatoken minter(s) to update the DDO/metadata content\n * @param dataToken refers to data token address\n * @param flags special flags associated with metadata\n * @param data referes to the actual metadata\n */\n function update(\n address dataToken,\n bytes calldata flags,\n bytes calldata data\n ) \n external\n onlyDataTokenMinter(dataToken)\n {\n emit MetadataUpdated(\n dataToken,\n msg.sender,\n flags,\n data\n );\n }\n}", - "sourcePath": "/ocean/ocean-contracts/contracts/metadata/Metadata.sol", - "ast": { - "absolutePath": "/ocean/ocean-contracts/contracts/metadata/Metadata.sol", - "exportedSymbols": { - "Metadata": [5158] - }, - "id": 5159, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 5072, - "literals": ["solidity", "0.5", ".7"], - "nodeType": "PragmaDirective", - "src": "0:22:11" - }, - { - "absolutePath": "/ocean/ocean-contracts/contracts/interfaces/IERC20Template.sol", - "file": "../interfaces/IERC20Template.sol", - "id": 5073, - "nodeType": "ImportDirective", - "scope": 5159, - "sourceUnit": 5071, - "src": "185:42:11", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": "@title Metadata\n \n@dev Metadata stands for Decentralized Document. It allows publishers\n to publish their dataset metadata in decentralized way.\n It follows the Ocean DID Document standard: \n https://github.com/oceanprotocol/OEPs/blob/master/7/v0.2/README.md", - "fullyImplemented": true, - "id": 5158, - "linearizedBaseContracts": [5158], - "name": "Metadata", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": null, - "id": 5083, - "name": "MetadataCreated", - "nodeType": "EventDefinition", - "parameters": { - "id": 5082, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5075, - "indexed": true, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5083, - "src": "576:25:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5074, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "576:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5077, - "indexed": true, - "name": "createdBy", - "nodeType": "VariableDeclaration", - "scope": 5083, - "src": "611:25:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5076, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "611:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5079, - "indexed": false, - "name": "flags", - "nodeType": "VariableDeclaration", - "scope": 5083, - "src": "646:11:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5078, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "646:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5081, - "indexed": false, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 5083, - "src": "667:10:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5080, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "667:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "566:117:11" - }, - "src": "545:139:11" - }, - { - "anonymous": false, - "documentation": null, - "id": 5093, - "name": "MetadataUpdated", - "nodeType": "EventDefinition", - "parameters": { - "id": 5092, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5085, - "indexed": true, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5093, - "src": "720:25:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5084, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "720:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5087, - "indexed": true, - "name": "updatedBy", - "nodeType": "VariableDeclaration", - "scope": 5093, - "src": "755:25:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5086, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "755:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5089, - "indexed": false, - "name": "flags", - "nodeType": "VariableDeclaration", - "scope": 5093, - "src": "790:11:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5088, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "790:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5091, - "indexed": false, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 5093, - "src": "811:10:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5090, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "811:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "710:117:11" - }, - "src": "689:139:11" - }, - { - "body": { - "id": 5114, - "nodeType": "Block", - "src": "886:195:11", - "statements": [ - { - "assignments": [5098], - "declarations": [ - { - "constant": false, - "id": 5098, - "name": "token", - "nodeType": "VariableDeclaration", - "scope": 5114, - "src": "896:20:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - }, - "typeName": { - "contractScope": null, - "id": 5097, - "name": "IERC20Template", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5070, - "src": "896:14:11", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 5102, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 5100, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5095, - "src": "934:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 5099, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "919:14:11", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 5101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "919:25:11", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "896:48:11" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 5109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "argumentTypes": null, - "id": 5104, - "name": "token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5098, - "src": "975:5:11", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 5105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "minter", - "nodeType": "MemberAccess", - "referencedDeclaration": 4993, - "src": "975:12:11", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_address_$", - "typeString": "function () view external returns (address)" - } - }, - "id": 5106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "975:14:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 5107, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "993:3:11", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 5108, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "993:10:11", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "975:28:11", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d657461646174613a20496e76616c69642044617461546f6b656e204d696e746572", - "id": 5110, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1017:36:11", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9ba73451bed8dd0d71b5cacc7e6cef9558d0637ee599c20ff1ce4f81329b3c5f", - "typeString": "literal_string \"Metadata: Invalid DataToken Minter\"" - }, - "value": "Metadata: Invalid DataToken Minter" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9ba73451bed8dd0d71b5cacc7e6cef9558d0637ee599c20ff1ce4f81329b3c5f", - "typeString": "literal_string \"Metadata: Invalid DataToken Minter\"" - } - ], - "id": 5103, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "954:7:11", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 5111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "954:109:11", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 5112, - "nodeType": "ExpressionStatement", - "src": "954:109:11" - }, - { - "id": 5113, - "nodeType": "PlaceholderStatement", - "src": "1073:1:11" - } - ] - }, - "documentation": null, - "id": 5115, - "name": "onlyDataTokenMinter", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 5096, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5095, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5115, - "src": "863:17:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5094, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "863:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "862:19:11" - }, - "src": "834:247:11", - "visibility": "internal" - }, - { - "body": { - "id": 5135, - "nodeType": "Block", - "src": "1520:131:11", - "statements": [ - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 5128, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5117, - "src": "1564:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 5129, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "1587:3:11", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 5130, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1587:10:11", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 5131, - "name": "flags", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5119, - "src": "1611:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - }, - { - "argumentTypes": null, - "id": 5132, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5121, - "src": "1630:4:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - }, - { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - ], - "id": 5127, - "name": "MetadataCreated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5083, - "src": "1535:15:11", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$__$", - "typeString": "function (address,address,bytes memory,bytes memory)" - } - }, - "id": 5133, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1535:109:11", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 5134, - "nodeType": "EmitStatement", - "src": "1530:114:11" - } - ] - }, - "documentation": "@dev create\n creates/publishes new metadata/DDO document on-chain. \n@param dataToken refers to data token address\n@param flags special flags associated with metadata\n@param data referes to the actual metadata", - "id": 5136, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 5124, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5117, - "src": "1505:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "id": 5125, - "modifierName": { - "argumentTypes": null, - "id": 5123, - "name": "onlyDataTokenMinter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5115, - "src": "1485:19:11", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_address_$", - "typeString": "modifier (address)" - } - }, - "nodeType": "ModifierInvocation", - "src": "1485:30:11" - } - ], - "name": "create", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 5122, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5117, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5136, - "src": "1376:17:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5116, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1376:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5119, - "name": "flags", - "nodeType": "VariableDeclaration", - "scope": 5136, - "src": "1403:20:11", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5118, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1403:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5121, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 5136, - "src": "1433:19:11", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5120, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1433:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1366:92:11" - }, - "returnParameters": { - "id": 5126, - "nodeType": "ParameterList", - "parameters": [], - "src": "1520:0:11" - }, - "scope": 5158, - "src": "1351:300:11", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 5156, - "nodeType": "Block", - "src": "2102:131:11", - "statements": [ - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 5149, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5138, - "src": "2146:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 5150, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "2169:3:11", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 5151, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2169:10:11", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 5152, - "name": "flags", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5140, - "src": "2193:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - }, - { - "argumentTypes": null, - "id": 5153, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5142, - "src": "2212:4:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - }, - { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - ], - "id": 5148, - "name": "MetadataUpdated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5093, - "src": "2117:15:11", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$__$", - "typeString": "function (address,address,bytes memory,bytes memory)" - } - }, - "id": 5154, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2117:109:11", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 5155, - "nodeType": "EmitStatement", - "src": "2112:114:11" - } - ] - }, - "documentation": "@dev update\n allows only datatoken minter(s) to update the DDO/metadata content\n@param dataToken refers to data token address\n@param flags special flags associated with metadata\n@param data referes to the actual metadata", - "id": 5157, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 5145, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5138, - "src": "2087:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "id": 5146, - "modifierName": { - "argumentTypes": null, - "id": 5144, - "name": "onlyDataTokenMinter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5115, - "src": "2067:19:11", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_address_$", - "typeString": "modifier (address)" - } - }, - "nodeType": "ModifierInvocation", - "src": "2067:30:11" - } - ], - "name": "update", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 5143, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5138, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5157, - "src": "1958:17:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5137, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1958:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5140, - "name": "flags", - "nodeType": "VariableDeclaration", - "scope": 5157, - "src": "1985:20:11", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5139, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1985:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5142, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 5157, - "src": "2015:19:11", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5141, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "2015:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1948:92:11" - }, - "returnParameters": { - "id": 5147, - "nodeType": "ParameterList", - "parameters": [], - "src": "2102:0:11" - }, - "scope": 5158, - "src": "1933:300:11", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - } - ], - "scope": 5159, - "src": "520:1715:11" - } - ], - "src": "0:2235:11" - }, - "legacyAST": { - "absolutePath": "/ocean/ocean-contracts/contracts/metadata/Metadata.sol", - "exportedSymbols": { - "Metadata": [5158] - }, - "id": 5159, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 5072, - "literals": ["solidity", "0.5", ".7"], - "nodeType": "PragmaDirective", - "src": "0:22:11" - }, - { - "absolutePath": "/ocean/ocean-contracts/contracts/interfaces/IERC20Template.sol", - "file": "../interfaces/IERC20Template.sol", - "id": 5073, - "nodeType": "ImportDirective", - "scope": 5159, - "sourceUnit": 5071, - "src": "185:42:11", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": "@title Metadata\n \n@dev Metadata stands for Decentralized Document. It allows publishers\n to publish their dataset metadata in decentralized way.\n It follows the Ocean DID Document standard: \n https://github.com/oceanprotocol/OEPs/blob/master/7/v0.2/README.md", - "fullyImplemented": true, - "id": 5158, - "linearizedBaseContracts": [5158], - "name": "Metadata", - "nodeType": "ContractDefinition", - "nodes": [ - { - "anonymous": false, - "documentation": null, - "id": 5083, - "name": "MetadataCreated", - "nodeType": "EventDefinition", - "parameters": { - "id": 5082, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5075, - "indexed": true, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5083, - "src": "576:25:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5074, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "576:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5077, - "indexed": true, - "name": "createdBy", - "nodeType": "VariableDeclaration", - "scope": 5083, - "src": "611:25:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5076, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "611:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5079, - "indexed": false, - "name": "flags", - "nodeType": "VariableDeclaration", - "scope": 5083, - "src": "646:11:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5078, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "646:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5081, - "indexed": false, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 5083, - "src": "667:10:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5080, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "667:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "566:117:11" - }, - "src": "545:139:11" - }, - { - "anonymous": false, - "documentation": null, - "id": 5093, - "name": "MetadataUpdated", - "nodeType": "EventDefinition", - "parameters": { - "id": 5092, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5085, - "indexed": true, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5093, - "src": "720:25:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5084, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "720:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5087, - "indexed": true, - "name": "updatedBy", - "nodeType": "VariableDeclaration", - "scope": 5093, - "src": "755:25:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5086, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "755:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5089, - "indexed": false, - "name": "flags", - "nodeType": "VariableDeclaration", - "scope": 5093, - "src": "790:11:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5088, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "790:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5091, - "indexed": false, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 5093, - "src": "811:10:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5090, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "811:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "710:117:11" - }, - "src": "689:139:11" - }, - { - "body": { - "id": 5114, - "nodeType": "Block", - "src": "886:195:11", - "statements": [ - { - "assignments": [5098], - "declarations": [ - { - "constant": false, - "id": 5098, - "name": "token", - "nodeType": "VariableDeclaration", - "scope": 5114, - "src": "896:20:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - }, - "typeName": { - "contractScope": null, - "id": 5097, - "name": "IERC20Template", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 5070, - "src": "896:14:11", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 5102, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 5100, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5095, - "src": "934:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 5099, - "name": "IERC20Template", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5070, - "src": "919:14:11", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20Template_$5070_$", - "typeString": "type(contract IERC20Template)" - } - }, - "id": 5101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "919:25:11", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "896:48:11" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 5109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "argumentTypes": null, - "id": 5104, - "name": "token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5098, - "src": "975:5:11", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20Template_$5070", - "typeString": "contract IERC20Template" - } - }, - "id": 5105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "minter", - "nodeType": "MemberAccess", - "referencedDeclaration": 4993, - "src": "975:12:11", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_address_$", - "typeString": "function () view external returns (address)" - } - }, - "id": 5106, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "975:14:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 5107, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "993:3:11", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 5108, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "993:10:11", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "975:28:11", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d657461646174613a20496e76616c69642044617461546f6b656e204d696e746572", - "id": 5110, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1017:36:11", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9ba73451bed8dd0d71b5cacc7e6cef9558d0637ee599c20ff1ce4f81329b3c5f", - "typeString": "literal_string \"Metadata: Invalid DataToken Minter\"" - }, - "value": "Metadata: Invalid DataToken Minter" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9ba73451bed8dd0d71b5cacc7e6cef9558d0637ee599c20ff1ce4f81329b3c5f", - "typeString": "literal_string \"Metadata: Invalid DataToken Minter\"" - } - ], - "id": 5103, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [6536, 6537], - "referencedDeclaration": 6537, - "src": "954:7:11", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 5111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "954:109:11", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 5112, - "nodeType": "ExpressionStatement", - "src": "954:109:11" - }, - { - "id": 5113, - "nodeType": "PlaceholderStatement", - "src": "1073:1:11" - } - ] - }, - "documentation": null, - "id": 5115, - "name": "onlyDataTokenMinter", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 5096, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5095, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5115, - "src": "863:17:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5094, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "863:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "862:19:11" - }, - "src": "834:247:11", - "visibility": "internal" - }, - { - "body": { - "id": 5135, - "nodeType": "Block", - "src": "1520:131:11", - "statements": [ - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 5128, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5117, - "src": "1564:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 5129, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "1587:3:11", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 5130, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1587:10:11", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 5131, - "name": "flags", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5119, - "src": "1611:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - }, - { - "argumentTypes": null, - "id": 5132, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5121, - "src": "1630:4:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - }, - { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - ], - "id": 5127, - "name": "MetadataCreated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5083, - "src": "1535:15:11", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$__$", - "typeString": "function (address,address,bytes memory,bytes memory)" - } - }, - "id": 5133, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1535:109:11", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 5134, - "nodeType": "EmitStatement", - "src": "1530:114:11" - } - ] - }, - "documentation": "@dev create\n creates/publishes new metadata/DDO document on-chain. \n@param dataToken refers to data token address\n@param flags special flags associated with metadata\n@param data referes to the actual metadata", - "id": 5136, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 5124, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5117, - "src": "1505:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "id": 5125, - "modifierName": { - "argumentTypes": null, - "id": 5123, - "name": "onlyDataTokenMinter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5115, - "src": "1485:19:11", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_address_$", - "typeString": "modifier (address)" - } - }, - "nodeType": "ModifierInvocation", - "src": "1485:30:11" - } - ], - "name": "create", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 5122, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5117, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5136, - "src": "1376:17:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5116, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1376:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5119, - "name": "flags", - "nodeType": "VariableDeclaration", - "scope": 5136, - "src": "1403:20:11", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5118, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1403:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5121, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 5136, - "src": "1433:19:11", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5120, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1433:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1366:92:11" - }, - "returnParameters": { - "id": 5126, - "nodeType": "ParameterList", - "parameters": [], - "src": "1520:0:11" - }, - "scope": 5158, - "src": "1351:300:11", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - }, - { - "body": { - "id": 5156, - "nodeType": "Block", - "src": "2102:131:11", - "statements": [ - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 5149, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5138, - "src": "2146:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 5150, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 6533, - "src": "2169:3:11", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 5151, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2169:10:11", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 5152, - "name": "flags", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5140, - "src": "2193:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - }, - { - "argumentTypes": null, - "id": 5153, - "name": "data", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5142, - "src": "2212:4:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - }, - { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes calldata" - } - ], - "id": 5148, - "name": "MetadataUpdated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5093, - "src": "2117:15:11", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$__$", - "typeString": "function (address,address,bytes memory,bytes memory)" - } - }, - "id": 5154, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2117:109:11", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 5155, - "nodeType": "EmitStatement", - "src": "2112:114:11" - } - ] - }, - "documentation": "@dev update\n allows only datatoken minter(s) to update the DDO/metadata content\n@param dataToken refers to data token address\n@param flags special flags associated with metadata\n@param data referes to the actual metadata", - "id": 5157, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": [ - { - "argumentTypes": null, - "id": 5145, - "name": "dataToken", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5138, - "src": "2087:9:11", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "id": 5146, - "modifierName": { - "argumentTypes": null, - "id": 5144, - "name": "onlyDataTokenMinter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5115, - "src": "2067:19:11", - "typeDescriptions": { - "typeIdentifier": "t_modifier$_t_address_$", - "typeString": "modifier (address)" - } - }, - "nodeType": "ModifierInvocation", - "src": "2067:30:11" - } - ], - "name": "update", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 5143, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 5138, - "name": "dataToken", - "nodeType": "VariableDeclaration", - "scope": 5157, - "src": "1958:17:11", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 5137, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1958:7:11", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5140, - "name": "flags", - "nodeType": "VariableDeclaration", - "scope": 5157, - "src": "1985:20:11", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5139, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "1985:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 5142, - "name": "data", - "nodeType": "VariableDeclaration", - "scope": 5157, - "src": "2015:19:11", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_bytes_calldata_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 5141, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "2015:5:11", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1948:92:11" - }, - "returnParameters": { - "id": 5147, - "nodeType": "ParameterList", - "parameters": [], - "src": "2102:0:11" - }, - "scope": 5158, - "src": "1933:300:11", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "external" - } - ], - "scope": 5159, - "src": "520:1715:11" - } - ], - "src": "0:2235:11" - }, - "compiler": { - "name": "solc", - "version": "0.5.7+commit.6da8b019.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "3.2.4", - "updatedAt": "2021-02-18T06:54:49.624Z", - "devdoc": { - "details": "Metadata stands for Decentralized Document. It allows publishers to publish their dataset metadata in decentralized way. It follows the Ocean DID Document standard: https://github.com/oceanprotocol/OEPs/blob/master/7/v0.2/README.md", - "methods": { - "create(address,bytes,bytes)": { - "details": "create creates/publishes new metadata/DDO document on-chain. ", - "params": { - "data": "referes to the actual metadata", - "dataToken": "refers to data token address", - "flags": "special flags associated with metadata" - } - }, - "update(address,bytes,bytes)": { - "details": "update allows only datatoken minter(s) to update the DDO/metadata content", - "params": { - "data": "referes to the actual metadata", - "dataToken": "refers to data token address", - "flags": "special flags associated with metadata" - } - } - }, - "title": "Metadata " - }, - "userdoc": { - "methods": {} - } -} diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 0dca88e..65eae88 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -17,7 +17,7 @@ services: postgres_pass: let-me-in postgres_db: graph-node ipfs: 'ipfs:5001' - ethereum: 'rinkeby:https://rinkeby.infura.io/v3/${INFURA_PROJECT_ID}' + ethereum: 'barge:http://172.15.0.3:8545' RUST_LOG: info ipfs: image: ipfs/go-ipfs:v0.4.23 diff --git a/package-lock.json b/package-lock.json index 32246d2..15e225c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "auto-changelog": "^2.3.0", "chai": "^4.3.4", "chai-spies": "^1.0.0", - "eslint": "^8.0.1", + "eslint": "^7.32.0", "eslint-config-oceanprotocol": "^1.5.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.24.2", @@ -1284,14 +1284,14 @@ "deprecated": "Please use @ensdomains/ens-contracts" }, "node_modules/@eslint/eslintrc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.3.tgz", - "integrity": "sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.0.0", + "debug": "^4.1.1", + "espree": "^7.3.0", "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", @@ -1300,7 +1300,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/@ethereum-navigator/atlas": { @@ -3704,9 +3704,9 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", - "integrity": "sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.0", @@ -11104,6 +11104,15 @@ "node": ">=0.10.0" } }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/async": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", @@ -15101,36 +15110,37 @@ } }, "node_modules/eslint": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.0.1.tgz", - "integrity": "sha512-LsgcwZgQ72vZ+SMp4K6pAnk2yFDWL7Ti4pJaRvsZ0Hsw2h8ZjUIW38a9AFn2cZXdBMlScMFYYgsSp4ttFI/0bA==", + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.0.3", - "@humanwhocodes/config-array": "^0.6.0", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.3.2", + "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^6.0.0", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.0.0", - "espree": "^9.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", + "glob-parent": "^5.1.2", "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -15138,10 +15148,11 @@ "natural-compare": "^1.4.0", "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^3.2.0", + "regexpp": "^3.1.0", "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -15149,7 +15160,7 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^10.12.0 || >=12.0.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -16365,12 +16376,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -16387,71 +16392,28 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz", - "integrity": "sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA==", + "node_modules/eslint/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" + "eslint-visitor-keys": "^1.1.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", - "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" + "node": ">=6" }, - "engines": { - "node": ">=10.13.0" + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/eslint/node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "node": ">=4" } }, "node_modules/eslint/node_modules/strip-ansi": { @@ -16467,38 +16429,26 @@ } }, "node_modules/espree": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.0.0.tgz", - "integrity": "sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, "dependencies": { - "acorn": "^8.5.0", + "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.0.0" + "eslint-visitor-keys": "^1.3.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/espree/node_modules/acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", - "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=4" } }, "node_modules/esprima": { @@ -19459,9 +19409,9 @@ } }, "node_modules/globals": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", - "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -24108,6 +24058,12 @@ "integrity": "sha1-j/TexTLYJIavWVc8OURZFOlEp/E=", "dev": true }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, "node_modules/lodash.uppercase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.uppercase/-/lodash.uppercase-4.3.0.tgz", @@ -30754,6 +30710,32 @@ "node": ">=8" } }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/snake-case": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz", @@ -32074,6 +32056,104 @@ "node": ">=8" } }, + "node_modules/table": { + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.2.tgz", + "integrity": "sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==", + "dev": true, + "dependencies": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/table/node_modules/ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/table/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/table/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/table/node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/table/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/table/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/taffydb": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.7.3.tgz", @@ -37922,14 +38002,14 @@ "integrity": "sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA==" }, "@eslint/eslintrc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.3.tgz", - "integrity": "sha512-DHI1wDPoKCBPoLZA3qDR91+3te/wDSc1YhKg3jR8NxKKRJq2hwHwcWv31cSwSYvIBrmbENoYMWcenW8uproQqg==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, "requires": { "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.0.0", + "debug": "^4.1.1", + "espree": "^7.3.0", "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", @@ -39899,9 +39979,9 @@ } }, "@humanwhocodes/config-array": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", - "integrity": "sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.0", @@ -46185,6 +46265,12 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "optional": true }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, "async": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", @@ -49496,36 +49582,37 @@ } }, "eslint": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.0.1.tgz", - "integrity": "sha512-LsgcwZgQ72vZ+SMp4K6pAnk2yFDWL7Ti4pJaRvsZ0Hsw2h8ZjUIW38a9AFn2cZXdBMlScMFYYgsSp4ttFI/0bA==", + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.0.3", - "@humanwhocodes/config-array": "^0.6.0", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.3.2", + "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^6.0.0", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.0.0", - "espree": "^9.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", + "glob-parent": "^5.1.2", "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -49533,10 +49620,11 @@ "natural-compare": "^1.4.0", "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^3.2.0", + "regexpp": "^3.1.0", "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -49547,12 +49635,6 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -49563,53 +49645,21 @@ "supports-color": "^7.1.0" } }, - "eslint-scope": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz", - "integrity": "sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA==", + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "eslint-visitor-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", - "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", - "dev": true - }, - "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", - "dev": true - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, "strip-ansi": { @@ -50520,26 +50570,20 @@ "dev": true }, "espree": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.0.0.tgz", - "integrity": "sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, "requires": { - "acorn": "^8.5.0", + "acorn": "^7.4.0", "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.0.0" + "eslint-visitor-keys": "^1.3.0" }, "dependencies": { - "acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", - "dev": true - }, "eslint-visitor-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz", - "integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true } } @@ -52937,9 +52981,9 @@ } }, "globals": { - "version": "13.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", - "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.0.tgz", + "integrity": "sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -56721,6 +56765,12 @@ "integrity": "sha1-j/TexTLYJIavWVc8OURZFOlEp/E=", "dev": true }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, "lodash.uppercase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.uppercase/-/lodash.uppercase-4.3.0.tgz", @@ -62144,6 +62194,25 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "devOptional": true }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + } + } + }, "snake-case": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz", @@ -63229,6 +63298,84 @@ "node-fetch": "^2.6.1" } }, + "table": { + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.2.tgz", + "integrity": "sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } + } + }, "taffydb": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.7.3.tgz", diff --git a/schema.graphql b/schema.graphql index 6e2f214..135d875 100644 --- a/schema.graphql +++ b/schema.graphql @@ -7,11 +7,9 @@ type Token @entity { cap: BigDecimal # supply: BigDecimal # isDatatoken: Boolean! # - - factory: DatatokenFactory # owner: String # address of ERC721 that owns the token, valid only for datatokens - minter: [String] # array of addresses with minter role, can be user wallet address, dispenser etc. + minter: [User!] # array of addresses with minter role, can be user wallet address, dispenser etc. feeManager: String # TODO: maybe we change name , depends on audit results . It's the address that collects the payments (NOT fees) publishMarketFeeAddress: String # address of the market where the datatoken was created. This address collects market fees. publishMarketFeeToken: String # adreess of fee token (can be Ocean, ETH, etc.) @@ -26,53 +24,35 @@ type Token @entity { block: Int # Block number when it was created } -type TokenValue { +type TokenValuePair @entity { + id : ID! token : Token! value : BigDecimal! } -type NftToken @entity{ - id: ID! # +type Nft @entity{ + id: ID! # nft address symbol: String! # name: String! # - address: String! tokenUri: String! # - owner: String! - + owner: String! # owner of the nft + address: String! # providerUrl: String # provider url that can decrypt the ddo assetState: Int! # state of the asset (described in docs) - managerRole: [String] - erc20DeployerRole: [String] - storeUpdateRole: [String] - metadataRole: [String] # addresses that can update the metadata -} + managerRole: [String!] + erc20DeployerRole: [String!] + storeUpdateRole: [String!] + metadataRole: [String!] # addresses that can update the metadata -#TODO: do we need factories in general? We can move statistics on global object, check if we use them in a way -type PoolFactory @entity { - id: ID! - totalValueLocked: [TokenValue] # total value locked represented in the base token - totalLiquidity: [TokenValue] # total liquidity for each base token - totalSwapVolume: [TokenValue] # total swap volume for each base token - totalSwapFee: [TokenValue] # All the swap fee in Ocean - - poolCount: Int! # Number of pools - finalizedPoolCount: Int! # Number of finalized pools - orderCount: BigInt # Number of total consumes - totalOrderVolume: BigDecimal # probably remove due to inconsistencies and imposibility to calculate - - pools: [Pool!] @derivedFrom(field: "factoryID") -} - -type DatatokenFactory @entity { - id: ID! - tokenCount: Int! # Number of datatokens - datatokens: [Tokens!] @derivedFrom(field: "factory") + template: String! # template address + createTime: Int! # Block time pool was created + tx: Bytes # Pool creation transaction id + block: Int # Block number when it was created } type Pool @entity { id: ID! # Pool address - poolFactory: PoolFactory! # Pool factory owner: String! # Owner address, pool controller isPublicSwap: Boolean! # if swap/trade is activated, probably always true @@ -86,16 +66,16 @@ type Pool @entity { poolFee: BigDecimal! # Pool Fee percent, fee goes to all liquidity providers : SWAP, JOIN , EXIT opfFee: BigDecimal! # OPF Fee percent, fee that goes to Ocean Protocol Foundation : SWAP marketFee: BigDecimal! # Market fee percent, fee that goes to the market where the pool was created : SWAP - totalPoolFee: [TokenValue!]! # actual value of fee collected in both tokens - totalOpfFee: [TokenValue!]! # actual value of fee collected in both tokens - totalMarketFee: [TokenValue!]! # actual value of fee collected in both tokens + totalPoolFee: [TokenValuePair!]! # actual value of fee collected in both tokens + totalOpfFee: [TokenValuePair!]! # actual value of fee collected in both tokens + totalMarketFee: [TokenValuePair!]! # actual value of fee collected in both tokens - currentOpfFee: [TokenValue!]! # fee after collection totalFee - colectedFee - currentMarketFee: [TokenValue!]! # fee after collection totalFee - colectedFee + currentOpfFee: [TokenValuePair!]! # fee after collection totalFee - colectedFee + currentMarketFee: [TokenValuePair!]! # fee after collection totalFee - colectedFee totalWeight: BigDecimal! # it's always 100 totalShares: BigDecimal! # Total pool token shares - totalSwapVolume: [TokenValue!]! # total tokens that were swaped + totalSwapVolume: [TokenValuePair!]! # total tokens that were swaped spotPrice: BigDecimal! # spot price @@ -109,8 +89,8 @@ type Pool @entity { block: Int # Block number when it was created # split in basetokne and datatoken like in fre - tokens: [PoolToken!] @derivedFrom(field: "poolId") - shares: [PoolShare!] @derivedFrom(field: "poolId") + tokens: [PoolToken!] @derivedFrom(field: "pool") + shares: [PoolShare!] @derivedFrom(field: "pool") transactions: [PoolTransaction!] @derivedFrom(field: "pool") } @@ -152,7 +132,7 @@ type PoolTransaction @entity { gasPrice: BigDecimal! # change to baseToken and dataToken - tokens: [TokenValue!] # tokens transfered , if value is negative it means it was removed. + tokens: [TokenValuePair!] # tokens transfered , if value is negative it means it was removed. } type Order @entity { # renamed from TokenOrder to Order @@ -196,7 +176,7 @@ type TokenTransaction @entity { type User @entity { id: ID! sharesOwned: [PoolShare!] @derivedFrom(field: "user") - tokenBalancesOwned: [TokenValue!] + tokenBalancesOwned: [TokenValuePair!] tokensOwned: [Token!] @derivedFrom(field: "minter") poolTransactions: [PoolTransaction!] @derivedFrom(field: "user") orders: [Order!] @derivedFrom(field: "payer") @@ -205,7 +185,7 @@ type User @entity { type FixedRateExchange @entity { id: ID! # fixed rate exchange id - exchangeOwner: User! + owner: User! datatoken: Token! baseToken: Token! price: BigDecimal! @@ -263,7 +243,7 @@ type Dispenser @entity { maxBalance: BigDecimal! # max balance of requester. If the balance is higher, the dispense is rejected balance: BigDecimal! # how many tokens are left - dispenses: [DispenserTransaction!] @derivedFrom(field: "dispenserId") + dispenses: [DispenserTransaction!] @derivedFrom(field: "dispenser") } type DispenserTransaction @entity { @@ -300,20 +280,21 @@ type PoolSnapshotTokenValue @entity { type Global @entity { id: ID! - totalValueLocked: [TokenValuePair] # total value locked represented in the base token , basically 2x liqudity for each base token - totalLiquidity: [TokenValuePair] # total liquidity for each base token - totalSwapVolume: [TokenValuePair] # total swap volume for each base token. pools and fre + totalValueLocked: [TokenValuePair!] # total value locked represented in the base token , basically 2x liqudity for each base token + totalLiquidity: [TokenValuePair!] # total liquidity for each base token + totalSwapVolume: [TokenValuePair!] # total swap volume for each base token. pools and fre orderCount: BigInt # Number of total consumes, pools + fre poolCount: Int! # Number of pools for all factories finalizedPoolCount: Int! # Number of finalized pools for all factories + totalOrderVolume: BigDecimal # probably remove due to inconsistencies and imposibility to calculate } type MetadataUpdate @entity { id: ID! # update tx + datatokenAddress - datatokenId: Datatoken! + datatoken: Token! datatokenAddress: String! userAddress: String! diff --git a/scripts/generatebargesubgraph.js b/scripts/generatebargesubgraph.js index 7452074..27d4644 100644 --- a/scripts/generatebargesubgraph.js +++ b/scripts/generatebargesubgraph.js @@ -4,46 +4,25 @@ var fs = require('fs') async function replaceContractAddresses() { // load barge addresses first try { - const data = JSON.parse(fs.readFileSync(process.env.ADDRESS_FILE, 'utf8')) + const data = JSON.parse( + fs.readFileSync( + '/home/mihai/.ocean/ocean-contracts/artifacts/address.json', + 'utf8' + ) + ) const { DTFactory, // eslint-disable-next-line no-unused-vars - BFactory, - // eslint-disable-next-line no-unused-vars - FixedRateExchange, - // eslint-disable-next-line no-unused-vars - Metadata, - // eslint-disable-next-line no-unused-vars - Dispenser + ERC721Factory } = data.development let subgraph = fs.readFileSync('subgraph.yaml', 'utf8') if (!data) { return false } - // BFactory + // ERC721Factory subgraph = subgraph.replace( - /0xbe0083053744ECb871510C88dC0f6b77Da162706/g, - BFactory - ) - // dt factory - subgraph = subgraph.replace( - /0x57317f97E9EA49eBd19f7c9bB7c180b8cDcbDeB9/g, - DTFactory - ) - // metadata - subgraph = subgraph.replace( - /0x1a4b70d8c9DcA47cD6D0Fb3c52BB8634CA1C0Fdf/g, - Metadata - ) - // fixed rate exchgage - subgraph = subgraph.replace( - /0x608d05214E42722B94a54cF6114d4840FCfF84e1/g, - FixedRateExchange - ) - // dispenser - subgraph = subgraph.replace( - /0xDEfD0018969cd2d4E648209F876ADe184815f038/g, - Dispenser + /0x17d55A3501999FFBF9b0623cDB258611419d01F5/g, + ERC721Factory ) // network subgraph = subgraph.replace(/network: mainnet/g, 'network: barge') diff --git a/src/helpers.ts b/src/helpers.ts index dd0d2e2..22011b3 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -1,31 +1,4 @@ -import { - BigDecimal, - BigInt, - Bytes, - dataSource, - Address, - ethereum, - log -} from '@graphprotocol/graph-ts' - -import { - Pool as PoolEntity, - User, - PoolToken, - PoolShare, - PoolTransaction, - PoolFactory, - Datatoken, - TokenBalance, - TokenTransaction, - PoolTransactionTokenValues, - Global -} from './@types/schema' - -import { Pool } from './@types/templates/Pool/Pool' -import { ERC20 } from './@types/templates/Pool/ERC20' -import { ERC20SymbolBytes } from './@types/templates/Pool/ERC20SymbolBytes' -import { ERC20NameBytes } from './@types/templates/Pool/ERC20NameBytes' +import { BigDecimal, BigInt, dataSource } from '@graphprotocol/graph-ts' export const ZERO_BD = BigDecimal.fromString('0.0') export const MINUS_1_BD = BigDecimal.fromString('-1.0') @@ -62,36 +35,36 @@ export function getOceanAddress(): string { export const OCEAN: string = getOceanAddress() -export function getGlobalStats(): Global { - let gStats: Global | null = Global.load('1') - if (gStats == null) { - gStats = new Global('1') - gStats.totalOceanLiquidity = ZERO_BD - gStats.totalSwapVolume = ZERO_BD - gStats.totalValueLocked = ZERO_BD - gStats.totalOrderVolume = ZERO_BD - gStats.orderCount = BigInt.fromI32(0) - gStats.poolCount = 0 - } +// export function getGlobalStats(): Global { +// let gStats: Global | null = Global.load('1') +// if (gStats == null) { +// gStats = new Global('1') +// gStats.totalOceanLiquidity = ZERO_BD +// gStats.totalSwapVolume = ZERO_BD +// gStats.totalValueLocked = ZERO_BD +// gStats.totalOrderVolume = ZERO_BD +// gStats.orderCount = BigInt.fromI32(0) +// gStats.poolCount = 0 +// } - return gStats -} +// return gStats +// } -export function hexToDecimal(hexString: string, decimals: i32): BigDecimal { - const bytes = Bytes.fromHexString(hexString.toString()).reverse() as Bytes - const bi = BigInt.fromUnsignedBytes(bytes) - const scale = BigInt.fromI32(10) - .pow(decimals as u8) - .toBigDecimal() - return bi.divDecimal(scale) -} +// export function hexToDecimal(hexString: string, decimals: i32): BigDecimal { +// const bytes = Bytes.fromHexString(hexString.toString()).reverse() as Bytes +// const bi = BigInt.fromUnsignedBytes(bytes) +// const scale = BigInt.fromI32(10) +// .pow(decimals as u8) +// .toBigDecimal() +// return bi.divDecimal(scale) +// } -export function bigIntToDecimal(amount: BigInt, decimals: i32): BigDecimal { - const scale = BigInt.fromI32(10) - .pow(decimals as u8) - .toBigDecimal() - return amount.toBigDecimal().div(scale) -} +// export function bigIntToDecimal(amount: BigInt, decimals: i32): BigDecimal { +// const scale = BigInt.fromI32(10) +// .pow(decimals as u8) +// .toBigDecimal() +// return amount.toBigDecimal().div(scale) +// } export function tokenToDecimal(amount: BigDecimal, decimals: i32): BigDecimal { const scale = BigInt.fromI32(10) @@ -100,379 +73,379 @@ export function tokenToDecimal(amount: BigDecimal, decimals: i32): BigDecimal { return amount.div(scale) } -export function decimalToBigInt(value: BigDecimal): BigInt { - value.truncate(18) - const scale = BigInt.fromI32(10).pow((value.exp.toI32() + 18) as u8) - return value.digits.times(scale) -} +// export function decimalToBigInt(value: BigDecimal): BigInt { +// value.truncate(18) +// const scale = BigInt.fromI32(10).pow((value.exp.toI32() + 18) as u8) +// return value.digits.times(scale) +// } -export function isNullEthValue(value: string): boolean { - return ( - value == - '0x0000000000000000000000000000000000000000000000000000000000000001' - ) -} +// export function isNullEthValue(value: string): boolean { +// return ( +// value == +// '0x0000000000000000000000000000000000000000000000000000000000000001' +// ) +// } -export function getTokenSymbol(tokenAddress: Address): string { - const contract = ERC20.bind(tokenAddress) - const contractSymbolBytes = ERC20SymbolBytes.bind(tokenAddress) +// export function getTokenSymbol(tokenAddress: Address): string { +// const contract = ERC20.bind(tokenAddress) +// const contractSymbolBytes = ERC20SymbolBytes.bind(tokenAddress) - // try types string and bytes32 for symbol - let symbolValue = 'unknown' - const symbolResult = contract.try_symbol() - if (symbolResult.reverted) { - const symbolResultBytes = contractSymbolBytes.try_symbol() - if (!symbolResultBytes.reverted) { - // for broken pairs that have no symbol function exposed - if (!isNullEthValue(symbolResultBytes.value.toHexString())) { - symbolValue = symbolResultBytes.value.toString() - } - } - } else { - symbolValue = symbolResult.value - } +// // try types string and bytes32 for symbol +// let symbolValue = 'unknown' +// const symbolResult = contract.try_symbol() +// if (symbolResult.reverted) { +// const symbolResultBytes = contractSymbolBytes.try_symbol() +// if (!symbolResultBytes.reverted) { +// // for broken pairs that have no symbol function exposed +// if (!isNullEthValue(symbolResultBytes.value.toHexString())) { +// symbolValue = symbolResultBytes.value.toString() +// } +// } +// } else { +// symbolValue = symbolResult.value +// } - return symbolValue -} +// return symbolValue +// } -export function getTokenName(tokenAddress: Address): string { - const contract = ERC20.bind(tokenAddress) - const contractNameBytes = ERC20NameBytes.bind(tokenAddress) +// export function getTokenName(tokenAddress: Address): string { +// const contract = ERC20.bind(tokenAddress) +// const contractNameBytes = ERC20NameBytes.bind(tokenAddress) - // try types string and bytes32 for name - let nameValue = 'unknown' - const nameResult = contract.try_name() - if (nameResult.reverted) { - const nameResultBytes = contractNameBytes.try_name() - if (!nameResultBytes.reverted) { - // for broken exchanges that have no name function exposed - if (!isNullEthValue(nameResultBytes.value.toHexString())) { - nameValue = nameResultBytes.value.toString() - } - } - } else { - nameValue = nameResult.value - } +// // try types string and bytes32 for name +// let nameValue = 'unknown' +// const nameResult = contract.try_name() +// if (nameResult.reverted) { +// const nameResultBytes = contractNameBytes.try_name() +// if (!nameResultBytes.reverted) { +// // for broken exchanges that have no name function exposed +// if (!isNullEthValue(nameResultBytes.value.toHexString())) { +// nameValue = nameResultBytes.value.toString() +// } +// } +// } else { +// nameValue = nameResult.value +// } - return nameValue -} +// return nameValue +// } -export function getTokenDecimals(tokenAddress: Address): i32 { - const contract = ERC20.bind(tokenAddress) - let decimals = 18 - const decimalCall = contract.try_decimals() - if (!decimalCall.reverted) { - decimals = decimalCall.value - } - return decimals -} +// export function getTokenDecimals(tokenAddress: Address): i32 { +// const contract = ERC20.bind(tokenAddress) +// let decimals = 18 +// const decimalCall = contract.try_decimals() +// if (!decimalCall.reverted) { +// decimals = decimalCall.value +// } +// return decimals +// } -export function updatePoolTokenBalance( - poolToken: PoolToken, - balance: BigDecimal, - source: string -): void { - if (!poolToken) return - if (balance < ZERO_BD || poolToken.balance < ZERO_BD) { - poolToken.balance = balance - } -} +// export function updatePoolTokenBalance( +// poolToken: PoolToken, +// balance: BigDecimal, +// source: string +// ): void { +// if (!poolToken) return +// if (balance < ZERO_BD || poolToken.balance < ZERO_BD) { +// poolToken.balance = balance +// } +// } -export function createUserEntity(address: string): void { - if (User.load(address) == null) { - const user = new User(address) - user.nrSales = 0 - user.save() - } -} +// export function createUserEntity(address: string): void { +// if (User.load(address) == null) { +// const user = new User(address) +// user.nrSales = 0 +// user.save() +// } +// } -export function createPoolShareEntity( - id: string, - pool: string, - user: string -): void { - const poolShare = new PoolShare(id) +// export function createPoolShareEntity( +// id: string, +// pool: string, +// user: string +// ): void { +// const poolShare = new PoolShare(id) - createUserEntity(user) +// createUserEntity(user) - poolShare.userAddress = user - poolShare.poolId = pool - poolShare.balance = ZERO_BD - poolShare.save() -} +// poolShare.userAddress = user +// poolShare.poolId = pool +// poolShare.balance = ZERO_BD +// poolShare.save() +// } -export function createPoolTokenEntity( - id: string, - pool: string, - address: Address -): void { - const datatoken = Datatoken.load(address.toHexString()) +// export function createPoolTokenEntity( +// id: string, +// pool: string, +// address: Address +// ): void { +// const datatoken = Datatoken.load(address.toHexString()) - const poolToken = new PoolToken(id) - poolToken.poolId = pool - poolToken.isDatatoken = !!datatoken - poolToken.tokenId = datatoken ? datatoken.id : '' - poolToken.address = address.toHexString() - poolToken.balance = ZERO_BD - poolToken.denormWeight = ZERO_BD - poolToken.symbol = getTokenSymbol(address) - poolToken.name = getTokenName(address) - poolToken.decimals = getTokenDecimals(address) - poolToken.save() -} +// const poolToken = new PoolToken(id) +// poolToken.poolId = pool +// poolToken.isDatatoken = !!datatoken +// poolToken.tokenId = datatoken ? datatoken.id : '' +// poolToken.address = address.toHexString() +// poolToken.balance = ZERO_BD +// poolToken.denormWeight = ZERO_BD +// poolToken.symbol = getTokenSymbol(address) +// poolToken.name = getTokenName(address) +// poolToken.decimals = getTokenDecimals(address) +// poolToken.save() +// } -export function updatePoolTransactionToken( - poolTx: string, - poolTokenId: string, - amount: BigDecimal, - balance: BigDecimal, - feeValue: BigDecimal -): void { - const ptx = PoolTransaction.load(poolTx) - const poolToken = PoolToken.load(poolTokenId) +// export function updatePoolTransactionToken( +// poolTx: string, +// poolTokenId: string, +// amount: BigDecimal, +// balance: BigDecimal, +// feeValue: BigDecimal +// ): void { +// const ptx = PoolTransaction.load(poolTx) +// const poolToken = PoolToken.load(poolTokenId) - if (!ptx) { - log.error('Cannot load PoolTransaction {}', [poolTx]) - return - } +// if (!ptx) { +// log.error('Cannot load PoolTransaction {}', [poolTx]) +// return +// } - if (!poolToken) { - log.error('Cannot load PoolToken {}', [poolTokenId]) - return - } - const pool = PoolEntity.load(poolToken.poolId) - if (!pool) { - log.error('Cannot load PoolEntity {}', [poolToken.poolId]) - return - } - const ptxTokenValuesId = poolTx.concat('-').concat(poolTokenId) - let ptxTokenValues = PoolTransactionTokenValues.load(ptxTokenValuesId) - if (ptxTokenValues == null) { - ptxTokenValues = new PoolTransactionTokenValues(ptxTokenValuesId) - log.warning('created PoolTransactionTokenValues for {}', [ptxTokenValuesId]) - } +// if (!poolToken) { +// log.error('Cannot load PoolToken {}', [poolTokenId]) +// return +// } +// const pool = PoolEntity.load(poolToken.poolId) +// if (!pool) { +// log.error('Cannot load PoolEntity {}', [poolToken.poolId]) +// return +// } +// const ptxTokenValuesId = poolTx.concat('-').concat(poolTokenId) +// let ptxTokenValues = PoolTransactionTokenValues.load(ptxTokenValuesId) +// if (ptxTokenValues == null) { +// ptxTokenValues = new PoolTransactionTokenValues(ptxTokenValuesId) +// log.warning('created PoolTransactionTokenValues for {}', [ptxTokenValuesId]) +// } - if (!ptxTokenValues) return +// if (!ptxTokenValues) return - ptxTokenValues.txId = poolTx - ptxTokenValues.poolToken = poolTokenId - ptxTokenValues.poolAddress = poolToken.poolId - const ptxUserAddress = ptx.userAddress - ptxTokenValues.userAddress = ptxUserAddress ? ptxUserAddress : '' - const poolTokenAddress = poolToken.address - ptxTokenValues.tokenAddress = poolTokenAddress ? poolTokenAddress : '' +// ptxTokenValues.txId = poolTx +// ptxTokenValues.poolToken = poolTokenId +// ptxTokenValues.poolAddress = poolToken.poolId +// const ptxUserAddress = ptx.userAddress +// ptxTokenValues.userAddress = ptxUserAddress ? ptxUserAddress : '' +// const poolTokenAddress = poolToken.address +// ptxTokenValues.tokenAddress = poolTokenAddress ? poolTokenAddress : '' - ptxTokenValues.value = amount - ptxTokenValues.tokenReserve = balance - ptxTokenValues.feeValue = feeValue - if (amount.lt(ZERO_BD)) { - ptxTokenValues.type = 'out' - } else { - ptxTokenValues.type = 'in' - } +// ptxTokenValues.value = amount +// ptxTokenValues.tokenReserve = balance +// ptxTokenValues.feeValue = feeValue +// if (amount.lt(ZERO_BD)) { +// ptxTokenValues.type = 'out' +// } else { +// ptxTokenValues.type = 'in' +// } - ptxTokenValues.save() +// ptxTokenValues.save() - if (ptxTokenValues.tokenAddress == OCEAN) { - const factory = PoolFactory.load('1') - if (factory !== null) { - factory.totalOceanLiquidity = factory.totalOceanLiquidity - .plus(ptxTokenValues.tokenReserve) - .minus(pool.oceanReserve) +// if (ptxTokenValues.tokenAddress == OCEAN) { +// const factory = PoolFactory.load('1') +// if (factory !== null) { +// factory.totalOceanLiquidity = factory.totalOceanLiquidity +// .plus(ptxTokenValues.tokenReserve) +// .minus(pool.oceanReserve) - const gStats: Global = getGlobalStats() - if (gStats !== null) { - gStats.totalOceanLiquidity = factory.totalOceanLiquidity +// const gStats: Global = getGlobalStats() +// if (gStats !== null) { +// gStats.totalOceanLiquidity = factory.totalOceanLiquidity - gStats.save() - } +// gStats.save() +// } - ptx.oceanReserve = ptxTokenValues.tokenReserve - pool.oceanReserve = ptxTokenValues.tokenReserve - factory.save() - } - } else { - ptx.datatokenReserve = ptxTokenValues.tokenReserve - pool.datatokenReserve = ptxTokenValues.tokenReserve - } - ptx.save() - pool.save() -} +// ptx.oceanReserve = ptxTokenValues.tokenReserve +// pool.oceanReserve = ptxTokenValues.tokenReserve +// factory.save() +// } +// } else { +// ptx.datatokenReserve = ptxTokenValues.tokenReserve +// pool.datatokenReserve = ptxTokenValues.tokenReserve +// } +// ptx.save() +// pool.save() +// } -export function calcSpotPrice( - balanceIn: BigDecimal, - wIn: BigDecimal, - balanceOut: BigDecimal, - wOut: BigDecimal, - swapFee: BigDecimal -): BigDecimal { - if (balanceIn <= ZERO_BD || balanceOut <= ZERO_BD) return MINUS_1_BD +// export function calcSpotPrice( +// balanceIn: BigDecimal, +// wIn: BigDecimal, +// balanceOut: BigDecimal, +// wOut: BigDecimal, +// swapFee: BigDecimal +// ): BigDecimal { +// if (balanceIn <= ZERO_BD || balanceOut <= ZERO_BD) return MINUS_1_BD - const numer = balanceIn.div(wIn) - const denom = balanceOut.div(wOut) - if (denom <= ZERO_BD) return MINUS_1_BD +// const numer = balanceIn.div(wIn) +// const denom = balanceOut.div(wOut) +// if (denom <= ZERO_BD) return MINUS_1_BD - const ratio = numer.div(denom) - const scale = ONE_BD.div(ONE_BD.minus(swapFee)) - const price = ratio.times(scale) - price.truncate(18) - return price -} +// const ratio = numer.div(denom) +// const scale = ONE_BD.div(ONE_BD.minus(swapFee)) +// const price = ratio.times(scale) +// price.truncate(18) +// return price +// } -export function createPoolTransaction( - event: ethereum.Event, - // eslint-disable-next-line camelcase - event_type: string, - userAddress: string -): void { - const poolId = event.address.toHex() - const pool = PoolEntity.load(poolId) - if (!pool) return - const ptx = event.transaction.hash.toHexString() +// export function createPoolTransaction( +// event: ethereum.Event, +// // eslint-disable-next-line camelcase +// event_type: string, +// userAddress: string +// ): void { +// const poolId = event.address.toHex() +// const pool = PoolEntity.load(poolId) +// if (!pool) return +// const ptx = event.transaction.hash.toHexString() - const ocnToken = PoolToken.load(poolId.concat('-').concat(OCEAN)) - const dtToken = PoolToken.load( - poolId.concat('-').concat(pool.datatokenAddress) - ) - if (ocnToken == null || dtToken == null) { - return - } +// const ocnToken = PoolToken.load(poolId.concat('-').concat(OCEAN)) +// const dtToken = PoolToken.load( +// poolId.concat('-').concat(pool.datatokenAddress) +// ) +// if (ocnToken == null || dtToken == null) { +// return +// } - let poolTx = PoolTransaction.load(ptx) - if (poolTx != null) { - return - } - poolTx = new PoolTransaction(ptx) +// let poolTx = PoolTransaction.load(ptx) +// if (poolTx != null) { +// return +// } +// poolTx = new PoolTransaction(ptx) - poolTx.poolAddress = poolId - poolTx.userAddress = userAddress - poolTx.poolAddressStr = poolId - poolTx.userAddressStr = userAddress +// poolTx.poolAddress = poolId +// poolTx.userAddress = userAddress +// poolTx.poolAddressStr = poolId +// poolTx.userAddressStr = userAddress - poolTx.sharesTransferAmount = ZERO_BD - poolTx.sharesBalance = ZERO_BD +// poolTx.sharesTransferAmount = ZERO_BD +// poolTx.sharesBalance = ZERO_BD - // pool.datatokenReserve = dtToken.balance - // pool.oceanReserve = ocnToken.balance - // Initial reserve values, will be updated in `updatePoolTransactionToken` - poolTx.datatokenReserve = dtToken.balance - poolTx.oceanReserve = ocnToken.balance +// // pool.datatokenReserve = dtToken.balance +// // pool.oceanReserve = ocnToken.balance +// // Initial reserve values, will be updated in `updatePoolTransactionToken` +// poolTx.datatokenReserve = dtToken.balance +// poolTx.oceanReserve = ocnToken.balance - const p = Pool.bind(Address.fromString(poolId)) +// const p = Pool.bind(Address.fromString(poolId)) - const priceResult = p.try_calcInGivenOut( - decimalToBigInt(ocnToken.balance), - decimalToBigInt(ocnToken.denormWeight), - decimalToBigInt(dtToken.balance), - decimalToBigInt(dtToken.denormWeight), - ONE_BASE_18, - decimalToBigInt(pool.swapFee) - ) +// const priceResult = p.try_calcInGivenOut( +// decimalToBigInt(ocnToken.balance), +// decimalToBigInt(ocnToken.denormWeight), +// decimalToBigInt(dtToken.balance), +// decimalToBigInt(dtToken.denormWeight), +// ONE_BASE_18, +// decimalToBigInt(pool.swapFee) +// ) - poolTx.consumePrice = priceResult.reverted - ? MINUS_1_BD - : bigIntToDecimal(priceResult.value, 18) +// poolTx.consumePrice = priceResult.reverted +// ? MINUS_1_BD +// : bigIntToDecimal(priceResult.value, 18) - const priceSpot = p.try_calcSpotPrice( - decimalToBigInt(ocnToken.balance), - decimalToBigInt(ocnToken.denormWeight), - decimalToBigInt(dtToken.balance), - decimalToBigInt(dtToken.denormWeight), - decimalToBigInt(pool.swapFee) - ) - poolTx.spotPrice = priceSpot.reverted - ? ZERO_BD - : bigIntToDecimal(priceSpot.value, 18) +// const priceSpot = p.try_calcSpotPrice( +// decimalToBigInt(ocnToken.balance), +// decimalToBigInt(ocnToken.denormWeight), +// decimalToBigInt(dtToken.balance), +// decimalToBigInt(dtToken.denormWeight), +// decimalToBigInt(pool.swapFee) +// ) +// poolTx.spotPrice = priceSpot.reverted +// ? ZERO_BD +// : bigIntToDecimal(priceSpot.value, 18) - pool.consumePrice = poolTx.consumePrice - pool.spotPrice = poolTx.spotPrice - const oldValueLocked = pool.valueLocked - const spotPrice = pool.spotPrice >= ZERO_BD ? pool.spotPrice : ZERO_BD - pool.valueLocked = poolTx.oceanReserve.plus( - poolTx.datatokenReserve.times(spotPrice) - ) - const factory = PoolFactory.load('1') - if (!factory) return - if (factory.totalValueLocked !== null) { - const tvl = factory.totalValueLocked +// pool.consumePrice = poolTx.consumePrice +// pool.spotPrice = poolTx.spotPrice +// const oldValueLocked = pool.valueLocked +// const spotPrice = pool.spotPrice >= ZERO_BD ? pool.spotPrice : ZERO_BD +// pool.valueLocked = poolTx.oceanReserve.plus( +// poolTx.datatokenReserve.times(spotPrice) +// ) +// const factory = PoolFactory.load('1') +// if (!factory) return +// if (factory.totalValueLocked !== null) { +// const tvl = factory.totalValueLocked - factory.totalValueLocked = tvl - ? tvl.minus(oldValueLocked).plus(pool.valueLocked) - : BigDecimal.fromString('0') - } +// factory.totalValueLocked = tvl +// ? tvl.minus(oldValueLocked).plus(pool.valueLocked) +// : BigDecimal.fromString('0') +// } - const gStats: Global = getGlobalStats() - if (gStats !== null) { - gStats.totalValueLocked = factory.totalValueLocked - gStats.save() - } +// const gStats: Global = getGlobalStats() +// if (gStats !== null) { +// gStats.totalValueLocked = factory.totalValueLocked +// gStats.save() +// } - pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1)) +// pool.transactionCount = pool.transactionCount.plus(BigInt.fromI32(1)) - pool.save() - factory.save() +// pool.save() +// factory.save() - poolTx.tx = event.transaction.hash - // eslint-disable-next-line camelcase - poolTx.event = event_type - poolTx.block = event.block.number.toI32() - poolTx.timestamp = event.block.timestamp.toI32() - // Property 'gasUsed' does not exist on type '~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.Transaction' - // poolTx.gasUsed = event.transaction.gasUsed.toBigDecimal() - poolTx.gasPrice = event.transaction.gasPrice.toBigDecimal() +// poolTx.tx = event.transaction.hash +// // eslint-disable-next-line camelcase +// poolTx.event = event_type +// poolTx.block = event.block.number.toI32() +// poolTx.timestamp = event.block.timestamp.toI32() +// // Property 'gasUsed' does not exist on type '~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.Transaction' +// // poolTx.gasUsed = event.transaction.gasUsed.toBigDecimal() +// poolTx.gasPrice = event.transaction.gasPrice.toBigDecimal() - poolTx.save() -} +// poolTx.save() +// } -export function decrPoolCount(finalized: boolean): void { - const factory = PoolFactory.load('1') - if (!factory) return - factory.poolCount -= 1 - if (finalized) factory.finalizedPoolCount -= 1 - factory.save() -} +// export function decrPoolCount(finalized: boolean): void { +// const factory = PoolFactory.load('1') +// if (!factory) return +// factory.poolCount -= 1 +// if (finalized) factory.finalizedPoolCount -= 1 +// factory.save() +// } -export function saveTokenTransaction( - event: ethereum.Event, - eventName: string -): void { - const tx = event.transaction.hash - .toHexString() - .concat('-') - .concat(event.logIndex.toString()) - const userAddress = event.transaction.from.toHex() - let transaction = TokenTransaction.load(tx) - if (transaction == null) { - transaction = new TokenTransaction(tx) - } - transaction.event = eventName - transaction.datatokenAddress = event.address.toHex() - transaction.userAddress = userAddress - // transaction.gasUsed = event.transaction.gasUsed.toBigDecimal() - transaction.gasPrice = event.transaction.gasPrice.toBigDecimal() - transaction.tx = event.transaction.hash - transaction.timestamp = event.block.timestamp.toI32() - transaction.block = event.block.number.toI32() - transaction.save() +// export function saveTokenTransaction( +// event: ethereum.Event, +// eventName: string +// ): void { +// const tx = event.transaction.hash +// .toHexString() +// .concat('-') +// .concat(event.logIndex.toString()) +// const userAddress = event.transaction.from.toHex() +// let transaction = TokenTransaction.load(tx) +// if (transaction == null) { +// transaction = new TokenTransaction(tx) +// } +// transaction.event = eventName +// transaction.datatokenAddress = event.address.toHex() +// transaction.userAddress = userAddress +// // transaction.gasUsed = event.transaction.gasUsed.toBigDecimal() +// transaction.gasPrice = event.transaction.gasPrice.toBigDecimal() +// transaction.tx = event.transaction.hash +// transaction.timestamp = event.block.timestamp.toI32() +// transaction.block = event.block.number.toI32() +// transaction.save() - createUserEntity(userAddress) -} +// createUserEntity(userAddress) +// } -export function updateTokenBalance( - id: string, - token: string, - user: string, - amount: BigDecimal -): void { - let tokenBalance = TokenBalance.load(id) - if (tokenBalance == null) { - tokenBalance = new TokenBalance(id) - createUserEntity(user) - tokenBalance.userAddress = user - tokenBalance.datatokenId = token - tokenBalance.balance = ZERO_BD - } +// export function updateTokenBalance( +// id: string, +// token: string, +// user: string, +// amount: BigDecimal +// ): void { +// let tokenBalance = TokenBalance.load(id) +// if (tokenBalance == null) { +// tokenBalance = new TokenBalance(id) +// createUserEntity(user) +// tokenBalance.userAddress = user +// tokenBalance.datatokenId = token +// tokenBalance.balance = ZERO_BD +// } - tokenBalance.balance = tokenBalance.balance.plus(amount) - tokenBalance.save() -} +// tokenBalance.balance = tokenBalance.balance.plus(amount) +// tokenBalance.save() +// } diff --git a/src/mappings/erc20Template.ts b/src/mappings/erc20Template.ts new file mode 100644 index 0000000..3783afc --- /dev/null +++ b/src/mappings/erc20Template.ts @@ -0,0 +1,9 @@ +import { + MinterApproved, + OrderStarted +} from '../@types/ERC20Template/ERC20Template' +// TODO: no events in contracts +export function handleMinterApproved(event: MinterApproved): void {} + +// TODO: to complicated at this point, return after basic events implemented ¯\_(ツ)_/¯ +export function handleOrderStarted(event: OrderStarted): void {} diff --git a/src/mappings/erc721Factory.ts b/src/mappings/erc721Factory.ts new file mode 100644 index 0000000..1fff59e --- /dev/null +++ b/src/mappings/erc721Factory.ts @@ -0,0 +1,33 @@ +import { log } from '@graphprotocol/graph-ts' +import { NFTCreated, TokenCreated } from '../@types/ERC721Factory/ERC721Factory' +import { Nft, Token } from '../@types/schema' +import { ZERO_BD } from '../helpers' + +export function handleNftCreated(event: NFTCreated): void { + const nft = new Nft(event.params.newTokenAddress.toHexString()) + + nft.owner = event.params.admin.toHexString() + nft.address = event.params.newTokenAddress.toHexString() + nft.name = event.params.tokenName.toHex() + nft.symbol = '' + nft.createTime = event.block.timestamp.toI32() + nft.tx = event.transaction.hash + nft.block = event.block.number.toI32() + + nft.save() +} + +export function handleNewToken(event: TokenCreated): void { + const token = new Token(event.params.newTokenAddress.toHexString()) + token.isDatatoken = true + token.address = event.params.newTokenAddress.toHexString() + token.createTime = event.block.timestamp.toI32() + token.tx = event.transaction.hash + token.block = event.block.number.toI32() + + token.name = event.params.tokenName.toString() + token.decimals = 18 + token.supply = ZERO_BD + log.info('dt name {} ', [event.params.tokenName.toString()]) + token.save() +} diff --git a/src/mappings/factoryRouter.ts b/src/mappings/factoryRouter.ts new file mode 100644 index 0000000..eb285fd --- /dev/null +++ b/src/mappings/factoryRouter.ts @@ -0,0 +1,11 @@ +import { NewPool } from '../@types/ERC20Template/ERC20Template' +import { Pool } from '../@types/schema' + +export function handleNewPool(event: NewPool): void { + const newPool = new Pool(event.params.poolAddress.toHex()) + + newPool.createTime = event.block.timestamp.toI32() + newPool.tx = event.transaction.hash + newPool.block = event.block.number.toI32() + newPool.save() +} diff --git a/src/mappings/fixedRateExchange.ts b/src/mappings/fixedRateExchange.ts new file mode 100644 index 0000000..e2f1d7e --- /dev/null +++ b/src/mappings/fixedRateExchange.ts @@ -0,0 +1,23 @@ +import { BigInt } from '@graphprotocol/graph-ts' +import { ExchangeCreated } from '../@types/FixedRateExchange/FixedRateExchange' + +import { FixedRateExchange } from '../@types/schema' + +import { tokenToDecimal } from '../helpers' + +export function handleExchangeCreated(event: ExchangeCreated): void { + const fixedRateExchange = new FixedRateExchange( + event.params.exchangeId.toHexString() + ) + fixedRateExchange.owner = event.params.exchangeOwner.toHexString() + fixedRateExchange.datatoken = event.params.dataToken.toHexString() + fixedRateExchange.baseToken = event.params.baseToken.toHexString() + // fixedRateExchange.baseTokenSymbol = getTokenSymbol(event.params.baseToken) + fixedRateExchange.active = false + + fixedRateExchange.price = tokenToDecimal( + event.params.fixedRate.toBigDecimal(), + BigInt.fromI32(18).toI32() + ) + fixedRateExchange.save() +} diff --git a/src/mappings/fixedrateexchange.ts b/src/mappings/fixedrateexchange.ts deleted file mode 100644 index 169eabe..0000000 --- a/src/mappings/fixedrateexchange.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { BigInt, ethereum, log } from '@graphprotocol/graph-ts' -import { - ExchangeCreated, - ExchangeActivated, - ExchangeDeactivated, - ExchangeRateChanged, - Swapped -} from '../@types/FixedRateExchange/FixedRateExchange' - -import { - FixedRateExchange, - FixedRateExchangeUpdate, - FixedRateExchangeSwap -} from '../@types/schema' - -import { getTokenSymbol, tokenToDecimal } from '../helpers' - -export function handleExchangeCreated(event: ExchangeCreated): void { - const fixedrateexchange = new FixedRateExchange( - event.params.exchangeId.toHexString() - ) - fixedrateexchange.exchangeOwner = event.params.exchangeOwner.toHexString() - fixedrateexchange.datatoken = event.params.dataToken.toHexString() - fixedrateexchange.baseToken = event.params.baseToken.toHexString() - fixedrateexchange.baseTokenSymbol = getTokenSymbol(event.params.baseToken) - fixedrateexchange.active = false - log.info('new exchange with datatoken {} and base token {} ', [ - fixedrateexchange.datatoken, - fixedrateexchange.baseToken - ]) - log.info('for new exchange {} for rate {}', [ - event.params.exchangeId.toHexString(), - event.params.fixedRate.toString() - ]) - fixedrateexchange.rate = tokenToDecimal( - event.params.fixedRate.toBigDecimal(), - BigInt.fromI32(18).toI32() - ) - fixedrateexchange.save() -} - -function _processActiveUpdated( - event: ethereum.Event, - exchangeId: string, - active: boolean -): void { - const tx = event.transaction.hash - const id = tx.toHexString().concat('-').concat(exchangeId) - const fixedrateexchange = FixedRateExchange.load(exchangeId) - - const freupdate = new FixedRateExchangeUpdate(id) - freupdate.exchangeId = exchangeId - if (fixedrateexchange) { - freupdate.oldRate = fixedrateexchange.rate - freupdate.newRate = fixedrateexchange.rate - freupdate.oldActive = fixedrateexchange.active - fixedrateexchange.active = active - fixedrateexchange.save() - } - - freupdate.newActive = active - freupdate.block = event.block.number.toI32() - freupdate.timestamp = event.block.timestamp.toI32() - freupdate.tx = tx - freupdate.save() -} - -export function handleExchangeActivated(event: ExchangeActivated): void { - _processActiveUpdated(event, event.params.exchangeId.toHexString(), true) -} - -export function handleExchangeDeactivated(event: ExchangeDeactivated): void { - _processActiveUpdated(event, event.params.exchangeId.toHexString(), false) -} - -export function handleExchangeRateChanged(event: ExchangeRateChanged): void { - const tx = event.transaction.hash - const id = tx - .toHexString() - .concat('-') - .concat(event.params.exchangeId.toHexString()) - const fixedrateexchange = FixedRateExchange.load( - event.params.exchangeId.toHexString() - ) - if (!fixedrateexchange) { - log.error('Cannot update unknown FRE {}', [ - event.params.exchangeId.toHexString() - ]) - return - } - - const freupdate = new FixedRateExchangeUpdate(id) - freupdate.exchangeId = fixedrateexchange.id - freupdate.oldRate = fixedrateexchange.rate - log.info('for new exchange {} for rate {}', [ - id, - event.params.newRate.toString() - ]) - freupdate.newRate = tokenToDecimal( - event.params.newRate.toBigDecimal(), - BigInt.fromI32(18).toI32() - ) - freupdate.oldActive = fixedrateexchange.active - freupdate.newActive = fixedrateexchange.active - freupdate.block = event.block.number.toI32() - freupdate.timestamp = event.block.timestamp.toI32() - freupdate.tx = tx - freupdate.save() - - fixedrateexchange.rate = freupdate.newRate - fixedrateexchange.save() -} - -export function handleSwapped(event: Swapped): void { - const tx = event.transaction.hash - const id = tx - .toHexString() - .concat('-') - .concat(event.params.exchangeId.toHexString()) - const freSwap = new FixedRateExchangeSwap(id) - freSwap.exchangeId = event.params.exchangeId.toHexString() - freSwap.by = event.params.by.toHexString() - freSwap.baseTokenAmount = tokenToDecimal( - event.params.baseTokenSwappedAmount.toBigDecimal(), - BigInt.fromI32(18).toI32() - ) - freSwap.dataTokenAmount = tokenToDecimal( - event.params.dataTokenSwappedAmount.toBigDecimal(), - BigInt.fromI32(18).toI32() - ) - freSwap.block = event.block.number.toI32() - freSwap.timestamp = event.block.timestamp.toI32() - freSwap.tx = tx - freSwap.save() -} diff --git a/src/mappings/datatoken.ts b/src/mappings/old/datatoken.ts similarity index 100% rename from src/mappings/datatoken.ts rename to src/mappings/old/datatoken.ts diff --git a/src/mappings/dispenser.ts b/src/mappings/old/dispenser.ts similarity index 98% rename from src/mappings/dispenser.ts rename to src/mappings/old/dispenser.ts index 15dd30e..d90b07d 100644 --- a/src/mappings/dispenser.ts +++ b/src/mappings/old/dispenser.ts @@ -14,9 +14,9 @@ import { DispenserTransaction, User, Datatoken -} from '../@types/schema' +} from '../../@types/schema' -import { tokenToDecimal } from '../helpers' +import { tokenToDecimal } from '../../helpers' function _processDispenserUpdate( event: ethereum.Event, diff --git a/src/mappings/dtfactory.ts b/src/mappings/old/dtfactory.ts similarity index 100% rename from src/mappings/dtfactory.ts rename to src/mappings/old/dtfactory.ts diff --git a/src/mappings/factory.ts b/src/mappings/old/factory.ts similarity index 100% rename from src/mappings/factory.ts rename to src/mappings/old/factory.ts diff --git a/src/mappings/metadata.ts b/src/mappings/old/metadata.ts similarity index 100% rename from src/mappings/metadata.ts rename to src/mappings/old/metadata.ts diff --git a/src/mappings/old/pool.ts b/src/mappings/old/pool.ts new file mode 100644 index 0000000..eb28f8e --- /dev/null +++ b/src/mappings/old/pool.ts @@ -0,0 +1,577 @@ +// import { BigInt, Address, BigDecimal, log } from '@graphprotocol/graph-ts' +// import { +// LOG_CALL, +// LOG_JOIN, +// LOG_EXIT, +// LOG_SWAP, +// Transfer, +// Pool as PoolEntity +// } from '../@types/templates/Pool/Pool' + +// import { +// PoolFactory, +// Pool, +// PoolToken, +// PoolShare, +// Datatoken, +// PoolTransaction, +// Global +// } from '../@types/schema' +// import { +// hexToDecimal, +// tokenToDecimal, +// createPoolShareEntity, +// createPoolTokenEntity, +// ZERO_BD, +// MINUS_1_BD, +// decrPoolCount, +// updatePoolTransactionToken, +// createPoolTransaction, +// OCEAN, +// updatePoolTokenBalance, +// getOceanAddress, +// getGlobalStats, +// bigIntToDecimal +// } from '../helpers' + +// /************************************ +// ********** Pool Controls *********** +// ************************************/ + +// export function handleSetSwapFee( +// event: LOG_CALL, +// swapFeeStr: string | null = null +// ): void { +// const poolId = event.address.toHex() +// const pool = Pool.load(poolId) +// if (!pool) return +// if (!swapFeeStr) { +// swapFeeStr = event.params.data.toHexString().slice(-40) +// } +// if (swapFeeStr !== null) pool.swapFee = hexToDecimal(swapFeeStr, 18) +// pool.save() +// } + +// export function handleSetController(event: LOG_CALL): void { +// const poolId = event.address.toHex() +// const pool = Pool.load(poolId) +// if (!pool) return +// pool.controller = Address.fromString( +// event.params.data.toHexString().slice(-40) +// ) +// pool.save() +// } + +// export function handleSetPublicSwap(event: LOG_CALL): void { +// const poolId = event.address.toHex() +// const pool = Pool.load(poolId) +// if (!pool) return +// pool.publicSwap = event.params.data.toHexString().slice(-1) == '1' +// pool.save() +// } + +// export function handleFinalize(event: LOG_CALL): void { +// const poolId = event.address.toHex() +// const pool = Pool.load(poolId) +// if (!pool) { +// log.error('Cannot handle finalize for unknown pool {} ', [poolId]) +// return +// } +// if (pool.tokenCount == BigInt.fromI32(0)) { +// log.error('Cannot mark pool {} finalized, because we have 0 tokenCount', [ +// poolId +// ]) +// return +// } +// pool.finalized = true +// pool.symbol = 'BPT' +// pool.publicSwap = true +// pool.save() + +// const factory = PoolFactory.load('1') +// if (!factory) return +// factory.finalizedPoolCount = factory.finalizedPoolCount + 1 +// factory.save() +// } + +// export function _handleRebind( +// event: LOG_CALL, +// poolId: string, +// tokenAddress: string, +// balanceStr: string, +// denormWeightStr: string +// ): void { +// const pool = Pool.load(poolId) +// if (!pool) return +// const decimals = BigInt.fromI32(18).toI32() + +// if (tokenAddress != OCEAN) { +// pool.datatokenAddress = tokenAddress +// } +// pool.tokenCount = pool.tokenCount.plus(BigInt.fromI32(1)) +// const address = Address.fromString(tokenAddress) +// const denormWeight = hexToDecimal(denormWeightStr, decimals) +// const poolTokenId = poolId.concat('-').concat(address.toHexString()) +// let poolToken = PoolToken.load(poolTokenId) +// if (poolToken == null) { +// createPoolTokenEntity(poolTokenId, poolId, address) +// poolToken = PoolToken.load(poolTokenId) +// pool.totalWeight = pool.totalWeight.plus(denormWeight) +// } else { +// const oldWeight = poolToken.denormWeight +// if (denormWeight > oldWeight) { +// pool.totalWeight = pool.totalWeight.plus(denormWeight).minus(oldWeight) +// } else { +// pool.totalWeight = pool.totalWeight.minus(oldWeight).minus(denormWeight) +// } +// } +// if (!poolToken) return +// poolToken.denormWeight = +// denormWeight !== null ? denormWeight : BigDecimal.fromString('0') +// const balance = hexToDecimal(balanceStr, decimals) +// updatePoolTokenBalance(poolToken as PoolToken, balance, '_handleRebind') + +// poolToken.save() +// if (balance.equals(ZERO_BD)) { +// decrPoolCount(pool.finalized) +// pool.active = false +// } +// pool.save() +// } + +// export function handleRebind(event: LOG_CALL): void { +// const poolId = event.address.toHex() +// _handleRebind( +// event, +// poolId, +// event.params.data.toHexString().slice(34, 74), +// event.params.data.toHexString().slice(74, 138), +// event.params.data.toHexString().slice(138) +// ) +// } + +// export function handleSetup(event: LOG_CALL): void { +// if (PoolTransaction.load(event.transaction.hash.toHexString()) != null) { +// return +// } + +// const poolId = event.address.toHex() +// const data = event.params.data.toHexString() +// // First 2 chars are 0x +// // Next there is 8 chars +// // Next starts the data each params occupies exactly 64 chars +// // Each value is padded with 0s to the left +// // For an Address, need to remove the leading 24 zeros, because the address itself is 40 chars +// // For numbers we donot need to remove the leading zeros because they have no effect being on the left of the number + +// // skip 8 then take the last 40 (2 + 8 + 24 = 34) to (2 + 8 + 64 = 74) +// const dataTokenAddress = Address.fromString(data.slice(34, 74)).toHexString() + +// const dataTokenAmount = data.slice(74, 138) // 74+64 +// const dataTokenWeight = data.slice(138, 202) // (74+64,74+(2*64) +// const baseTokenAddress = Address.fromString( +// data.slice(202 + 24, 266) +// ).toHexString() // (74+(2*64)+24, 74+(3*64)) +// const baseTokenAmount = data.slice(266, 330) // (74+(3*64),74+(4*64)) +// const baseTokenWeight = data.slice(330, 394) // (74+(4*64),74+(5*64)) +// const swapFee = data.slice(394) // (74+(5*64), END) + +// if (baseTokenAddress != OCEAN) { +// log.error('baseTokenAddress is not Ocean, but is {}', [baseTokenAddress]) +// return +// } +// const poolTokenId = poolId.concat('-').concat(baseTokenAddress) +// const poolToken = PoolToken.load(poolTokenId) +// if (!poolToken) return + +// _handleRebind( +// event, +// poolId, +// dataTokenAddress, +// dataTokenAmount, +// dataTokenWeight +// ) +// _handleRebind( +// event, +// poolId, +// baseTokenAddress, +// baseTokenAmount, +// baseTokenWeight +// ) +// handleSetSwapFee(event, swapFee) +// handleFinalize(event) +// createPoolTransaction(event, 'setup', event.transaction.from.toHex()) + +// // update base token +// let amount = hexToDecimal(baseTokenAmount, 18) + +// const poolTokenBalance = poolToken.balance +// const balance = poolTokenBalance +// ? poolTokenBalance +// : BigDecimal.fromString('0') +// updatePoolTransactionToken( +// event.transaction.hash.toHexString(), +// poolTokenId, +// amount, +// balance, +// ZERO_BD +// ) +// // update the datatoken +// const poolDataToken = PoolToken.load( +// poolId.concat('-').concat(dataTokenAddress) +// ) +// if (poolDataToken !== null) { +// amount = hexToDecimal(dataTokenAmount, 18) +// updatePoolTransactionToken( +// event.transaction.hash.toHexString(), +// poolId.concat('-').concat(dataTokenAddress), +// amount, +// poolDataToken.balance, +// ZERO_BD +// ) +// } +// } + +// /************************************ +// ********** JOINS & EXITS *********** +// ************************************/ + +// export function handleJoinPool(event: LOG_JOIN): void { +// const poolId = event.address.toHex() +// const address = event.params.tokenIn.toHex() +// const ptx = event.transaction.hash.toHexString() +// const poolTokenId = poolId.concat('-').concat(address) +// const poolToken = PoolToken.load(poolTokenId) +// const pool = Pool.load(poolId) +// const datatoken = Datatoken.load(poolTokenId) + +// const poolTx = PoolTransaction.load(ptx) +// if (poolTx !== null) return +// if (!pool || !poolToken || !datatoken) return + +// if (pool.finalized == false) { +// return +// } + +// pool.joinCount = pool.joinCount.plus(BigInt.fromI32(1)) +// pool.save() + +// const decimals = +// datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals +// const tokenAmountIn = tokenToDecimal( +// event.params.tokenAmountIn.toBigDecimal(), +// decimals +// ) +// updatePoolTokenBalance( +// poolToken as PoolToken, +// poolToken.balance.plus(tokenAmountIn), +// 'handleJoinPool' +// ) + +// poolToken.save() +// createPoolTransaction(event, 'join', event.params.caller.toHexString()) +// updatePoolTransactionToken( +// event.transaction.hash.toHexString(), +// poolTokenId, +// tokenAmountIn, +// poolToken.balance, +// tokenAmountIn.times(pool.swapFee) +// ) +// } + +// export function handleExitPool(event: LOG_EXIT): void { +// const poolId = event.address.toHex() + +// const address = event.params.tokenOut.toHex() +// const poolTokenId = poolId.concat('-').concat(address.toString()) +// const pool = Pool.load(poolId) +// const poolToken = PoolToken.load(poolTokenId) +// const datatoken = Datatoken.load(poolTokenId) +// if (!poolToken || !pool || !datatoken) { +// return +// } + +// const decimals = +// datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals +// const tokenAmountOut = tokenToDecimal( +// event.params.tokenAmountOut.toBigDecimal(), +// decimals +// ) +// const newAmount = poolToken.balance.minus(tokenAmountOut) +// updatePoolTokenBalance(poolToken as PoolToken, newAmount, 'handleExitPool') +// poolToken.save() + +// pool.exitCount = pool.exitCount.plus(BigInt.fromI32(1)) +// if (newAmount.equals(ZERO_BD)) { +// decrPoolCount(pool.finalized) +// pool.active = false +// } +// pool.save() + +// createPoolTransaction(event, 'exit', event.params.caller.toHexString()) +// updatePoolTransactionToken( +// event.transaction.hash.toHexString(), +// poolTokenId, +// tokenAmountOut.times(MINUS_1_BD), +// poolToken.balance, +// tokenAmountOut.times(pool.swapFee) +// ) +// } + +// /************************************ +// ************** SWAPS *************** +// ************************************/ + +// export function handleSwap(event: LOG_SWAP): void { +// const poolId = event.address.toHex() +// const ptx = event.transaction.hash.toHexString() + +// const tokenIn = event.params.tokenIn.toHex() +// const poolTokenInId = poolId.concat('-').concat(tokenIn.toString()) +// const poolTokenIn = PoolToken.load(poolTokenInId) +// if (!poolTokenIn) { +// return +// } +// const dtIn = Datatoken.load(tokenIn) +// const tokenAmountIn = tokenToDecimal( +// event.params.tokenAmountIn.toBigDecimal(), +// dtIn == null ? 18 : dtIn.decimals +// ) +// const newAmountIn = poolTokenIn.balance.plus(tokenAmountIn) +// updatePoolTokenBalance( +// poolTokenIn as PoolToken, +// newAmountIn, +// 'handleSwap.tokenIn' +// ) +// poolTokenIn.save() + +// const tokenOut = event.params.tokenOut.toHex() +// const poolTokenOutId = poolId.concat('-').concat(tokenOut.toString()) +// const poolTokenOut = PoolToken.load(poolTokenOutId) +// const pool = Pool.load(poolId) +// const factory = PoolFactory.load('1') +// const dtOut = Datatoken.load(tokenOut) +// if (!poolTokenOut || !dtOut || !factory || !pool) return + +// const tokenAmountOut = tokenToDecimal( +// event.params.tokenAmountOut.toBigDecimal(), +// dtOut == null ? 18 : dtOut.decimals +// ) +// const newAmountOut = poolTokenOut.balance.minus(tokenAmountOut) +// updatePoolTokenBalance( +// poolTokenOut as PoolToken, +// newAmountOut, +// 'handleSwap.tokenOut' +// ) +// poolTokenOut.save() + +// pool.swapCount = pool.swapCount.plus(BigInt.fromI32(1)) +// if (newAmountIn.equals(ZERO_BD) || newAmountOut.equals(ZERO_BD)) { +// decrPoolCount(pool.finalized) +// pool.active = false +// } +// if (tokenIn === getOceanAddress()) { +// pool.totalSwapVolume = pool.totalSwapVolume.plus(tokenAmountIn) +// factory.totalSwapVolume = factory.totalSwapVolume.plus(tokenAmountIn) +// } else { +// pool.totalSwapVolume = pool.totalSwapVolume.plus(tokenAmountOut) +// factory.totalSwapVolume = factory.totalSwapVolume.plus(tokenAmountOut) +// } + +// factory.save() +// pool.save() +// const gStats: Global = getGlobalStats() +// if (gStats !== null) { +// gStats.totalSwapVolume = factory.totalSwapVolume +// gStats.save() +// } + +// createPoolTransaction(event, 'swap', event.params.caller.toHexString()) +// updatePoolTransactionToken( +// ptx, +// poolTokenIn.id, +// tokenAmountIn, +// poolTokenIn.balance, +// tokenAmountIn.times(pool.swapFee) +// ) +// updatePoolTransactionToken( +// ptx, +// poolTokenOut.id, +// tokenAmountOut.times(MINUS_1_BD), +// poolTokenOut.balance, +// BigDecimal.fromString('0.0') +// ) +// } + +// /************************************ +// *********** POOL SHARES ************ +// ************************************/ + +// export function handleTransfer(event: Transfer): void { +// const poolId = event.address.toHex() + +// const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' + +// const isMint = event.params.from.toHex() == ZERO_ADDRESS +// const isBurn = event.params.to.toHex() == ZERO_ADDRESS + +// const poolShareFromId = poolId.concat('-').concat(event.params.from.toHex()) +// let poolShareFrom = PoolShare.load(poolShareFromId) + +// const poolShareToId = poolId.concat('-').concat(event.params.to.toHex()) +// let poolShareTo = PoolShare.load(poolShareToId) +// const poolShareToBalance = poolShareTo == null ? ZERO_BD : poolShareTo.balance + +// const pool = Pool.load(poolId) +// if (!pool) return +// const poolTx = PoolTransaction.load(event.transaction.hash.toHexString()) +// const value = tokenToDecimal(event.params.value.toBigDecimal(), 18) + +// if (isMint) { +// if (poolShareTo == null) { +// createPoolShareEntity(poolShareToId, poolId, event.params.to.toHex()) +// poolShareTo = PoolShare.load(poolShareToId) +// } +// if (poolShareTo !== null) { +// poolShareTo.balance = poolShareTo.balance.plus(value) +// poolShareTo.save() +// } + +// pool.totalShares = pool.totalShares.plus(value) +// if (poolTx != null) { +// poolTx.sharesTransferAmount = value +// if (poolShareTo !== null) poolTx.sharesBalance = poolShareTo.balance +// } +// } else if (isBurn) { +// if (poolShareFrom == null) { +// createPoolShareEntity(poolShareFromId, poolId, event.params.from.toHex()) +// poolShareFrom = PoolShare.load(poolShareFromId) +// } + +// pool.totalShares = pool.totalShares.minus(value) +// if (poolTx !== null) { +// poolTx.sharesTransferAmount = poolTx.sharesTransferAmount.minus(value) +// } + +// if (poolTx !== null && poolShareFrom !== null) { +// poolTx.sharesBalance = poolShareFrom.balance +// } + +// if (poolShareFrom !== null) { +// poolShareFrom.balance = poolShareFrom.balance.minus(value) +// poolShareFrom.save() +// } +// } else { +// if (poolShareTo == null) { +// createPoolShareEntity(poolShareToId, poolId, event.params.to.toHex()) +// poolShareTo = PoolShare.load(poolShareToId) +// } + +// if (poolShareTo !== null) { +// poolShareTo.balance = poolShareTo.balance.plus(value) +// poolShareTo.save() +// } + +// if (poolShareFrom == null) { +// createPoolShareEntity(poolShareFromId, poolId, event.params.from.toHex()) +// poolShareFrom = PoolShare.load(poolShareFromId) +// } +// if (poolShareFrom !== null) { +// poolShareFrom.balance = poolShareFrom.balance.minus(value) +// poolShareFrom.save() +// } +// } + +// if ( +// poolShareTo != null && +// poolShareTo.balance.notEqual(ZERO_BD) && +// poolShareToBalance.equals(ZERO_BD) +// ) { +// pool.holderCount = pool.holderCount.plus(BigInt.fromI32(1)) +// } + +// if ( +// poolShareFrom !== null && +// poolShareFrom.balance.equals(ZERO_BD) && +// poolShareFrom.balance.notEqual(ZERO_BD) +// ) { +// pool.holderCount = pool.holderCount.plus(BigInt.fromI32(1)) +// } + +// if (poolTx !== null) { +// poolTx.save() +// } + +// pool.save() +// } + +// /************************************ +// *********** GULP ************ +// ************************************/ +// export function handleGulp(event: LOG_CALL): void { +// const poolId = event.address.toHex() +// const ptx = event.transaction.hash.toHexString() +// // we need to check the contract balance & compare with our internal balances +// const pool = Pool.load(poolId) +// const poolEbtity = PoolEntity.bind(Address.fromString(poolId)) +// if (!pool) { +// log.warning('Gulp called, but cannot load pool {}', [poolId]) +// return +// } +// const ocnToken = PoolToken.load(poolId.concat('-').concat(OCEAN)) +// const dtToken = PoolToken.load( +// poolId.concat('-').concat(pool.datatokenAddress) +// ) + +// // get the balances from the contract +// // for ocean +// if (ocnToken) { +// const ocnTokenBalance = ocnToken.balance +// const balanceAttempt = poolEbtity.try_getBalance(Address.fromString(OCEAN)) +// if (!balanceAttempt.reverted) { +// const contractBalance = bigIntToDecimal(balanceAttempt.value, 18) +// if ( +// ocnToken.balance.notEqual(contractBalance) && +// contractBalance.ge(ZERO_BD) +// ) { +// // we have a difference. let's absorb that +// createPoolTransaction(event, 'gulp', event.params.caller.toHexString()) +// ocnToken.balance = contractBalance +// ocnToken.save() +// updatePoolTransactionToken( +// ptx, +// ocnToken.id, +// contractBalance.minus(ocnTokenBalance), +// contractBalance, +// ZERO_BD +// ) +// } +// } +// } +// // for dt +// if (dtToken) { +// const dtTokenBalance = dtToken.balance +// const balanceAttempt = poolEbtity.try_getBalance( +// Address.fromString(pool.datatokenAddress) +// ) +// if (!balanceAttempt.reverted) { +// const contractBalance = bigIntToDecimal(balanceAttempt.value, 18) +// if ( +// dtToken.balance.notEqual(contractBalance) && +// contractBalance.ge(ZERO_BD) +// ) { +// // we have a difference. let's absorb that +// createPoolTransaction(event, 'gulp', event.params.caller.toHexString()) +// dtToken.balance = contractBalance +// dtToken.save() +// updatePoolTransactionToken( +// ptx, +// dtToken.id, +// contractBalance.minus(dtTokenBalance), +// contractBalance, +// ZERO_BD +// ) +// } +// } +// } +// } diff --git a/src/mappings/pool.ts b/src/mappings/pool.ts deleted file mode 100644 index adec689..0000000 --- a/src/mappings/pool.ts +++ /dev/null @@ -1,577 +0,0 @@ -import { BigInt, Address, BigDecimal, log } from '@graphprotocol/graph-ts' -import { - LOG_CALL, - LOG_JOIN, - LOG_EXIT, - LOG_SWAP, - Transfer, - Pool as PoolEntity -} from '../@types/templates/Pool/Pool' - -import { - PoolFactory, - Pool, - PoolToken, - PoolShare, - Datatoken, - PoolTransaction, - Global -} from '../@types/schema' -import { - hexToDecimal, - tokenToDecimal, - createPoolShareEntity, - createPoolTokenEntity, - ZERO_BD, - MINUS_1_BD, - decrPoolCount, - updatePoolTransactionToken, - createPoolTransaction, - OCEAN, - updatePoolTokenBalance, - getOceanAddress, - getGlobalStats, - bigIntToDecimal -} from '../helpers' - -/************************************ - ********** Pool Controls *********** - ************************************/ - -export function handleSetSwapFee( - event: LOG_CALL, - swapFeeStr: string | null = null -): void { - const poolId = event.address.toHex() - const pool = Pool.load(poolId) - if (!pool) return - if (!swapFeeStr) { - swapFeeStr = event.params.data.toHexString().slice(-40) - } - if (swapFeeStr !== null) pool.swapFee = hexToDecimal(swapFeeStr, 18) - pool.save() -} - -export function handleSetController(event: LOG_CALL): void { - const poolId = event.address.toHex() - const pool = Pool.load(poolId) - if (!pool) return - pool.controller = Address.fromString( - event.params.data.toHexString().slice(-40) - ) - pool.save() -} - -export function handleSetPublicSwap(event: LOG_CALL): void { - const poolId = event.address.toHex() - const pool = Pool.load(poolId) - if (!pool) return - pool.publicSwap = event.params.data.toHexString().slice(-1) == '1' - pool.save() -} - -export function handleFinalize(event: LOG_CALL): void { - const poolId = event.address.toHex() - const pool = Pool.load(poolId) - if (!pool) { - log.error('Cannot handle finalize for unknown pool {} ', [poolId]) - return - } - if (pool.tokenCount == BigInt.fromI32(0)) { - log.error('Cannot mark pool {} finalized, because we have 0 tokenCount', [ - poolId - ]) - return - } - pool.finalized = true - pool.symbol = 'BPT' - pool.publicSwap = true - pool.save() - - const factory = PoolFactory.load('1') - if (!factory) return - factory.finalizedPoolCount = factory.finalizedPoolCount + 1 - factory.save() -} - -export function _handleRebind( - event: LOG_CALL, - poolId: string, - tokenAddress: string, - balanceStr: string, - denormWeightStr: string -): void { - const pool = Pool.load(poolId) - if (!pool) return - const decimals = BigInt.fromI32(18).toI32() - - if (tokenAddress != OCEAN) { - pool.datatokenAddress = tokenAddress - } - pool.tokenCount = pool.tokenCount.plus(BigInt.fromI32(1)) - const address = Address.fromString(tokenAddress) - const denormWeight = hexToDecimal(denormWeightStr, decimals) - const poolTokenId = poolId.concat('-').concat(address.toHexString()) - let poolToken = PoolToken.load(poolTokenId) - if (poolToken == null) { - createPoolTokenEntity(poolTokenId, poolId, address) - poolToken = PoolToken.load(poolTokenId) - pool.totalWeight = pool.totalWeight.plus(denormWeight) - } else { - const oldWeight = poolToken.denormWeight - if (denormWeight > oldWeight) { - pool.totalWeight = pool.totalWeight.plus(denormWeight).minus(oldWeight) - } else { - pool.totalWeight = pool.totalWeight.minus(oldWeight).minus(denormWeight) - } - } - if (!poolToken) return - poolToken.denormWeight = - denormWeight !== null ? denormWeight : BigDecimal.fromString('0') - const balance = hexToDecimal(balanceStr, decimals) - updatePoolTokenBalance(poolToken as PoolToken, balance, '_handleRebind') - - poolToken.save() - if (balance.equals(ZERO_BD)) { - decrPoolCount(pool.finalized) - pool.active = false - } - pool.save() -} - -export function handleRebind(event: LOG_CALL): void { - const poolId = event.address.toHex() - _handleRebind( - event, - poolId, - event.params.data.toHexString().slice(34, 74), - event.params.data.toHexString().slice(74, 138), - event.params.data.toHexString().slice(138) - ) -} - -export function handleSetup(event: LOG_CALL): void { - if (PoolTransaction.load(event.transaction.hash.toHexString()) != null) { - return - } - - const poolId = event.address.toHex() - const data = event.params.data.toHexString() - // First 2 chars are 0x - // Next there is 8 chars - // Next starts the data each params occupies exactly 64 chars - // Each value is padded with 0s to the left - // For an Address, need to remove the leading 24 zeros, because the address itself is 40 chars - // For numbers we donot need to remove the leading zeros because they have no effect being on the left of the number - - // skip 8 then take the last 40 (2 + 8 + 24 = 34) to (2 + 8 + 64 = 74) - const dataTokenAddress = Address.fromString(data.slice(34, 74)).toHexString() - - const dataTokenAmount = data.slice(74, 138) // 74+64 - const dataTokenWeight = data.slice(138, 202) // (74+64,74+(2*64) - const baseTokenAddress = Address.fromString( - data.slice(202 + 24, 266) - ).toHexString() // (74+(2*64)+24, 74+(3*64)) - const baseTokenAmount = data.slice(266, 330) // (74+(3*64),74+(4*64)) - const baseTokenWeight = data.slice(330, 394) // (74+(4*64),74+(5*64)) - const swapFee = data.slice(394) // (74+(5*64), END) - - if (baseTokenAddress != OCEAN) { - log.error('baseTokenAddress is not Ocean, but is {}', [baseTokenAddress]) - return - } - const poolTokenId = poolId.concat('-').concat(baseTokenAddress) - const poolToken = PoolToken.load(poolTokenId) - if (!poolToken) return - - _handleRebind( - event, - poolId, - dataTokenAddress, - dataTokenAmount, - dataTokenWeight - ) - _handleRebind( - event, - poolId, - baseTokenAddress, - baseTokenAmount, - baseTokenWeight - ) - handleSetSwapFee(event, swapFee) - handleFinalize(event) - createPoolTransaction(event, 'setup', event.transaction.from.toHex()) - - // update base token - let amount = hexToDecimal(baseTokenAmount, 18) - - const poolTokenBalance = poolToken.balance - const balance = poolTokenBalance - ? poolTokenBalance - : BigDecimal.fromString('0') - updatePoolTransactionToken( - event.transaction.hash.toHexString(), - poolTokenId, - amount, - balance, - ZERO_BD - ) - // update the datatoken - const poolDataToken = PoolToken.load( - poolId.concat('-').concat(dataTokenAddress) - ) - if (poolDataToken !== null) { - amount = hexToDecimal(dataTokenAmount, 18) - updatePoolTransactionToken( - event.transaction.hash.toHexString(), - poolId.concat('-').concat(dataTokenAddress), - amount, - poolDataToken.balance, - ZERO_BD - ) - } -} - -/************************************ - ********** JOINS & EXITS *********** - ************************************/ - -export function handleJoinPool(event: LOG_JOIN): void { - const poolId = event.address.toHex() - const address = event.params.tokenIn.toHex() - const ptx = event.transaction.hash.toHexString() - const poolTokenId = poolId.concat('-').concat(address) - const poolToken = PoolToken.load(poolTokenId) - const pool = Pool.load(poolId) - const datatoken = Datatoken.load(poolTokenId) - - const poolTx = PoolTransaction.load(ptx) - if (poolTx !== null) return - if (!pool || !poolToken || !datatoken) return - - if (pool.finalized == false) { - return - } - - pool.joinCount = pool.joinCount.plus(BigInt.fromI32(1)) - pool.save() - - const decimals = - datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals - const tokenAmountIn = tokenToDecimal( - event.params.tokenAmountIn.toBigDecimal(), - decimals - ) - updatePoolTokenBalance( - poolToken as PoolToken, - poolToken.balance.plus(tokenAmountIn), - 'handleJoinPool' - ) - - poolToken.save() - createPoolTransaction(event, 'join', event.params.caller.toHexString()) - updatePoolTransactionToken( - event.transaction.hash.toHexString(), - poolTokenId, - tokenAmountIn, - poolToken.balance, - tokenAmountIn.times(pool.swapFee) - ) -} - -export function handleExitPool(event: LOG_EXIT): void { - const poolId = event.address.toHex() - - const address = event.params.tokenOut.toHex() - const poolTokenId = poolId.concat('-').concat(address.toString()) - const pool = Pool.load(poolId) - const poolToken = PoolToken.load(poolTokenId) - const datatoken = Datatoken.load(poolTokenId) - if (!poolToken || !pool || !datatoken) { - return - } - - const decimals = - datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals - const tokenAmountOut = tokenToDecimal( - event.params.tokenAmountOut.toBigDecimal(), - decimals - ) - const newAmount = poolToken.balance.minus(tokenAmountOut) - updatePoolTokenBalance(poolToken as PoolToken, newAmount, 'handleExitPool') - poolToken.save() - - pool.exitCount = pool.exitCount.plus(BigInt.fromI32(1)) - if (newAmount.equals(ZERO_BD)) { - decrPoolCount(pool.finalized) - pool.active = false - } - pool.save() - - createPoolTransaction(event, 'exit', event.params.caller.toHexString()) - updatePoolTransactionToken( - event.transaction.hash.toHexString(), - poolTokenId, - tokenAmountOut.times(MINUS_1_BD), - poolToken.balance, - tokenAmountOut.times(pool.swapFee) - ) -} - -/************************************ - ************** SWAPS *************** - ************************************/ - -export function handleSwap(event: LOG_SWAP): void { - const poolId = event.address.toHex() - const ptx = event.transaction.hash.toHexString() - - const tokenIn = event.params.tokenIn.toHex() - const poolTokenInId = poolId.concat('-').concat(tokenIn.toString()) - const poolTokenIn = PoolToken.load(poolTokenInId) - if (!poolTokenIn) { - return - } - const dtIn = Datatoken.load(tokenIn) - const tokenAmountIn = tokenToDecimal( - event.params.tokenAmountIn.toBigDecimal(), - dtIn == null ? 18 : dtIn.decimals - ) - const newAmountIn = poolTokenIn.balance.plus(tokenAmountIn) - updatePoolTokenBalance( - poolTokenIn as PoolToken, - newAmountIn, - 'handleSwap.tokenIn' - ) - poolTokenIn.save() - - const tokenOut = event.params.tokenOut.toHex() - const poolTokenOutId = poolId.concat('-').concat(tokenOut.toString()) - const poolTokenOut = PoolToken.load(poolTokenOutId) - const pool = Pool.load(poolId) - const factory = PoolFactory.load('1') - const dtOut = Datatoken.load(tokenOut) - if (!poolTokenOut || !dtOut || !factory || !pool) return - - const tokenAmountOut = tokenToDecimal( - event.params.tokenAmountOut.toBigDecimal(), - dtOut == null ? 18 : dtOut.decimals - ) - const newAmountOut = poolTokenOut.balance.minus(tokenAmountOut) - updatePoolTokenBalance( - poolTokenOut as PoolToken, - newAmountOut, - 'handleSwap.tokenOut' - ) - poolTokenOut.save() - - pool.swapCount = pool.swapCount.plus(BigInt.fromI32(1)) - if (newAmountIn.equals(ZERO_BD) || newAmountOut.equals(ZERO_BD)) { - decrPoolCount(pool.finalized) - pool.active = false - } - if (tokenIn === getOceanAddress()) { - pool.totalSwapVolume = pool.totalSwapVolume.plus(tokenAmountIn) - factory.totalSwapVolume = factory.totalSwapVolume.plus(tokenAmountIn) - } else { - pool.totalSwapVolume = pool.totalSwapVolume.plus(tokenAmountOut) - factory.totalSwapVolume = factory.totalSwapVolume.plus(tokenAmountOut) - } - - factory.save() - pool.save() - const gStats: Global = getGlobalStats() - if (gStats !== null) { - gStats.totalSwapVolume = factory.totalSwapVolume - gStats.save() - } - - createPoolTransaction(event, 'swap', event.params.caller.toHexString()) - updatePoolTransactionToken( - ptx, - poolTokenIn.id, - tokenAmountIn, - poolTokenIn.balance, - tokenAmountIn.times(pool.swapFee) - ) - updatePoolTransactionToken( - ptx, - poolTokenOut.id, - tokenAmountOut.times(MINUS_1_BD), - poolTokenOut.balance, - BigDecimal.fromString('0.0') - ) -} - -/************************************ - *********** POOL SHARES ************ - ************************************/ - -export function handleTransfer(event: Transfer): void { - const poolId = event.address.toHex() - - const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' - - const isMint = event.params.from.toHex() == ZERO_ADDRESS - const isBurn = event.params.to.toHex() == ZERO_ADDRESS - - const poolShareFromId = poolId.concat('-').concat(event.params.from.toHex()) - let poolShareFrom = PoolShare.load(poolShareFromId) - - const poolShareToId = poolId.concat('-').concat(event.params.to.toHex()) - let poolShareTo = PoolShare.load(poolShareToId) - const poolShareToBalance = poolShareTo == null ? ZERO_BD : poolShareTo.balance - - const pool = Pool.load(poolId) - if (!pool) return - const poolTx = PoolTransaction.load(event.transaction.hash.toHexString()) - const value = tokenToDecimal(event.params.value.toBigDecimal(), 18) - - if (isMint) { - if (poolShareTo == null) { - createPoolShareEntity(poolShareToId, poolId, event.params.to.toHex()) - poolShareTo = PoolShare.load(poolShareToId) - } - if (poolShareTo !== null) { - poolShareTo.balance = poolShareTo.balance.plus(value) - poolShareTo.save() - } - - pool.totalShares = pool.totalShares.plus(value) - if (poolTx != null) { - poolTx.sharesTransferAmount = value - if (poolShareTo !== null) poolTx.sharesBalance = poolShareTo.balance - } - } else if (isBurn) { - if (poolShareFrom == null) { - createPoolShareEntity(poolShareFromId, poolId, event.params.from.toHex()) - poolShareFrom = PoolShare.load(poolShareFromId) - } - - pool.totalShares = pool.totalShares.minus(value) - if (poolTx !== null) { - poolTx.sharesTransferAmount = poolTx.sharesTransferAmount.minus(value) - } - - if (poolTx !== null && poolShareFrom !== null) { - poolTx.sharesBalance = poolShareFrom.balance - } - - if (poolShareFrom !== null) { - poolShareFrom.balance = poolShareFrom.balance.minus(value) - poolShareFrom.save() - } - } else { - if (poolShareTo == null) { - createPoolShareEntity(poolShareToId, poolId, event.params.to.toHex()) - poolShareTo = PoolShare.load(poolShareToId) - } - - if (poolShareTo !== null) { - poolShareTo.balance = poolShareTo.balance.plus(value) - poolShareTo.save() - } - - if (poolShareFrom == null) { - createPoolShareEntity(poolShareFromId, poolId, event.params.from.toHex()) - poolShareFrom = PoolShare.load(poolShareFromId) - } - if (poolShareFrom !== null) { - poolShareFrom.balance = poolShareFrom.balance.minus(value) - poolShareFrom.save() - } - } - - if ( - poolShareTo != null && - poolShareTo.balance.notEqual(ZERO_BD) && - poolShareToBalance.equals(ZERO_BD) - ) { - pool.holderCount = pool.holderCount.plus(BigInt.fromI32(1)) - } - - if ( - poolShareFrom !== null && - poolShareFrom.balance.equals(ZERO_BD) && - poolShareFrom.balance.notEqual(ZERO_BD) - ) { - pool.holderCount = pool.holderCount.plus(BigInt.fromI32(1)) - } - - if (poolTx !== null) { - poolTx.save() - } - - pool.save() -} - -/************************************ - *********** GULP ************ - ************************************/ -export function handleGulp(event: LOG_CALL): void { - const poolId = event.address.toHex() - const ptx = event.transaction.hash.toHexString() - // we need to check the contract balance & compare with our internal balances - const pool = Pool.load(poolId) - const poolEbtity = PoolEntity.bind(Address.fromString(poolId)) - if (!pool) { - log.warning('Gulp called, but cannot load pool {}', [poolId]) - return - } - const ocnToken = PoolToken.load(poolId.concat('-').concat(OCEAN)) - const dtToken = PoolToken.load( - poolId.concat('-').concat(pool.datatokenAddress) - ) - - // get the balances from the contract - // for ocean - if (ocnToken) { - const ocnTokenBalance = ocnToken.balance - const balanceAttempt = poolEbtity.try_getBalance(Address.fromString(OCEAN)) - if (!balanceAttempt.reverted) { - const contractBalance = bigIntToDecimal(balanceAttempt.value, 18) - if ( - ocnToken.balance.notEqual(contractBalance) && - contractBalance.ge(ZERO_BD) - ) { - // we have a difference. let's absorb that - createPoolTransaction(event, 'gulp', event.params.caller.toHexString()) - ocnToken.balance = contractBalance - ocnToken.save() - updatePoolTransactionToken( - ptx, - ocnToken.id, - contractBalance.minus(ocnTokenBalance), - contractBalance, - ZERO_BD - ) - } - } - } - // for dt - if (dtToken) { - const dtTokenBalance = dtToken.balance - const balanceAttempt = poolEbtity.try_getBalance( - Address.fromString(pool.datatokenAddress) - ) - if (!balanceAttempt.reverted) { - const contractBalance = bigIntToDecimal(balanceAttempt.value, 18) - if ( - dtToken.balance.notEqual(contractBalance) && - contractBalance.ge(ZERO_BD) - ) { - // we have a difference. let's absorb that - createPoolTransaction(event, 'gulp', event.params.caller.toHexString()) - dtToken.balance = contractBalance - dtToken.save() - updatePoolTransactionToken( - ptx, - dtToken.id, - contractBalance.minus(dtTokenBalance), - contractBalance, - ZERO_BD - ) - } - } - } -} diff --git a/subgraph.yaml b/subgraph.yaml index f215d5c..c842ec4 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -1,213 +1,89 @@ -specVersion: 0.0.2 +specVersion: 0.0.3 description: Ocean provides data sharing through IDOs repository: https://github.com/oceanprotocol/ocean-subgraph schema: file: ./schema.graphql dataSources: - kind: ethereum/contract - name: Factory - network: mainnet + name: ERC721Factory + network: barge source: - address: '0xbe0083053744ECb871510C88dC0f6b77Da162706' - abi: Factory - startBlock: 11105585 + address: '0x0599a4a2873B38D836E10302De1ca4834F7BDF4E' + abi: ERC721Factory + startBlock: 0 mapping: kind: ethereum/events apiVersion: 0.0.5 language: wasm/assemblyscript - file: ./src/mappings/factory.ts + file: ./src/mappings/erc721Factory.ts entities: - - PoolFactory + - ERC721Factory abis: - - name: Factory - file: ./abis/BFactory.json + - name: ERC721Factory + file: ./abis/ERC721Factory.json eventHandlers: - - event: BPoolRegistered(address,indexed address) - handler: handleNewPool - - kind: ethereum/contract - name: DTFactory - network: mainnet - source: - address: '0x57317f97E9EA49eBd19f7c9bB7c180b8cDcbDeB9' - abi: DTFactory - startBlock: 11105560 - mapping: - kind: ethereum/events - apiVersion: 0.0.5 - language: wasm/assemblyscript - file: ./src/mappings/dtfactory.ts - entities: - - DatatokenFactory - abis: - - name: DTFactory - file: ./abis/DTFactory.json - eventHandlers: - - event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string) + - event: NFTCreated(indexed address,indexed address,indexed string,address) + handler: handleNftCreated + - event: TokenCreated(indexed address,indexed address,indexed string) handler: handleNewToken - - kind: ethereum/contract - name: Metadata - network: mainnet - source: - address: '0x1a4b70d8c9DcA47cD6D0Fb3c52BB8634CA1C0Fdf' - abi: Metadata - startBlock: 11105610 - mapping: - kind: ethereum/events - apiVersion: 0.0.5 - language: wasm/assemblyscript - file: ./src/mappings/metadata.ts - entities: - - Metadata - abis: - - name: Metadata - file: ./abis/Metadata.json - eventHandlers: - - event: MetadataCreated(indexed address,indexed address,bytes,bytes) - handler: handleMetadataCreated - - event: MetadataUpdated(indexed address,indexed address,bytes,bytes) - handler: handleMetadataUpdated - kind: ethereum/contract name: FixedRateExchange - network: mainnet + network: barge source: - address: '0x608d05214E42722B94a54cF6114d4840FCfF84e1' + address: '0x2356DeCd8CFB6c6f2bf46b5ED4531818B4662337' abi: FixedRateExchange - startBlock: 11105610 + startBlock: 0 mapping: kind: ethereum/events apiVersion: 0.0.5 language: wasm/assemblyscript - file: ./src/mappings/fixedrateexchange.ts + file: ./src/mappings/fixedRateExchange.ts entities: - FixedRateExchange abis: - name: FixedRateExchange file: ./abis/FixedRateExchange.json - - name: ERC20 - file: ./abis/ERC20.json - - name: ERC20SymbolBytes - file: ./abis/ERC20SymbolBytes.json - - name: ERC20NameBytes - file: ./abis/ERC20NameBytes.json eventHandlers: - event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256) handler: handleExchangeCreated - - event: ExchangeActivated(indexed bytes32,indexed address) - handler: handleExchangeActivated - - event: ExchangeDeactivated(indexed bytes32,indexed address) - handler: handleExchangeDeactivated - - event: ExchangeRateChanged(indexed bytes32,indexed address,uint256) - handler: handleExchangeRateChanged - - event: Swapped(indexed bytes32,indexed address,uint256,uint256) - handler: handleSwapped - kind: ethereum/contract - name: Dispenser - network: mainnet + name: FactoryRouter + network: barge source: - address: '0xDEfD0018969cd2d4E648209F876ADe184815f038' - abi: Dispenser - startBlock: 12398958 + address: '0x5509dc151e25BdA96d508A5994654980b7574883' + abi: FactoryRouter + startBlock: 0 mapping: kind: ethereum/events apiVersion: 0.0.5 language: wasm/assemblyscript - file: ./src/mappings/dispenser.ts + file: ./src/mappings/factoryRouter.ts entities: - - Dispenser + - FactoryRouter abis: - - name: Dispenser - file: ./abis/Dispenser.json + - name: FactoryRouter + file: ./abis/FactoryRouter.json eventHandlers: - - event: Activated(indexed address) - handler: handleDispenserActivated - - event: Deactivated(indexed address) - handler: handleDispenserDeactivated - - event: AcceptedMinter(indexed address) - handler: handleDispenserAcceptedMinter - - event: RemovedMinter(indexed address) - handler: handleDispenserRemovedMinter - - event: TokensDispensed(indexed address,indexed address,uint256) - handler: handleDispenserTokensDispensed - - event: OwnerWithdrawed(indexed address,indexed address,uint256) - handler: handleDispenserOwnerWithdrawed + - event: NewPool(indexed address,bool) + handler: handleNewPool templates: - - kind: ethereum/contract - name: Pool - network: mainnet + - name: ERC20Template + kind: ethereum/contract + network: barge source: - abi: Pool + abi: ERC20Template mapping: kind: ethereum/events apiVersion: 0.0.5 language: wasm/assemblyscript - file: ./src/mappings/pool.ts + file: ./src/mappings/erc20Template.ts entities: - - Pool - - PoolFactory - - Swap + - ERC20Template abis: - - name: Pool - file: ./abis/BPool.json - - name: BToken - file: ./abis/BToken.json - - name: ERC20 - file: ./abis/ERC20.json - - name: ERC20SymbolBytes - file: ./abis/ERC20SymbolBytes.json - - name: ERC20NameBytes - file: ./abis/ERC20NameBytes.json + - name: ERC20Template + file: ./abis/ERC20Template.json eventHandlers: - - event: LOG_CALL(indexed bytes4,indexed address,bytes) - topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000' - handler: handleSetSwapFee - - event: LOG_CALL(indexed bytes4,indexed address,bytes) - topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000' - handler: handleSetController - - event: LOG_CALL(indexed bytes4,indexed address,bytes) - topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000' - handler: handleSetPublicSwap - - event: LOG_CALL(indexed bytes4,indexed address,bytes) - topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000' - handler: handleFinalize - - event: LOG_CALL(indexed bytes4,indexed address,bytes) - topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000' - handler: handleSetup - - event: LOG_CALL(indexed bytes4,indexed address,bytes) - topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000' - handler: handleRebind - - event: LOG_CALL(indexed bytes4,indexed address,bytes) - topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000' - handler: handleRebind - - event: LOG_CALL(indexed bytes4,indexed address,bytes) - topic0: '0x8c28cbe800000000000000000000000000000000000000000000000000000000' - handler: handleGulp - - event: LOG_JOIN(indexed address,indexed address,uint256) - handler: handleJoinPool - - event: LOG_EXIT(indexed address,indexed address,uint256) - handler: handleExitPool - - event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256) - handler: handleSwap - - event: Transfer(indexed address,indexed address,uint256) - handler: handleTransfer - - - kind: ethereum/contract - name: DataToken - network: mainnet - source: - abi: DataToken - mapping: - kind: ethereum/events - apiVersion: 0.0.5 - language: wasm/assemblyscript - file: ./src/mappings/datatoken.ts - entities: - - DataToken - - DatatokenFactory - abis: - - name: DataToken - file: ./abis/DataTokenTemplate.json - eventHandlers: - - event: Transfer(indexed address,indexed address,uint256) - handler: handleTransfer - - event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256) + - event: OrderStarted(indexed address,address,uint256,uint256,uint256,indexed address,indexed address,uint256) handler: handleOrderStarted + - event: MinterApproved(address,address) + handler: handleMinterApproved