diff --git a/.gitignore b/.gitignore index b400562..b38db2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -RedPacket.json -HappyRedPacket.json -Migration.json node_modules/ build/ diff --git a/test/build/contracts/HappyRedPacket.json b/test/build/contracts/HappyRedPacket.json deleted file mode 100644 index 871d3c0..0000000 --- a/test/build/contracts/HappyRedPacket.json +++ /dev/null @@ -1,25453 +0,0 @@ -{ - "contractName": "HappyRedPacket", - "abi": [ - { - "inputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token_address", - "type": "address" - } - ], - "name": "ClaimSuccess", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "token_address", - "type": "address" - } - ], - "name": "CreationSuccess", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "token_address", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32[]", - "name": "_hashes", - "type": "bytes32[]" - }, - { - "internalType": "bool", - "name": "_ifrandom", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "_duration", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "_seed", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "_message", - "type": "string" - }, - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "uint256", - "name": "_token_type", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_token_addr", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_total_tokens", - "type": "uint256" - } - ], - "name": "create_red_packet", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "token_type", - "type": "uint256" - }, - { - "internalType": "address", - "name": "token_address", - "type": "address" - }, - { - "internalType": "address", - "name": "sender_address", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient_address", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer_token", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "a", - "type": "address" - } - ], - "name": "toBytes", - "outputs": [ - { - "internalType": "bytes", - "name": "b", - "type": "bytes" - } - ], - "payable": false, - "stateMutability": "pure", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "string", - "name": "password", - "type": "string" - }, - { - "internalType": "address", - "name": "_recipient", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "validation", - "type": "bytes32" - } - ], - "name": "claim", - "outputs": [ - { - "internalType": "uint256", - "name": "claimed", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "check_availability", - "outputs": [ - { - "internalType": "address", - "name": "token_address", - "type": "address" - }, - { - "internalType": "uint256", - "name": "balance", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimed", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "expired", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "check_claimed_list", - "outputs": [ - { - "internalType": "uint256[]", - "name": "claimed_list", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "claimer_addrs", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "refund", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.5.12+commit.7709ece9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"claimer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"claimed_value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token_address\",\"type\":\"address\"}],\"name\":\"ClaimSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"creator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"creation_time\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token_address\",\"type\":\"address\"}],\"name\":\"CreationSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"hash1\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"hash2\",\"type\":\"bytes32\"}],\"name\":\"Failure\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token_address\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"remaining_balance\",\"type\":\"uint256\"}],\"name\":\"RefundSuccess\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"check_availability\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"token_address\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimed\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"expired\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"check_claimed_list\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"claimed_list\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"claimer_addrs\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"password\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_recipient\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"validation\",\"type\":\"bytes32\"}],\"name\":\"claim\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"claimed\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"_hashes\",\"type\":\"bytes32[]\"},{\"internalType\":\"bool\",\"name\":\"_ifrandom\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_seed\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"_message\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"uint256\",\"name\":\"_token_type\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_token_addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_total_tokens\",\"type\":\"uint256\"}],\"name\":\"create_red_packet\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"refund\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"toBytes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"b\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"token_type\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"token_address\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender_address\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient_address\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer_token\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/yisiliu/Workspace/DimensionDev/RedPacket/test/contracts/redpacket.sol\":\"HappyRedPacket\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/yisiliu/Workspace/DimensionDev/RedPacket/test/contracts/redpacket.sol\":{\"keccak256\":\"0x5ae474895dc84dc8f9b749815ab5372ac4bc77addcdba719193a247d1d4170fa\",\"urls\":[\"bzz-raw://8ef8f5b24acde02d0b99b44046575f7e360ada95cf3c71d5209074048b9ac308\",\"dweb:/ipfs/QmTVXJxkpxMGuqTbigR8y8mej1EzTL2w2AnuMBJ7Kx4ruX\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzz-raw://59fd025151435da35faa8093a5c7a17de02de9d08ad27275c5cdf05050820d91\",\"dweb:/ipfs/QmQMvwEcPhoRXzbXyrdoeRtvLoifUW9Qh7Luho7bmUPRkc\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040518060800160405280604f8152602001612019604f913942600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516020018084805190602001908083835b602083106100c557805182526020820191506020810190506020830392506100a2565b6001836020036101000a0380198251168184511680821785525050505050509050018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b8152601401935050505060405160208183030381529060405280519060200120600481905550611ec7806101526000396000f3fe6080604052600436106100705760003560e01c80637249fbb61161004e5780637249fbb61461041557806388f20c19146104505780639224967c146104e8578063ffed49bc146105c057610070565b806311a9465f14610075578063593b79fe146102b05780636bfdaece1461037a575b600080fd5b6102ae600480360361012081101561008c57600080fd5b81019080803590602001906401000000008111156100a957600080fd5b8201836020820111156100bb57600080fd5b803590602001918460208302840111640100000000831117156100dd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080351515906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561015d57600080fd5b82018360208201111561016f57600080fd5b8035906020019184600183028401116401000000008311171561019157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101f457600080fd5b82018360208201111561020657600080fd5b8035906020019184600183028401116401000000008311171561022857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d0565b005b3480156102bc57600080fd5b506102ff600480360360208110156102d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610df9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033f578082015181840152602081019050610324565b50505050905090810190601f16801561036c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561038657600080fd5b506103b36004803603602081101561039d57600080fd5b8101908080359060200190929190505050610e44565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001838152602001821515151581526020019550505050505060405180910390f35b34801561042157600080fd5b5061044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050610eb1565b005b6104e6600480360360a081101561046657600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611117565b005b3480156104f457600080fd5b506105216004803603602081101561050b57600080fd5b810190808035906020019092919050505061140f565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561056857808201518184015260208101905061054d565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156105aa57808201518184015260208101905061058f565b5050505090500194505050505060405180910390f35b3480156105cc57600080fd5b506106ba600480360360808110156105e357600080fd5b81019080803590602001909291908035906020019064010000000081111561060a57600080fd5b82018360208201111561061c57600080fd5b8035906020019184600183028401116401000000008311171561063e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115af565b6040518082815260200191505060405180910390f35b600160008082825401925050819055506003805490506000541161075c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f3030302074727920616761696e206c617465720000000000000000000000000081525060200191505060405180910390fd5b88518110156107b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f815260200180611d9b603f913960400191505060405180910390fd5b6000895111610810576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180611e31602f913960400191505060405180910390fd5b60008314156108775780341015610872576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611dda6023913960400191505060405180910390fd5b6109d3565b60018314156109d257808273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561093257600080fd5b505afa158015610946573d6000803e3d6000fd5b505050506040513d602081101561095c57600080fd5b810190808051906020019092919050505010156109c4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d766025913960400191505060405180910390fd5b6109d18383333085611117565b5b5b600033426000546004548a604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018581526020018481526020018381526020018281526020019550505050505060405160208183030381529060405280519060200120905060006002600083815260200190815260200160002090508181600001819055506003816000015490806001815401808255809150509060018203906000526020600020016000909192909190915055508481600301819055508381600d0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508a5181600801819055508281600c0181905550338160040160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085816004016000019080519060200190610b61929190611c5e565b5086816004016002019080519060200190610b7d929190611c5e565b506000891415610b8e576201518098505b88420181600b0181905550600081600a0181905550898160010160006101000a81548160ff0219169083151502179055508a816007019080519060200190610bd7929190611cde565b5060008082600c015490506000600190506000600285600801548481610bf957fe5b0402905060008090505b8560080154811015610cb4578560010160009054906101000a900460ff1615610c665783610c3987600001548360005401611be3565b81610c4057fe5b06945082851015610c545760019450610c61565b81851115610c60578194505b5b610c74565b60028281610c7057fe5b0494505b8560020185908060018154018082558091505090600182039060005260206000200160009091929091909150555084840393508080600101915050610c03565b508285600201600187600201805490500381548110610ccf57fe5b90600052602060002001600082825401925050819055507f246f6c24037ffa65fe063dfda4cbb0c8403a2b63b9d1d455bf9724c3dc11564885600c015486600001548760040160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff164289600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390a1505050505050505050505050505050565b606060405173ffffffffffffffffffffffffffffffffffffffff8316925082741400000000000000000000000000000000000000001860148201526034810160405280915050919050565b60008060008060008060026000888152602001908152602001600020905080600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600c0154826008015483600a015484600b01544211955095509550955095505091939590929450565b60006002600083815260200190815260200160002090508060040160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611dfd6034913960400191505060405180910390fd5b4281600b015410610fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611e606033913960400191505060405180910390fd5b7f66c304c539e0bc7c8070207c09b9f6a5a9591b434dfed1867cc57fde7fb60093816000015482600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600c0154604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a16000816003015414156110cb573373ffffffffffffffffffffffffffffffffffffffff166108fc82600c01549081150290604051600060405180830381858888f193505050501580156110c5573d6000803e3d6000fd5b50611113565b60018160030154141561111257611111816003015482600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303385600c0154611117565b5b5b5050565b600185141561140857808473ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561119e57600080fd5b505afa1580156111b2573d6000803e3d6000fd5b505050506040513d60208110156111c857600080fd5b8101908080519060200190929190505050101561124d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4e6f7420656e6f7567680000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1663095ea7b383836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156112d457600080fd5b505af11580156112e8573d6000803e3d6000fd5b505050506040513d60208110156112fe57600080fd5b8101908080519060200190929190505050508373ffffffffffffffffffffffffffffffffffffffff166323b872dd8484846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156113cb57600080fd5b505af11580156113df573d6000803e3d6000fd5b505050506040513d60208110156113f557600080fd5b8101908080519060200190929190505050505b5050505050565b6060806000600260008581526020019081526020016000209050606081600a015460405190808252806020026020018201604052801561145e5781602001602082028038833980820191505090505b50905060008090505b82600a01548110156115165782601001600084600f01838154811061148857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301548282815181106114fd57fe5b6020026020010181815250508080600101915050611467565b508082600f018080548060200260200160405190810160405280929190818152602001828054801561159d57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611553575b50505050509050935093505050915091565b60008060026000878152602001908152602001600020905060008490504282600b015411611645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f30303320457870697265642e000000000000000000000000000000000000000081525060200191505060405180910390fd5b816008015482600a0154106116c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f303034204f7574206f662053746f636b2e00000000000000000000000000000081525060200191505060405180910390fd5b60008260100160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541461177c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f30303520416c726561647920436c61696d65640000000000000000000000000081525060200191505060405180910390fd5b8160070182600a01548154811061178f57fe5b9060005260206000200154868051906020012014611815576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f3030362057726f6e672050617373776f72642e0000000000000000000000000081525060200191505060405180910390fd5b61181e33610df9565b805190602001208414611899576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f3030372056616c69646174696f6e204661696c6564000000000000000000000081525060200191505060405180910390fd5b81600f018190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506000600115158360010160009054906101000a900460ff1615151415611946578260020183600a01548154811061193457fe5b90600052602060002001549050611964565b8260020160008154811061195657fe5b906000526020600020015490505b8083600c016000828254039250508190555082600a01548360100160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550808360100160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550428360100160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555082600a0160008154809291906001019190505550600083600301541415611ac2578173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611abc573d6000803e3d6000fd5b50611b06565b600183600301541415611b0557611b04836003015484600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308585611117565b5b5b7f358ddd686a5ca3ef6f8aee9b8d2dc3c642ecc278657c3802f8802b1a44c10e448360000154838386600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390a1809350505050949350505050565b600081338442604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c9f57805160ff1916838001178555611ccd565b82800160010185558215611ccd579182015b82811115611ccc578251825591602001919060010190611cb1565b5b509050611cda9190611d2b565b5090565b828054828255906000526020600020908101928215611d1a579160200282015b82811115611d19578251825591602001919060010190611cfe565b5b509050611d279190611d50565b5090565b611d4d91905b80821115611d49576000816000905550600101611d31565b5090565b90565b611d7291905b80821115611d6e576000816000905550600101611d56565b5090565b9056fe30303920596f75206861766520746f2073657420656e6f75676820616c6c6f77616e63652e303031204174206c65617374205b6e756d626572206f6620726564207061636b6574735d20746f6b656e7320746f20796f757220726564207061636b65742e30303820596f75206861766520746f2073656e6420656e6f75676820746f6b656e732e303038204f6e6c792074686520726564207061636b65742063726561746f722063616e20726566756e6420746865206d6f6e6579303032204174206c65617374203120706572736f6e2063616e20636c61696d2074686520726564207061636b65742e30303920446973616c6c6f77656420756e74696c207468652065787069726174696f6e2074696d652068617320706173736564a265627a7a72315820a177baedd506dc0dd392558c93c2c9ae0d608d9d84f902696ce53a75b7019a9464736f6c634300050c0032466f726d6572204e6174696f6e616c204261736b657462616c6c204173736f63696174696f6e20284e42412920436f6d6d697373696f6e657220446176696420537465726e2068617320646965642e", - "deployedBytecode": "0x6080604052600436106100705760003560e01c80637249fbb61161004e5780637249fbb61461041557806388f20c19146104505780639224967c146104e8578063ffed49bc146105c057610070565b806311a9465f14610075578063593b79fe146102b05780636bfdaece1461037a575b600080fd5b6102ae600480360361012081101561008c57600080fd5b81019080803590602001906401000000008111156100a957600080fd5b8201836020820111156100bb57600080fd5b803590602001918460208302840111640100000000831117156100dd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080351515906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561015d57600080fd5b82018360208201111561016f57600080fd5b8035906020019184600183028401116401000000008311171561019157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101f457600080fd5b82018360208201111561020657600080fd5b8035906020019184600183028401116401000000008311171561022857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106d0565b005b3480156102bc57600080fd5b506102ff600480360360208110156102d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610df9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033f578082015181840152602081019050610324565b50505050905090810190601f16801561036c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561038657600080fd5b506103b36004803603602081101561039d57600080fd5b8101908080359060200190929190505050610e44565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001838152602001821515151581526020019550505050505060405180910390f35b34801561042157600080fd5b5061044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050610eb1565b005b6104e6600480360360a081101561046657600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611117565b005b3480156104f457600080fd5b506105216004803603602081101561050b57600080fd5b810190808035906020019092919050505061140f565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561056857808201518184015260208101905061054d565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156105aa57808201518184015260208101905061058f565b5050505090500194505050505060405180910390f35b3480156105cc57600080fd5b506106ba600480360360808110156105e357600080fd5b81019080803590602001909291908035906020019064010000000081111561060a57600080fd5b82018360208201111561061c57600080fd5b8035906020019184600183028401116401000000008311171561063e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115af565b6040518082815260200191505060405180910390f35b600160008082825401925050819055506003805490506000541161075c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f3030302074727920616761696e206c617465720000000000000000000000000081525060200191505060405180910390fd5b88518110156107b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f815260200180611d9b603f913960400191505060405180910390fd5b6000895111610810576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180611e31602f913960400191505060405180910390fd5b60008314156108775780341015610872576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611dda6023913960400191505060405180910390fd5b6109d3565b60018314156109d257808273ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561093257600080fd5b505afa158015610946573d6000803e3d6000fd5b505050506040513d602081101561095c57600080fd5b810190808051906020019092919050505010156109c4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d766025913960400191505060405180910390fd5b6109d18383333085611117565b5b5b600033426000546004548a604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018581526020018481526020018381526020018281526020019550505050505060405160208183030381529060405280519060200120905060006002600083815260200190815260200160002090508181600001819055506003816000015490806001815401808255809150509060018203906000526020600020016000909192909190915055508481600301819055508381600d0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508a5181600801819055508281600c0181905550338160040160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085816004016000019080519060200190610b61929190611c5e565b5086816004016002019080519060200190610b7d929190611c5e565b506000891415610b8e576201518098505b88420181600b0181905550600081600a0181905550898160010160006101000a81548160ff0219169083151502179055508a816007019080519060200190610bd7929190611cde565b5060008082600c015490506000600190506000600285600801548481610bf957fe5b0402905060008090505b8560080154811015610cb4578560010160009054906101000a900460ff1615610c665783610c3987600001548360005401611be3565b81610c4057fe5b06945082851015610c545760019450610c61565b81851115610c60578194505b5b610c74565b60028281610c7057fe5b0494505b8560020185908060018154018082558091505090600182039060005260206000200160009091929091909150555084840393508080600101915050610c03565b508285600201600187600201805490500381548110610ccf57fe5b90600052602060002001600082825401925050819055507f246f6c24037ffa65fe063dfda4cbb0c8403a2b63b9d1d455bf9724c3dc11564885600c015486600001548760040160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff164289600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019550505050505060405180910390a1505050505050505050505050505050565b606060405173ffffffffffffffffffffffffffffffffffffffff8316925082741400000000000000000000000000000000000000001860148201526034810160405280915050919050565b60008060008060008060026000888152602001908152602001600020905080600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600c0154826008015483600a015484600b01544211955095509550955095505091939590929450565b60006002600083815260200190815260200160002090508060040160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611dfd6034913960400191505060405180910390fd5b4281600b015410610fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611e606033913960400191505060405180910390fd5b7f66c304c539e0bc7c8070207c09b9f6a5a9591b434dfed1867cc57fde7fb60093816000015482600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600c0154604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a16000816003015414156110cb573373ffffffffffffffffffffffffffffffffffffffff166108fc82600c01549081150290604051600060405180830381858888f193505050501580156110c5573d6000803e3d6000fd5b50611113565b60018160030154141561111257611111816003015482600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303385600c0154611117565b5b5b5050565b600185141561140857808473ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561119e57600080fd5b505afa1580156111b2573d6000803e3d6000fd5b505050506040513d60208110156111c857600080fd5b8101908080519060200190929190505050101561124d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4e6f7420656e6f7567680000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1663095ea7b383836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156112d457600080fd5b505af11580156112e8573d6000803e3d6000fd5b505050506040513d60208110156112fe57600080fd5b8101908080519060200190929190505050508373ffffffffffffffffffffffffffffffffffffffff166323b872dd8484846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156113cb57600080fd5b505af11580156113df573d6000803e3d6000fd5b505050506040513d60208110156113f557600080fd5b8101908080519060200190929190505050505b5050505050565b6060806000600260008581526020019081526020016000209050606081600a015460405190808252806020026020018201604052801561145e5781602001602082028038833980820191505090505b50905060008090505b82600a01548110156115165782601001600084600f01838154811061148857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301548282815181106114fd57fe5b6020026020010181815250508080600101915050611467565b508082600f018080548060200260200160405190810160405280929190818152602001828054801561159d57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611553575b50505050509050935093505050915091565b60008060026000878152602001908152602001600020905060008490504282600b015411611645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f30303320457870697265642e000000000000000000000000000000000000000081525060200191505060405180910390fd5b816008015482600a0154106116c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f303034204f7574206f662053746f636b2e00000000000000000000000000000081525060200191505060405180910390fd5b60008260100160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541461177c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f30303520416c726561647920436c61696d65640000000000000000000000000081525060200191505060405180910390fd5b8160070182600a01548154811061178f57fe5b9060005260206000200154868051906020012014611815576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f3030362057726f6e672050617373776f72642e0000000000000000000000000081525060200191505060405180910390fd5b61181e33610df9565b805190602001208414611899576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f3030372056616c69646174696f6e204661696c6564000000000000000000000081525060200191505060405180910390fd5b81600f018190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506000600115158360010160009054906101000a900460ff1615151415611946578260020183600a01548154811061193457fe5b90600052602060002001549050611964565b8260020160008154811061195657fe5b906000526020600020015490505b8083600c016000828254039250508190555082600a01548360100160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550808360100160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550428360100160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555082600a0160008154809291906001019190505550600083600301541415611ac2578173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611abc573d6000803e3d6000fd5b50611b06565b600183600301541415611b0557611b04836003015484600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308585611117565b5b5b7f358ddd686a5ca3ef6f8aee9b8d2dc3c642ecc278657c3802f8802b1a44c10e448360000154838386600d0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390a1809350505050949350505050565b600081338442604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611c9f57805160ff1916838001178555611ccd565b82800160010185558215611ccd579182015b82811115611ccc578251825591602001919060010190611cb1565b5b509050611cda9190611d2b565b5090565b828054828255906000526020600020908101928215611d1a579160200282015b82811115611d19578251825591602001919060010190611cfe565b5b509050611d279190611d50565b5090565b611d4d91905b80821115611d49576000816000905550600101611d31565b5090565b90565b611d7291905b80821115611d6e576000816000905550600101611d56565b5090565b9056fe30303920596f75206861766520746f2073657420656e6f75676820616c6c6f77616e63652e303031204174206c65617374205b6e756d626572206f6620726564207061636b6574735d20746f6b656e7320746f20796f757220726564207061636b65742e30303820596f75206861766520746f2073656e6420656e6f75676820746f6b656e732e303038204f6e6c792074686520726564207061636b65742063726561746f722063616e20726566756e6420746865206d6f6e6579303032204174206c65617374203120706572736f6e2063616e20636c61696d2074686520726564207061636b65742e30303920446973616c6c6f77656420756e74696c207468652065787069726174696f6e2074696d652068617320706173736564a265627a7a72315820a177baedd506dc0dd392558c93c2c9ae0d608d9d84f902696ce53a75b7019a9464736f6c634300050c0032", - "sourceMap": "91:9358:1:-;;;1635:141;8:9:-1;5:2;;;30:1;27;20:12;5:2;1635:141:1;1685:10;1666:16;;:29;;;;;;;;;;;;;;;;;;1739:5;;;;;;;;;;;;;;;;;1746:3;1751:16;;;;;;;;;;;1722:46;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1722:46:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1722:46:1;;;1712:57;;;;;;1705:4;:64;;;;91:9358;;;;;;", - "deployedSourceMap": "91:9358:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1866:2611;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1866:2611:1;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1866:2611:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1866:2611:1;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;1866:2611:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1866:2611:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1866:2611:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1866:2611:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1866:2611:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1866:2611:1;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1866:2611:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1866:2611:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1866:2611:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1866:2611:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;5462:343;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5462:343:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5462:343:1;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;5462:343:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7742:380;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7742:380:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7742:380:1;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8671:655;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8671:655:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8671:655:1;;;;;;;;;;;;;;;;;:::i;:::-;;4527:490;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;4527:490:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;8214:451;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8214:451:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;8214:451:1;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8214:451:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;8214:451:1;;;;;;;;;;;;;;;;;;;5898:1740;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5898:1740:1;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;5898:1740:1;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;5898:1740:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;5898:1740:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;5898:1740:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;5898:1740:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1866:2611;2175:1;2166:5;;:10;;;;;;;;;;;2202;:17;;;;2194:5;;:25;2186:57;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2279:7;:14;2262:13;:31;;2254:123;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2412:1;2395:7;:14;:18;2387:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2495:1;2480:11;:16;2476:409;;;2531:13;2518:9;:26;;2510:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2476:409;;;2618:1;2603:11;:16;2599:286;;;2703:13;2650:11;2643:29;;;2673:10;2693:4;2643:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2643:56:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2643:56:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2643:56:1;;;;;;;;;;;;;;;;:73;;2635:143;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2792:82;2807:11;2820;2833:10;2853:4;2860:13;2792:14;:82::i;:::-;2599:286;2476:409;2895:11;2936:10;2948:3;2953:5;;2960:4;;2966:5;2919:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2919:53:1;;;2909:64;;;;;;2895:78;;2983:20;3006:15;:20;3022:3;3006:20;;;;;;;;;;;2983:43;;3044:3;3036:2;:5;;:11;;;;3057:10;3073:2;:5;;;3057:22;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;3057:22:1;;;;;;;;;;;;;;;;;;;;;;3106:11;3090:2;:13;;:27;;;;3146:11;3127:2;:16;;;:30;;;;;;;;;;;;;;;;;;3186:7;:14;3168:2;:15;;:32;;;;3232:13;3210:2;:19;;:35;;;;3274:10;3256:2;:10;;:15;;;:28;;;;;;;;;;;;;;;;;;3312:5;3294:2;:10;;:15;;:23;;;;;;;;;;;;:::i;:::-;;3348:8;3327:2;:10;;:18;;:29;;;;;;;;;;;;:::i;:::-;;3384:1;3371:9;:14;3367:49;;;3411:5;3399:17;;3367:49;3464:9;3458:3;:15;3437:2;:18;;:36;;;;3504:1;3484:2;:17;;:21;;;;3529:9;3515:2;:11;;;:23;;;;;;;;;;;;;;;;;;3560:7;3548:2;:9;;:19;;;;;;;;;;;;:::i;:::-;;3578:16;3604:17;3624:2;:19;;;3604:39;;3653:15;3671:1;3653:19;;3682:15;3733:1;3715:2;:15;;;3700:12;:30;;;;;;:34;3682:52;;3749:6;3758:1;3749:10;;3744:548;3765:2;:15;;;3761:1;:19;3744:548;;;3804:2;:11;;;;;;;;;;;;3800:400;;;3873:12;3848:22;3855:2;:5;;;3868:1;3862:5;;:7;3848:6;:22::i;:::-;:37;;;;;;3834:51;;3921:10;3907:11;:24;3903:203;;;3969:1;3955:15;;3903:203;;;4029:10;4015:11;:24;4011:95;;;4077:10;4063:24;;4011:95;3903:203;3800:400;;;4184:1;4171:10;:14;;;;;;4156:29;;3800:400;4213:2;:9;;4228:11;4213:27;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;4213:27:1;;;;;;;;;;;;;;;;;;;;;;4270:11;4254:27;;;;3782:3;;;;;;;3744:548;;;;4360:12;4327:2;:9;;4354:1;4337:2;:9;;:16;;;;:18;4327:29;;;;;;;;;;;;;;;;:45;;;;;;;;;;;4387:83;4403:2;:19;;;4424:2;:5;;;4431:2;:10;;:15;;;;;;;;;;;;4448:3;4453:2;:16;;;;;;;;;;;;4387:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1866:2611;;;;;;;;;;;;;;;:::o;5462:343::-;5511:14;5575:4;5569:11;5605:42;5602:1;5598:50;5593:55;;5730:1;5684:44;5680:52;5675:2;5672:1;5668:10;5661:72;5766:2;5763:1;5759:10;5753:4;5746:24;5788:1;5783:6;;5546:253;;;;:::o;7742:380::-;7803:21;7826:12;7905:10;7917:12;7931;7955:20;7978:15;:19;7994:2;7978:19;;;;;;;;;;;7955:42;;8015:2;:16;;;;;;;;;;;;8033:2;:19;;;8054:2;:15;;;8071:2;:17;;;8096:2;:18;;;8090:3;:24;8007:108;;;;;;;;;;;7742:380;;;;;;;:::o;8671:655::-;8716:20;8739:15;:19;8755:2;8739:19;;;;;;;;;;;8716:42;;8790:2;:10;;:15;;;;;;;;;;;;8776:29;;:10;:29;;;8768:94;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8901:3;8880:2;:18;;;:24;8872:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8976:59;8990:2;:5;;;8997:2;:16;;;;;;;;;;;;9015:2;:19;;;8976:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9066:1;9049:2;:13;;;:18;9045:275;;;9083:10;:19;;:40;9103:2;:19;;;9083:40;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9083:40:1;9045:275;;;9169:1;9152:2;:13;;;:18;9148:172;;;9186:123;9201:2;:13;;;9216:2;:16;;;;;;;;;;;;9242:4;9277:10;9289:2;:19;;;9186:14;:123::i;:::-;9148:172;9045:275;8671:655;;:::o;4527:490::-;4742:1;4728:10;:15;4724:287;;;4818:6;4774:13;4767:31;;;4799:14;4767:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4767:47:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4767:47:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4767:47:1;;;;;;;;;;;;;;;;:57;;4759:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4860:13;4853:29;;;4883:17;4902:6;4853:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4853:56:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4853:56:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4853:56:1;;;;;;;;;;;;;;;;;4930:13;4923:34;;;4958:14;4974:17;4993:6;4923:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4923:77:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4923:77:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4923:77:1;;;;;;;;;;;;;;;;;4724:287;4527:490;;;;;:::o;8214:451::-;8280:26;8308:30;8350:20;8373:15;:19;8389:2;8373:19;;;;;;;;;;;8350:42;;8402:28;8444:2;:17;;;8433:29;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;8433:29:1;;;;8402:60;;8477:6;8486:1;8477:10;;8472:136;8493:2;:17;;;8489:1;:21;8472:136;;;8550:2;:11;;:32;8562:2;:16;;8579:1;8562:19;;;;;;;;;;;;;;;;;;;;;;;;;8550:32;;;;;;;;;;;;;;;:47;;;8530:14;8545:1;8530:17;;;;;;;;;;;;;:67;;;;;8512:3;;;;;;;8472:136;;;;8625:14;8641:2;:16;;8617:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8214:451;;;:::o;5898:1740::-;6010:12;6034:20;6057:15;:19;6073:2;6057:19;;;;;;;;;;;6034:42;;6086:25;6130:10;6086:56;;6207:3;6186:2;:18;;;:24;6177:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6266:2;:15;;;6246:2;:17;;;:35;6237:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6363:1;6322:2;:11;;:22;6334:9;6322:22;;;;;;;;;;;;;;;:37;;;:42;6313:75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6437:2;:9;;6447:2;:17;;;6437:28;;;;;;;;;;;;;;;;6423:8;6407:26;;;;;;:58;6398:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6532:19;6540:10;6532:7;:19::i;:::-;6522:30;;;;;;6508:10;:44;6499:79;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6619:2;:16;;6641:9;6619:32;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;6619:32:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6719:19;6767:4;6752:19;;:2;:11;;;;;;;;;;;;:19;;;6748:163;;;6804:2;:9;;6814:2;:17;;;6804:28;;;;;;;;;;;;;;;;6787:45;;6748:163;;;6888:2;:9;;6898:1;6888:12;;;;;;;;;;;;;;;;6871:29;;6748:163;6943:14;6920:2;:19;;;:37;;;;;;;;;;;6998:2;:17;;;6967:2;:11;;:22;6979:9;6967:22;;;;;;;;;;;;;;;:28;;:48;;;;7065:14;7025:2;:11;;:22;7037:9;7025:22;;;;;;;;;;;;;;;:37;;:54;;;;7127:3;7089:2;:11;;:22;7101:9;7089:22;;;;;;;;;;;;;;;:35;;:41;;;;7140:2;:17;;;:20;;;;;;;;;;;;;7248:1;7231:2;:13;;;:18;7227:263;;;7265:9;:18;;:34;7284:14;7265:34;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;7265:34:1;7227:263;;;7345:1;7328:2;:13;;;:18;7324:166;;;7362:117;7377:2;:13;;;7392:2;:16;;;;;;;;;;;;7418:4;7453:9;7464:14;7362;:117::i;:::-;7324:166;7227:263;7536:64;7549:2;:5;;;7556:9;7567:14;7583:2;:16;;;;;;;;;;;;7536:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7617:14;7610:21;;;;;5898:1740;;;;;;:::o;5152:173::-;5222:9;5282:10;5294;5306:4;5312:3;5265:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;5265:51:1;;;5255:62;;;;;;5250:68;;5243:75;;5152:173;;;;:::o;91:9358::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity >0.4.22;\nimport \"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\";\n\ncontract HappyRedPacket {\n\n struct RedPacket {\n bytes32 id;\n bool ifrandom;\n uint[] tokens;\n uint token_type;\n Creator creator;\n bytes32[] hashes;\n uint total_number;\n string creator_name;\n uint claimed_number;\n uint expiration_time;\n uint remaining_tokens;\n address token_address;\n string claimed_list_str;\n address[] claimer_addrs;\n mapping(address => Claimer) claimers;\n }\n\n struct Creator {\n string name;\n address addr;\n string message;\n }\n\n struct Claimer {\n uint index;\n string name;\n uint claimed_time;\n uint claimed_tokens;\n }\n\n event CreationSuccess(\n uint total,\n bytes32 id,\n address creator,\n uint creation_time,\n address token_address\n );\n\n event ClaimSuccess(\n bytes32 id,\n address claimer,\n uint claimed_value,\n address token_address\n );\n\n event Failure(\n bytes32 id,\n bytes32 hash1,\n bytes32 hash2\n );\n event RefundSuccess(\n bytes32 id,\n address token_address,\n uint remaining_balance\n );\n\n uint nonce;\n address contract_creator;\n mapping(bytes32 => RedPacket) redpacket_by_id;\n bytes32 [] redpackets;\n string constant magic = \"Former National Basketball Association (NBA) Commissioner David Stern has died.\";\n bytes32 private uuid;\n // uint constant min_amount = 135000 * 15 * 10**9; // 0.002025 ETH\n\n constructor() public {\n contract_creator = msg.sender;\n uuid = keccak256(abi.encodePacked(magic, now, contract_creator));\n }\n\n // Inits a red packet instance\n // _token_type: 0 - ETH 1 - ERC20 2 - ERC721\n function create_red_packet (bytes32[] memory _hashes, bool _ifrandom, uint _duration, \n bytes32 _seed, string memory _message, string memory _name,\n uint _token_type, address _token_addr, uint _total_tokens) \n public payable {\n nonce += 1;\n require(nonce > redpackets.length, \"000 try again later\");\n\n require(_total_tokens >= _hashes.length,\n \"001 At least [number of red packets] tokens to your red packet.\");\n require(_hashes.length > 0, \"002 At least 1 person can claim the red packet.\");\n\n if (_token_type == 0)\n require(msg.value >= _total_tokens, \"008 You have to send enough tokens.\");\n else if (_token_type == 1) {\n require(IERC20(_token_addr).allowance(msg.sender, address(this)) >= _total_tokens,\n \"009 You have to set enough allowance.\");\n transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens);\n }\n\n bytes32 _id = keccak256(abi.encodePacked(msg.sender, now, nonce, uuid, _seed));\n RedPacket storage rp = redpacket_by_id[_id];\n rp.id = _id;\n redpackets.push(rp.id);\n\n rp.token_type = _token_type;\n rp.token_address = _token_addr;\n\n rp.total_number = _hashes.length;\n rp.remaining_tokens = _total_tokens;\n\n rp.creator.addr = msg.sender;\n rp.creator.name = _name;\n rp.creator.message = _message;\n\n if (_duration == 0)\n _duration = 86400; // 24hours\n rp.expiration_time = now + _duration;\n\n rp.claimed_number = 0;\n rp.ifrandom = _ifrandom;\n rp.hashes = _hashes;\n\n uint rand_tokens;\n uint total_tokens = rp.remaining_tokens;\n uint MIN_AMOUNT = 1;\n uint MAX_AMOUNT = total_tokens / rp.total_number * 2;\n for (uint i = 0; i < rp.total_number; i++){\n if (rp.ifrandom){\n rand_tokens = random(rp.id, nonce+i) % total_tokens;\n if (rand_tokens < MIN_AMOUNT) {\n rand_tokens = 1;\n }\n else if (rand_tokens > MAX_AMOUNT) {\n rand_tokens = MAX_AMOUNT;\n }\n }\n else {\n rand_tokens = MAX_AMOUNT / 2;\n }\n rp.tokens.push(rand_tokens);\n total_tokens -= rand_tokens;\n }\n // Last gets left\n rp.tokens[rp.tokens.length-1] += total_tokens;\n emit CreationSuccess(rp.remaining_tokens, rp.id, rp.creator.addr, now, rp.token_address);\n }\n\n // Check the balance of the given token\n function transfer_token(uint token_type, address token_address, address sender_address,\n address recipient_address, uint amount) public payable{\n // ERC20\n if (token_type == 1) {\n require(IERC20(token_address).balanceOf(sender_address) >= amount, \"Not enough\");\n IERC20(token_address).approve(recipient_address, amount);\n IERC20(token_address).transferFrom(sender_address, recipient_address, amount);\n }\n }\n\n // An interactive way of generating randint\n // This should be only used in claim()\n // Pending on finding better ways\n function random(bytes32 seed, uint nonce_rand) internal view returns (uint rand) {\n return uint(keccak256(abi.encodePacked(nonce_rand, msg.sender, seed, now)));\n }\n \n // https://ethereum.stackexchange.com/questions/884/how-to-convert-an-address-to-bytes-in-solidity\n // 695 gas consumed\n function toBytes(address a) public pure returns (bytes memory b) {\n assembly {\n let m := mload(0x40)\n a := and(a, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)\n mstore(add(m, 20), xor(0x140000000000000000000000000000000000000000, a))\n mstore(0x40, add(m, 52))\n b := m\n }\n }\n\n // It takes the unhashed password and a hashed random seed generated from the user\n function claim(bytes32 id, string memory password, address _recipient, bytes32 validation) \n public returns (uint claimed) {\n RedPacket storage rp = redpacket_by_id[id];\n address payable recipient = address(uint160(_recipient));\n\n // Unsuccessful\n require (rp.expiration_time > now, \"003 Expired.\");\n require (rp.claimed_number < rp.total_number, \"004 Out of Stock.\");\n require (rp.claimers[recipient].claimed_tokens == 0, \"005 Already Claimed\");\n require (keccak256(bytes(password)) == rp.hashes[rp.claimed_number], \"006 Wrong Password.\");\n require (validation == keccak256(toBytes(msg.sender)), \"007 Validation Failed\");\n\n // Store claimer info\n rp.claimer_addrs.push(recipient);\n // Claimer memory claimer = claimers[msg.sender];\n uint claimed_tokens;\n if (rp.ifrandom == true) {\n claimed_tokens = rp.tokens[rp.claimed_number];\n }\n else {\n claimed_tokens = rp.tokens[0];\n }\n rp.remaining_tokens -= claimed_tokens;\n rp.claimers[recipient].index = rp.claimed_number;\n rp.claimers[recipient].claimed_tokens = claimed_tokens;\n rp.claimers[recipient].claimed_time = now;\n rp.claimed_number ++;\n\n // Transfer the red packet after state changing\n if (rp.token_type == 0) {\n recipient.transfer(claimed_tokens);\n }\n else if (rp.token_type == 1) {\n transfer_token(rp.token_type, rp.token_address, address(this),\n recipient, claimed_tokens);\n }\n\n // Claim success event\n emit ClaimSuccess(rp.id, recipient, claimed_tokens, rp.token_address);\n return claimed_tokens;\n }\n\n // Returns 1. remaining value 2. total number of red packets 3. claimed number of red packets\n function check_availability(bytes32 id) public view returns (address token_address, uint balance, \n uint total, uint claimed, bool expired) {\n RedPacket storage rp = redpacket_by_id[id];\n return (rp.token_address, rp.remaining_tokens, rp.total_number, rp.claimed_number, now > rp.expiration_time);\n }\n\n // Returns 1. a list of claimed values 2. a list of claimed addresses accordingly\n function check_claimed_list(bytes32 id) \n public view returns (uint[] memory claimed_list, address[] memory claimer_addrs) {\n RedPacket storage rp = redpacket_by_id[id];\n uint[] memory claimed_tokens = new uint[](rp.claimed_number);\n for (uint i = 0; i < rp.claimed_number; i++){\n claimed_tokens[i] = rp.claimers[rp.claimer_addrs[i]].claimed_tokens;\n }\n return (claimed_tokens, rp.claimer_addrs);\n }\n\n function refund(bytes32 id) public {\n RedPacket storage rp = redpacket_by_id[id];\n require(msg.sender == rp.creator.addr, \"008 Only the red packet creator can refund the money\");\n require(rp.expiration_time < now, \"009 Disallowed until the expiration time has passed\");\n\n emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens);\n if (rp.token_type == 0) {\n msg.sender.transfer(rp.remaining_tokens);\n }\n else if (rp.token_type == 1) {\n transfer_token(rp.token_type, rp.token_address, address(this),\n msg.sender, rp.remaining_tokens);\n }\n }\n\n // One cannot send tokens to this contract after constructor anymore\n // function () external payable {\n // }\n}\n", - "sourcePath": "/Users/yisiliu/Workspace/DimensionDev/RedPacket/test/contracts/redpacket.sol", - "ast": { - "absolutePath": "/Users/yisiliu/Workspace/DimensionDev/RedPacket/test/contracts/redpacket.sol", - "exportedSymbols": { - "HappyRedPacket": [ - 956 - ] - }, - "id": 957, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 58, - "literals": [ - "solidity", - ">", - "0.4", - ".22" - ], - "nodeType": "PragmaDirective", - "src": "0:24:1" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 59, - "nodeType": "ImportDirective", - "scope": 957, - "sourceUnit": 1729, - "src": "25:64:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 956, - "linearizedBaseContracts": [ - 956 - ], - "name": "HappyRedPacket", - "nodeType": "ContractDefinition", - "nodes": [ - { - "canonicalName": "HappyRedPacket.RedPacket", - "id": 95, - "members": [ - { - "constant": false, - "id": 61, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "149:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 60, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "149:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 63, - "name": "ifrandom", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "169:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 62, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "169:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 66, - "name": "tokens", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "192:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 64, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "192:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 65, - "length": null, - "nodeType": "ArrayTypeName", - "src": "192:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 68, - "name": "token_type", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "215:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 67, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "215:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 70, - "name": "creator", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "240:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" - }, - "typeName": { - "contractScope": null, - "id": 69, - "name": "Creator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 102, - "src": "240:7:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 73, - "name": "hashes", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "265:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 71, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "265:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 72, - "length": null, - "nodeType": "ArrayTypeName", - "src": "265:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 75, - "name": "total_number", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "291:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 74, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "291:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 77, - "name": "creator_name", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "318:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 76, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "318:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 79, - "name": "claimed_number", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "347:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "347:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 81, - "name": "expiration_time", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "376:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 80, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "376:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 83, - "name": "remaining_tokens", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "406:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 82, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "406:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "437:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "437:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 87, - "name": "claimed_list_str", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "468:23:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 86, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "468:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 90, - "name": "claimer_addrs", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "501:23:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 88, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "501:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 89, - "length": null, - "nodeType": "ArrayTypeName", - "src": "501:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 94, - "name": "claimers", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "534:36:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer)" - }, - "typeName": { - "id": 93, - "keyType": { - "id": 91, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "542:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "534:27:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer)" - }, - "valueType": { - "contractScope": null, - "id": 92, - "name": "Claimer", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 111, - "src": "553:7:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage_ptr", - "typeString": "struct HappyRedPacket.Claimer" - } - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "RedPacket", - "nodeType": "StructDefinition", - "scope": 956, - "src": "122:455:1", - "visibility": "public" - }, - { - "canonicalName": "HappyRedPacket.Creator", - "id": 102, - "members": [ - { - "constant": false, - "id": 97, - "name": "name", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "608:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 96, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "608:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 99, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "629:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 98, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "629:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 101, - "name": "message", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "651:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 100, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "651:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Creator", - "nodeType": "StructDefinition", - "scope": 956, - "src": "583:89:1", - "visibility": "public" - }, - { - "canonicalName": "HappyRedPacket.Claimer", - "id": 111, - "members": [ - { - "constant": false, - "id": 104, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 111, - "src": "703:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 103, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "703:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 106, - "name": "name", - "nodeType": "VariableDeclaration", - "scope": 111, - "src": "723:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 105, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "723:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 108, - "name": "claimed_time", - "nodeType": "VariableDeclaration", - "scope": 111, - "src": "744:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 107, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "744:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 110, - "name": "claimed_tokens", - "nodeType": "VariableDeclaration", - "scope": 111, - "src": "771:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 109, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "771:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Claimer", - "nodeType": "StructDefinition", - "scope": 956, - "src": "678:119:1", - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 123, - "name": "CreationSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 122, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 113, - "indexed": false, - "name": "total", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "834:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 112, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "834:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 115, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "854:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 114, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "854:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 117, - "indexed": false, - "name": "creator", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "874:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 116, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "874:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 119, - "indexed": false, - "name": "creation_time", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "899:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 118, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "899:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 121, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "927:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 120, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "927:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "824:130:1" - }, - "src": "803:152:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 133, - "name": "ClaimSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 132, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 125, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 133, - "src": "989:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 124, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "989:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 127, - "indexed": false, - "name": "claimer", - "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1009:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 126, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1009:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 129, - "indexed": false, - "name": "claimed_value", - "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1034:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 128, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1034:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 131, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1062:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 130, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1062:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "979:110:1" - }, - "src": "961:129:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 141, - "name": "Failure", - "nodeType": "EventDefinition", - "parameters": { - "id": 140, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 135, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 141, - "src": "1119:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 134, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1119:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 137, - "indexed": false, - "name": "hash1", - "nodeType": "VariableDeclaration", - "scope": 141, - "src": "1139:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 136, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1139:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 139, - "indexed": false, - "name": "hash2", - "nodeType": "VariableDeclaration", - "scope": 141, - "src": "1162:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 138, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1162:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1109:72:1" - }, - "src": "1096:86:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 149, - "name": "RefundSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 148, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 143, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1216:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 142, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1216:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 145, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1236:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 144, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1236:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 147, - "indexed": false, - "name": "remaining_balance", - "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1267:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 146, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1267:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1206:89:1" - }, - "src": "1187:109:1" - }, - { - "constant": false, - "id": 151, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1302:10:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 150, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1302:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 153, - "name": "contract_creator", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1318:24:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 152, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1318:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 157, - "name": "redpacket_by_id", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1348:45:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" - }, - "typeName": { - "id": 156, - "keyType": { - "id": 154, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1356:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1348:29:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" - }, - "valueType": { - "contractScope": null, - "id": 155, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "1367:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 160, - "name": "redpackets", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1399:21:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 158, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1399:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 159, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1399:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": true, - "id": 163, - "name": "magic", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1426:105:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_memory", - "typeString": "string" - }, - "typeName": { - "id": 161, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1426:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "466f726d6572204e6174696f6e616c204261736b657462616c6c204173736f63696174696f6e20284e42412920436f6d6d697373696f6e657220446176696420537465726e2068617320646965642e", - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1450:81:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7d4f8d20362f4719f19c74721d909a5e78cf4a6c5c17229194ea4fc2e05eed05", - "typeString": "literal_string \"Former National Basketball Association (NBA) Commissioner David Stern has died.\"" - }, - "value": "Former National Basketball Association (NBA) Commissioner David Stern has died." - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 165, - "name": "uuid", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1537:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 164, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1537:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "private" - }, - { - "body": { - "id": 184, - "nodeType": "Block", - "src": "1656:120:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 171, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 168, - "name": "contract_creator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1666:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 169, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "1685:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1685:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1666:29:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 172, - "nodeType": "ExpressionStatement", - "src": "1666:29:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 182, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 173, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 165, - "src": "1705:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 177, - "name": "magic", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "1739:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 178, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "1746:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 179, - "name": "contract_creator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1751:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 175, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "1722:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 176, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1722:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 180, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1722:46:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 174, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "1712:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1712:57:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "1705:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 183, - "nodeType": "ExpressionStatement", - "src": "1705:64:1" - } - ] - }, - "documentation": null, - "id": 185, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 166, - "nodeType": "ParameterList", - "parameters": [], - "src": "1646:2:1" - }, - "returnParameters": { - "id": 167, - "nodeType": "ParameterList", - "parameters": [], - "src": "1656:0:1" - }, - "scope": 956, - "src": "1635:141:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 508, - "nodeType": "Block", - "src": "2156:2321:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 207, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "2166:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2175:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2166:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 210, - "nodeType": "ExpressionStatement", - "src": "2166:10:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 215, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 212, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "2194:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 213, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "2202:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 214, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2202:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2194:25:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "3030302074727920616761696e206c61746572", - "id": 216, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2221:21:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9add011834ce6f1e96d072b9f48b75881e32c05397de40574f621d8ae7053c26", - "typeString": "literal_string \"000 try again later\"" - }, - "value": "000 try again later" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9add011834ce6f1e96d072b9f48b75881e32c05397de40574f621d8ae7053c26", - "typeString": "literal_string \"000 try again later\"" - } - ], - "id": 211, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2186:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 217, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2186:57:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 218, - "nodeType": "ExpressionStatement", - "src": "2186:57:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 223, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 220, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2262:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 221, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "2279:7:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" - } - }, - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2279:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2262:31:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303031204174206c65617374205b6e756d626572206f6620726564207061636b6574735d20746f6b656e7320746f20796f757220726564207061636b65742e", - "id": 224, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2311:65:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_11d6ebd9aff304f907e6eb3e95d72a807d0943fd9daef427f13cfb099a04b7fd", - "typeString": "literal_string \"001 At least [number of red packets] tokens to your red packet.\"" - }, - "value": "001 At least [number of red packets] tokens to your red packet." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_11d6ebd9aff304f907e6eb3e95d72a807d0943fd9daef427f13cfb099a04b7fd", - "typeString": "literal_string \"001 At least [number of red packets] tokens to your red packet.\"" - } - ], - "id": 219, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2254:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 225, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2254:123:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 226, - "nodeType": "ExpressionStatement", - "src": "2254:123:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 228, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "2395:7:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" - } - }, - "id": 229, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2395:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 230, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2412:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2395:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303032204174206c65617374203120706572736f6e2063616e20636c61696d2074686520726564207061636b65742e", - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2415:49:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_d721f059b7f6f28eace805f1c369e965f06e424cd51b5241d01bbc61cb558491", - "typeString": "literal_string \"002 At least 1 person can claim the red packet.\"" - }, - "value": "002 At least 1 person can claim the red packet." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_d721f059b7f6f28eace805f1c369e965f06e424cd51b5241d01bbc61cb558491", - "typeString": "literal_string \"002 At least 1 person can claim the red packet.\"" - } - ], - "id": 227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2387:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2387:78:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "2387:78:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 237, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 235, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "2480:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 236, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2495:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2480:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 246, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "2603:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 247, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2618:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2603:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 277, - "nodeType": "IfStatement", - "src": "2599:286:1", - "trueBody": { - "id": 276, - "nodeType": "Block", - "src": "2621:264:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 254, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2673:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2673:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 257, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "2693:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - ], - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2685:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 258, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2685:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 251, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "2650:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 250, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "2643:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 252, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2643:19:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" - } - }, - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "allowance", - "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "2643:29:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", - "typeString": "function (address,address) view external returns (uint256)" - } - }, - "id": 259, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2643:56:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 260, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2703:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2643:73:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303920596f75206861766520746f2073657420656e6f75676820616c6c6f77616e63652e", - "id": 262, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2738:39:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_045c3fdbe9be7c410557980ae9d07d09e642d6b0a93c8a557bf0962856b8cac8", - "typeString": "literal_string \"009 You have to set enough allowance.\"" - }, - "value": "009 You have to set enough allowance." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_045c3fdbe9be7c410557980ae9d07d09e642d6b0a93c8a557bf0962856b8cac8", - "typeString": "literal_string \"009 You have to set enough allowance.\"" - } - ], - "id": 249, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2635:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 263, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2635:143:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 264, - "nodeType": "ExpressionStatement", - "src": "2635:143:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 266, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "2807:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 267, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "2820:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 268, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2833:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2833:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 271, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "2853:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - ], - "id": 270, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2845:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 272, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2845:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 273, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2860:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 265, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "2792:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256)" - } - }, - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2792:82:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 275, - "nodeType": "ExpressionStatement", - "src": "2792:82:1" - } - ] - } - }, - "id": 278, - "nodeType": "IfStatement", - "src": "2476:409:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 242, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 239, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2518:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 240, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2518:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 241, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2531:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2518:26:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303820596f75206861766520746f2073656e6420656e6f75676820746f6b656e732e", - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2546:37:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7056057dcb86c508a9987cd8948bb05c548c32af095f20744e77091b4c57ce0c", - "typeString": "literal_string \"008 You have to send enough tokens.\"" - }, - "value": "008 You have to send enough tokens." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7056057dcb86c508a9987cd8948bb05c548c32af095f20744e77091b4c57ce0c", - "typeString": "literal_string \"008 You have to send enough tokens.\"" - } - ], - "id": 238, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2510:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2510:74:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 245, - "nodeType": "ExpressionStatement", - "src": "2510:74:1" - } - }, - { - "assignments": [ - 280 - ], - "declarations": [ - { - "constant": false, - "id": 280, - "name": "_id", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2895:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 279, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2895:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 292, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 284, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2936:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2936:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 286, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "2948:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 287, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "2953:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 288, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 165, - "src": "2960:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 289, - "name": "_seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "2966:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 282, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "2919:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 283, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2919:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2919:53:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 281, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "2909:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 291, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2909:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2895:78:1" - }, - { - "assignments": [ - 294 - ], - "declarations": [ - { - "constant": false, - "id": 294, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2983:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 293, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "2983:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 298, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 295, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "3006:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 297, - "indexExpression": { - "argumentTypes": null, - "id": 296, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 280, - "src": "3022:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3006:20:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2983:43:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 299, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3036:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 301, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3036:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 302, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 280, - "src": "3044:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "3036:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 304, - "nodeType": "ExpressionStatement", - "src": "3036:11:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 308, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3073:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 309, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3073:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 305, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3057:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3057:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) returns (uint256)" - } - }, - "id": 310, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3057:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 311, - "nodeType": "ExpressionStatement", - "src": "3057:22:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 312, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3090:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 314, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "3090:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 315, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "3106:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3090:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 317, - "nodeType": "ExpressionStatement", - "src": "3090:27:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 318, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3127:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 320, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "3127:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 321, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "3146:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "3127:30:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 323, - "nodeType": "ExpressionStatement", - "src": "3127:30:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 329, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 324, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3168:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 326, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3168:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 327, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "3186:7:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" - } - }, - "id": 328, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3186:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3168:32:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 330, - "nodeType": "ExpressionStatement", - "src": "3168:32:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 331, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3210:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 333, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3210:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 334, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "3232:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3210:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 336, - "nodeType": "ExpressionStatement", - "src": "3210:35:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 337, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3256:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 340, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "3256:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 341, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "3256:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 342, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "3274:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 343, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3274:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "3256:28:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 345, - "nodeType": "ExpressionStatement", - "src": "3256:28:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 352, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 346, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3294:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 349, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "3294:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 350, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "name", - "nodeType": "MemberAccess", - "referencedDeclaration": 97, - "src": "3294:15:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 351, - "name": "_name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 198, - "src": "3312:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "3294:23:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 353, - "nodeType": "ExpressionStatement", - "src": "3294:23:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 360, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 354, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3327:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 357, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "3327:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 358, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "message", - "nodeType": "MemberAccess", - "referencedDeclaration": 101, - "src": "3327:18:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 359, - "name": "_message", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "3348:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "3327:29:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 361, - "nodeType": "ExpressionStatement", - "src": "3327:29:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 364, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 362, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3371:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 363, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3384:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3371:14:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 369, - "nodeType": "IfStatement", - "src": "3367:49:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 367, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 365, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3399:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "3836343030", - "id": 366, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3411:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_86400_by_1", - "typeString": "int_const 86400" - }, - "value": "86400" - }, - "src": "3399:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 368, - "nodeType": "ExpressionStatement", - "src": "3399:17:1" - } - }, - { - "expression": { - "argumentTypes": null, - "id": 376, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 370, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3437:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 372, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "3437:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 375, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 373, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "3458:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 374, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3464:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3458:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3437:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 377, - "nodeType": "ExpressionStatement", - "src": "3437:36:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 382, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 378, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3484:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 380, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "3484:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 381, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3504:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3484:21:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 383, - "nodeType": "ExpressionStatement", - "src": "3484:21:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 388, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 384, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3515:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 386, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "3515:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 387, - "name": "_ifrandom", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "3529:9:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "3515:23:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 389, - "nodeType": "ExpressionStatement", - "src": "3515:23:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 394, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 390, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3548:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 392, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "hashes", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "3548:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 393, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "3560:7:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" - } - }, - "src": "3548:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 395, - "nodeType": "ExpressionStatement", - "src": "3548:19:1" - }, - { - "assignments": [ - 397 - ], - "declarations": [ - { - "constant": false, - "id": 397, - "name": "rand_tokens", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3578:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 396, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3578:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 398, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "3578:16:1" - }, - { - "assignments": [ - 400 - ], - "declarations": [ - { - "constant": false, - "id": 400, - "name": "total_tokens", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3604:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 399, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3604:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 403, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 401, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3624:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 402, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3624:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3604:39:1" - }, - { - "assignments": [ - 405 - ], - "declarations": [ - { - "constant": false, - "id": 405, - "name": "MIN_AMOUNT", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3653:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 404, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3653:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 407, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 406, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3671:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3653:19:1" - }, - { - "assignments": [ - 409 - ], - "declarations": [ - { - "constant": false, - "id": 409, - "name": "MAX_AMOUNT", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3682:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 408, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3682:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 416, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 415, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 413, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 410, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "3700:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 411, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3715:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 412, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3715:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3700:30:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 414, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3733:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "3700:34:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3682:52:1" - }, - { - "body": { - "id": 481, - "nodeType": "Block", - "src": "3786:506:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 428, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3804:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 429, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "3804:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 467, - "nodeType": "Block", - "src": "4138:62:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 465, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 461, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4156:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 464, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 462, - "name": "MAX_AMOUNT", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "4171:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 463, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4184:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "4171:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4156:29:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 466, - "nodeType": "ExpressionStatement", - "src": "4156:29:1" - } - ] - }, - "id": 468, - "nodeType": "IfStatement", - "src": "3800:400:1", - "trueBody": { - "id": 460, - "nodeType": "Block", - "src": "3816:304:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 440, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 430, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "3834:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 439, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 432, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3855:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 433, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3855:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 434, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "3862:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 435, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 418, - "src": "3868:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3862:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 431, - "name": "random", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 580, - "src": "3848:6:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" - } - }, - "id": 437, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3848:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "id": 438, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "3873:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3848:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3834:51:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 441, - "nodeType": "ExpressionStatement", - "src": "3834:51:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 444, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 442, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "3907:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 443, - "name": "MIN_AMOUNT", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 405, - "src": "3921:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3907:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 452, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 450, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4015:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 451, - "name": "MAX_AMOUNT", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "4029:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4015:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 458, - "nodeType": "IfStatement", - "src": "4011:95:1", - "trueBody": { - "id": 457, - "nodeType": "Block", - "src": "4041:65:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 455, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 453, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4063:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 454, - "name": "MAX_AMOUNT", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "4077:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4063:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 456, - "nodeType": "ExpressionStatement", - "src": "4063:24:1" - } - ] - } - }, - "id": 459, - "nodeType": "IfStatement", - "src": "3903:203:1", - "trueBody": { - "id": 449, - "nodeType": "Block", - "src": "3933:56:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 445, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "3955:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 446, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3969:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "3955:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 448, - "nodeType": "ExpressionStatement", - "src": "3955:15:1" - } - ] - } - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 474, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4228:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 469, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4213:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 472, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4213:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 473, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4213:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4213:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 476, - "nodeType": "ExpressionStatement", - "src": "4213:27:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 479, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 477, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "4254:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "id": 478, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4270:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4254:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 480, - "nodeType": "ExpressionStatement", - "src": "4254:27:1" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 424, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 421, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 418, - "src": "3761:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 422, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3765:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 423, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3765:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3761:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 482, - "initializationExpression": { - "assignments": [ - 418 - ], - "declarations": [ - { - "constant": false, - "id": 418, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 482, - "src": "3749:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 417, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3749:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 420, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3758:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3749:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "3782:3:1", - "subExpression": { - "argumentTypes": null, - "id": 425, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 418, - "src": "3782:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 427, - "nodeType": "ExpressionStatement", - "src": "3782:3:1" - }, - "nodeType": "ForStatement", - "src": "3744:548:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 493, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 483, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4327:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 490, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4327:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 491, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 489, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 485, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4337:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 486, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4337:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 487, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4337:16:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 488, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4354:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "4337:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4327:29:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "id": 492, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "4360:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4327:45:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 494, - "nodeType": "ExpressionStatement", - "src": "4327:45:1" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 496, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4403:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 497, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "4403:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 498, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4424:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "4424:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 500, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4431:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 501, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "4431:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 502, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "4431:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 503, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "4448:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 504, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4453:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 505, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "4453:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 495, - "name": "CreationSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 123, - "src": "4387:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$returns$__$", - "typeString": "function (uint256,bytes32,address,uint256,address)" - } - }, - "id": 506, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4387:83:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 507, - "nodeType": "EmitStatement", - "src": "4382:88:1" - } - ] - }, - "documentation": null, - "id": 509, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "create_red_packet", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 205, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 188, - "name": "_hashes", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1894:24:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 186, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1894:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 187, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1894:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 190, - "name": "_ifrandom", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1920:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 189, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1920:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 192, - "name": "_duration", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1936:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 191, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1936:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 194, - "name": "_seed", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1985:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 193, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1985:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 196, - "name": "_message", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2000:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 195, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2000:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 198, - "name": "_name", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2024:19:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 197, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2024:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 200, - "name": "_token_type", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2077:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 199, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2077:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 202, - "name": "_token_addr", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2095:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 201, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2095:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 204, - "name": "_total_tokens", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2116:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 203, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2116:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1893:242:1" - }, - "returnParameters": { - "id": 206, - "nodeType": "ParameterList", - "parameters": [], - "src": "2156:0:1" - }, - "scope": 956, - "src": "1866:2611:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 556, - "nodeType": "Block", - "src": "4697:320:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 522, - "name": "token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 511, - "src": "4728:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 523, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4742:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "4728:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 555, - "nodeType": "IfStatement", - "src": "4724:287:1", - "trueBody": { - "id": 554, - "nodeType": "Block", - "src": "4745:266:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 530, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "4799:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 527, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "4774:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 526, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "4767:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 528, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4767:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" - } - }, - "id": 529, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 1673, - "src": "4767:31:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4767:47:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 532, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "4818:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4767:57:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420656e6f756768", - "id": 534, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4826:12:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7011343f7537059a90db546368183fdbe3c33cbdd9f65235d24a095b397eec61", - "typeString": "literal_string \"Not enough\"" - }, - "value": "Not enough" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7011343f7537059a90db546368183fdbe3c33cbdd9f65235d24a095b397eec61", - "typeString": "literal_string \"Not enough\"" - } - ], - "id": 525, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "4759:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4759:80:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 536, - "nodeType": "ExpressionStatement", - "src": "4759:80:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 541, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 517, - "src": "4883:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 542, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "4902:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 538, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "4860:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 537, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "4853:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 539, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4853:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" - } - }, - "id": 540, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 1700, - "src": "4853:29:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4853:56:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 544, - "nodeType": "ExpressionStatement", - "src": "4853:56:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 549, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "4958:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 550, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 517, - "src": "4974:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 551, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "4993:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 546, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "4930:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 545, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "4923:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 547, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4923:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" - } - }, - "id": 548, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 1711, - "src": "4923:34:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 552, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4923:77:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 553, - "nodeType": "ExpressionStatement", - "src": "4923:77:1" - } - ] - } - } - ] - }, - "documentation": null, - "id": 557, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "transfer_token", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 520, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 511, - "name": "token_type", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4551:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 510, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4551:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 513, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4568:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 512, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4568:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 515, - "name": "sender_address", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4591:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 514, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4591:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 517, - "name": "recipient_address", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4643:25:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 516, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4643:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 519, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4670:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 518, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4670:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4550:132:1" - }, - "returnParameters": { - "id": 521, - "nodeType": "ParameterList", - "parameters": [], - "src": "4697:0:1" - }, - "scope": 956, - "src": "4527:490:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 579, - "nodeType": "Block", - "src": "5233:92:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 570, - "name": "nonce_rand", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 561, - "src": "5282:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 571, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "5294:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5294:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 573, - "name": "seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 559, - "src": "5306:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 574, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "5312:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 568, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "5265:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 569, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5265:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 575, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5265:51:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 567, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "5255:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 576, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5255:62:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 566, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5250:4:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 577, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5250:68:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 565, - "id": 578, - "nodeType": "Return", - "src": "5243:75:1" - } - ] - }, - "documentation": null, - "id": 580, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "random", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 562, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 559, - "name": "seed", - "nodeType": "VariableDeclaration", - "scope": 580, - "src": "5168:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 558, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5168:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 561, - "name": "nonce_rand", - "nodeType": "VariableDeclaration", - "scope": 580, - "src": "5182:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 560, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5182:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5167:31:1" - }, - "returnParameters": { - "id": 565, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 564, - "name": "rand", - "nodeType": "VariableDeclaration", - "scope": 580, - "src": "5222:9:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 563, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5222:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5221:11:1" - }, - "scope": 956, - "src": "5152:173:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 588, - "nodeType": "Block", - "src": "5527:278:1", - "statements": [ - { - "externalReferences": [ - { - "a": { - "declaration": 582, - "isOffset": false, - "isSlot": false, - "src": "5593:1:1", - "valueSize": 1 - } - }, - { - "b": { - "declaration": 585, - "isOffset": false, - "isSlot": false, - "src": "5783:1:1", - "valueSize": 1 - } - }, - { - "a": { - "declaration": 582, - "isOffset": false, - "isSlot": false, - "src": "5602:1:1", - "valueSize": 1 - } - }, - { - "a": { - "declaration": 582, - "isOffset": false, - "isSlot": false, - "src": "5730:1:1", - "valueSize": 1 - } - } - ], - "id": 587, - "nodeType": "InlineAssembly", - "operations": "{\n let m := mload(0x40)\n a := and(a, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)\n mstore(add(m, 20), xor(0x140000000000000000000000000000000000000000, a))\n mstore(0x40, add(m, 52))\n b := m\n}", - "src": "5537:262:1" - } - ] - }, - "documentation": null, - "id": 589, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "toBytes", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 583, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 582, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 589, - "src": "5479:9:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 581, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5479:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5478:11:1" - }, - "returnParameters": { - "id": 586, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 585, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 589, - "src": "5511:14:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 584, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "5511:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5510:16:1" - }, - "scope": 956, - "src": "5462:343:1", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 784, - "nodeType": "Block", - "src": "6024:1614:1", - "statements": [ - { - "assignments": [ - 603 - ], - "declarations": [ - { - "constant": false, - "id": 603, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 784, - "src": "6034:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 602, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "6034:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 607, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 604, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "6057:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 606, - "indexExpression": { - "argumentTypes": null, - "id": 605, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 591, - "src": "6073:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6057:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6034:42:1" - }, - { - "assignments": [ - 609 - ], - "declarations": [ - { - "constant": false, - "id": 609, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 784, - "src": "6086:25:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 608, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6086:15:1", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 615, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 612, - "name": "_recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 595, - "src": "6130:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 611, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6122:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint160_$", - "typeString": "type(uint160)" - }, - "typeName": "uint160" - }, - "id": 613, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6122:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } - ], - "id": 610, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6114:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 614, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6114:28:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6086:56:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 620, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 617, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6186:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 618, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "6186:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 619, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "6207:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6186:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303320457870697265642e", - "id": 621, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6212:14:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_f833742dfe7fbdc9ca55286e79cd3ab04267c4e4354a00d8d89d45eb5d5b219d", - "typeString": "literal_string \"003 Expired.\"" - }, - "value": "003 Expired." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_f833742dfe7fbdc9ca55286e79cd3ab04267c4e4354a00d8d89d45eb5d5b219d", - "typeString": "literal_string \"003 Expired.\"" - } - ], - "id": 616, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6177:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 622, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6177:50:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 623, - "nodeType": "ExpressionStatement", - "src": "6177:50:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 629, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 625, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6246:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 626, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6246:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 627, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6266:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 628, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "6266:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6246:35:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303034204f7574206f662053746f636b2e", - "id": 630, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6283:19:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0682e79e4aaa50aee21676ee92bdd9c9f3db32a9b3cf7c35db38035443e713e9", - "typeString": "literal_string \"004 Out of Stock.\"" - }, - "value": "004 Out of Stock." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0682e79e4aaa50aee21676ee92bdd9c9f3db32a9b3cf7c35db38035443e713e9", - "typeString": "literal_string \"004 Out of Stock.\"" - } - ], - "id": 624, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6237:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6237:66:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 632, - "nodeType": "ExpressionStatement", - "src": "6237:66:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 640, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 634, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6322:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 635, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "6322:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 637, - "indexExpression": { - "argumentTypes": null, - "id": 636, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "6334:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6322:22:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 638, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 110, - "src": "6322:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 639, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6363:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "6322:42:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303520416c726561647920436c61696d6564", - "id": 641, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6366:21:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_e178fe598cba40ce74f596b9ce049ddb4a443ec31be05fa4dd8a98f23e784e4d", - "typeString": "literal_string \"005 Already Claimed\"" - }, - "value": "005 Already Claimed" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_e178fe598cba40ce74f596b9ce049ddb4a443ec31be05fa4dd8a98f23e784e4d", - "typeString": "literal_string \"005 Already Claimed\"" - } - ], - "id": 633, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6313:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 642, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6313:75:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 643, - "nodeType": "ExpressionStatement", - "src": "6313:75:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 655, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 647, - "name": "password", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 593, - "src": "6423:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - ], - "id": 646, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6417:5:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", - "typeString": "type(bytes storage pointer)" - }, - "typeName": "bytes" - }, - "id": 648, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6417:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 645, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "6407:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6407:26:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 650, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6437:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 651, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "hashes", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "6437:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 654, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 652, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6447:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 653, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6447:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6437:28:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "6407:58:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "3030362057726f6e672050617373776f72642e", - "id": 656, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6467:21:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0bd568fc7f9d8b13453e55ed69b5ba4763aa5390b1a1e32eb9d6040b5560a102", - "typeString": "literal_string \"006 Wrong Password.\"" - }, - "value": "006 Wrong Password." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0bd568fc7f9d8b13453e55ed69b5ba4763aa5390b1a1e32eb9d6040b5560a102", - "typeString": "literal_string \"006 Wrong Password.\"" - } - ], - "id": 644, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6398:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 657, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6398:91:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 658, - "nodeType": "ExpressionStatement", - "src": "6398:91:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 667, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 660, - "name": "validation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 597, - "src": "6508:10:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 663, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "6540:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 664, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6540:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 662, - "name": "toBytes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 589, - "src": "6532:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_bytes_memory_ptr_$", - "typeString": "function (address) pure returns (bytes memory)" - } - }, - "id": 665, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6532:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 661, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "6522:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 666, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6522:30:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "6508:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "3030372056616c69646174696f6e204661696c6564", - "id": 668, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6554:23:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ab3c2b580745b5803ff193dc805a5ac261daca1d5dd01f19c1a5107135b6dd76", - "typeString": "literal_string \"007 Validation Failed\"" - }, - "value": "007 Validation Failed" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ab3c2b580745b5803ff193dc805a5ac261daca1d5dd01f19c1a5107135b6dd76", - "typeString": "literal_string \"007 Validation Failed\"" - } - ], - "id": 659, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6499:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 669, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6499:79:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 670, - "nodeType": "ExpressionStatement", - "src": "6499:79:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 676, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "6641:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 671, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6619:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 674, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 90, - "src": "6619:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 675, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6619:21:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 677, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6619:32:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 678, - "nodeType": "ExpressionStatement", - "src": "6619:32:1" - }, - { - "assignments": [ - 680 - ], - "declarations": [ - { - "constant": false, - "id": 680, - "name": "claimed_tokens", - "nodeType": "VariableDeclaration", - "scope": 784, - "src": "6719:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 679, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6719:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 681, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "6719:19:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 682, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6752:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 683, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "6752:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 684, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6767:4:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "6752:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 702, - "nodeType": "Block", - "src": "6857:54:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 700, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 695, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "6871:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 696, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6888:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 697, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "6888:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 699, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 698, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6898:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6888:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6871:29:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 701, - "nodeType": "ExpressionStatement", - "src": "6871:29:1" - } - ] - }, - "id": 703, - "nodeType": "IfStatement", - "src": "6748:163:1", - "trueBody": { - "id": 694, - "nodeType": "Block", - "src": "6773:70:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 692, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 686, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "6787:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 687, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6804:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 688, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "6804:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 691, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 689, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6814:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 690, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6814:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6804:28:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6787:45:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 693, - "nodeType": "ExpressionStatement", - "src": "6787:45:1" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 704, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6920:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 706, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "6920:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "id": 707, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "6943:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6920:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 709, - "nodeType": "ExpressionStatement", - "src": "6920:37:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 718, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 710, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6967:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 713, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "6967:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 714, - "indexExpression": { - "argumentTypes": null, - "id": 712, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "6979:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6967:22:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 715, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "index", - "nodeType": "MemberAccess", - "referencedDeclaration": 104, - "src": "6967:28:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 716, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6998:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 717, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6998:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6967:48:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 719, - "nodeType": "ExpressionStatement", - "src": "6967:48:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 727, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 720, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7025:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 723, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "7025:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 724, - "indexExpression": { - "argumentTypes": null, - "id": 722, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7037:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7025:22:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 725, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 110, - "src": "7025:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 726, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7065:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7025:54:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 728, - "nodeType": "ExpressionStatement", - "src": "7025:54:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 729, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7089:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 732, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "7089:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 733, - "indexExpression": { - "argumentTypes": null, - "id": 731, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7101:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7089:22:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 734, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 108, - "src": "7089:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 735, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "7127:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7089:41:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 737, - "nodeType": "ExpressionStatement", - "src": "7089:41:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 741, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "7140:20:1", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 738, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7140:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 740, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "7140:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 742, - "nodeType": "ExpressionStatement", - "src": "7140:20:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 746, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 743, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7231:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 744, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7231:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 745, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7248:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7231:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 757, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 754, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7328:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 755, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7328:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 756, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7345:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "7328:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 771, - "nodeType": "IfStatement", - "src": "7324:166:1", - "trueBody": { - "id": 770, - "nodeType": "Block", - "src": "7348:142:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 759, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7377:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 760, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7377:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 761, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7392:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 762, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "7392:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 764, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "7418:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - ], - "id": 763, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7410:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7410:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 766, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7453:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 767, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7464:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 758, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "7362:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256)" - } - }, - "id": 768, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7362:117:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 769, - "nodeType": "ExpressionStatement", - "src": "7362:117:1" - } - ] - } - }, - "id": 772, - "nodeType": "IfStatement", - "src": "7227:263:1", - "trueBody": { - "id": 753, - "nodeType": "Block", - "src": "7251:59:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 750, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7284:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 747, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7265:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 749, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7265:18:1", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7265:34:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 752, - "nodeType": "ExpressionStatement", - "src": "7265:34:1" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 774, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7549:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 775, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "7549:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 776, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7556:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 777, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7567:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 778, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7583:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 779, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "7583:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 773, - "name": "ClaimSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "7536:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$returns$__$", - "typeString": "function (bytes32,address,uint256,address)" - } - }, - "id": 780, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7536:64:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 781, - "nodeType": "EmitStatement", - "src": "7531:69:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 782, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7617:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 601, - "id": 783, - "nodeType": "Return", - "src": "7610:21:1" - } - ] - }, - "documentation": null, - "id": 785, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "claim", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 598, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 591, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5913:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 590, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5913:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 593, - "name": "password", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5925:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 592, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "5925:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 595, - "name": "_recipient", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5949:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 594, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5949:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 597, - "name": "validation", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5969:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 596, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5969:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5912:76:1" - }, - "returnParameters": { - "id": 601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 600, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "6010:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 599, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6010:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6009:14:1" - }, - "scope": 956, - "src": "5898:1740:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 820, - "nodeType": "Block", - "src": "7945:177:1", - "statements": [ - { - "assignments": [ - 801 - ], - "declarations": [ - { - "constant": false, - "id": 801, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 820, - "src": "7955:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 800, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "7955:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 805, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 802, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "7978:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 804, - "indexExpression": { - "argumentTypes": null, - "id": 803, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 787, - "src": "7994:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7978:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7955:42:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 806, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8015:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 807, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "8015:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 808, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8033:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 809, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "8033:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 810, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8054:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 811, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "8054:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 812, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8071:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 813, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8071:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 817, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 814, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "8090:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 815, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8096:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 816, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8096:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8090:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "id": 818, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "8014:101:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$", - "typeString": "tuple(address,uint256,uint256,uint256,bool)" - } - }, - "functionReturnParameters": 799, - "id": 819, - "nodeType": "Return", - "src": "8007:108:1" - } - ] - }, - "documentation": null, - "id": 821, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_availability", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 788, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 787, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7770:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 786, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7770:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7769:12:1" - }, - "returnParameters": { - "id": 799, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 790, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7803:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 789, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7803:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 792, - "name": "balance", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7826:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 791, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7826:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 794, - "name": "total", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7905:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 793, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7905:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 796, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7917:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 795, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7917:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 798, - "name": "expired", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7931:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 797, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7931:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7802:142:1" - }, - "scope": 956, - "src": "7742:380:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 880, - "nodeType": "Block", - "src": "8340:325:1", - "statements": [ - { - "assignments": [ - 833 - ], - "declarations": [ - { - "constant": false, - "id": 833, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 880, - "src": "8350:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 832, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "8350:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 837, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 834, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "8373:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 836, - "indexExpression": { - "argumentTypes": null, - "id": 835, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 823, - "src": "8389:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8373:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8350:42:1" - }, - { - "assignments": [ - 841 - ], - "declarations": [ - { - "constant": false, - "id": 841, - "name": "claimed_tokens", - "nodeType": "VariableDeclaration", - "scope": 880, - "src": "8402:28:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 839, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8402:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 840, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8402:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 848, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 845, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8444:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 846, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8444:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 844, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "8433:10:1", - "typeDescriptions": { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", - "typeString": "function (uint256) pure returns (uint256[] memory)" - }, - "typeName": { - "baseType": { - "id": 842, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8437:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 843, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8437:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 847, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8433:29:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8402:60:1" - }, - { - "body": { - "id": 873, - "nodeType": "Block", - "src": "8516:92:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 871, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 860, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 841, - "src": "8530:14:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 862, - "indexExpression": { - "argumentTypes": null, - "id": 861, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8545:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8530:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 863, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8550:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 864, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "8550:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 869, - "indexExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 865, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8562:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 866, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 90, - "src": "8562:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 868, - "indexExpression": { - "argumentTypes": null, - "id": 867, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8579:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8562:19:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8550:32:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 870, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 110, - "src": "8550:47:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8530:67:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 872, - "nodeType": "ExpressionStatement", - "src": "8530:67:1" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 856, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 853, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8489:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 854, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8493:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 855, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8493:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8489:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 874, - "initializationExpression": { - "assignments": [ - 850 - ], - "declarations": [ - { - "constant": false, - "id": 850, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 874, - "src": "8477:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 849, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8477:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 852, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8486:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "8477:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 858, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "8512:3:1", - "subExpression": { - "argumentTypes": null, - "id": 857, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8512:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 859, - "nodeType": "ExpressionStatement", - "src": "8512:3:1" - }, - "nodeType": "ForStatement", - "src": "8472:136:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 875, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 841, - "src": "8625:14:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 876, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8641:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 877, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 90, - "src": "8641:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - } - ], - "id": 878, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "8624:34:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_array$_t_uint256_$dyn_memory_ptr_$_t_array$_t_address_$dyn_storage_$", - "typeString": "tuple(uint256[] memory,address[] storage ref)" - } - }, - "functionReturnParameters": 831, - "id": 879, - "nodeType": "Return", - "src": "8617:41:1" - } - ] - }, - "documentation": null, - "id": 881, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_claimed_list", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 824, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 823, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8242:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 822, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8242:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8241:12:1" - }, - "returnParameters": { - "id": 831, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 827, - "name": "claimed_list", - "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8280:26:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 825, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8280:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 826, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8280:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 830, - "name": "claimer_addrs", - "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8308:30:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 828, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "8308:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 829, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8308:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8279:60:1" - }, - "scope": 956, - "src": "8214:451:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 954, - "nodeType": "Block", - "src": "8706:620:1", - "statements": [ - { - "assignments": [ - 887 - ], - "declarations": [ - { - "constant": false, - "id": 887, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 954, - "src": "8716:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 886, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "8716:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 891, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 888, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "8739:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 890, - "indexExpression": { - "argumentTypes": null, - "id": 889, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 883, - "src": "8755:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8739:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8716:42:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 898, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 893, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "8776:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 894, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8776:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 895, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8790:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 896, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "8790:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 897, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "8790:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8776:29:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303038204f6e6c792074686520726564207061636b65742063726561746f722063616e20726566756e6420746865206d6f6e6579", - "id": 899, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8807:54:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_bc53fa365cb20c8143df9a0166321d7a480df48fc715dae4b4ff50e8ffee4ec5", - "typeString": "literal_string \"008 Only the red packet creator can refund the money\"" - }, - "value": "008 Only the red packet creator can refund the money" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_bc53fa365cb20c8143df9a0166321d7a480df48fc715dae4b4ff50e8ffee4ec5", - "typeString": "literal_string \"008 Only the red packet creator can refund the money\"" - } - ], - "id": 892, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "8768:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 900, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8768:94:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 901, - "nodeType": "ExpressionStatement", - "src": "8768:94:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 906, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 903, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8880:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 904, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8880:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 905, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "8901:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8880:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303920446973616c6c6f77656420756e74696c207468652065787069726174696f6e2074696d652068617320706173736564", - "id": 907, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8906:53:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ec34b70a20ae3323704ae41ac8e57231c9f8f08811cac61019ac48eecc2def17", - "typeString": "literal_string \"009 Disallowed until the expiration time has passed\"" - }, - "value": "009 Disallowed until the expiration time has passed" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ec34b70a20ae3323704ae41ac8e57231c9f8f08811cac61019ac48eecc2def17", - "typeString": "literal_string \"009 Disallowed until the expiration time has passed\"" - } - ], - "id": 902, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "8872:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 908, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8872:88:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 909, - "nodeType": "ExpressionStatement", - "src": "8872:88:1" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 911, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8990:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 912, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "8990:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 913, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8997:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 914, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "8997:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 915, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9015:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 916, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9015:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 910, - "name": "RefundSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 149, - "src": "8976:13:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256)" - } - }, - "id": 917, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8976:59:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 918, - "nodeType": "EmitStatement", - "src": "8971:64:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 922, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 919, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9049:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 920, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9049:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 921, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9066:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "9049:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 936, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 933, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9152:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 934, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9152:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 935, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9169:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "9152:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 952, - "nodeType": "IfStatement", - "src": "9148:172:1", - "trueBody": { - "id": 951, - "nodeType": "Block", - "src": "9172:148:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 938, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9201:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 939, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9201:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 940, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9216:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 941, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "9216:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 943, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "9242:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - ], - "id": 942, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "9234:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 944, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9234:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 945, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "9277:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 946, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9277:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 947, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9289:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 948, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9289:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 937, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "9186:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256)" - } - }, - "id": 949, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9186:123:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 950, - "nodeType": "ExpressionStatement", - "src": "9186:123:1" - } - ] - } - }, - "id": 953, - "nodeType": "IfStatement", - "src": "9045:275:1", - "trueBody": { - "id": 932, - "nodeType": "Block", - "src": "9069:65:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 928, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9103:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 929, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9103:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 923, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "9083:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 926, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9083:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 927, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9083:19:1", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 930, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9083:40:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 931, - "nodeType": "ExpressionStatement", - "src": "9083:40:1" - } - ] - } - } - ] - }, - "documentation": null, - "id": 955, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "refund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 884, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 883, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 955, - "src": "8687:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 882, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8687:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8686:12:1" - }, - "returnParameters": { - "id": 885, - "nodeType": "ParameterList", - "parameters": [], - "src": "8706:0:1" - }, - "scope": 956, - "src": "8671:655:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 957, - "src": "91:9358:1" - } - ], - "src": "0:9450:1" - }, - "legacyAST": { - "absolutePath": "/Users/yisiliu/Workspace/DimensionDev/RedPacket/test/contracts/redpacket.sol", - "exportedSymbols": { - "HappyRedPacket": [ - 956 - ] - }, - "id": 957, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 58, - "literals": [ - "solidity", - ">", - "0.4", - ".22" - ], - "nodeType": "PragmaDirective", - "src": "0:24:1" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "file": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", - "id": 59, - "nodeType": "ImportDirective", - "scope": 957, - "sourceUnit": 1729, - "src": "25:64:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 956, - "linearizedBaseContracts": [ - 956 - ], - "name": "HappyRedPacket", - "nodeType": "ContractDefinition", - "nodes": [ - { - "canonicalName": "HappyRedPacket.RedPacket", - "id": 95, - "members": [ - { - "constant": false, - "id": 61, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "149:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 60, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "149:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 63, - "name": "ifrandom", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "169:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 62, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "169:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 66, - "name": "tokens", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "192:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 64, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "192:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 65, - "length": null, - "nodeType": "ArrayTypeName", - "src": "192:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 68, - "name": "token_type", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "215:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 67, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "215:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 70, - "name": "creator", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "240:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" - }, - "typeName": { - "contractScope": null, - "id": 69, - "name": "Creator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 102, - "src": "240:7:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 73, - "name": "hashes", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "265:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 71, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "265:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 72, - "length": null, - "nodeType": "ArrayTypeName", - "src": "265:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 75, - "name": "total_number", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "291:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 74, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "291:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 77, - "name": "creator_name", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "318:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 76, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "318:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 79, - "name": "claimed_number", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "347:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "347:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 81, - "name": "expiration_time", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "376:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 80, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "376:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 83, - "name": "remaining_tokens", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "406:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 82, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "406:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 85, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "437:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "437:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 87, - "name": "claimed_list_str", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "468:23:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 86, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "468:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 90, - "name": "claimer_addrs", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "501:23:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 88, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "501:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 89, - "length": null, - "nodeType": "ArrayTypeName", - "src": "501:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 94, - "name": "claimers", - "nodeType": "VariableDeclaration", - "scope": 95, - "src": "534:36:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer)" - }, - "typeName": { - "id": 93, - "keyType": { - "id": 91, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "542:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "534:27:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer)" - }, - "valueType": { - "contractScope": null, - "id": 92, - "name": "Claimer", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 111, - "src": "553:7:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage_ptr", - "typeString": "struct HappyRedPacket.Claimer" - } - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "RedPacket", - "nodeType": "StructDefinition", - "scope": 956, - "src": "122:455:1", - "visibility": "public" - }, - { - "canonicalName": "HappyRedPacket.Creator", - "id": 102, - "members": [ - { - "constant": false, - "id": 97, - "name": "name", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "608:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 96, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "608:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 99, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "629:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 98, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "629:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 101, - "name": "message", - "nodeType": "VariableDeclaration", - "scope": 102, - "src": "651:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 100, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "651:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Creator", - "nodeType": "StructDefinition", - "scope": 956, - "src": "583:89:1", - "visibility": "public" - }, - { - "canonicalName": "HappyRedPacket.Claimer", - "id": 111, - "members": [ - { - "constant": false, - "id": 104, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 111, - "src": "703:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 103, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "703:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 106, - "name": "name", - "nodeType": "VariableDeclaration", - "scope": 111, - "src": "723:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 105, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "723:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 108, - "name": "claimed_time", - "nodeType": "VariableDeclaration", - "scope": 111, - "src": "744:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 107, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "744:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 110, - "name": "claimed_tokens", - "nodeType": "VariableDeclaration", - "scope": 111, - "src": "771:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 109, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "771:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Claimer", - "nodeType": "StructDefinition", - "scope": 956, - "src": "678:119:1", - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 123, - "name": "CreationSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 122, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 113, - "indexed": false, - "name": "total", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "834:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 112, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "834:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 115, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "854:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 114, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "854:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 117, - "indexed": false, - "name": "creator", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "874:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 116, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "874:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 119, - "indexed": false, - "name": "creation_time", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "899:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 118, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "899:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 121, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 123, - "src": "927:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 120, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "927:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "824:130:1" - }, - "src": "803:152:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 133, - "name": "ClaimSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 132, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 125, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 133, - "src": "989:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 124, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "989:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 127, - "indexed": false, - "name": "claimer", - "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1009:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 126, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1009:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 129, - "indexed": false, - "name": "claimed_value", - "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1034:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 128, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1034:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 131, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1062:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 130, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1062:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "979:110:1" - }, - "src": "961:129:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 141, - "name": "Failure", - "nodeType": "EventDefinition", - "parameters": { - "id": 140, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 135, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 141, - "src": "1119:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 134, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1119:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 137, - "indexed": false, - "name": "hash1", - "nodeType": "VariableDeclaration", - "scope": 141, - "src": "1139:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 136, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1139:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 139, - "indexed": false, - "name": "hash2", - "nodeType": "VariableDeclaration", - "scope": 141, - "src": "1162:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 138, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1162:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1109:72:1" - }, - "src": "1096:86:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 149, - "name": "RefundSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 148, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 143, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1216:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 142, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1216:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 145, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1236:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 144, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1236:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 147, - "indexed": false, - "name": "remaining_balance", - "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1267:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 146, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1267:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1206:89:1" - }, - "src": "1187:109:1" - }, - { - "constant": false, - "id": 151, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1302:10:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 150, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1302:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 153, - "name": "contract_creator", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1318:24:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 152, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1318:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 157, - "name": "redpacket_by_id", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1348:45:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" - }, - "typeName": { - "id": 156, - "keyType": { - "id": 154, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1356:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1348:29:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" - }, - "valueType": { - "contractScope": null, - "id": 155, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "1367:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 160, - "name": "redpackets", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1399:21:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 158, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1399:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 159, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1399:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": true, - "id": 163, - "name": "magic", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1426:105:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_memory", - "typeString": "string" - }, - "typeName": { - "id": 161, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1426:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "466f726d6572204e6174696f6e616c204261736b657462616c6c204173736f63696174696f6e20284e42412920436f6d6d697373696f6e657220446176696420537465726e2068617320646965642e", - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1450:81:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7d4f8d20362f4719f19c74721d909a5e78cf4a6c5c17229194ea4fc2e05eed05", - "typeString": "literal_string \"Former National Basketball Association (NBA) Commissioner David Stern has died.\"" - }, - "value": "Former National Basketball Association (NBA) Commissioner David Stern has died." - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 165, - "name": "uuid", - "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1537:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 164, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1537:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "private" - }, - { - "body": { - "id": 184, - "nodeType": "Block", - "src": "1656:120:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 171, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 168, - "name": "contract_creator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1666:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 169, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "1685:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1685:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1666:29:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 172, - "nodeType": "ExpressionStatement", - "src": "1666:29:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 182, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 173, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 165, - "src": "1705:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 177, - "name": "magic", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "1739:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 178, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "1746:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 179, - "name": "contract_creator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1751:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 175, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "1722:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 176, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1722:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 180, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1722:46:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 174, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "1712:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1712:57:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "1705:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 183, - "nodeType": "ExpressionStatement", - "src": "1705:64:1" - } - ] - }, - "documentation": null, - "id": 185, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 166, - "nodeType": "ParameterList", - "parameters": [], - "src": "1646:2:1" - }, - "returnParameters": { - "id": 167, - "nodeType": "ParameterList", - "parameters": [], - "src": "1656:0:1" - }, - "scope": 956, - "src": "1635:141:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 508, - "nodeType": "Block", - "src": "2156:2321:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 207, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "2166:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2175:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2166:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 210, - "nodeType": "ExpressionStatement", - "src": "2166:10:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 215, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 212, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "2194:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 213, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "2202:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 214, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2202:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2194:25:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "3030302074727920616761696e206c61746572", - "id": 216, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2221:21:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9add011834ce6f1e96d072b9f48b75881e32c05397de40574f621d8ae7053c26", - "typeString": "literal_string \"000 try again later\"" - }, - "value": "000 try again later" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9add011834ce6f1e96d072b9f48b75881e32c05397de40574f621d8ae7053c26", - "typeString": "literal_string \"000 try again later\"" - } - ], - "id": 211, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2186:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 217, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2186:57:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 218, - "nodeType": "ExpressionStatement", - "src": "2186:57:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 223, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 220, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2262:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 221, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "2279:7:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" - } - }, - "id": 222, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2279:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2262:31:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303031204174206c65617374205b6e756d626572206f6620726564207061636b6574735d20746f6b656e7320746f20796f757220726564207061636b65742e", - "id": 224, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2311:65:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_11d6ebd9aff304f907e6eb3e95d72a807d0943fd9daef427f13cfb099a04b7fd", - "typeString": "literal_string \"001 At least [number of red packets] tokens to your red packet.\"" - }, - "value": "001 At least [number of red packets] tokens to your red packet." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_11d6ebd9aff304f907e6eb3e95d72a807d0943fd9daef427f13cfb099a04b7fd", - "typeString": "literal_string \"001 At least [number of red packets] tokens to your red packet.\"" - } - ], - "id": 219, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2254:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 225, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2254:123:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 226, - "nodeType": "ExpressionStatement", - "src": "2254:123:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 228, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "2395:7:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" - } - }, - "id": 229, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2395:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 230, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2412:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2395:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303032204174206c65617374203120706572736f6e2063616e20636c61696d2074686520726564207061636b65742e", - "id": 232, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2415:49:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_d721f059b7f6f28eace805f1c369e965f06e424cd51b5241d01bbc61cb558491", - "typeString": "literal_string \"002 At least 1 person can claim the red packet.\"" - }, - "value": "002 At least 1 person can claim the red packet." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_d721f059b7f6f28eace805f1c369e965f06e424cd51b5241d01bbc61cb558491", - "typeString": "literal_string \"002 At least 1 person can claim the red packet.\"" - } - ], - "id": 227, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2387:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 233, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2387:78:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "2387:78:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 237, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 235, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "2480:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 236, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2495:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2480:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 246, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "2603:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 247, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2618:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2603:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 277, - "nodeType": "IfStatement", - "src": "2599:286:1", - "trueBody": { - "id": 276, - "nodeType": "Block", - "src": "2621:264:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 261, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 254, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2673:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2673:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 257, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "2693:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - ], - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2685:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 258, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2685:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 251, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "2650:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 250, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "2643:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 252, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2643:19:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" - } - }, - "id": 253, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "allowance", - "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "2643:29:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", - "typeString": "function (address,address) view external returns (uint256)" - } - }, - "id": 259, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2643:56:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 260, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2703:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2643:73:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303920596f75206861766520746f2073657420656e6f75676820616c6c6f77616e63652e", - "id": 262, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2738:39:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_045c3fdbe9be7c410557980ae9d07d09e642d6b0a93c8a557bf0962856b8cac8", - "typeString": "literal_string \"009 You have to set enough allowance.\"" - }, - "value": "009 You have to set enough allowance." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_045c3fdbe9be7c410557980ae9d07d09e642d6b0a93c8a557bf0962856b8cac8", - "typeString": "literal_string \"009 You have to set enough allowance.\"" - } - ], - "id": 249, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2635:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 263, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2635:143:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 264, - "nodeType": "ExpressionStatement", - "src": "2635:143:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 266, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "2807:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 267, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "2820:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 268, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2833:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2833:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 271, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "2853:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - ], - "id": 270, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "2845:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 272, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2845:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 273, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2860:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 265, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "2792:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256)" - } - }, - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2792:82:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 275, - "nodeType": "ExpressionStatement", - "src": "2792:82:1" - } - ] - } - }, - "id": 278, - "nodeType": "IfStatement", - "src": "2476:409:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 242, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 239, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2518:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 240, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2518:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 241, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2531:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2518:26:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303820596f75206861766520746f2073656e6420656e6f75676820746f6b656e732e", - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2546:37:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7056057dcb86c508a9987cd8948bb05c548c32af095f20744e77091b4c57ce0c", - "typeString": "literal_string \"008 You have to send enough tokens.\"" - }, - "value": "008 You have to send enough tokens." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7056057dcb86c508a9987cd8948bb05c548c32af095f20744e77091b4c57ce0c", - "typeString": "literal_string \"008 You have to send enough tokens.\"" - } - ], - "id": 238, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2510:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2510:74:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 245, - "nodeType": "ExpressionStatement", - "src": "2510:74:1" - } - }, - { - "assignments": [ - 280 - ], - "declarations": [ - { - "constant": false, - "id": 280, - "name": "_id", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2895:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 279, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2895:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 292, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 284, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2936:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2936:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 286, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "2948:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 287, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "2953:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 288, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 165, - "src": "2960:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 289, - "name": "_seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 194, - "src": "2966:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 282, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "2919:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 283, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2919:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2919:53:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 281, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "2909:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 291, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2909:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2895:78:1" - }, - { - "assignments": [ - 294 - ], - "declarations": [ - { - "constant": false, - "id": 294, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2983:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 293, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "2983:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 298, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 295, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "3006:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 297, - "indexExpression": { - "argumentTypes": null, - "id": 296, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 280, - "src": "3022:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3006:20:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2983:43:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 299, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3036:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 301, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3036:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 302, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 280, - "src": "3044:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "3036:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 304, - "nodeType": "ExpressionStatement", - "src": "3036:11:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 308, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3073:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 309, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3073:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 305, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3057:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3057:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) returns (uint256)" - } - }, - "id": 310, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3057:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 311, - "nodeType": "ExpressionStatement", - "src": "3057:22:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 312, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3090:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 314, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "3090:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 315, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "3106:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3090:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 317, - "nodeType": "ExpressionStatement", - "src": "3090:27:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 318, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3127:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 320, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "3127:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 321, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "3146:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "3127:30:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 323, - "nodeType": "ExpressionStatement", - "src": "3127:30:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 329, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 324, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3168:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 326, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3168:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 327, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "3186:7:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" - } - }, - "id": 328, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3186:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3168:32:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 330, - "nodeType": "ExpressionStatement", - "src": "3168:32:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 331, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3210:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 333, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3210:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 334, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "3232:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3210:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 336, - "nodeType": "ExpressionStatement", - "src": "3210:35:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 337, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3256:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 340, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "3256:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 341, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "3256:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 342, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "3274:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 343, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3274:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "3256:28:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 345, - "nodeType": "ExpressionStatement", - "src": "3256:28:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 352, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 346, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3294:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 349, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "3294:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 350, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "name", - "nodeType": "MemberAccess", - "referencedDeclaration": 97, - "src": "3294:15:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 351, - "name": "_name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 198, - "src": "3312:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "3294:23:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 353, - "nodeType": "ExpressionStatement", - "src": "3294:23:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 360, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 354, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3327:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 357, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "3327:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 358, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "message", - "nodeType": "MemberAccess", - "referencedDeclaration": 101, - "src": "3327:18:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 359, - "name": "_message", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "3348:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "3327:29:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 361, - "nodeType": "ExpressionStatement", - "src": "3327:29:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 364, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 362, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3371:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 363, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3384:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3371:14:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 369, - "nodeType": "IfStatement", - "src": "3367:49:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 367, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 365, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3399:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "3836343030", - "id": 366, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3411:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_86400_by_1", - "typeString": "int_const 86400" - }, - "value": "86400" - }, - "src": "3399:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 368, - "nodeType": "ExpressionStatement", - "src": "3399:17:1" - } - }, - { - "expression": { - "argumentTypes": null, - "id": 376, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 370, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3437:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 372, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "3437:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 375, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 373, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "3458:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 374, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3464:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3458:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3437:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 377, - "nodeType": "ExpressionStatement", - "src": "3437:36:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 382, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 378, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3484:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 380, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "3484:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 381, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3504:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3484:21:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 383, - "nodeType": "ExpressionStatement", - "src": "3484:21:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 388, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 384, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3515:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 386, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "3515:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 387, - "name": "_ifrandom", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 190, - "src": "3529:9:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "3515:23:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 389, - "nodeType": "ExpressionStatement", - "src": "3515:23:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 394, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 390, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3548:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 392, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "hashes", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "3548:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 393, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "3560:7:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" - } - }, - "src": "3548:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 395, - "nodeType": "ExpressionStatement", - "src": "3548:19:1" - }, - { - "assignments": [ - 397 - ], - "declarations": [ - { - "constant": false, - "id": 397, - "name": "rand_tokens", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3578:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 396, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3578:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 398, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "3578:16:1" - }, - { - "assignments": [ - 400 - ], - "declarations": [ - { - "constant": false, - "id": 400, - "name": "total_tokens", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3604:17:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 399, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3604:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 403, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 401, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3624:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 402, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3624:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3604:39:1" - }, - { - "assignments": [ - 405 - ], - "declarations": [ - { - "constant": false, - "id": 405, - "name": "MIN_AMOUNT", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3653:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 404, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3653:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 407, - "initialValue": { - "argumentTypes": null, - "hexValue": "31", - "id": 406, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3671:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3653:19:1" - }, - { - "assignments": [ - 409 - ], - "declarations": [ - { - "constant": false, - "id": 409, - "name": "MAX_AMOUNT", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3682:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 408, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3682:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 416, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 415, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 413, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 410, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "3700:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 411, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3715:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 412, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3715:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3700:30:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 414, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3733:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "3700:34:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3682:52:1" - }, - { - "body": { - "id": 481, - "nodeType": "Block", - "src": "3786:506:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 428, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3804:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 429, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "3804:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 467, - "nodeType": "Block", - "src": "4138:62:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 465, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 461, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4156:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 464, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 462, - "name": "MAX_AMOUNT", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "4171:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 463, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4184:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "4171:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4156:29:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 466, - "nodeType": "ExpressionStatement", - "src": "4156:29:1" - } - ] - }, - "id": 468, - "nodeType": "IfStatement", - "src": "3800:400:1", - "trueBody": { - "id": 460, - "nodeType": "Block", - "src": "3816:304:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 440, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 430, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "3834:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 439, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 432, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3855:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 433, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3855:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 434, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "3862:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 435, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 418, - "src": "3868:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3862:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 431, - "name": "random", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 580, - "src": "3848:6:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" - } - }, - "id": 437, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3848:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "id": 438, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "3873:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3848:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3834:51:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 441, - "nodeType": "ExpressionStatement", - "src": "3834:51:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 444, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 442, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "3907:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 443, - "name": "MIN_AMOUNT", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 405, - "src": "3921:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3907:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 452, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 450, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4015:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 451, - "name": "MAX_AMOUNT", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "4029:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4015:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 458, - "nodeType": "IfStatement", - "src": "4011:95:1", - "trueBody": { - "id": 457, - "nodeType": "Block", - "src": "4041:65:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 455, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 453, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4063:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 454, - "name": "MAX_AMOUNT", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "4077:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4063:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 456, - "nodeType": "ExpressionStatement", - "src": "4063:24:1" - } - ] - } - }, - "id": 459, - "nodeType": "IfStatement", - "src": "3903:203:1", - "trueBody": { - "id": 449, - "nodeType": "Block", - "src": "3933:56:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 445, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "3955:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 446, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3969:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "3955:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 448, - "nodeType": "ExpressionStatement", - "src": "3955:15:1" - } - ] - } - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 474, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4228:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 469, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4213:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 472, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4213:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 473, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4213:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" - } - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4213:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 476, - "nodeType": "ExpressionStatement", - "src": "4213:27:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 479, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 477, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "4254:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "id": 478, - "name": "rand_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4270:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4254:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 480, - "nodeType": "ExpressionStatement", - "src": "4254:27:1" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 424, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 421, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 418, - "src": "3761:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 422, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3765:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 423, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3765:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3761:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 482, - "initializationExpression": { - "assignments": [ - 418 - ], - "declarations": [ - { - "constant": false, - "id": 418, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 482, - "src": "3749:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 417, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3749:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 420, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3758:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3749:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "3782:3:1", - "subExpression": { - "argumentTypes": null, - "id": 425, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 418, - "src": "3782:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 427, - "nodeType": "ExpressionStatement", - "src": "3782:3:1" - }, - "nodeType": "ForStatement", - "src": "3744:548:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 493, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 483, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4327:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 490, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4327:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 491, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 489, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 485, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4337:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 486, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4337:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 487, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4337:16:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 488, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4354:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "4337:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4327:29:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "id": 492, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "4360:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4327:45:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 494, - "nodeType": "ExpressionStatement", - "src": "4327:45:1" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 496, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4403:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 497, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "4403:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 498, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4424:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "4424:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 500, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4431:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 501, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "4431:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 502, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "4431:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 503, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "4448:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 504, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4453:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 505, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "4453:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 495, - "name": "CreationSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 123, - "src": "4387:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$returns$__$", - "typeString": "function (uint256,bytes32,address,uint256,address)" - } - }, - "id": 506, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4387:83:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 507, - "nodeType": "EmitStatement", - "src": "4382:88:1" - } - ] - }, - "documentation": null, - "id": 509, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "create_red_packet", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 205, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 188, - "name": "_hashes", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1894:24:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 186, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1894:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 187, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1894:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 190, - "name": "_ifrandom", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1920:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 189, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1920:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 192, - "name": "_duration", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1936:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 191, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1936:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 194, - "name": "_seed", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1985:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 193, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1985:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 196, - "name": "_message", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2000:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 195, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2000:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 198, - "name": "_name", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2024:19:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 197, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2024:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 200, - "name": "_token_type", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2077:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 199, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2077:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 202, - "name": "_token_addr", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2095:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 201, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2095:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 204, - "name": "_total_tokens", - "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2116:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 203, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2116:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1893:242:1" - }, - "returnParameters": { - "id": 206, - "nodeType": "ParameterList", - "parameters": [], - "src": "2156:0:1" - }, - "scope": 956, - "src": "1866:2611:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 556, - "nodeType": "Block", - "src": "4697:320:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 524, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 522, - "name": "token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 511, - "src": "4728:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 523, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4742:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "4728:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 555, - "nodeType": "IfStatement", - "src": "4724:287:1", - "trueBody": { - "id": 554, - "nodeType": "Block", - "src": "4745:266:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 530, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "4799:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 527, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "4774:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 526, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "4767:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 528, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4767:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" - } - }, - "id": 529, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 1673, - "src": "4767:31:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4767:47:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 532, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "4818:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4767:57:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4e6f7420656e6f756768", - "id": 534, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4826:12:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7011343f7537059a90db546368183fdbe3c33cbdd9f65235d24a095b397eec61", - "typeString": "literal_string \"Not enough\"" - }, - "value": "Not enough" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7011343f7537059a90db546368183fdbe3c33cbdd9f65235d24a095b397eec61", - "typeString": "literal_string \"Not enough\"" - } - ], - "id": 525, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "4759:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4759:80:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 536, - "nodeType": "ExpressionStatement", - "src": "4759:80:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 541, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 517, - "src": "4883:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 542, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "4902:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 538, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "4860:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 537, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "4853:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 539, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4853:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" - } - }, - "id": 540, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 1700, - "src": "4853:29:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4853:56:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 544, - "nodeType": "ExpressionStatement", - "src": "4853:56:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 549, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 515, - "src": "4958:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 550, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 517, - "src": "4974:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 551, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "4993:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 546, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "4930:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 545, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "4923:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 547, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4923:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" - } - }, - "id": 548, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 1711, - "src": "4923:34:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" - } - }, - "id": 552, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4923:77:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 553, - "nodeType": "ExpressionStatement", - "src": "4923:77:1" - } - ] - } - } - ] - }, - "documentation": null, - "id": 557, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "transfer_token", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 520, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 511, - "name": "token_type", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4551:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 510, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4551:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 513, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4568:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 512, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4568:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 515, - "name": "sender_address", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4591:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 514, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4591:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 517, - "name": "recipient_address", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4643:25:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 516, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4643:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 519, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4670:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 518, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4670:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4550:132:1" - }, - "returnParameters": { - "id": 521, - "nodeType": "ParameterList", - "parameters": [], - "src": "4697:0:1" - }, - "scope": 956, - "src": "4527:490:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 579, - "nodeType": "Block", - "src": "5233:92:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 570, - "name": "nonce_rand", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 561, - "src": "5282:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 571, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "5294:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 572, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5294:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 573, - "name": "seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 559, - "src": "5306:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 574, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "5312:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 568, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "5265:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 569, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5265:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 575, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5265:51:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 567, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "5255:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 576, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5255:62:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 566, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5250:4:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 577, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5250:68:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 565, - "id": 578, - "nodeType": "Return", - "src": "5243:75:1" - } - ] - }, - "documentation": null, - "id": 580, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "random", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 562, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 559, - "name": "seed", - "nodeType": "VariableDeclaration", - "scope": 580, - "src": "5168:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 558, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5168:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 561, - "name": "nonce_rand", - "nodeType": "VariableDeclaration", - "scope": 580, - "src": "5182:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 560, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5182:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5167:31:1" - }, - "returnParameters": { - "id": 565, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 564, - "name": "rand", - "nodeType": "VariableDeclaration", - "scope": 580, - "src": "5222:9:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 563, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5222:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5221:11:1" - }, - "scope": 956, - "src": "5152:173:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 588, - "nodeType": "Block", - "src": "5527:278:1", - "statements": [ - { - "externalReferences": [ - { - "a": { - "declaration": 582, - "isOffset": false, - "isSlot": false, - "src": "5593:1:1", - "valueSize": 1 - } - }, - { - "b": { - "declaration": 585, - "isOffset": false, - "isSlot": false, - "src": "5783:1:1", - "valueSize": 1 - } - }, - { - "a": { - "declaration": 582, - "isOffset": false, - "isSlot": false, - "src": "5602:1:1", - "valueSize": 1 - } - }, - { - "a": { - "declaration": 582, - "isOffset": false, - "isSlot": false, - "src": "5730:1:1", - "valueSize": 1 - } - } - ], - "id": 587, - "nodeType": "InlineAssembly", - "operations": "{\n let m := mload(0x40)\n a := and(a, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)\n mstore(add(m, 20), xor(0x140000000000000000000000000000000000000000, a))\n mstore(0x40, add(m, 52))\n b := m\n}", - "src": "5537:262:1" - } - ] - }, - "documentation": null, - "id": 589, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "toBytes", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 583, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 582, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 589, - "src": "5479:9:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 581, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5479:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5478:11:1" - }, - "returnParameters": { - "id": 586, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 585, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 589, - "src": "5511:14:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 584, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "5511:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5510:16:1" - }, - "scope": 956, - "src": "5462:343:1", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 784, - "nodeType": "Block", - "src": "6024:1614:1", - "statements": [ - { - "assignments": [ - 603 - ], - "declarations": [ - { - "constant": false, - "id": 603, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 784, - "src": "6034:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 602, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "6034:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 607, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 604, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "6057:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 606, - "indexExpression": { - "argumentTypes": null, - "id": 605, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 591, - "src": "6073:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6057:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6034:42:1" - }, - { - "assignments": [ - 609 - ], - "declarations": [ - { - "constant": false, - "id": 609, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 784, - "src": "6086:25:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 608, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6086:15:1", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 615, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 612, - "name": "_recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 595, - "src": "6130:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 611, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6122:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint160_$", - "typeString": "type(uint160)" - }, - "typeName": "uint160" - }, - "id": 613, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6122:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } - ], - "id": 610, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6114:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 614, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6114:28:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6086:56:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 620, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 617, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6186:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 618, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "6186:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 619, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "6207:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6186:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303320457870697265642e", - "id": 621, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6212:14:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_f833742dfe7fbdc9ca55286e79cd3ab04267c4e4354a00d8d89d45eb5d5b219d", - "typeString": "literal_string \"003 Expired.\"" - }, - "value": "003 Expired." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_f833742dfe7fbdc9ca55286e79cd3ab04267c4e4354a00d8d89d45eb5d5b219d", - "typeString": "literal_string \"003 Expired.\"" - } - ], - "id": 616, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6177:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 622, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6177:50:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 623, - "nodeType": "ExpressionStatement", - "src": "6177:50:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 629, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 625, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6246:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 626, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6246:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 627, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6266:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 628, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "6266:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6246:35:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303034204f7574206f662053746f636b2e", - "id": 630, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6283:19:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0682e79e4aaa50aee21676ee92bdd9c9f3db32a9b3cf7c35db38035443e713e9", - "typeString": "literal_string \"004 Out of Stock.\"" - }, - "value": "004 Out of Stock." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0682e79e4aaa50aee21676ee92bdd9c9f3db32a9b3cf7c35db38035443e713e9", - "typeString": "literal_string \"004 Out of Stock.\"" - } - ], - "id": 624, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6237:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6237:66:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 632, - "nodeType": "ExpressionStatement", - "src": "6237:66:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 640, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 634, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6322:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 635, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "6322:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 637, - "indexExpression": { - "argumentTypes": null, - "id": 636, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "6334:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6322:22:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 638, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 110, - "src": "6322:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 639, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6363:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "6322:42:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303520416c726561647920436c61696d6564", - "id": 641, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6366:21:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_e178fe598cba40ce74f596b9ce049ddb4a443ec31be05fa4dd8a98f23e784e4d", - "typeString": "literal_string \"005 Already Claimed\"" - }, - "value": "005 Already Claimed" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_e178fe598cba40ce74f596b9ce049ddb4a443ec31be05fa4dd8a98f23e784e4d", - "typeString": "literal_string \"005 Already Claimed\"" - } - ], - "id": 633, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6313:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 642, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6313:75:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 643, - "nodeType": "ExpressionStatement", - "src": "6313:75:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 655, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 647, - "name": "password", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 593, - "src": "6423:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - ], - "id": 646, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6417:5:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", - "typeString": "type(bytes storage pointer)" - }, - "typeName": "bytes" - }, - "id": 648, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6417:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 645, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "6407:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6407:26:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 650, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6437:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 651, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "hashes", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "6437:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 654, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 652, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6447:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 653, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6447:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6437:28:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "6407:58:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "3030362057726f6e672050617373776f72642e", - "id": 656, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6467:21:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0bd568fc7f9d8b13453e55ed69b5ba4763aa5390b1a1e32eb9d6040b5560a102", - "typeString": "literal_string \"006 Wrong Password.\"" - }, - "value": "006 Wrong Password." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0bd568fc7f9d8b13453e55ed69b5ba4763aa5390b1a1e32eb9d6040b5560a102", - "typeString": "literal_string \"006 Wrong Password.\"" - } - ], - "id": 644, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6398:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 657, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6398:91:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 658, - "nodeType": "ExpressionStatement", - "src": "6398:91:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 667, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 660, - "name": "validation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 597, - "src": "6508:10:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 663, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "6540:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 664, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6540:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 662, - "name": "toBytes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 589, - "src": "6532:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_bytes_memory_ptr_$", - "typeString": "function (address) pure returns (bytes memory)" - } - }, - "id": 665, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6532:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 661, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "6522:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 666, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6522:30:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "6508:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "3030372056616c69646174696f6e204661696c6564", - "id": 668, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6554:23:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ab3c2b580745b5803ff193dc805a5ac261daca1d5dd01f19c1a5107135b6dd76", - "typeString": "literal_string \"007 Validation Failed\"" - }, - "value": "007 Validation Failed" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ab3c2b580745b5803ff193dc805a5ac261daca1d5dd01f19c1a5107135b6dd76", - "typeString": "literal_string \"007 Validation Failed\"" - } - ], - "id": 659, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6499:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 669, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6499:79:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 670, - "nodeType": "ExpressionStatement", - "src": "6499:79:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 676, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "6641:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 671, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6619:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 674, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 90, - "src": "6619:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 675, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6619:21:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 677, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6619:32:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 678, - "nodeType": "ExpressionStatement", - "src": "6619:32:1" - }, - { - "assignments": [ - 680 - ], - "declarations": [ - { - "constant": false, - "id": 680, - "name": "claimed_tokens", - "nodeType": "VariableDeclaration", - "scope": 784, - "src": "6719:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 679, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6719:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 681, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "6719:19:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 682, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6752:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 683, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "6752:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 684, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6767:4:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "6752:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 702, - "nodeType": "Block", - "src": "6857:54:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 700, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 695, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "6871:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 696, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6888:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 697, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "6888:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 699, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 698, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6898:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6888:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6871:29:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 701, - "nodeType": "ExpressionStatement", - "src": "6871:29:1" - } - ] - }, - "id": 703, - "nodeType": "IfStatement", - "src": "6748:163:1", - "trueBody": { - "id": 694, - "nodeType": "Block", - "src": "6773:70:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 692, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 686, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "6787:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 687, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6804:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 688, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "6804:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 691, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 689, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6814:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 690, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6814:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6804:28:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6787:45:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 693, - "nodeType": "ExpressionStatement", - "src": "6787:45:1" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 708, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 704, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6920:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 706, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "6920:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "id": 707, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "6943:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6920:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 709, - "nodeType": "ExpressionStatement", - "src": "6920:37:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 718, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 710, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6967:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 713, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "6967:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 714, - "indexExpression": { - "argumentTypes": null, - "id": 712, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "6979:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6967:22:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 715, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "index", - "nodeType": "MemberAccess", - "referencedDeclaration": 104, - "src": "6967:28:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 716, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6998:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 717, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6998:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6967:48:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 719, - "nodeType": "ExpressionStatement", - "src": "6967:48:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 727, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 720, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7025:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 723, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "7025:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 724, - "indexExpression": { - "argumentTypes": null, - "id": 722, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7037:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7025:22:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 725, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 110, - "src": "7025:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 726, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7065:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7025:54:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 728, - "nodeType": "ExpressionStatement", - "src": "7025:54:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 729, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7089:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 732, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "7089:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 733, - "indexExpression": { - "argumentTypes": null, - "id": 731, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7101:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7089:22:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 734, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 108, - "src": "7089:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 735, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "7127:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7089:41:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 737, - "nodeType": "ExpressionStatement", - "src": "7089:41:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 741, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "7140:20:1", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 738, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7140:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 740, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "7140:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 742, - "nodeType": "ExpressionStatement", - "src": "7140:20:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 746, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 743, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7231:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 744, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7231:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 745, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7248:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7231:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 757, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 754, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7328:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 755, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7328:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 756, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7345:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "7328:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 771, - "nodeType": "IfStatement", - "src": "7324:166:1", - "trueBody": { - "id": 770, - "nodeType": "Block", - "src": "7348:142:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 759, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7377:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 760, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7377:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 761, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7392:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 762, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "7392:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 764, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "7418:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - ], - "id": 763, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7410:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7410:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 766, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7453:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 767, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7464:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 758, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "7362:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256)" - } - }, - "id": 768, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7362:117:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 769, - "nodeType": "ExpressionStatement", - "src": "7362:117:1" - } - ] - } - }, - "id": 772, - "nodeType": "IfStatement", - "src": "7227:263:1", - "trueBody": { - "id": 753, - "nodeType": "Block", - "src": "7251:59:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 750, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7284:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 747, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7265:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 749, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7265:18:1", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7265:34:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 752, - "nodeType": "ExpressionStatement", - "src": "7265:34:1" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 774, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7549:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 775, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "7549:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 776, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7556:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 777, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7567:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 778, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7583:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 779, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "7583:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 773, - "name": "ClaimSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "7536:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$returns$__$", - "typeString": "function (bytes32,address,uint256,address)" - } - }, - "id": 780, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7536:64:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 781, - "nodeType": "EmitStatement", - "src": "7531:69:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 782, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7617:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 601, - "id": 783, - "nodeType": "Return", - "src": "7610:21:1" - } - ] - }, - "documentation": null, - "id": 785, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "claim", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 598, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 591, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5913:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 590, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5913:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 593, - "name": "password", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5925:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 592, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "5925:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 595, - "name": "_recipient", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5949:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 594, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5949:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 597, - "name": "validation", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5969:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 596, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5969:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5912:76:1" - }, - "returnParameters": { - "id": 601, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 600, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 785, - "src": "6010:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 599, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6010:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6009:14:1" - }, - "scope": 956, - "src": "5898:1740:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 820, - "nodeType": "Block", - "src": "7945:177:1", - "statements": [ - { - "assignments": [ - 801 - ], - "declarations": [ - { - "constant": false, - "id": 801, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 820, - "src": "7955:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 800, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "7955:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 805, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 802, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "7978:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 804, - "indexExpression": { - "argumentTypes": null, - "id": 803, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 787, - "src": "7994:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7978:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7955:42:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 806, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8015:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 807, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "8015:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 808, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8033:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 809, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "8033:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 810, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8054:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 811, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "8054:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 812, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8071:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 813, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8071:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 817, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 814, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "8090:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 815, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8096:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 816, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8096:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8090:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "id": 818, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "8014:101:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$", - "typeString": "tuple(address,uint256,uint256,uint256,bool)" - } - }, - "functionReturnParameters": 799, - "id": 819, - "nodeType": "Return", - "src": "8007:108:1" - } - ] - }, - "documentation": null, - "id": 821, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_availability", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 788, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 787, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7770:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 786, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "7770:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7769:12:1" - }, - "returnParameters": { - "id": 799, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 790, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7803:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 789, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "7803:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 792, - "name": "balance", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7826:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 791, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7826:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 794, - "name": "total", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7905:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 793, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7905:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 796, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7917:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 795, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7917:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 798, - "name": "expired", - "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7931:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 797, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7931:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7802:142:1" - }, - "scope": 956, - "src": "7742:380:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 880, - "nodeType": "Block", - "src": "8340:325:1", - "statements": [ - { - "assignments": [ - 833 - ], - "declarations": [ - { - "constant": false, - "id": 833, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 880, - "src": "8350:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 832, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "8350:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 837, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 834, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "8373:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 836, - "indexExpression": { - "argumentTypes": null, - "id": 835, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 823, - "src": "8389:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8373:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8350:42:1" - }, - { - "assignments": [ - 841 - ], - "declarations": [ - { - "constant": false, - "id": 841, - "name": "claimed_tokens", - "nodeType": "VariableDeclaration", - "scope": 880, - "src": "8402:28:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 839, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8402:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 840, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8402:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 848, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 845, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8444:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 846, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8444:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 844, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "8433:10:1", - "typeDescriptions": { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", - "typeString": "function (uint256) pure returns (uint256[] memory)" - }, - "typeName": { - "baseType": { - "id": 842, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8437:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 843, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8437:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 847, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8433:29:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8402:60:1" - }, - { - "body": { - "id": 873, - "nodeType": "Block", - "src": "8516:92:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 871, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 860, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 841, - "src": "8530:14:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 862, - "indexExpression": { - "argumentTypes": null, - "id": 861, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8545:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8530:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 863, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8550:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 864, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimers", - "nodeType": "MemberAccess", - "referencedDeclaration": 94, - "src": "8550:11:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer storage ref)" - } - }, - "id": 869, - "indexExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 865, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8562:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 866, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 90, - "src": "8562:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 868, - "indexExpression": { - "argumentTypes": null, - "id": 867, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8579:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8562:19:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8550:32:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" - } - }, - "id": 870, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 110, - "src": "8550:47:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8530:67:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 872, - "nodeType": "ExpressionStatement", - "src": "8530:67:1" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 856, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 853, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8489:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 854, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8493:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 855, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8493:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8489:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 874, - "initializationExpression": { - "assignments": [ - 850 - ], - "declarations": [ - { - "constant": false, - "id": 850, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 874, - "src": "8477:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 849, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8477:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 852, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8486:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "8477:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 858, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "8512:3:1", - "subExpression": { - "argumentTypes": null, - "id": 857, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8512:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 859, - "nodeType": "ExpressionStatement", - "src": "8512:3:1" - }, - "nodeType": "ForStatement", - "src": "8472:136:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "id": 875, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 841, - "src": "8625:14:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 876, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8641:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 877, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 90, - "src": "8641:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - } - ], - "id": 878, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "8624:34:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_array$_t_uint256_$dyn_memory_ptr_$_t_array$_t_address_$dyn_storage_$", - "typeString": "tuple(uint256[] memory,address[] storage ref)" - } - }, - "functionReturnParameters": 831, - "id": 879, - "nodeType": "Return", - "src": "8617:41:1" - } - ] - }, - "documentation": null, - "id": 881, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_claimed_list", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 824, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 823, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8242:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 822, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8242:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8241:12:1" - }, - "returnParameters": { - "id": 831, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 827, - "name": "claimed_list", - "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8280:26:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 825, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8280:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 826, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8280:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 830, - "name": "claimer_addrs", - "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8308:30:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 828, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "8308:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 829, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8308:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8279:60:1" - }, - "scope": 956, - "src": "8214:451:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 954, - "nodeType": "Block", - "src": "8706:620:1", - "statements": [ - { - "assignments": [ - 887 - ], - "declarations": [ - { - "constant": false, - "id": 887, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 954, - "src": "8716:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 886, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "8716:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 891, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 888, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "8739:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 890, - "indexExpression": { - "argumentTypes": null, - "id": 889, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 883, - "src": "8755:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8739:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8716:42:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 898, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 893, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "8776:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 894, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8776:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 895, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8790:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 896, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "8790:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 897, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "8790:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "8776:29:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303038204f6e6c792074686520726564207061636b65742063726561746f722063616e20726566756e6420746865206d6f6e6579", - "id": 899, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8807:54:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_bc53fa365cb20c8143df9a0166321d7a480df48fc715dae4b4ff50e8ffee4ec5", - "typeString": "literal_string \"008 Only the red packet creator can refund the money\"" - }, - "value": "008 Only the red packet creator can refund the money" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_bc53fa365cb20c8143df9a0166321d7a480df48fc715dae4b4ff50e8ffee4ec5", - "typeString": "literal_string \"008 Only the red packet creator can refund the money\"" - } - ], - "id": 892, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "8768:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 900, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8768:94:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 901, - "nodeType": "ExpressionStatement", - "src": "8768:94:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 906, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 903, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8880:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 904, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8880:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 905, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "8901:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8880:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "30303920446973616c6c6f77656420756e74696c207468652065787069726174696f6e2074696d652068617320706173736564", - "id": 907, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8906:53:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ec34b70a20ae3323704ae41ac8e57231c9f8f08811cac61019ac48eecc2def17", - "typeString": "literal_string \"009 Disallowed until the expiration time has passed\"" - }, - "value": "009 Disallowed until the expiration time has passed" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ec34b70a20ae3323704ae41ac8e57231c9f8f08811cac61019ac48eecc2def17", - "typeString": "literal_string \"009 Disallowed until the expiration time has passed\"" - } - ], - "id": 902, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "8872:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 908, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8872:88:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 909, - "nodeType": "ExpressionStatement", - "src": "8872:88:1" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 911, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8990:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 912, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "8990:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 913, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8997:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 914, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "8997:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 915, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9015:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 916, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9015:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 910, - "name": "RefundSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 149, - "src": "8976:13:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256)" - } - }, - "id": 917, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8976:59:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 918, - "nodeType": "EmitStatement", - "src": "8971:64:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 922, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 919, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9049:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 920, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9049:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 921, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9066:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "9049:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 936, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 933, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9152:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 934, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9152:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 935, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9169:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "9152:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 952, - "nodeType": "IfStatement", - "src": "9148:172:1", - "trueBody": { - "id": 951, - "nodeType": "Block", - "src": "9172:148:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 938, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9201:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 939, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9201:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 940, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9216:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 941, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "9216:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 943, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "9242:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" - } - ], - "id": 942, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "9234:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 944, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9234:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 945, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "9277:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 946, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9277:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 947, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9289:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 948, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9289:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 937, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "9186:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256)" - } - }, - "id": 949, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9186:123:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 950, - "nodeType": "ExpressionStatement", - "src": "9186:123:1" - } - ] - } - }, - "id": 953, - "nodeType": "IfStatement", - "src": "9045:275:1", - "trueBody": { - "id": 932, - "nodeType": "Block", - "src": "9069:65:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 928, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9103:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 929, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9103:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 923, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "9083:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 926, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9083:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 927, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9083:19:1", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 930, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9083:40:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 931, - "nodeType": "ExpressionStatement", - "src": "9083:40:1" - } - ] - } - } - ] - }, - "documentation": null, - "id": 955, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "refund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 884, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 883, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 955, - "src": "8687:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 882, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8687:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8686:12:1" - }, - "returnParameters": { - "id": 885, - "nodeType": "ParameterList", - "parameters": [], - "src": "8706:0:1" - }, - "scope": 956, - "src": "8671:655:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 957, - "src": "91:9358:1" - } - ], - "src": "0:9450:1" - }, - "compiler": { - "name": "solc", - "version": "0.5.12+commit.7709ece9.Emscripten.clang" - }, - "networks": { - "1576558570946": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0x7c5b30cb246ffca31f0c5b0bb7cc4ea9c9ef4b8ab6d9ead8c5ea87cbc5fcb83f": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0x7c5b30cb246ffca31f0c5b0bb7cc4ea9c9ef4b8ab6d9ead8c5ea87cbc5fcb83f" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - } - }, - "links": {}, - "address": "0xFF1ED2E44A43cc5Ab5F02565eFE61A39DcCAF3B2", - "transactionHash": "0x221e4442730b08fcefd5cc1a2d0a7fa955aa2d66b027bda7fde0213082d188e4" - }, - "1576577276431": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0xDeB4354bfDf629a6466ABb3887f22846435c04E0", - "transactionHash": "0x4688f5125e74d815580ffb9432b9f7ff4e5d400d865e03c0f9236817314b00bb" - }, - "1576577798272": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0x491443bE99a432b814D8550A3E4e47121C3bb8f4", - "transactionHash": "0xa0c57440bded73596cdf9c002cfabfd0b58d1a0bdef2cdfeb82fe128c83ec494" - }, - "1576578108862": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0xb43B5FC932fBafEEc31FE41807516403821475e0", - "transactionHash": "0x3df41cd23fb4350ccbe28c57d43940267bad7cb5a0bf5c66f4865096afe8d87f" - }, - "1576578768356": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0xf4A5Da4017d7d4C93DFb210a243a0A2Ba5ed3702", - "transactionHash": "0xe8c45edcb972df607cac2a8a88316bc1fa4cf948fbba36bbef7c07fdcb059409" - }, - "1576579143463": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0x992751b5eAf19C63A6afe9b6A339fb7045BeF2Cb", - "transactionHash": "0x32a2ee0bd344255c87b5c627f4a0d2a5e663a22199baf0f74ca61cd2d56dfa61" - }, - "1576579206200": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0xF3F60b7da0a5E122FF923468Ff27fCc3BeECc595", - "transactionHash": "0x9f3e6aeb4d99562b0749162f56e737caf8cf8f843a9e18c652fd889d8ad9aa45" - }, - "1577415382068": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0x082000dF120B0Cf4bbe6f1b706dc92fBD453C1F9", - "transactionHash": "0x3b4092339e8b0cadf332091052611dc7c27531cf5a7a6f26b27c17b83702845c" - }, - "1577871578226": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0xf4854224279823dB73A964273a53Cfe656a13c7C", - "transactionHash": "0xee26a32f2bd1f449874b0eb04fa874882adbaf575b33fd0e733d42f8a8be2b09" - }, - "1577871612451": { - "events": { - "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "claimer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimed_value", - "type": "uint256" - } - ], - "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" - }, - "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "creation_time", - "type": "uint256" - } - ], - "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" - }, - "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" - } - ], - "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" - }, - "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "remaining_balance", - "type": "uint256" - } - ], - "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" - } - }, - "links": {}, - "address": "0xEc9Fe35219934B182c2eA29e1E44eADA6B111248", - "transactionHash": "0xe53f8b43eb721c4ad0a3145444d3e340a32e88820658e7bc40d387e195911dbb" - } - }, - "schemaVersion": "3.0.19", - "updatedAt": "2020-01-03T04:16:34.670Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index d9e3e1e..0bad29e 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -1,5 +1,6 @@ pragma solidity >0.4.22; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; +import "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; contract HappyRedPacket { @@ -17,6 +18,7 @@ contract HappyRedPacket { uint remaining_tokens; address token_address; address[] claimer_addrs; + uint256[] erc721_token_ids; mapping(address => bool) claimed; } @@ -31,14 +33,16 @@ contract HappyRedPacket { bytes32 id, address creator, uint creation_time, - address token_address + address token_address, + uint256[] erc721_token_ids ); event ClaimSuccess( bytes32 id, address claimer, uint claimed_value, - address token_address + address token_address, + uint256[] token_id ); event RefundSuccess( @@ -50,6 +54,7 @@ contract HappyRedPacket { uint nonce; address public contract_creator; mapping(bytes32 => RedPacket) redpacket_by_id; + mapping(address => bytes32[]) rpid_by_address; bytes32 [] redpackets; string constant private magic = "Former NBA Commissioner David St"; // 32 bytes bytes32 private uuid; @@ -63,7 +68,8 @@ contract HappyRedPacket { // _token_type: 0 - ETH 1 - ERC20 2 - ERC721 function create_red_packet (bytes32 _hash, uint8 _number, bool _ifrandom, uint _duration, bytes32 _seed, string memory _message, string memory _name, - uint _token_type, address _token_addr, uint _total_tokens) + uint _token_type, address _token_addr, uint _total_tokens, + uint256[] memory _erc721_token_ids) public payable { nonce ++; require(nonce > redpackets.length, "000"); @@ -75,10 +81,16 @@ contract HappyRedPacket { } else if (_token_type == 1) { require(IERC20(_token_addr).allowance(msg.sender, address(this)) >= _total_tokens, "009"); - transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens); + transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, new uint256[](0)); + } + else if (_token_type == 2) { + require(IERC721(_token_addr).isApprovedForAll(msg.sender, address(this)), "011"); + transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, _erc721_token_ids); + // IERC721(_token_addr).setApprovalForAll(address(this), false); } bytes32 _id = keccak256(abi.encodePacked(msg.sender, now, nonce, uuid, _seed)); + rpid_by_address[msg.sender].push(_id); RedPacket storage rp = redpacket_by_id[_id]; rp.id = _id; redpackets.push(rp.id); @@ -101,19 +113,31 @@ contract HappyRedPacket { rp.ifrandom = _ifrandom; rp.hash = _hash; rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(_total_tokens, rp.total_number), 2); - - emit CreationSuccess(rp.remaining_tokens, rp.id, rp.creator.addr, now, rp.token_address); + rp.erc721_token_ids = _erc721_token_ids; + emit CreationSuccess(rp.remaining_tokens, rp.id, rp.creator.addr, now, rp.token_address, rp.erc721_token_ids); } // Check the balance of the given token function transfer_token(uint token_type, address token_address, address sender_address, - address recipient_address, uint amount) public payable{ + address recipient_address, uint amount, uint256 [] memory erc721_token_ids) public payable{ // ERC20 if (token_type == 1) { require(IERC20(token_address).balanceOf(sender_address) >= amount, "010"); - IERC20(token_address).approve(recipient_address, amount); + IERC20(token_address).approve(sender_address, amount); IERC20(token_address).transferFrom(sender_address, recipient_address, amount); } + + // ERC721 + else if (token_type == 2) { + require(IERC721(token_address).balanceOf(sender_address) >= amount, "012"); + for (uint i=0; i < amount; i++) { + if (recipient_address == address(this)){ + IERC721(token_address).approve(recipient_address, erc721_token_ids[i]); + } + IERC721(token_address).transferFrom(sender_address, recipient_address, erc721_token_ids[i]); + } + } + } // A boring wrapper @@ -133,12 +157,22 @@ contract HappyRedPacket { } } + function getTokenIdWithIndex(uint256[] memory array, uint index) internal view returns(uint256[] memory) { + if (index >= array.length) return array; + for (uint i = index; i < array.length - 1; i++){ + array[i] = array[i + 1]; + } + array[array.length - 1] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + return array; + } + // It takes the unhashed password and a hashed random seed generated from the user function claim(bytes32 id, string memory password, address _recipient, bytes32 validation) public returns (uint claimed) { + RedPacket storage rp = redpacket_by_id[id]; address payable recipient = address(uint160(_recipient)); - + // uint256 token_id; // Unsuccessful require (rp.expiration_time > now, "003"); require (rp.claimed_number < rp.total_number, "004"); @@ -149,34 +183,66 @@ contract HappyRedPacket { // Store claimer info rp.claimer_addrs.push(recipient); uint claimed_tokens; + uint256 [] memory token_ids = new uint256[](1); //TODO: Optimize this behavior. + // Todo get erc721 token id; if (rp.ifrandom == true) { - if (rp.total_number - rp.claimed_number == 1){ - claimed_tokens = rp.remaining_tokens; + if (rp.token_type == 2) { + uint token_id_index = random(uuid, nonce) % rp.remaining_tokens; + uint256[] memory _array = rp.erc721_token_ids; + token_ids[0] = _array[token_id_index]; + rp.erc721_token_ids = getTokenIdWithIndex(_array, token_id_index); + claimed_tokens = 1; + rp.remaining_tokens -= 1; } - else{ - claimed_tokens = random(uuid, nonce) % rp.MAX_AMOUNT; - if (claimed_tokens == 0) { - claimed_tokens = 1; + else + { + if (rp.total_number - rp.claimed_number == 1){ + claimed_tokens = rp.remaining_tokens; } - else if (claimed_tokens >= rp.remaining_tokens) { - claimed_tokens = rp.remaining_tokens - (rp.total_number - rp.claimed_number - 1); + else{ + claimed_tokens = random(uuid, nonce) % rp.MAX_AMOUNT; + if (claimed_tokens == 0) { + claimed_tokens = 1; + } + else if (claimed_tokens >= rp.remaining_tokens) { + claimed_tokens = rp.remaining_tokens - (rp.total_number - rp.claimed_number - 1); + } + rp.remaining_tokens -= claimed_tokens; } } } else { - if (rp.total_number - rp.claimed_number == 1){ - claimed_tokens = rp.remaining_tokens; + if (rp.token_type == 2) { + // token_id_index = random(uuid, nonce) % rp.remaining_tokens; + uint256[] memory _array = rp.erc721_token_ids; + token_ids[0] = rp.erc721_token_ids[0]; + rp.erc721_token_ids = getTokenIdWithIndex(_array, 0); + claimed_tokens = 1; + rp.remaining_tokens -= 1; } - else{ - claimed_tokens = SafeMath.div(rp.remaining_tokens, (rp.total_number - rp.claimed_number)); + else + { + if (rp.total_number - rp.claimed_number == 1){ + claimed_tokens = rp.remaining_tokens; + } + else{ + claimed_tokens = SafeMath.div(rp.remaining_tokens, (rp.total_number - rp.claimed_number)); + } + rp.remaining_tokens -= claimed_tokens; } } - rp.remaining_tokens -= claimed_tokens; + rp.claimed[recipient] = true; rp.claimed_number ++; - if (rp.total_number != rp.claimed_number){ - rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(rp.remaining_tokens, rp.total_number - rp.claimed_number), 2); + if (rp.token_type == 2) { + rp.MAX_AMOUNT = rp.remaining_tokens; + } + else { + if (rp.total_number != rp.claimed_number){ + rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(rp.remaining_tokens, rp.total_number - rp.claimed_number), 2); + } + } // Transfer the red packet after state changing @@ -184,12 +250,17 @@ contract HappyRedPacket { recipient.transfer(claimed_tokens); } else if (rp.token_type == 1) { + uint256 [] memory token_ids_holder = new uint256[](0); transfer_token(rp.token_type, rp.token_address, address(this), - recipient, claimed_tokens); + recipient, claimed_tokens, token_ids_holder); + } + else if (rp.token_type == 2) { + transfer_token(rp.token_type, rp.token_address, address(this), + recipient, claimed_tokens, token_ids); } // Claim success event - emit ClaimSuccess(rp.id, recipient, claimed_tokens, rp.token_address); + emit ClaimSuccess(rp.id, recipient, claimed_tokens, rp.token_address, token_ids); return claimed_tokens; } @@ -201,12 +272,23 @@ contract HappyRedPacket { rp.claimed_number, now > rp.expiration_time, rp.claimed[msg.sender]); } + // Returns 1. remaining value 2. total number of red packets 3. claimed number of red packets + function check_redpacket_history(address addr) public view returns (bytes32[] memory rpids) { + return rpid_by_address[addr]; + } + // Returns a list of claimed addresses accordingly function check_claimed_list(bytes32 id) public view returns (address[] memory claimer_addrs) { RedPacket storage rp = redpacket_by_id[id]; return (rp.claimer_addrs); } + // Returns a list of claiming token id + function check_erc721_token_ids(bytes32 id) public view returns (uint256[] memory erc721_token_ids) { + RedPacket storage rp = redpacket_by_id[id]; + return (rp.erc721_token_ids); + } + function refund(bytes32 id) public { RedPacket storage rp = redpacket_by_id[id]; require(msg.sender == rp.creator.addr, "011"); @@ -216,9 +298,21 @@ contract HappyRedPacket { msg.sender.transfer(rp.remaining_tokens); } else if (rp.token_type == 1) { + uint256[] memory token_ids_holder = new uint256[](0); IERC20(rp.token_address).approve(msg.sender, rp.remaining_tokens); transfer_token(rp.token_type, rp.token_address, address(this), - msg.sender, rp.remaining_tokens); + msg.sender, rp.remaining_tokens, token_ids_holder); + } + else if (rp.token_type == 2) { + uint256[] memory token_ids; + for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){ + if (rp.erc721_token_ids[i] != 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) { + token_ids[token_ids.length] = rp.erc721_token_ids[i]; + } + } + // IERC721(rp.token_address).approve(msg.sender, rp.remaining_tokens); + transfer_token(rp.token_type, rp.token_address, address(this), + msg.sender, rp.remaining_tokens, token_ids); } emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens); diff --git a/test/contracts/test_erc721_token.sol b/test/contracts/test_erc721_token.sol new file mode 100644 index 0000000..4c5a5ef --- /dev/null +++ b/test/contracts/test_erc721_token.sol @@ -0,0 +1,13 @@ +pragma solidity >0.4.22; + +import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; +import "openzeppelin-solidity/contracts/token/ERC721/ERC721Enumerable.sol"; +import "openzeppelin-solidity/contracts/token/ERC721/ERC721Metadata.sol"; + +contract Test721Token is ERC721, ERC721Enumerable, ERC721Metadata { + constructor (uint256 initialSupply) public ERC721Metadata("Test721Token", "TEST721") { + for (uint i=0; i { const seed = web3.utils.sha3("lajsdklfjaskldfhaikl"); const token_type = 1; const token_address = testtoken.address; + const token_ids = []; const total_tokens = _total_tokens; - const creation_success_encode = 'CreationSuccess(uint256,bytes32,address,uint256,address)'; - const creation_success_types = ['uint256', 'bytes32', 'address', 'uint256', 'address']; + const creation_success_encode = 'CreationSuccess(uint256,bytes32,address,uint256,address,uint256[])'; + const creation_success_types = ['uint256', 'bytes32', 'address', 'uint256', 'address', 'uint256[]']; await testtoken.approve.sendTransaction(redpacket.address, total_tokens); const creation_receipt = await redpacket.create_red_packet .sendTransaction(hashes[0], number, true, duration, seed, msg, - name, token_type, token_address, total_tokens); + name, token_type, token_address, total_tokens, token_ids); const logs = await web3.eth.getPastLogs({address: redpacket.address, topics: [web3.utils.sha3(creation_success_encode)]}); redpacket_id = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data)['1']; assert.notEqual(redpacket_id, null); @@ -108,4 +111,154 @@ contract("TestToken", accounts => { }); + it("Should return the redpacket id list of the given address", async () => { + var rp_list = await redpacket.check_redpacket_history.call(accounts[0]); + console.log(rp_list); + }); + it("Should return another redpacket id", async () => { + + const passwords = ["1", "2"]; + const hashes = passwords.map(function (pass) { + return web3.utils.sha3(pass); + }); + const name = "cache"; + const msg = "hi"; + const number = 3; + const duration = 1200; + const seed = web3.utils.sha3("lajsdklfjaskldfhaikl"); + const token_type = 1; + const token_address = testtoken.address; + const token_ids = []; + const total_tokens = _total_tokens; + + const creation_success_encode = 'CreationSuccess(uint256,bytes32,address,uint256,address,uint256[])'; + const creation_success_types = ['uint256', 'bytes32', 'address', 'uint256', 'address', 'uint256[]']; + + await testtoken.approve.sendTransaction(redpacket.address, total_tokens); + const creation_receipt = await redpacket.create_red_packet + .sendTransaction(hashes[1], number, true, duration, seed, msg, + name, token_type, token_address, total_tokens, token_ids); + const logs = await web3.eth.getPastLogs({address: redpacket.address, topics: [web3.utils.sha3(creation_success_encode)]}); + redpacket_id = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data)['1']; + assert.notEqual(redpacket_id, null); + }); + it("Should return the redpacket id list of the given address", async () => { + var rp_list = await redpacket.check_redpacket_history.call(accounts[0]); + console.log(rp_list); + }); + }); + +contract("Test721Token", accounts => { + beforeEach(async () =>{ + console.log("Before ALL\n"); + test721token = await Test721Token.deployed(); + redpacket = await HappyRedPacket.deployed(); + _total_tokens = 10; + }); + it("Should return the HappyRedPacket contract creator", async () => { + const contract_creator = await redpacket.contract_creator.call(); + assert.equal(contract_creator, accounts[0]); + }); + it("Should return a redpacket id", async () => { + + const passwords = ["1", "2"]; + const hashes = passwords.map(function (pass) { + return web3.utils.sha3(pass); + }); + const name = "cache"; + const msg = "hi"; + const number = 3; + const duration = 1200; + const seed = web3.utils.sha3("lajsdklfjaskldfhaikl"); + const token_type = 2; + const token_address = test721token.address; + // const token_total = await test721token.balanceOf.call(accounts[0]); + const token_total = 5; + const token_ids = []; + for (i=0; i < token_total; i++) { + token_id = await test721token.tokenOfOwnerByIndex.call(accounts[0], i); + token_ids.push(token_id); + } + const total_tokens = token_ids.length; + + const creation_success_encode = 'CreationSuccess(uint256,bytes32,address,uint256,address,uint256[])'; + const creation_success_types = ['uint256', 'bytes32', 'address', 'uint256', 'address', 'uint256[]']; + + await test721token.setApprovalForAll.sendTransaction(redpacket.address, true); + const creation_receipt = await redpacket.create_red_packet + .sendTransaction(hashes[0], number, true, duration, seed, msg, + name, token_type, token_address, total_tokens, token_ids); + const logs = await web3.eth.getPastLogs({address: redpacket.address, topics: [web3.utils.sha3(creation_success_encode)]}); + log = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data); + redpacket_id = log['1'] + redpacket_token_ids = log['5']; + assert.notEqual(redpacket_id, null); + assert.notEqual(token_ids, null); + assert.equal(await test721token.balanceOf(redpacket.address), 5) + }); + it("Should allow two users to claim red packets.", async () => { + // const redpacket = await HappyRedPacket.deployed(); + const password = "1"; + const rp_id = redpacket_id; + + const claim_success_encode = "ClaimSuccess(%s,%s,%s,%s,%s)"; + const claim_success_types = ['bytes32', 'address', 'uint256', 'address', 'uint256']; + + // Check Availability + var returned = await redpacket.check_availability.call(rp_id); + assert.equal(returned.ifclaimed, false); + + // 1st + const recipient1 = accounts[1]; + const validation1 = web3.utils.sha3(recipient1); + + const claim_receipt = await redpacket.claim.sendTransaction(rp_id, password, recipient1, validation1, {'from': recipient1}); + const logs = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(claim_success_encode)]}); + + + // Check Availability + returned = await redpacket.check_availability.call(rp_id, {'from': recipient1}); + assert.equal(returned.ifclaimed, true); + + // 2nd + const recipient2 = accounts[2]; + const validation2 = web3.utils.sha3(recipient2); + + const claim_receipt2 = await redpacket.claim.sendTransaction(rp_id, password, recipient2, validation2, {'from':recipient2}); + const logs2 = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(claim_success_encode)]}); + + // Check Availability + returned = await redpacket.check_availability.call(rp_id, {'from': recipient2}); + assert.equal(returned.ifclaimed, true); + + // 3rd + const recipient3 = accounts[3]; + const validation3 = web3.utils.sha3(recipient3); + + const claim_receipt3 = await redpacket.claim.sendTransaction(rp_id, password, recipient3, validation3, {'from':recipient3}); + const logs3 = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(claim_success_encode)]}); + // Check Availability + returned = await redpacket.check_availability.call(rp_id, {'from': recipient3}); + assert.equal(returned.ifclaimed, true); + + // Check balance + const balance1 = await test721token.balanceOf.call(recipient1, {'from':recipient1}); + const balance2 = await test721token.balanceOf.call(recipient2, {'from':recipient2}); + const balance3 = await test721token.balanceOf.call(recipient3, {'from':recipient3}); + const balance4 = await test721token.balanceOf.call(accounts[4], {'from':accounts[4]}); + + // Assert + assert.isAbove(Number(balance1), 0); + assert.isAbove(Number(balance2), 0); + assert.isAbove(Number(balance3), 0); + assert.equal(Number(balance4), 0); + // assert.equal(Number(balance1) + Number(balance2) + Number(balance3), _total_tokens) + + }); + it("Should return the redpacket id list of the given address", async () => { + var rp_list = await redpacket.check_redpacket_history.call(accounts[0]); + console.log(rp_list); + }); +}); +