From f47ec9bb090d425d472b64ea26c3754c72d0ce3d Mon Sep 17 00:00:00 2001 From: Alex Coseru Date: Thu, 13 May 2021 09:19:21 +0300 Subject: [PATCH] add dispenser (#106) * add dispenser Co-authored-by: mihaisc Co-authored-by: Jamie Hewitt --- .gitignore | 3 + README.md | 1 + abis/Dispenser.json | 17468 +++++++++++++++++++++++++++ package-lock.json | 82 +- package.json | 2 +- schema.graphql | 368 +- scripts/generatebargesubgraph.js | 9 +- src/mappings/dispenser.ts | 176 + subgraph.moonbeamalpha.yaml | 30 + subgraph.polygon.yaml | 30 + subgraph.rinkeby.yaml | 30 + subgraph.ropsten.yaml | 30 + subgraph.yaml | 30 + test/integration/Dispenser.test.ts | 235 + test/integration/ZEnding.test.ts | 10 +- 15 files changed, 18298 insertions(+), 206 deletions(-) create mode 100644 abis/Dispenser.json create mode 100644 src/mappings/dispenser.ts create mode 100644 test/integration/Dispenser.test.ts diff --git a/.gitignore b/.gitignore index 33da998..7ebe308 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,6 @@ typings/ # next.js build output .next + +# auto generated barge yaml +subgraph.barge.yaml \ No newline at end of file diff --git a/README.md b/README.md index 6201123..cc6f079 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json" 4. Generate the subgraph ```bash +npm run codegen npm run bargesetup ``` diff --git a/abis/Dispenser.json b/abis/Dispenser.json new file mode 100644 index 0000000..5955c72 --- /dev/null +++ b/abis/Dispenser.json @@ -0,0 +1,17468 @@ +{ + "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/package-lock.json b/package-lock.json index 9e28f28..9245611 100644 --- a/package-lock.json +++ b/package-lock.json @@ -399,17 +399,17 @@ } }, "@oceanprotocol/contracts": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.5.16.tgz", - "integrity": "sha512-p7aFIUT8RVoMzdPP7ML8G08BnQ09syywKjOT16hqJm0GmofunEuVffUXbryG4EkQ+qRbf/zeoxSmesi79kQXlA==" + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.6.2.tgz", + "integrity": "sha512-J6amHsmVbdc2rAwbUYOaY7inLV13GxPIiqbsLF78nmdIvhhGDhT2LYMyfQtxkMwQzYDP6EzD4albCgOXlWM15g==" }, "@oceanprotocol/lib": { - "version": "0.14.8", - "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.14.8.tgz", - "integrity": "sha512-eqab5iEgowyIM/LcDDs6xhZo/KToOmVw0betjXLG0+g70zS8R6XL2RHzCpFyutSdf/cH0w/ltPUfR8ZBElIyhQ==", + "version": "0.14.9", + "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.14.9.tgz", + "integrity": "sha512-PUNbsryrm4614CbvalP2CZS9LZjvWfqopTdb91Rz4vLbnqinioELSFXNq+hiSkyuFqAy0szG0wueBcW8mwFbSg==", "requires": { "@ethereum-navigator/navigator": "^0.5.2", - "@oceanprotocol/contracts": "0.5.16", + "@oceanprotocol/contracts": "^0.6.2", "@types/crypto-js": "^4.0.1", "cross-fetch": "^3.1.2", "crypto-js": "^4.0.0", @@ -5163,9 +5163,9 @@ "integrity": "sha512-WRRyllsGXJM7ZN7gPTCCQ/6wNPTRDwiWdPK66l5sJzcU/oOzcIcRRf0Rux8bkpox/1yjt0F6VJRsQOIG2qz5sg==" }, "is-bigint": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz", - "integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", + "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==" }, "is-binary-path": { "version": "2.1.0", @@ -5182,11 +5182,32 @@ "integrity": "sha1-o9fZb+HD/wZex84nwsIea6ksGDI=" }, "is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", + "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", "requires": { - "call-bind": "^1.0.0" + "call-bind": "^1.0.2" + }, + "dependencies": { + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + } } }, "is-buffer": { @@ -5252,9 +5273,9 @@ "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==" }, "is-generator-function": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz", - "integrity": "sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ==" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz", + "integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==" }, "is-glob": { "version": "4.0.1", @@ -5413,9 +5434,9 @@ "dev": true }, "is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", + "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==" }, "is-obj": { "version": "2.0.0", @@ -5566,12 +5587,19 @@ "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==" }, "is-regex": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", - "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", "requires": { "call-bind": "^1.0.2", - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.2" + }, + "dependencies": { + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" + } } }, "string.prototype.trimend": { @@ -9818,9 +9846,9 @@ } }, "utf-8-validate": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz", - "integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.5.tgz", + "integrity": "sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ==", "requires": { "node-gyp-build": "^4.2.0" } diff --git a/package.json b/package.json index 941c285..aa92b41 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "typescript": "^4.2.4" }, "dependencies": { - "@oceanprotocol/lib": "^0.14.8", + "@oceanprotocol/lib": "^0.14.9", "cross-fetch": "^3.1.4" }, "repository": { diff --git a/schema.graphql b/schema.graphql index 3708fd4..0c2c4e9 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,239 +1,255 @@ type PoolFactory @entity { - id: ID! + id: ID! - totalValueLocked: BigDecimal # total value from all pools expressed in OCEAN - - totalOceanLiquidity: BigDecimal! # Total of OCEAN liquidity from all pools - totalSwapVolume: BigDecimal! # All the swap volume in Ocean - totalSwapFee: BigDecimal! # All the swap fee in Ocean - - poolCount: Int! # Number of pools - finalizedPoolCount: Int! # Number of finalized pools - - pools: [Pool!] @derivedFrom(field: "factoryID") + totalValueLocked: BigDecimal # total value from all pools expressed in OCEAN + totalOceanLiquidity: BigDecimal! # Total of OCEAN liquidity from all pools + totalSwapVolume: BigDecimal! # All the swap volume in Ocean + totalSwapFee: BigDecimal! # All the swap fee in Ocean + poolCount: Int! # Number of pools + finalizedPoolCount: Int! # Number of finalized pools + pools: [Pool!] @derivedFrom(field: "factoryID") } type Pool @entity { - id: ID! # Pool address - factoryID: PoolFactory! - controller: Bytes! # Controller address - publicSwap: Boolean! # isPublicSwap - finalized: Boolean! # isFinalized - symbol: String # Pool token symbol - name: String # Pool token name - cap: BigInt # Maximum supply if any - active: Boolean! # isActive - swapFee: BigDecimal! # Swap Fees + id: ID! # Pool address + factoryID: PoolFactory! + controller: Bytes! # Controller address + publicSwap: Boolean! # isPublicSwap + finalized: Boolean! # isFinalized + symbol: String # Pool token symbol + name: String # Pool token name + cap: BigInt # Maximum supply if any + active: Boolean! # isActive + swapFee: BigDecimal! # Swap Fees + totalWeight: BigDecimal! + totalShares: BigDecimal! # Total pool token shares + totalSwapVolume: BigDecimal! # Total swap volume in OCEAN + totalSwapFee: BigDecimal! # Total swap fee in OCEAN + valueLocked: BigDecimal! # value locked in pool expressed in OCEAN (captures both Ocean and Datatoken) + datatokenReserve: BigDecimal! # Total pool reserve of Datatoken + oceanReserve: BigDecimal! # Total pool reserve of OCEAN + spotPrice: BigDecimal! + consumePrice: BigDecimal! - totalWeight: BigDecimal! - totalShares: BigDecimal! # Total pool token shares - totalSwapVolume: BigDecimal! # Total swap volume in OCEAN - totalSwapFee: BigDecimal! # Total swap fee in OCEAN - - valueLocked: BigDecimal! # value locked in pool expressed in OCEAN (captures both Ocean and Datatoken) - datatokenReserve: BigDecimal! # Total pool reserve of Datatoken - oceanReserve: BigDecimal! # Total pool reserve of OCEAN - spotPrice: BigDecimal! - consumePrice: BigDecimal! - - tokenCount: BigInt! # Number of tokens in the pool - holderCount: BigInt! # Number of addresses holding a positive balance of pool shares - joinCount: BigInt! # liquidity has been added - exitCount: BigInt! # liquidity has been removed - swapCount: BigInt! - transactionCount: BigInt! # Number of transactions in this pool involving liquidity changes - - datatokenAddress: String! - createTime: Int! # Block time pool was created - tx: Bytes # Pool creation transaction id - - tokens: [PoolToken!] @derivedFrom(field: "poolId") - shares: [PoolShare!] @derivedFrom(field: "poolId") - transactions: [PoolTransaction!] @derivedFrom(field: "poolAddress") - transactionsTokenValues: [PoolTransactionTokenValues!] @derivedFrom(field: "poolAddress") + tokenCount: BigInt! # Number of tokens in the pool + holderCount: BigInt! # Number of addresses holding a positive balance of pool shares + joinCount: BigInt! # liquidity has been added + exitCount: BigInt! # liquidity has been removed + swapCount: BigInt! + transactionCount: BigInt! # Number of transactions in this pool involving liquidity changes + datatokenAddress: String! + createTime: Int! # Block time pool was created + tx: Bytes # Pool creation transaction id + tokens: [PoolToken!] @derivedFrom(field: "poolId") + shares: [PoolShare!] @derivedFrom(field: "poolId") + transactions: [PoolTransaction!] @derivedFrom(field: "poolAddress") + transactionsTokenValues: [PoolTransactionTokenValues!] + @derivedFrom(field: "poolAddress") } type PoolToken @entity { - id: ID! # poolId + token address - poolId: Pool! - tokenId: Datatoken - tokenAddress: String - balance: BigDecimal! - denormWeight: BigDecimal! + id: ID! # poolId + token address + poolId: Pool! + tokenId: Datatoken + tokenAddress: String + balance: BigDecimal! + denormWeight: BigDecimal! } type PoolShare @entity { - id: ID! # poolId + userAddress - userAddress: User! - poolId: Pool! - balance: BigDecimal! + id: ID! # poolId + userAddress + userAddress: User! + poolId: Pool! + balance: BigDecimal! } type PoolTransactionTokenValues @entity { - id: ID! # pool tx + tokenAddress - txId: PoolTransaction! - poolToken: PoolToken! - poolAddress: Pool! - userAddress: User! - tokenAddress: String! + id: ID! # pool tx + tokenAddress + txId: PoolTransaction! + poolToken: PoolToken! + poolAddress: Pool! + userAddress: User! + tokenAddress: String! - value: BigDecimal! - tokenReserve: BigDecimal! - feeValue: BigDecimal! # Swap fee value in OCEAN - type: String! + value: BigDecimal! + tokenReserve: BigDecimal! + feeValue: BigDecimal! # Swap fee value in OCEAN + type: String! } type PoolTransaction @entity { - id: ID! # pool tx - poolAddress: Pool - userAddress: User # User address that initiates the swap - poolAddressStr: String! - userAddressStr: String! + id: ID! # pool tx + poolAddress: Pool + userAddress: User # User address that initiates the swap + poolAddressStr: String! + userAddressStr: String! - sharesTransferAmount: BigDecimal! # - sharesBalance: BigDecimal! + sharesTransferAmount: BigDecimal! # + sharesBalance: BigDecimal! - spotPrice: BigDecimal! - consumePrice: BigDecimal! - tx: Bytes! - event: String - block: Int! - timestamp: Int! - gasUsed: BigDecimal! - gasPrice: BigDecimal! + spotPrice: BigDecimal! + consumePrice: BigDecimal! + tx: Bytes! + event: String + block: Int! + timestamp: Int! + gasUsed: BigDecimal! + gasPrice: BigDecimal! - oceanReserve: BigDecimal! - datatokenReserve: BigDecimal! + oceanReserve: BigDecimal! + datatokenReserve: BigDecimal! - tokens: [PoolTransactionTokenValues!] @derivedFrom(field: "txId") + tokens: [PoolTransactionTokenValues!] @derivedFrom(field: "txId") } type DatatokenFactory @entity { - id: ID! + id: ID! - tokenCount: Int! # Number of datatokens - - datatokens: [Datatoken!] @derivedFrom(field: "factoryID") + tokenCount: Int! # Number of datatokens + datatokens: [Datatoken!] @derivedFrom(field: "factoryID") } type Datatoken @entity { - id: ID! # token address - factoryID: DatatokenFactory! + id: ID! # token address + factoryID: DatatokenFactory! - symbol: String - name: String - decimals: Int! - address: String! - cap: BigDecimal! - supply: BigDecimal! - minter: User! - publisher: String! + symbol: String + name: String + decimals: Int! + address: String! + cap: BigDecimal! + supply: BigDecimal! + minter: User! + publisher: String! - holderCount: BigInt! # Number of addresses holding a balance of datatoken - orderCount: BigInt! # Number of orders executed for this dataset - metadataUpdateCount: BigInt! + holderCount: BigInt! # Number of addresses holding a balance of datatoken + orderCount: BigInt! # Number of orders executed for this dataset + metadataUpdateCount: BigInt! - createTime: Int! # Block time datatoken was created - tx: Bytes # Datatoken creation transaction id - - balances: [TokenBalance!] @derivedFrom(field: "datatokenId") - orders: [TokenOrder!] @derivedFrom(field: "datatokenId") - updates: [MetadataUpdate!] @derivedFrom(field: "datatokenId") # list of MetadataUpdate objects + createTime: Int! # Block time datatoken was created + tx: Bytes # Datatoken creation transaction id + balances: [TokenBalance!] @derivedFrom(field: "datatokenId") + orders: [TokenOrder!] @derivedFrom(field: "datatokenId") + updates: [MetadataUpdate!] @derivedFrom(field: "datatokenId") # list of MetadataUpdate objects } type MetadataUpdate @entity { - id: ID! # update tx + datatokenAddress - datatokenId: Datatoken! + id: ID! # update tx + datatokenAddress + datatokenId: Datatoken! - datatokenAddress: String! - userAddress: String! + datatokenAddress: String! + userAddress: String! - block: Int! - timestamp: Int! - tx: Bytes! + block: Int! + timestamp: Int! + tx: Bytes! } type TokenOrder @entity { - id: ID! # datatokenId + userAddress + tx + id: ID! # datatokenId + userAddress + tx + datatokenId: Datatoken! - datatokenId: Datatoken! + consumer: User! + payer: User! + amount: BigDecimal! + serviceId: Int! + marketFeeCollector: User + marketFee: BigDecimal! - consumer: User! - payer: User! - amount: BigDecimal! - serviceId: Int! - marketFeeCollector: User - marketFee: BigDecimal! - - timestamp: Int! - tx: Bytes - block: Int! + timestamp: Int! + tx: Bytes + block: Int! } type TokenBalance @entity { - id: ID! # datatokenId + userAddress - userAddress: User! - datatokenId: Datatoken! - balance: BigDecimal! + id: ID! # datatokenId + userAddress + userAddress: User! + datatokenId: Datatoken! + balance: BigDecimal! } type TokenTransaction @entity { - id: ID! # Log ID + id: ID! # Log ID + event: String + datatokenAddress: Datatoken + userAddress: User - event: String - datatokenAddress: Datatoken - userAddress: User - - block: Int! - gasUsed: BigDecimal! - gasPrice: BigDecimal! - timestamp: Int! - tx: Bytes! + block: Int! + gasUsed: BigDecimal! + gasPrice: BigDecimal! + timestamp: Int! + tx: Bytes! } type User @entity { - id: ID! + id: ID! - sharesOwned: [PoolShare!] @derivedFrom(field: "userAddress") - tokenBalancesOwned: [TokenBalance!] @derivedFrom(field: "userAddress") - tokensOwned: [Datatoken!] @derivedFrom(field: "minter") - poolTransactions: [PoolTransaction!] @derivedFrom(field: "userAddress") - poolTransactionsTokenValues: [PoolTransactionTokenValues!] @derivedFrom(field: "userAddress") - tokenTransactions: [TokenTransaction!] @derivedFrom(field: "userAddress") - orders: [TokenOrder!] @derivedFrom(field: "payer") - freSwaps: [FixedRateExchangeSwap!] @derivedFrom(field: "by") + sharesOwned: [PoolShare!] @derivedFrom(field: "userAddress") + tokenBalancesOwned: [TokenBalance!] @derivedFrom(field: "userAddress") + tokensOwned: [Datatoken!] @derivedFrom(field: "minter") + poolTransactions: [PoolTransaction!] @derivedFrom(field: "userAddress") + poolTransactionsTokenValues: [PoolTransactionTokenValues!] + @derivedFrom(field: "userAddress") + tokenTransactions: [TokenTransaction!] @derivedFrom(field: "userAddress") + orders: [TokenOrder!] @derivedFrom(field: "payer") + freSwaps: [FixedRateExchangeSwap!] @derivedFrom(field: "by") } type FixedRateExchange @entity { - id: ID! # fixed rate exchange id - exchangeOwner: User! - datatoken: Datatoken! - baseToken: String! - rate: BigDecimal! - active: Boolean! - updates: [FixedRateExchangeUpdate!] @derivedFrom(field: "exchangeId") - swaps: [FixedRateExchangeSwap!] @derivedFrom(field: "exchangeId") + id: ID! # fixed rate exchange id + exchangeOwner: User! + datatoken: Datatoken! + baseToken: String! + rate: BigDecimal! + active: Boolean! + updates: [FixedRateExchangeUpdate!] @derivedFrom(field: "exchangeId") + swaps: [FixedRateExchangeSwap!] @derivedFrom(field: "exchangeId") } type FixedRateExchangeUpdate @entity { - id: ID! - exchangeId: FixedRateExchange! - oldRate: BigDecimal! - newRate: BigDecimal! - oldActive: Boolean! - newActive: Boolean! - block: Int! - timestamp: Int! - tx: Bytes! + id: ID! + exchangeId: FixedRateExchange! + oldRate: BigDecimal! + newRate: BigDecimal! + oldActive: Boolean! + newActive: Boolean! + block: Int! + timestamp: Int! + tx: Bytes! } type FixedRateExchangeSwap @entity { - id: ID! - exchangeId: FixedRateExchange! - by: User! - baseTokenAmount: BigDecimal! - dataTokenAmount: BigDecimal! - block: Int! - timestamp: Int! - tx: Bytes! -} \ No newline at end of file + id: ID! + exchangeId: FixedRateExchange! + by: User! + baseTokenAmount: BigDecimal! + dataTokenAmount: BigDecimal! + block: Int! + timestamp: Int! + tx: Bytes! +} + +type Dispenser @entity { + id: ID! # dispenser datatoken + active: Boolean! + owner: User! + minterApproved: Boolean! + isTrueMinter: Boolean! + maxTokens: BigDecimal! + maxBalance: BigDecimal! + balance: BigDecimal! + datatoken: Datatoken! + dispenses: [DispenserTransaction!] @derivedFrom(field: "dispenserId") +} + +type DispenserTransaction @entity { + id: ID! + dispenserId: Dispenser! + datatoken: Datatoken! + user: User! + amount: BigDecimal! + block: Int! + timestamp: Int! + tx: Bytes! + type: String! +} diff --git a/scripts/generatebargesubgraph.js b/scripts/generatebargesubgraph.js index 56d5618..7452074 100644 --- a/scripts/generatebargesubgraph.js +++ b/scripts/generatebargesubgraph.js @@ -12,7 +12,9 @@ async function replaceContractAddresses() { // eslint-disable-next-line no-unused-vars FixedRateExchange, // eslint-disable-next-line no-unused-vars - Metadata + Metadata, + // eslint-disable-next-line no-unused-vars + Dispenser } = data.development let subgraph = fs.readFileSync('subgraph.yaml', 'utf8') if (!data) { @@ -38,6 +40,11 @@ async function replaceContractAddresses() { /0x608d05214E42722B94a54cF6114d4840FCfF84e1/g, FixedRateExchange ) + // dispenser + subgraph = subgraph.replace( + /0xDEfD0018969cd2d4E648209F876ADe184815f038/g, + Dispenser + ) // network subgraph = subgraph.replace(/network: mainnet/g, 'network: barge') diff --git a/src/mappings/dispenser.ts b/src/mappings/dispenser.ts new file mode 100644 index 0000000..f6e9e8c --- /dev/null +++ b/src/mappings/dispenser.ts @@ -0,0 +1,176 @@ +import { Address, BigInt, ethereum, log } from '@graphprotocol/graph-ts' +import { + Activated, + Deactivated, + AcceptedMinter, + RemovedMinter, + TokensDispensed, + OwnerWithdrawed, + Dispenser as DispenserEntity +} from '../@types/Dispenser/Dispenser' + +import { + Dispenser, + DispenserTransaction, + User, + Datatoken +} from '../@types/schema' + +import { tokenToDecimal, _debuglog } from '../helpers' + +function _processDispenserUpdate( + event: ethereum.Event, + datatoken: string, + contractAddress: Address +): void { + _debuglog('Start processDispenserUpdate', null, [ + datatoken, + contractAddress.toHexString() + ]) + const dt = Datatoken.load(datatoken) + if (!dt) { + return + } + let dispenser = Dispenser.load(datatoken) + if (!dispenser) { + _debuglog('Creating new dispenser', null, null) + dispenser = new Dispenser(datatoken) + } + const dispenserEntity = DispenserEntity.bind(contractAddress) + _debuglog('Bound dispenser entity', null, null) + const dispenserStatus = dispenserEntity.try_status( + Address.fromString(datatoken) + ) + _debuglog('Got status', null, null) + if (dispenserStatus.reverted) return + dispenser.active = dispenserStatus.value.value0 + let owner = User.load(dispenserStatus.value.value1.toHexString()) + if (!owner) { + owner = new User(dispenserStatus.value.value1.toHexString()) + owner.save() + } + dispenser.owner = owner.id + dispenser.minterApproved = dispenserStatus.value.value2 + dispenser.isTrueMinter = dispenserStatus.value.value3 + dispenser.maxTokens = tokenToDecimal( + dispenserStatus.value.value4.toBigDecimal(), + 18 + ) + dispenser.maxBalance = tokenToDecimal( + dispenserStatus.value.value5.toBigDecimal(), + 18 + ) + dispenser.balance = tokenToDecimal( + dispenserStatus.value.value6.toBigDecimal(), + 18 + ) + dispenser.datatoken = dt.id + dispenser.save() +} + +export function handleDispenserActivated(event: Activated): void { + _debuglog('Start handleDispenserActivated', event, [ + event.params.datatokenAddress.toHexString() + ]) + _processDispenserUpdate( + event, + event.params.datatokenAddress.toHexString(), + event.address + ) +} + +export function handleDispenserDeactivated(event: Deactivated): void { + _processDispenserUpdate( + event, + event.params.datatokenAddress.toHexString(), + event.address + ) +} +export function handleDispenserAcceptedMinter(event: AcceptedMinter): void { + _processDispenserUpdate( + event, + event.params.datatokenAddress.toHexString(), + event.address + ) +} +export function handleDispenserRemovedMinter(event: RemovedMinter): void { + _processDispenserUpdate( + event, + event.params.datatokenAddress.toHexString(), + event.address + ) +} + +export function handleDispenserTokensDispensed(event: TokensDispensed): void { + _processDispenserUpdate( + event, + event.params.datatokenAddress.toHexString(), + event.address + ) + const dt = Datatoken.load(event.params.datatokenAddress.toHexString()) + if (!dt) { + log.warning('Tokens dispensed, but no datatoken ? ', [ + event.params.datatokenAddress.toHexString() + ]) + return + } + + const tx = event.transaction.hash + const id = tx + .toHexString() + .concat('-') + .concat(event.params.datatokenAddress.toHexString()) + log.info('Created dispenser in handleDispenserTokensDispensed with id {}', [ + id + ]) + const dispensers = new DispenserTransaction(id) + dispensers.dispenserId = event.params.datatokenAddress.toHexString() + dispensers.datatoken = event.params.datatokenAddress.toHexString() + dispensers.user = event.params.userAddress.toHexString() + dispensers.amount = tokenToDecimal( + event.params.amount.toBigDecimal(), + BigInt.fromI32(18).toI32() + ) + dispensers.block = event.block.number.toI32() + dispensers.timestamp = event.block.timestamp.toI32() + dispensers.tx = tx + dispensers.type = 'dispense' + dispensers.save() +} + +export function handleDispenserOwnerWithdrawed(event: OwnerWithdrawed): void { + _processDispenserUpdate( + event, + event.params.datatoken.toHexString(), + event.address + ) + const dt = Datatoken.load(event.params.datatoken.toHexString()) + if (!dt) { + log.warning('Tokens dispensed, but no datatoken ? ', [ + event.params.datatoken.toHexString() + ]) + return + } + + const tx = event.transaction.hash + const id = tx + .toHexString() + .concat('-') + .concat(event.params.datatoken.toHexString()) + log.info('Created dispenser in handleDispenserOwnerWithdrawed with id {} ', [ + id + ]) + const dispensers = new DispenserTransaction(id) + dispensers.dispenserId = event.params.datatoken.toHexString() + dispensers.datatoken = event.params.datatoken.toHexString() + dispensers.user = event.params.owner.toHexString() + dispensers.amount = tokenToDecimal( + event.params.amount.toBigDecimal(), + BigInt.fromI32(18).toI32() + ) + dispensers.block = event.block.number.toI32() + dispensers.timestamp = event.block.timestamp.toI32() + dispensers.tx = tx + dispensers.type = 'withdraw' + dispensers.save() +} diff --git a/subgraph.moonbeamalpha.yaml b/subgraph.moonbeamalpha.yaml index 457e229..9016ffe 100644 --- a/subgraph.moonbeamalpha.yaml +++ b/subgraph.moonbeamalpha.yaml @@ -94,6 +94,36 @@ dataSources: handler: handleExchangeRateChanged - event: Swapped(indexed bytes32,indexed address,uint256,uint256) handler: handleSwapped + - kind: ethereum/contract + name: Dispenser + network: moonbeamalpha + source: + address: '0x042D709b72B437d7d387F2679bD4ac060e561c9f' + abi: Dispenser + startBlock: 260710 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/dispenser.ts + entities: + - Dispenser + abis: + - name: Dispenser + file: ./abis/Dispenser.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 templates: - kind: ethereum/contract name: Pool diff --git a/subgraph.polygon.yaml b/subgraph.polygon.yaml index 2e88325..ccda4ee 100644 --- a/subgraph.polygon.yaml +++ b/subgraph.polygon.yaml @@ -94,6 +94,36 @@ dataSources: handler: handleExchangeRateChanged - event: Swapped(indexed bytes32,indexed address,uint256,uint256) handler: handleSwapped + - kind: ethereum/contract + name: Dispenser + network: polygon + source: + address: '0x30E4CC2C7A9c6aA2b2Ce93586E3Df24a3A00bcDD' + abi: Dispenser + startBlock: 14275634 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/dispenser.ts + entities: + - Dispenser + abis: + - name: Dispenser + file: ./abis/Dispenser.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 templates: - kind: ethereum/contract name: Pool diff --git a/subgraph.rinkeby.yaml b/subgraph.rinkeby.yaml index 494bf69..82576cb 100644 --- a/subgraph.rinkeby.yaml +++ b/subgraph.rinkeby.yaml @@ -94,6 +94,36 @@ dataSources: handler: handleExchangeRateChanged - event: Swapped(indexed bytes32,indexed address,uint256,uint256) handler: handleSwapped + - kind: ethereum/contract + name: Dispenser + network: rinkeby + source: + address: '0x623744Cd25Ed553d3b4722667697F926cf99658B' + abi: Dispenser + startBlock: 8554110 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/dispenser.ts + entities: + - Dispenser + abis: + - name: Dispenser + file: ./abis/Dispenser.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 templates: - kind: ethereum/contract name: Pool diff --git a/subgraph.ropsten.yaml b/subgraph.ropsten.yaml index 00827fc..e17942e 100644 --- a/subgraph.ropsten.yaml +++ b/subgraph.ropsten.yaml @@ -94,6 +94,36 @@ dataSources: handler: handleExchangeRateChanged - event: Swapped(indexed bytes32,indexed address,uint256,uint256) handler: handleSwapped + - kind: ethereum/contract + name: Dispenser + network: ropsten + source: + address: '0xc37F8341Ac6e4a94538302bCd4d49Cf0852D30C0' + abi: Dispenser + startBlock: 10201082 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/dispenser.ts + entities: + - Dispenser + abis: + - name: Dispenser + file: ./abis/Dispenser.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 templates: - kind: ethereum/contract name: Pool diff --git a/subgraph.yaml b/subgraph.yaml index 364f48a..da48e48 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -94,6 +94,36 @@ dataSources: handler: handleExchangeRateChanged - event: Swapped(indexed bytes32,indexed address,uint256,uint256) handler: handleSwapped + - kind: ethereum/contract + name: Dispenser + network: mainnet + source: + address: '0xDEfD0018969cd2d4E648209F876ADe184815f038' + abi: Dispenser + startBlock: 12398958 + mapping: + kind: ethereum/events + apiVersion: 0.0.4 + language: wasm/assemblyscript + file: ./src/mappings/dispenser.ts + entities: + - Dispenser + abis: + - name: Dispenser + file: ./abis/Dispenser.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 templates: - kind: ethereum/contract name: Pool diff --git a/test/integration/Dispenser.test.ts b/test/integration/Dispenser.test.ts new file mode 100644 index 0000000..2170c0e --- /dev/null +++ b/test/integration/Dispenser.test.ts @@ -0,0 +1,235 @@ +/* eslint-disable prefer-destructuring */ +import { assert, use } from 'chai' +import spies from 'chai-spies' +import Web3 from 'web3' +import { Ocean, ConfigHelper, Account } from '@oceanprotocol/lib' +const fetch = require('cross-fetch') +const web3 = new Web3('http://127.0.0.1:8545') +const subgraphUrl = + 'http://localhost:9000/subgraphs/name/oceanprotocol/ocean-subgraph' +function sleep(ms: number) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) +} + +async function getDispenserStatusFromGraph(datatoken: string) { + const id = datatoken.toLowerCase() + const query = { + query: `query { + dispenser(id:"${id}"){active,owner{id},minterApproved,isTrueMinter,maxTokens,maxBalance,balance,datatoken{id}}}` + } + const response = await fetch(subgraphUrl, { + method: 'POST', + body: JSON.stringify(query) + }) + const result = await response.json() + return result +} + +use(spies) + +describe('Dispenser test flow', () => { + let alice: Account + let bob: Account + let ocean: Ocean + let tokenAddress + let tokenAddress2 + let tokenAddress3 + const tokenAmount = '1000' + it('Initialize Ocean Library', async () => { + const config = new ConfigHelper().getConfig('development') + config.web3Provider = web3 + ocean = await Ocean.getInstance(config) + alice = (await ocean.accounts.list())[0] + bob = (await ocean.accounts.list())[1] + }) + + it('should create some datatokens', async () => { + tokenAddress = await ocean.datatokens.create( + '', + alice.getId(), + '1000000000000000', + 'AliceDT', + 'DTA' + ) + assert(tokenAddress !== null) + tokenAddress2 = await ocean.datatokens.create( + '', + alice.getId(), + '1000000000000000', + 'AliceDT2', + 'DTA2' + ) + assert(tokenAddress2 !== null) + tokenAddress3 = await ocean.datatokens.create( + '', + alice.getId(), + '1000000000000000', + 'AliceDT3', + 'DTA3' + ) + assert(tokenAddress3 !== null) + }) + + it('Alice mints 1000 tokens', async () => { + const txid = await ocean.datatokens.mint( + tokenAddress, + alice.getId(), + tokenAmount + ) + assert(txid !== null) + }) + + it('Alice creates a dispenser', async () => { + const tx = await ocean.OceanDispenser.activate( + tokenAddress, + '1', + '1', + alice.getId() + ) + assert(tx, 'Cannot activate dispenser') + await sleep(3000) // let graph ingest our transaction + const status = await getDispenserStatusFromGraph(tokenAddress) + assert(status.data.dispenser.datatoken.id === tokenAddress.toLowerCase()) + assert(status.data.dispenser.owner.id === alice.getId().toLowerCase()) + assert(status.data.dispenser.isTrueMinter === false) + assert(status.data.dispenser.minterApproved === false) + assert(status.data.dispenser.active === true) + assert(status.data.dispenser.balance === '0') + }) + + it('Alice should make the dispenser a minter', async () => { + const tx = await ocean.OceanDispenser.makeMinter( + tokenAddress, + alice.getId() + ) + assert(tx, 'Cannot make dispenser a minter') + await sleep(3000) // let graph ingest our transaction + const status = await getDispenserStatusFromGraph(tokenAddress) + assert(status.data.dispenser.datatoken.id === tokenAddress.toLowerCase()) + assert(status.data.dispenser.owner.id === alice.getId().toLowerCase()) + assert(status.data.dispenser.isTrueMinter === true) + assert(status.data.dispenser.minterApproved === true) + }) + + it('Bob requests datatokens', async () => { + const tx = await ocean.OceanDispenser.dispense( + tokenAddress, + bob.getId(), + '1' + ) + assert(tx, 'Bob failed to get 1DT') + await sleep(3000) // let graph ingest our transaction + const id = tx.transactionHash.toLowerCase() + const query = { + query: `query DispenserHistory { + dispenserTransactions(orderBy: timestamp, orderDirection: desc, + where: {tx: "${id}"}) { + datatoken{id}, + user{id}, + amount, + block, + timestamp, + tx, + type + } + }` + } + + const response = await fetch(subgraphUrl, { + method: 'POST', + body: JSON.stringify(query) + }) + const result = await response.json() + + assert(result.data.dispenserTransactions[0].type === 'dispense') + }) + it('Alice calls removeMinter role and checks if she is the new minter', async () => { + const tx = await ocean.OceanDispenser.cancelMinter( + tokenAddress, + alice.getId() + ) + assert(tx, 'Cannot cancel minter role') + await sleep(3000) // let graph ingest our transaction + const status = await getDispenserStatusFromGraph(tokenAddress) + assert(status.data.dispenser.datatoken.id === tokenAddress.toLowerCase()) + assert(status.data.dispenser.owner.id === alice.getId().toLowerCase()) + assert(status.data.dispenser.isTrueMinter === false) + assert(status.data.dispenser.minterApproved === false) + assert(status.data.dispenser.active === true) + }) + it('Alice deactivates the dispenser', async () => { + const tx = await ocean.OceanDispenser.deactivate( + tokenAddress, + alice.getId() + ) + assert(tx, 'Cannot make dispenser a minter') + await sleep(3000) // let graph ingest our transaction + const status = await getDispenserStatusFromGraph(tokenAddress) + assert(status.data.dispenser.datatoken.id === tokenAddress.toLowerCase()) + assert(status.data.dispenser.owner.id === alice.getId().toLowerCase()) + assert(status.data.dispenser.active === false) + }) + + it('Alice creates a dispenser without minter role', async () => { + const tx = await ocean.OceanDispenser.activate( + tokenAddress2, + '1', + '1', + alice.getId() + ) + assert(tx, 'Cannot activate dispenser') + await sleep(3000) // let graph ingest our transaction + const status = await getDispenserStatusFromGraph(tokenAddress2) + assert(status.data.dispenser.datatoken.id === tokenAddress2.toLowerCase()) + assert(status.data.dispenser.owner.id === alice.getId().toLowerCase()) + assert(status.data.dispenser.isTrueMinter === false) + assert(status.data.dispenser.minterApproved === false) + assert(status.data.dispenser.active === true) + }) + it('Alice withdraws all datatokens', async () => { + const mintTx = await ocean.datatokens.mint( + tokenAddress2, + alice.getId(), + '10', + ocean.OceanDispenser.dispenserAddress + ) + assert(mintTx, 'Alice cannot mint tokens') + const tx = await ocean.OceanDispenser.ownerWithdraw( + tokenAddress2, + alice.getId() + ) + assert(tx, 'Alice failed to withdraw all her tokens') + await sleep(3000) // let graph ingest our transaction + const status = await getDispenserStatusFromGraph(tokenAddress2) + assert(status.data.dispenser.datatoken.id === tokenAddress2.toLowerCase()) + assert(status.data.dispenser.owner.id === alice.getId().toLowerCase()) + assert(status.data.dispenser.isTrueMinter === false) + assert(status.data.dispenser.minterApproved === false) + assert(status.data.dispenser.active === true) + assert(status.data.dispenser.balance === '0') + const id = tx.transactionHash.toLowerCase() + const query = { + query: `query DispenserHistory { + dispenserTransactions(orderBy: timestamp, orderDirection: desc, + where: {tx: "${id}"}) { + datatoken{id}, + user{id}, + amount, + block, + timestamp, + tx, + type + } + }` + } + // console.log(query) + const response = await fetch(subgraphUrl, { + method: 'POST', + body: JSON.stringify(query) + }) + const result = await response.json() + assert(result.data.dispenserTransactions[0].type === 'withdraw') + }) +}) diff --git a/test/integration/ZEnding.test.ts b/test/integration/ZEnding.test.ts index 0aa17f4..d732412 100644 --- a/test/integration/ZEnding.test.ts +++ b/test/integration/ZEnding.test.ts @@ -7,11 +7,20 @@ const web3 = new Web3('http://127.0.0.1:8545') const subgraphUrl = 'http://localhost:9000/subgraphs/name/oceanprotocol/ocean-subgraph' +function sleep(ms: number) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) +} + use(spies) describe('Ending tests', () => { let result: any + let lastblock it('Get Graph status', async () => { + await sleep(1000) // let graph ingest our last transactions + lastblock = await web3.eth.getBlockNumber() const query = { query: `query { _meta{hasIndexingErrors, @@ -31,7 +40,6 @@ describe('Ending tests', () => { assert(result.data._meta.hasIndexingErrors == false) }) it('Make sure that graph has synced to last block', async () => { - const lastblock = await web3.eth.getBlockNumber() assert(result.data._meta.block.number === lastblock) }) })