From ec2c68ad5e5b3a731fce4e1c63cdcc95c0c4e6f7 Mon Sep 17 00:00:00 2001 From: Hging Date: Thu, 10 Sep 2020 23:53:10 +0800 Subject: [PATCH 1/7] WIP: Improve the code --- test/contracts/redpacket.sol | 147 +++++++++++++++--- test/contracts/test_erc721_token.sol | 13 ++ test/contracts/test_token.sol | 2 +- test/migrations/4_test_721_token_migration.js | 5 + test/test/Testrp.js | 123 ++++++++++++++- 5 files changed, 263 insertions(+), 27 deletions(-) create mode 100644 test/contracts/test_erc721_token.sol create mode 100644 test/migrations/4_test_721_token_migration.js diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index d9e3e1e..6766236 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( @@ -63,7 +67,18 @@ 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) + public payable { + create_red_packet(_hash, _number, _ifrandom, _duration, _seed, _message, _name, + _token_type, _token_addr, _total_tokens, new uint256[](1)); + } + + // Inits a red packet instance + // _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, + uint256[] memory _erc721_token_ids) public payable { nonce ++; require(nonce > redpackets.length, "000"); @@ -77,6 +92,11 @@ contract HappyRedPacket { require(IERC20(_token_addr).allowance(msg.sender, address(this)) >= _total_tokens, "009"); transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens); } + 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)); RedPacket storage rp = redpacket_by_id[_id]; @@ -101,8 +121,8 @@ 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 @@ -111,9 +131,31 @@ contract HappyRedPacket { // 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); } + + } + + function transfer_token(uint token_type, address token_address, address sender_address, + address recipient_address, uint amount, uint256 erc721_token_ids) public payable{ + if (token_type == 2) { + require(IERC721(token_address).balanceOf(sender_address) >= amount, "012"); + IERC721(token_address).transferFrom(sender_address, recipient_address, erc721_token_ids); + } + } + + function transfer_token(uint token_type, address token_address, address sender_address, + address recipient_address, uint amount, uint256[] memory erc721_token_ids) public payable{ + 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 +175,21 @@ 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]; + } + 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 +200,66 @@ contract HappyRedPacket { // Store claimer info rp.claimer_addrs.push(recipient); uint claimed_tokens; + uint256 token_ids; + // 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 = _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 = 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 @@ -185,11 +268,15 @@ contract HappyRedPacket { } else if (rp.token_type == 1) { transfer_token(rp.token_type, rp.token_address, address(this), - recipient, claimed_tokens); + recipient, claimed_tokens); + } + 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; } @@ -207,6 +294,12 @@ contract HappyRedPacket { 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"); @@ -220,6 +313,12 @@ contract HappyRedPacket { transfer_token(rp.token_type, rp.token_address, address(this), msg.sender, rp.remaining_tokens); } + else if (rp.token_type == 2) { + // Todo 取回 + 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); + } emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens); rp.remaining_tokens = 0; 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 token_address = testtoken.address; 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 @@ -109,3 +111,120 @@ contract("TestToken", accounts => { }); }); +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; + + // console.log('---------') + // console.log('1234----') + // console.log(token_ids); + // console.log('---------') + + 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); + // console.log(creation_receipt); + 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)]}); + console.log(await redpacket.check_erc721_token_ids.call(rp_id)); + + + // 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)]}); + console.log(await redpacket.check_erc721_token_ids.call(rp_id)); + + // 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)]}); + console.log(await redpacket.check_erc721_token_ids.call(rp_id)); + // 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) + + }); +}); \ No newline at end of file From a975432f8f74d9a956e943b37a9019536b38e679 Mon Sep 17 00:00:00 2001 From: Hging Date: Fri, 11 Sep 2020 18:12:52 +0800 Subject: [PATCH 2/7] add erc721 token refund --- test/contracts/redpacket.sol | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 6766236..0cd1d61 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -180,6 +180,7 @@ contract HappyRedPacket { for (uint i = index; i < array.length - 1; i++){ array[i] = array[i + 1]; } + array[array.length - 1] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; return array; } @@ -315,9 +316,15 @@ contract HappyRedPacket { } else if (rp.token_type == 2) { // Todo 取回 - IERC721(rp.token_address).approve(msg.sender, rp.remaining_tokens); + uint256[] _token_ids; + for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){ + if (rp.erc721_token_ids[i] != 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) { + _token_ids.push(); + } + } + // 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); + msg.sender, rp.remaining_tokens, _token_ids); } emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens); From 08efa618b1c9a1be828eb59e23cbd035e9f92a46 Mon Sep 17 00:00:00 2001 From: Hging Date: Fri, 11 Sep 2020 18:14:52 +0800 Subject: [PATCH 3/7] remove unused code --- test/contracts/redpacket.sol | 1 - test/test/Testrp.js | 9 --------- 2 files changed, 10 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 0cd1d61..da95a77 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -315,7 +315,6 @@ contract HappyRedPacket { msg.sender, rp.remaining_tokens); } else if (rp.token_type == 2) { - // Todo 取回 uint256[] _token_ids; for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){ if (rp.erc721_token_ids[i] != 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) { diff --git a/test/test/Testrp.js b/test/test/Testrp.js index 3c58b59..3de42fd 100644 --- a/test/test/Testrp.js +++ b/test/test/Testrp.js @@ -144,11 +144,6 @@ contract("Test721Token", accounts => { } const total_tokens = token_ids.length; - // console.log('---------') - // console.log('1234----') - // console.log(token_ids); - // console.log('---------') - const creation_success_encode = 'CreationSuccess(uint256,bytes32,address,uint256,address,uint256[])'; const creation_success_types = ['uint256', 'bytes32', 'address', 'uint256', 'address', 'uint256[]']; @@ -156,7 +151,6 @@ contract("Test721Token", accounts => { 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); - // console.log(creation_receipt); 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'] @@ -183,7 +177,6 @@ contract("Test721Token", accounts => { 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)]}); - console.log(await redpacket.check_erc721_token_ids.call(rp_id)); // Check Availability @@ -196,7 +189,6 @@ contract("Test721Token", accounts => { 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)]}); - console.log(await redpacket.check_erc721_token_ids.call(rp_id)); // Check Availability returned = await redpacket.check_availability.call(rp_id, {'from': recipient2}); @@ -208,7 +200,6 @@ contract("Test721Token", accounts => { 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)]}); - console.log(await redpacket.check_erc721_token_ids.call(rp_id)); // Check Availability returned = await redpacket.check_availability.call(rp_id, {'from': recipient3}); assert.equal(returned.ifclaimed, true); From ed35516ccb99b5fdc67adc5aacc47e0a17cdfa3c Mon Sep 17 00:00:00 2001 From: Hging Date: Tue, 15 Sep 2020 16:30:14 +0800 Subject: [PATCH 4/7] fix compile error --- test/contracts/redpacket.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index da95a77..f8d55e2 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -315,10 +315,10 @@ contract HappyRedPacket { msg.sender, rp.remaining_tokens); } else if (rp.token_type == 2) { - uint256[] _token_ids; + 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.push(); + _token_ids[_token_ids.length] = rp.erc721_token_ids[i]; } } // IERC721(rp.token_address).approve(msg.sender, rp.remaining_tokens); From 82f71175feea71da060bef6e61f5566cf2adef53 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Thu, 17 Sep 2020 15:22:47 +0800 Subject: [PATCH 5/7] Refactor the code --- .gitignore | 2 +- test/build/contracts/HappyRedPacket.json | 43277 +++++++++++++-------- test/contracts/redpacket.sol | 40 +- 3 files changed, 27374 insertions(+), 15945 deletions(-) diff --git a/.gitignore b/.gitignore index b400562..812fd29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ RedPacket.json -HappyRedPacket.json +test/build/contracts/HappyRedPacket.json Migration.json node_modules/ build/ diff --git a/test/build/contracts/HappyRedPacket.json b/test/build/contracts/HappyRedPacket.json index 871d3c0..5ea39d9 100644 --- a/test/build/contracts/HappyRedPacket.json +++ b/test/build/contracts/HappyRedPacket.json @@ -33,6 +33,12 @@ "internalType": "address", "name": "token_address", "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "token_id", + "type": "uint256[]" } ], "name": "ClaimSuccess", @@ -70,6 +76,12 @@ "internalType": "address", "name": "token_address", "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "erc721_token_ids", + "type": "uint256[]" } ], "name": "CreationSuccess", @@ -86,52 +98,112 @@ }, { "indexed": false, - "internalType": "bytes32", - "name": "hash1", - "type": "bytes32" + "internalType": "address", + "name": "token_address", + "type": "address" }, { "indexed": false, - "internalType": "bytes32", - "name": "hash2", - "type": "bytes32" + "internalType": "uint256", + "name": "remaining_balance", + "type": "uint256" } ], - "name": "Failure", + "name": "RefundSuccess", "type": "event" }, { - "anonymous": false, + "constant": true, + "inputs": [], + "name": "contract_creator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, "inputs": [ { - "indexed": false, "internalType": "bytes32", - "name": "id", + "name": "_hash", "type": "bytes32" }, { - "indexed": false, + "internalType": "uint8", + "name": "_number", + "type": "uint8" + }, + { + "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_address", + "name": "_token_addr", "type": "address" }, { - "indexed": false, "internalType": "uint256", - "name": "remaining_balance", + "name": "_total_tokens", "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "_erc721_token_ids", + "type": "uint256[]" } ], - "name": "RefundSuccess", - "type": "event" + "name": "create_red_packet", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" }, { "constant": false, "inputs": [ { - "internalType": "bytes32[]", - "name": "_hashes", - "type": "bytes32[]" + "internalType": "bytes32", + "name": "_hash", + "type": "bytes32" + }, + { + "internalType": "uint8", + "name": "_number", + "type": "uint8" }, { "internalType": "bool", @@ -207,6 +279,11 @@ "internalType": "uint256", "name": "amount", "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "erc721_token_ids", + "type": "uint256[]" } ], "name": "transfer_token", @@ -307,6 +384,11 @@ "internalType": "bool", "name": "expired", "type": "bool" + }, + { + "internalType": "bool", + "name": "ifclaimed", + "type": "bool" } ], "payable": false, @@ -324,11 +406,6 @@ ], "name": "check_claimed_list", "outputs": [ - { - "internalType": "uint256[]", - "name": "claimed_list", - "type": "uint256[]" - }, { "internalType": "address[]", "name": "claimer_addrs", @@ -339,6 +416,27 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "id", + "type": "bytes32" + } + ], + "name": "check_erc721_token_ids", + "outputs": [ + { + "internalType": "uint256[]", + "name": "erc721_token_ids", + "type": "uint256[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": false, "inputs": [ @@ -355,21 +453,21 @@ "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", + "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"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\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"token_id\",\"type\":\"uint256[]\"}],\"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\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"erc721_token_ids\",\"type\":\"uint256[]\"}],\"name\":\"CreationSuccess\",\"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\"},{\"internalType\":\"bool\",\"name\":\"ifclaimed\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"check_claimed_list\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"claimer_addrs\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"check_erc721_token_ids\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"erc721_token_ids\",\"type\":\"uint256[]\"}],\"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\":true,\"inputs\":[],\"name\":\"contract_creator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_number\",\"type\":\"uint8\"},{\"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\"},{\"internalType\":\"uint256[]\",\"name\":\"_erc721_token_ids\",\"type\":\"uint256[]\"}],\"name\":\"create_red_packet\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_number\",\"type\":\"uint8\"},{\"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\"},{\"internalType\":\"uint256[]\",\"name\":\"erc721_token_ids\",\"type\":\"uint256[]\"}],\"name\":\"transfer_token\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol\":\"HappyRedPacket\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol\":{\"keccak256\":\"0xe003fb6d26b8831eb810cc324cc7ee54eeb9e6e9abcb71043534d7c271751d54\",\"urls\":[\"bzz-raw://690ba37f77adcc7c3a51f5ec5dfaa91115043ef2c82a3f1595788ce1761409ca\",\"dweb:/ipfs/QmU1Um2nk6Y86qYGw6nV5Rz4pBfBHdqnsSDH6CPEDikuzX\"]},\"openzeppelin-solidity/contracts/introspection/IERC165.sol\":{\"keccak256\":\"0xe0ed10f53955c35eecb02724538650a155aa940be3f0a54cd3bde6c6b0c6e48c\",\"urls\":[\"bzz-raw://7dcfda88e3225987245908c3296f3559752647036804325ebfaa9fd1545161c3\",\"dweb:/ipfs/QmXxx5rHfLL57zdgyyyG9MMv4XGN7bpVSc2MuDcaCgto6u\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzz-raw://59fd025151435da35faa8093a5c7a17de02de9d08ad27275c5cdf05050820d91\",\"dweb:/ipfs/QmQMvwEcPhoRXzbXyrdoeRtvLoifUW9Qh7Luho7bmUPRkc\"]},\"openzeppelin-solidity/contracts/token/ERC721/IERC721.sol\":{\"keccak256\":\"0x680c11bc8173eef7d5db843baaf64ce499476de2c172f6aea631dbee54bcd2e6\",\"urls\":[\"bzz-raw://0f314963ab26fb65c6f364d57900f0f1aa8f6aeb4396e327e5e5c646815f060e\",\"dweb:/ipfs/Qmf6eSUtRUF4YDxGyhQq7TVDYzuHcYEvk9Us3RVy5iZQVH\"]}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040518060400160405280602081526020017f466f726d6572204e424120436f6d6d697373696f6e657220446176696420537481525042600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516020018084805190602001908083835b602083106100e257805182526020820191506020810190506020830392506100bf565b6001836020036101000a0380198251168184511680821785525050505050509050018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b8152601401935050505060405160208183030381529060405280519060200120600481905550612f528061016f6000396000f3fe6080604052600436106100915760003560e01c80639224967c116100595780639224967c14610523578063a2f2d261146105b3578063bf5c2920146106df578063c807a6b614610736578063ffed49bc146108f457610091565b8063313f315814610096578063507249eb14610126578063593b79fe146103785780636bfdaece146104425780637249fbb6146104e8575b600080fd5b3480156100a257600080fd5b506100cf600480360360208110156100b957600080fd5b8101908080359060200190929190505050610a04565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156101125780820151818401526020810190506100f7565b505050509050019250505060405180910390f35b610376600480360361016081101561013d57600080fd5b8101908080359060200190929190803560ff16906020019092919080351515906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561019157600080fd5b8201836020820111156101a357600080fd5b803590602001918460018302840111640100000000831117156101c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184600183028401116401000000008311171561025c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102f357600080fd5b82018360208201111561030557600080fd5b8035906020019184602083028401116401000000008311171561032757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610a78565b005b34801561038457600080fd5b506103c76004803603602081101561039b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061136c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104075780820151818401526020810190506103ec565b50505050905090810190601f1680156104345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561044e57600080fd5b5061047b6004803603602081101561046557600080fd5b81019080803590602001909291905050506113b7565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018315151515815260200182151515158152602001965050505050505060405180910390f35b3480156104f457600080fd5b506105216004803603602081101561050b57600080fd5b810190808035906020019092919050505061149d565b005b34801561052f57600080fd5b5061055c6004803603602081101561054657600080fd5b8101908080359060200190929190505050611953565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561059f578082015181840152602081019050610584565b505050509050019250505060405180910390f35b6106dd600480360360c08110156105c957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561065a57600080fd5b82018360208201111561066c57600080fd5b8035906020019184602083028401116401000000008311171561068e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506119fd565b005b3480156106eb57600080fd5b506106f461201b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108f2600480360361014081101561074d57600080fd5b8101908080359060200190929190803560ff1690602001909291908035151590602001909291908035906020019092919080359060200190929190803590602001906401000000008111156107a157600080fd5b8201836020820111156107b357600080fd5b803590602001918460018302840111640100000000831117156107d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561083857600080fd5b82018360208201111561084a57600080fd5b8035906020019184600183028401116401000000008311171561086c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612041565b005b34801561090057600080fd5b506109ee6004803603608081101561091757600080fd5b81019080803590602001909291908035906020019064010000000081111561093e57600080fd5b82018360208201111561095057600080fd5b8035906020019184600183028401116401000000008311171561097257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612090565b6040518082815260200191505060405180910390f35b6060600060026000848152602001908152602001600020905080600d01805480602002602001604051908101604052809291908181526020018280548015610a6b57602002820191906000526020600020905b815481526020019060010190808311610a57575b5050505050915050919050565b600080815480929190600101919050555060038054905060005411610b05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303030000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8960ff16821015610b7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303031000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008a60ff1611610bf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303032000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000841415610c7b5781341015610c76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303038000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fa6565b6001841415610e2e57818373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d6020811015610d6057600080fd5b81019080805190602001909291905050501015610de5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303039000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60606000604051908082528060200260200182016040528015610e175781602001602082028038833980820191505090505b509050610e288585333087866119fd565b50610fa5565b6002841415610fa4578273ffffffffffffffffffffffffffffffffffffffff1663e985e9c533306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610ee857600080fd5b505afa158015610efc573d6000803e3d6000fd5b505050506040513d6020811015610f1257600080fd5b8101908080519060200190929190505050610f95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303131000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fa38484333086866119fd565b5b5b5b600033426000546004548b604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018581526020018481526020018381526020018281526020019550505050505060405160208183030381529060405280519060200120905060006002600083815260200190815260200160002090508181600001819055506003816000015490806001815401808255809150509060018203906000526020600020016000909192909190915055508581600301819055508481600b0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508b8160080160006101000a81548160ff021916908360ff1602179055508381600a0181905550338160050160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086816005016000019080519060200190611147929190612e0a565b5087816005016002019080519060200190611163929190612e0a565b5060008a1415611174576201518099505b61117e428b612ac9565b816009018190555060008160080160016101000a81548160ff021916908360ff1602179055508a8160020160006101000a81548160ff0219169083151502179055508c81600101819055506111f16111ea858360080160009054906101000a900460ff1660ff16612b51565b6002612b9b565b81600401819055508281600d019080519060200190611211929190612e8a565b507fdcb284c7587b44873346be2269371093618514e6af139985542910fed956590b81600a015482600001548360050160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff164285600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600d01604051808781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818154815260200191508054801561134a57602002820191906000526020600020905b815481526020019060010190808311611336575b505097505050505050505060405180910390a150505050505050505050505050565b606060405173ffffffffffffffffffffffffffffffffffffffff8316925082741400000000000000000000000000000000000000001860148201526034810160405280915050919050565b600080600080600080600060026000898152602001908152602001600020905080600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600a01548260080160009054906101000a900460ff168360080160019054906101000a900460ff168460090154421185600e0160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168360ff1693508260ff1692509650965096509650965096505091939550919395565b60006002600083815260200190815260200160002090508060050160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461157c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303131000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b428160090154106115f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303132000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081600301541415611652573373ffffffffffffffffffffffffffffffffffffffff166108fc82600a01549081150290604051600060405180830381858888f1935050505015801561164c573d6000803e3d6000fd5b506118a6565b6001816003015414156117bf57606060006040519080825280602002602001820160405280156116915781602001602082028038833980820191505090505b50905081600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b33384600a01546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174357600080fd5b505af1158015611757573d6000803e3d6000fd5b505050506040513d602081101561176d57600080fd5b8101908080519060200190929190505050506117b9826003015483600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303386600a0154866119fd565b506118a5565b6002816003015414156118a457606060008090505b600183600d018054905003811015611867577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83600d01828154811061181657fe5b90600052602060002001541461185a5782600d01818154811061183557fe5b90600052602060002001548283518151811061184d57fe5b6020026020010181815250505b80806001019150506117d4565b506118a2826003015483600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303386600a0154866119fd565b505b5b5b7f66c304c539e0bc7c8070207c09b9f6a5a9591b434dfed1867cc57fde7fb60093816000015482600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600a0154604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1600081600a01819055505050565b6060600060026000848152602001908152602001600020905080600c018054806020026020016040519081016040528092919081815260200182805480156119f057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116119a6575b5050505050915050919050565b6001861415611cf257818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611a8457600080fd5b505afa158015611a98573d6000803e3d6000fd5b505050506040513d6020811015611aae57600080fd5b81019080805190602001909291905050501015611b33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303130000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b385846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611bba57600080fd5b505af1158015611bce573d6000803e3d6000fd5b505050506040513d6020811015611be457600080fd5b8101908080519060200190929190505050508473ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611cb157600080fd5b505af1158015611cc5573d6000803e3d6000fd5b505050506040513d6020811015611cdb57600080fd5b810190808051906020019092919050505050612013565b600286141561201257818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611d7957600080fd5b505afa158015611d8d573d6000803e3d6000fd5b505050506040513d6020811015611da357600080fd5b81019080805190602001909291905050501015611e28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303132000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b82811015612010573073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611f1d578573ffffffffffffffffffffffffffffffffffffffff1663095ea7b385848481518110611e9357fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611f0457600080fd5b505af1158015611f18573d6000803e3d6000fd5b505050505b8573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686858581518110611f4757fe5b60200260200101516040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015611feb57600080fd5b505af1158015611fff573d6000803e3d6000fd5b505050508080600101915050611e2e565b505b5b505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6120848a8a8a8a8a8a8a8a8a8a600160405190808252806020026020018201604052801561207e5781602001602082028038833980820191505090505b50610a78565b50505050505050505050565b600080600260008781526020019081526020016000209050600084905042826009015411612126576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303033000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8160080160009054906101000a900460ff1660ff168260080160019054906101000a900460ff1660ff16106121c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303034000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000151582600e0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461228b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303035000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b816001015486805190602001201461230b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303036000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6123143361136c565b80519060200120841461238f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303037000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600c018190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060006060600160405190808252806020026020018201604052801561242b5781602001602082028038833980820191505090505b509050600115158460020160009054906101000a900460ff16151514156126005760028460030154141561253c57600084600a015461246e600454600054612c21565b8161247557fe5b069050606085600d018054806020026020016040519081016040528092919081815260200182805480156124c857602002820191906000526020600020905b8154815260200190600101908083116124b4575b505050505090508082815181106124db57fe5b6020026020010151836000815181106124f057fe5b6020026020010181815250506125068183612c9c565b86600d01908051906020019061251d929190612e8a565b5060019350600186600a016000828254039250508190555050506125fb565b60018460080160019054906101000a900460ff168560080160009054906101000a900460ff160360ff1614156125785783600a015491506125fa565b836004015461258b600454600054612c21565b8161259257fe5b06915060008214156125a757600191506125e7565b83600a015482106125e65760018460080160019054906101000a900460ff168560080160009054906101000a900460ff16030360ff1684600a01540391505b5b8184600a01600082825403925050819055505b5b612760565b6002846003015414156126d857606084600d0180548060200260200160405190810160405280929190818152602001828054801561265d57602002820191906000526020600020905b815481526020019060010190808311612649575b5050505050905084600d0160008154811061267457fe5b90600052602060002001548260008151811061268c57fe5b6020026020010181815250506126a3816000612c9c565b85600d0190805190602001906126ba929190612e8a565b5060019250600185600a01600082825403925050819055505061275f565b60018460080160019054906101000a900460ff168560080160009054906101000a900460ff160360ff1614156127145783600a0154915061274c565b61274984600a01548560080160019054906101000a900460ff168660080160009054906101000a900460ff160360ff16612b51565b91505b8184600a01600082825403925050819055505b5b600184600e0160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555083600801600181819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff1602179055505060028460030154141561280d5783600a01548460040181905550612885565b8360080160019054906101000a900460ff1660ff168460080160009054906101000a900460ff1660ff16146128845761287b61287485600a01548660080160019054906101000a900460ff168760080160009054906101000a900460ff160360ff16612b51565b6002612b9b565b84600401819055505b5b6000846003015414156128de578273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156128d8573d6000803e3d6000fd5b506129a2565b60018460030154141561295c576060600060405190808252806020026020018201604052801561291d5781602001602082028038833980820191505090505b509050612956856003015486600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308787866119fd565b506129a1565b6002846003015414156129a05761299f846003015485600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308686866119fd565b5b5b5b7f0fe6f2b72f83f5f793de367c980d289f086ddce851bb3d8be18a71b410a01e488460000154848487600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685604051808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015612aa3578082015181840152602081019050612a88565b50505050905001965050505050505060405180910390a181945050505050949350505050565b600080828401905083811015612b47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612b9383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d44565b905092915050565b600080831415612bae5760009050612c1b565b6000828402905082848281612bbf57fe5b0414612c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612efd6021913960400191505060405180910390fd5b809150505b92915050565b600081338442604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c905092915050565b606082518210612cae57829050612d3e565b60008290505b6001845103811015612cfc57836001820181518110612ccf57fe5b6020026020010151848281518110612ce357fe5b6020026020010181815250508080600101915050612cb4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83600185510381518110612d2e57fe5b6020026020010181815250508290505b92915050565b60008083118290612df0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612db5578082015181840152602081019050612d9a565b50505050905090810190601f168015612de25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612dfc57fe5b049050809150509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e4b57805160ff1916838001178555612e79565b82800160010185558215612e79579182015b82811115612e78578251825591602001919060010190612e5d565b5b509050612e869190612ed7565b5090565b828054828255906000526020600020908101928215612ec6579160200282015b82811115612ec5578251825591602001919060010190612eaa565b5b509050612ed39190612ed7565b5090565b612ef991905b80821115612ef5576000816000905550600101612edd565b5090565b9056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158208faa56b8e97bd75aa6a59df6ba3e1dd6e1eaef916561fcae60a87b58497b0fea64736f6c63430005100032", + "deployedBytecode": "0x6080604052600436106100915760003560e01c80639224967c116100595780639224967c14610523578063a2f2d261146105b3578063bf5c2920146106df578063c807a6b614610736578063ffed49bc146108f457610091565b8063313f315814610096578063507249eb14610126578063593b79fe146103785780636bfdaece146104425780637249fbb6146104e8575b600080fd5b3480156100a257600080fd5b506100cf600480360360208110156100b957600080fd5b8101908080359060200190929190505050610a04565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156101125780820151818401526020810190506100f7565b505050509050019250505060405180910390f35b610376600480360361016081101561013d57600080fd5b8101908080359060200190929190803560ff16906020019092919080351515906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561019157600080fd5b8201836020820111156101a357600080fd5b803590602001918460018302840111640100000000831117156101c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184600183028401116401000000008311171561025c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102f357600080fd5b82018360208201111561030557600080fd5b8035906020019184602083028401116401000000008311171561032757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610a78565b005b34801561038457600080fd5b506103c76004803603602081101561039b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061136c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104075780820151818401526020810190506103ec565b50505050905090810190601f1680156104345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561044e57600080fd5b5061047b6004803603602081101561046557600080fd5b81019080803590602001909291905050506113b7565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018315151515815260200182151515158152602001965050505050505060405180910390f35b3480156104f457600080fd5b506105216004803603602081101561050b57600080fd5b810190808035906020019092919050505061149d565b005b34801561052f57600080fd5b5061055c6004803603602081101561054657600080fd5b8101908080359060200190929190505050611953565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561059f578082015181840152602081019050610584565b505050509050019250505060405180910390f35b6106dd600480360360c08110156105c957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561065a57600080fd5b82018360208201111561066c57600080fd5b8035906020019184602083028401116401000000008311171561068e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506119fd565b005b3480156106eb57600080fd5b506106f461201b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108f2600480360361014081101561074d57600080fd5b8101908080359060200190929190803560ff1690602001909291908035151590602001909291908035906020019092919080359060200190929190803590602001906401000000008111156107a157600080fd5b8201836020820111156107b357600080fd5b803590602001918460018302840111640100000000831117156107d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561083857600080fd5b82018360208201111561084a57600080fd5b8035906020019184600183028401116401000000008311171561086c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612041565b005b34801561090057600080fd5b506109ee6004803603608081101561091757600080fd5b81019080803590602001909291908035906020019064010000000081111561093e57600080fd5b82018360208201111561095057600080fd5b8035906020019184600183028401116401000000008311171561097257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612090565b6040518082815260200191505060405180910390f35b6060600060026000848152602001908152602001600020905080600d01805480602002602001604051908101604052809291908181526020018280548015610a6b57602002820191906000526020600020905b815481526020019060010190808311610a57575b5050505050915050919050565b600080815480929190600101919050555060038054905060005411610b05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303030000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8960ff16821015610b7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303031000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008a60ff1611610bf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303032000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000841415610c7b5781341015610c76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303038000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fa6565b6001841415610e2e57818373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d6020811015610d6057600080fd5b81019080805190602001909291905050501015610de5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303039000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60606000604051908082528060200260200182016040528015610e175781602001602082028038833980820191505090505b509050610e288585333087866119fd565b50610fa5565b6002841415610fa4578273ffffffffffffffffffffffffffffffffffffffff1663e985e9c533306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610ee857600080fd5b505afa158015610efc573d6000803e3d6000fd5b505050506040513d6020811015610f1257600080fd5b8101908080519060200190929190505050610f95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303131000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fa38484333086866119fd565b5b5b5b600033426000546004548b604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018581526020018481526020018381526020018281526020019550505050505060405160208183030381529060405280519060200120905060006002600083815260200190815260200160002090508181600001819055506003816000015490806001815401808255809150509060018203906000526020600020016000909192909190915055508581600301819055508481600b0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508b8160080160006101000a81548160ff021916908360ff1602179055508381600a0181905550338160050160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086816005016000019080519060200190611147929190612e0a565b5087816005016002019080519060200190611163929190612e0a565b5060008a1415611174576201518099505b61117e428b612ac9565b816009018190555060008160080160016101000a81548160ff021916908360ff1602179055508a8160020160006101000a81548160ff0219169083151502179055508c81600101819055506111f16111ea858360080160009054906101000a900460ff1660ff16612b51565b6002612b9b565b81600401819055508281600d019080519060200190611211929190612e8a565b507fdcb284c7587b44873346be2269371093618514e6af139985542910fed956590b81600a015482600001548360050160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff164285600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600d01604051808781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818154815260200191508054801561134a57602002820191906000526020600020905b815481526020019060010190808311611336575b505097505050505050505060405180910390a150505050505050505050505050565b606060405173ffffffffffffffffffffffffffffffffffffffff8316925082741400000000000000000000000000000000000000001860148201526034810160405280915050919050565b600080600080600080600060026000898152602001908152602001600020905080600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600a01548260080160009054906101000a900460ff168360080160019054906101000a900460ff168460090154421185600e0160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168360ff1693508260ff1692509650965096509650965096505091939550919395565b60006002600083815260200190815260200160002090508060050160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461157c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303131000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b428160090154106115f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303132000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081600301541415611652573373ffffffffffffffffffffffffffffffffffffffff166108fc82600a01549081150290604051600060405180830381858888f1935050505015801561164c573d6000803e3d6000fd5b506118a6565b6001816003015414156117bf57606060006040519080825280602002602001820160405280156116915781602001602082028038833980820191505090505b50905081600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b33384600a01546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174357600080fd5b505af1158015611757573d6000803e3d6000fd5b505050506040513d602081101561176d57600080fd5b8101908080519060200190929190505050506117b9826003015483600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303386600a0154866119fd565b506118a5565b6002816003015414156118a457606060008090505b600183600d018054905003811015611867577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83600d01828154811061181657fe5b90600052602060002001541461185a5782600d01818154811061183557fe5b90600052602060002001548283518151811061184d57fe5b6020026020010181815250505b80806001019150506117d4565b506118a2826003015483600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303386600a0154866119fd565b505b5b5b7f66c304c539e0bc7c8070207c09b9f6a5a9591b434dfed1867cc57fde7fb60093816000015482600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600a0154604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1600081600a01819055505050565b6060600060026000848152602001908152602001600020905080600c018054806020026020016040519081016040528092919081815260200182805480156119f057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116119a6575b5050505050915050919050565b6001861415611cf257818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611a8457600080fd5b505afa158015611a98573d6000803e3d6000fd5b505050506040513d6020811015611aae57600080fd5b81019080805190602001909291905050501015611b33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303130000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b385846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611bba57600080fd5b505af1158015611bce573d6000803e3d6000fd5b505050506040513d6020811015611be457600080fd5b8101908080519060200190929190505050508473ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611cb157600080fd5b505af1158015611cc5573d6000803e3d6000fd5b505050506040513d6020811015611cdb57600080fd5b810190808051906020019092919050505050612013565b600286141561201257818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611d7957600080fd5b505afa158015611d8d573d6000803e3d6000fd5b505050506040513d6020811015611da357600080fd5b81019080805190602001909291905050501015611e28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303132000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b82811015612010573073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611f1d578573ffffffffffffffffffffffffffffffffffffffff1663095ea7b385848481518110611e9357fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611f0457600080fd5b505af1158015611f18573d6000803e3d6000fd5b505050505b8573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686858581518110611f4757fe5b60200260200101516040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015611feb57600080fd5b505af1158015611fff573d6000803e3d6000fd5b505050508080600101915050611e2e565b505b5b505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6120848a8a8a8a8a8a8a8a8a8a600160405190808252806020026020018201604052801561207e5781602001602082028038833980820191505090505b50610a78565b50505050505050505050565b600080600260008781526020019081526020016000209050600084905042826009015411612126576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303033000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8160080160009054906101000a900460ff1660ff168260080160019054906101000a900460ff1660ff16106121c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303034000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000151582600e0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461228b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303035000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b816001015486805190602001201461230b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303036000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6123143361136c565b80519060200120841461238f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303037000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600c018190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060006060600160405190808252806020026020018201604052801561242b5781602001602082028038833980820191505090505b509050600115158460020160009054906101000a900460ff16151514156126005760028460030154141561253c57600084600a015461246e600454600054612c21565b8161247557fe5b069050606085600d018054806020026020016040519081016040528092919081815260200182805480156124c857602002820191906000526020600020905b8154815260200190600101908083116124b4575b505050505090508082815181106124db57fe5b6020026020010151836000815181106124f057fe5b6020026020010181815250506125068183612c9c565b86600d01908051906020019061251d929190612e8a565b5060019350600186600a016000828254039250508190555050506125fb565b60018460080160019054906101000a900460ff168560080160009054906101000a900460ff160360ff1614156125785783600a015491506125fa565b836004015461258b600454600054612c21565b8161259257fe5b06915060008214156125a757600191506125e7565b83600a015482106125e65760018460080160019054906101000a900460ff168560080160009054906101000a900460ff16030360ff1684600a01540391505b5b8184600a01600082825403925050819055505b5b612760565b6002846003015414156126d857606084600d0180548060200260200160405190810160405280929190818152602001828054801561265d57602002820191906000526020600020905b815481526020019060010190808311612649575b5050505050905084600d0160008154811061267457fe5b90600052602060002001548260008151811061268c57fe5b6020026020010181815250506126a3816000612c9c565b85600d0190805190602001906126ba929190612e8a565b5060019250600185600a01600082825403925050819055505061275f565b60018460080160019054906101000a900460ff168560080160009054906101000a900460ff160360ff1614156127145783600a0154915061274c565b61274984600a01548560080160019054906101000a900460ff168660080160009054906101000a900460ff160360ff16612b51565b91505b8184600a01600082825403925050819055505b5b600184600e0160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555083600801600181819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff1602179055505060028460030154141561280d5783600a01548460040181905550612885565b8360080160019054906101000a900460ff1660ff168460080160009054906101000a900460ff1660ff16146128845761287b61287485600a01548660080160019054906101000a900460ff168760080160009054906101000a900460ff160360ff16612b51565b6002612b9b565b84600401819055505b5b6000846003015414156128de578273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156128d8573d6000803e3d6000fd5b506129a2565b60018460030154141561295c576060600060405190808252806020026020018201604052801561291d5781602001602082028038833980820191505090505b509050612956856003015486600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308787866119fd565b506129a1565b6002846003015414156129a05761299f846003015485600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308686866119fd565b5b5b5b7f0fe6f2b72f83f5f793de367c980d289f086ddce851bb3d8be18a71b410a01e488460000154848487600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685604051808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015612aa3578082015181840152602081019050612a88565b50505050905001965050505050505060405180910390a181945050505050949350505050565b600080828401905083811015612b47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612b9383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d44565b905092915050565b600080831415612bae5760009050612c1b565b6000828402905082848281612bbf57fe5b0414612c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612efd6021913960400191505060405180910390fd5b809150505b92915050565b600081338442604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c905092915050565b606082518210612cae57829050612d3e565b60008290505b6001845103811015612cfc57836001820181518110612ccf57fe5b6020026020010151848281518110612ce357fe5b6020026020010181815250508080600101915050612cb4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83600185510381518110612d2e57fe5b6020026020010181815250508290505b92915050565b60008083118290612df0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612db5578082015181840152602081019050612d9a565b50505050905090810190601f168015612de25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612dfc57fe5b049050809150509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e4b57805160ff1916838001178555612e79565b82800160010185558215612e79579182015b82811115612e78578251825591602001919060010190612e5d565b5b509050612e869190612ed7565b5090565b828054828255906000526020600020908101928215612ec6579160200282015b82811115612ec5578251825591602001919060010190612eaa565b5b509050612ed39190612ed7565b5090565b612ef991905b80821115612ef5576000816000905550600101612edd565b5090565b9056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158208faa56b8e97bd75aa6a59df6ba3e1dd6e1eaef916561fcae60a87b58497b0fea64736f6c63430005100032", + "sourceMap": "218:12962:1:-;;;1489:141;8:9:-1;5:2;;;30:1;27;20:12;5:2;1489:141:1;1539:10;1520:16;;:29;;;;;;;;;;;;;;;;;;1593:5;;;;;;;;;;;;;;;;;1600:3;1605:16;;;;;;;;;;;1576: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;;;1576:46:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1576:46:1;;;1566:57;;;;;;1559:4;:64;;;;218:12962;;;;;;", + "deployedSourceMap": "218:12962:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11484:197;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11484:197:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11484:197: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;11484:197:1;;;;;;;;;;;;;;;;;2284:2237;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;2284:2237:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2284:2237:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2284:2237: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;2284:2237: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;;2284:2237:1;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2284:2237:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2284:2237: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;2284:2237: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;;2284:2237:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2284:2237:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2284:2237: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;2284:2237: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;;2284:2237:1;;;;;;;;;;;;;;;:::i;:::-;;5903:343;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5903:343:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5903: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;5903:343:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10746:441;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10746:441:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10746:441:1;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11687:1370;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11687:1370:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11687:1370:1;;;;;;;;;;;;;;;;;:::i;:::-;;11248:187;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11248:187:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11248:187: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;11248:187:1;;;;;;;;;;;;;;;;;4571:988;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;4571:988:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;4571:988:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;4571:988: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;4571:988: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;;4571:988:1;;;;;;;;;;;;;;;:::i;:::-;;1263:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1263:31:1;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1720:474;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1720:474:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1720:474:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1720:474: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;1720:474: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;;1720:474:1;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1720:474:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1720:474: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;1720:474: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;;1720:474:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;6734:3908;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6734:3908:1;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;6734:3908:1;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;6734:3908:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;6734:3908: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;6734:3908: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;;6734:3908:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;11484:197;11549:33;11594:20;11617:15;:19;11633:2;11617:19;;;;;;;;;;;11594:42;;11654:2;:19;;11646:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11484:197;;;:::o;2284:2237::-;2656:5;;:8;;;;;;;;;;;;;2690:10;:17;;;;2682:5;;:25;2674:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2750:7;2733:24;;:13;:24;;2725:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2793:1;2783:7;:11;;;2775:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2832:1;2817:11;:16;2813:762;;;2870:13;2857:9;:26;;2849:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2813:762;;;2943:1;2928:11;:16;2924:651;;;3028:13;2975:11;2968:29;;;2998:10;3018:4;2968:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2968:56:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2968:56:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2968:56:1;;;;;;;;;;;;;;;;:73;;2960:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3063:34;3114:1;3100:16;;;;;;;;;;;;;;;;;;;;;;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;3100:16:1;;;;3063:53;;3131:100;3146:11;3159;3172:10;3192:4;3199:13;3214:16;3131:14;:100::i;:::-;2924:651;;;;3275:1;3260:11;:16;3256:319;;;3308:11;3300:37;;;3338:10;3358:4;3300:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3300:64:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3300:64:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3300:64:1;;;;;;;;;;;;;;;;3292:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3386:101;3401:11;3414;3427:10;3447:4;3454:13;3469:17;3386:14;:101::i;:::-;3256:319;2924:651;2813:762;3585:11;3626:10;3638:3;3643:5;;3650:4;;3656:5;3609:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3609:53:1;;;3599:64;;;;;;3585:78;;3673:20;3696:15;:20;3712:3;3696:20;;;;;;;;;;;3673:43;;3734:3;3726:2;:5;;:11;;;;3747:10;3763:2;:5;;;3747:22;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;3747:22:1;;;;;;;;;;;;;;;;;;;;;;3796:11;3780:2;:13;;:27;;;;3836:11;3817:2;:16;;;:30;;;;;;;;;;;;;;;;;;3876:7;3858:2;:15;;;:25;;;;;;;;;;;;;;;;;;3915:13;3893:2;:19;;:35;;;;3957:10;3939:2;:10;;:15;;;:28;;;;;;;;;;;;;;;;;;3995:5;3977:2;:10;;:15;;:23;;;;;;;;;;;;:::i;:::-;;4031:8;4010:2;:10;;:18;;:29;;;;;;;;;;;;:::i;:::-;;4067:1;4054:9;:14;4050:49;;;4094:5;4082:17;;4050:49;4141:28;4154:3;4159:9;4141:12;:28::i;:::-;4120:2;:18;;:49;;;;4200:1;4180:2;:17;;;:21;;;;;;;;;;;;;;;;;;4225:9;4211:2;:11;;;:23;;;;;;;;;;;;;;;;;;4254:5;4244:2;:7;;:15;;;;4285:61;4298:44;4311:13;4326:2;:15;;;;;;;;;;;;4298:44;;:12;:44::i;:::-;4344:1;4285:12;:61::i;:::-;4269:2;:13;;:77;;;;4378:17;4356:2;:19;;:39;;;;;;;;;;;;:::i;:::-;;4410:104;4426:2;:19;;;4447:2;:5;;;4454:2;:10;;:15;;;;;;;;;;;;4471:3;4476:2;:16;;;;;;;;;;;;4494:2;:19;;4410:104;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2284:2237;;;;;;;;;;;;;:::o;5903:343::-;5952:14;6016:4;6010:11;6046:42;6043:1;6039:50;6034:55;;6171:1;6125:44;6121:52;6116:2;6113:1;6109:10;6102:72;6207:2;6204:1;6200:10;6194:4;6187:24;6229:1;6224:6;;5987:253;;;;:::o;10746:441::-;10807:21;10830:12;10844:10;10925:12;10939;10953:14;10979:20;11002:15;:19;11018:2;11002:19;;;;;;;;;;;10979:42;;11039:2;:16;;;;;;;;;;;;11057:2;:19;;;11078:2;:15;;;;;;;;;;;;11112:2;:17;;;;;;;;;;;;11137:2;:18;;;11131:3;:24;11157:2;:10;;:22;11168:10;11157:22;;;;;;;;;;;;;;;;;;;;;;;;;11031:149;;;;;;;;;;;;;;;;;;;;;;;10746:441;;;;;;;:::o;11687:1370::-;11732:20;11755:15;:19;11771:2;11755:19;;;;;;;;;;;11732:42;;11806:2;:10;;:15;;;;;;;;;;;;11792:29;;:10;:29;;;11784:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11868:3;11847:2;:18;;;:24;11839:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11911:1;11894:2;:13;;;:18;11890:1053;;;11928:10;:19;;:40;11948:2;:19;;;11928:40;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11928:40:1;11890:1053;;;12014:1;11997:2;:13;;;:18;11993:950;;;12031:33;12081:1;12067:16;;;;;;;;;;;;;;;;;;;;;;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;12067:16:1;;;;12031:52;;12105:2;:16;;;;;;;;;;;;12098:32;;;12131:10;12143:2;:19;;;12098:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12098:65:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;12098:65:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;12098:65:1;;;;;;;;;;;;;;;;;12177:141;12192:2;:13;;;12207:2;:16;;;;;;;;;;;;12233:4;12268:10;12280:2;:19;;;12301:16;12177:14;:141::i;:::-;11993:950;;;;12364:1;12347:2;:13;;;:18;12343:600;;;12381:26;12426:6;12435:1;12426:10;;12421:280;12471:1;12442:2;:19;;:26;;;;:30;12438:1;:34;12421:280;;;12526:66;12500:2;:19;;12520:1;12500:22;;;;;;;;;;;;;;;;:92;12496:191;;12646:2;:19;;12666:1;12646:22;;;;;;;;;;;;;;;;12616:9;12626;:16;12616:27;;;;;;;;;;;;;:52;;;;;12496:191;12474:3;;;;;;;12421:280;;;;12797:134;12812:2;:13;;;12827:2;:16;;;;;;;;;;;;12853:4;12888:10;12900:2;:19;;;12921:9;12797:14;:134::i;:::-;12343:600;;11993:950;11890:1053;12958:59;12972:2;:5;;;12979:2;:16;;;;;;;;;;;;12997:2;:19;;;12958:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13049:1;13027:2;:19;;:23;;;;11687:1370;;:::o;11248:187::-;11309:30;11351:20;11374:15;:19;11390:2;11374:19;;;;;;;;;;;11351:42;;11411:2;:16;;11403:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11248:187;;;:::o;4571:988::-;4822:1;4808:10;:15;4804:748;;;4898:6;4854:13;4847:31;;;4879:14;4847:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4847:47:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4847:47:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4847:47:1;;;;;;;;;;;;;;;;:57;;4839:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4933:13;4926:29;;;4956:14;4972:6;4926:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4926:53:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4926:53:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4926:53:1;;;;;;;;;;;;;;;;;5000:13;4993:34;;;5028:14;5044:17;5063:6;4993:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4993:77:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4993:77:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4993:77:1;;;;;;;;;;;;;;;;;4804:748;;;5114:1;5100:10;:15;5096:456;;;5191:6;5147:13;5139:32;;;5172:14;5139:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5139:48:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5139:48:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5139:48:1;;;;;;;;;;;;;;;;:58;;5131:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5224:6;5231:1;5224:8;;5219:323;5238:6;5234:1;:10;5219:323;;;5302:4;5273:34;;:17;:34;;;5269:150;;;5338:13;5330:30;;;5361:17;5380:16;5397:1;5380:19;;;;;;;;;;;;;;5330:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5330:70:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5330:70:1;;;;5269:150;5444:13;5436:35;;;5472:14;5488:17;5507:16;5524:1;5507:19;;;;;;;;;;;;;;5436:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5436:91:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5436:91:1;;;;5246:3;;;;;;;5219:323;;;;5096:456;4804:748;4571:988;;;;;;:::o;1263:31::-;;;;;;;;;;;;;:::o;1720:474::-;2023:164;2041:5;2048:7;2057:9;2068;2079:5;2086:8;2096:5;2129:11;2142;2155:13;2184:1;2170:16;;;;;;;;;;;;;;;;;;;;;;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;2170:16:1;;;;2023:17;:164::i;:::-;1720:474;;;;;;;;;;:::o;6734:3908::-;6846:12;6871:20;6894:15;:19;6910:2;6894:19;;;;;;;;;;;6871:42;;6923:25;6967:10;6923:56;;7072:3;7051:2;:18;;;:24;7042:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7122:2;:15;;;;;;;;;;;;7102:35;;:2;:17;;;;;;;;;;;;:35;;;7093:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7189:5;7164:30;;:2;:10;;:21;7175:9;7164:21;;;;;;;;;;;;;;;;;;;;;;;;;:30;;;7155:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7251:2;:7;;;7237:8;7221:26;;;;;;:37;7212:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7309:19;7317:10;7309:7;:19::i;:::-;7299:30;;;;;;7285:10;:44;7276:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7378:2;:16;;7400:9;7378:32;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;7378:32:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7420:19;7449:27;7493:1;7479:16;;;;;;;;;;;;;;;;;;;;;;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;7479:16:1;;;;7449:46;;7593:4;7578:19;;:2;:11;;;;;;;;;;;;:19;;;7574:1924;;;7634:1;7617:2;:13;;;:18;7613:1063;;;7655:19;7699:2;:19;;;7677;7684:4;;7690:5;;7677:6;:19::i;:::-;:41;;;;;;7655:63;;7736:23;7762:2;:19;;7736:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7814:6;7821:14;7814:22;;;;;;;;;;;;;;7799:9;7809:1;7799:12;;;;;;;;;;;;;:37;;;;;7876:43;7896:6;7904:14;7876:19;:43::i;:::-;7854:2;:19;;:65;;;;;;;;;;;;:::i;:::-;;7954:1;7937:18;;7996:1;7973:2;:19;;;:24;;;;;;;;;;;7613:1063;;;;;8103:1;8082:2;:17;;;;;;;;;;;;8064:2;:15;;;;;;;;;;;;:35;:40;;;8060:602;;;8144:2;:19;;;8127:36;;8060:602;;;8264:2;:13;;;8242:19;8249:4;;8255:5;;8242:6;:19::i;:::-;:35;;;;;;8225:52;;8321:1;8303:14;:19;8299:290;;;8367:1;8350:18;;8299:290;;;8439:2;:19;;;8421:14;:37;8417:172;;8564:1;8544:2;:17;;;;;;;;;;;;8526:2;:15;;;;;;;;;;;;:35;:39;8503:63;;:2;:19;;;:63;8486:80;;8417:172;8299:290;8629:14;8606:2;:19;;;:37;;;;;;;;;;;8060:602;7613:1063;7574:1924;;;8735:1;8718:2;:13;;;:18;8714:774;;;8835:23;8861:2;:19;;8835:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8913:2;:19;;8933:1;8913:22;;;;;;;;;;;;;;;;8898:9;8908:1;8898:12;;;;;;;;;;;;;:37;;;;;8975:30;8995:6;9003:1;8975:19;:30::i;:::-;8953:2;:19;;:52;;;;;;;;;;;;:::i;:::-;;9040:1;9023:18;;9082:1;9059:2;:19;;;:24;;;;;;;;;;;8714:774;;;;9189:1;9168:2;:17;;;;;;;;;;;;9150:2;:15;;;;;;;;;;;;:35;:40;;;9146:273;;;9230:2;:19;;;9213:36;;9146:273;;;9328:72;9341:2;:19;;;9381:2;:17;;;;;;;;;;;;9363:2;:15;;;;;;;;;;;;:35;9328:72;;:12;:72::i;:::-;9311:89;;9146:273;9459:14;9436:2;:19;;;:37;;;;;;;;;;;8714:774;7574:1924;9532:4;9508:2;:10;;:21;9519:9;9508:21;;;;;;;;;;;;;;;;:28;;;;;;;;;;;;;;;;;;9547:2;:17;;;:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9598:1;9581:2;:13;;;:18;9577:300;;;9631:2;:19;;;9615:2;:13;;:35;;;;9577:300;;;9712:2;:17;;;;;;;;;;;;9693:36;;:2;:15;;;;;;;;;;;;:36;;;9689:177;;9764:87;9777:70;9790:2;:19;;;9829:2;:17;;;;;;;;;;;;9811:2;:15;;;;;;;;;;;;:35;9777:70;;:12;:70::i;:::-;9849:1;9764:12;:87::i;:::-;9748:2;:13;;:103;;;;9689:177;9577:300;9964:1;9947:2;:13;;;:18;9943:540;;;9981:9;:18;;:34;10000:14;9981:34;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9981:34:1;9943:540;;;10061:1;10044:2;:13;;;:18;10040:443;;;10078:34;10129:1;10115:16;;;;;;;;;;;;;;;;;;;;;;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;10115:16:1;;;;10078:53;;10146:135;10161:2;:13;;;10176:2;:16;;;;;;;;;;;;10202:4;10237:9;10248:14;10264:16;10146:14;:135::i;:::-;10040:443;;;;10327:1;10310:2;:13;;;:18;10306:177;;;10344:128;10359:2;:13;;;10374:2;:16;;;;;;;;;;;;10400:4;10435:9;10446:14;10462:9;10344:14;:128::i;:::-;10306:177;10040:443;9943:540;10529:75;10542:2;:5;;;10549:9;10560:14;10576:2;:16;;;;;;;;;;;;10594:9;10529:75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;10529:75:1;;;;;;;;;;;;;;;;;;;;;10621:14;10614:21;;;;;;6734:3908;;;;;;:::o;834:176:8:-;892:7;911:9;927:1;923;:5;911:17;;951:1;946;:6;;938:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1002:1;995:8;;;834:176;;;;:::o;3073:130::-;3131:7;3157:39;3161:1;3164;3157:39;;;;;;;;;;;;;;;;;:3;:39::i;:::-;3150:46;;3073:130;;;;:::o;2159:459::-;2217:7;2463:1;2458;:6;2454:45;;;2487:1;2480:8;;;;2454:45;2509:9;2525:1;2521;:5;2509:17;;2553:1;2548;2544;:5;;;;;;:10;2536:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2610:1;2603:8;;;2159:459;;;;;:::o;5593:173:1:-;5663:9;5723:10;5735;5747:4;5753:3;5706:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;5706:51:1;;;5696:62;;;;;;5691:68;;5684:75;;5593:173;;;;:::o;6252:389::-;6339:16;6380:5;:12;6371:5;:21;6367:39;;6401:5;6394:12;;;;6367:39;6421:6;6430:5;6421:14;;6416:95;6456:1;6441:5;:12;:16;6437:1;:20;6416:95;;;6488:5;6498:1;6494;:5;6488:12;;;;;;;;;;;;;;6477:5;6483:1;6477:8;;;;;;;;;;;;;:23;;;;;6459:3;;;;;;;6416:95;;;;6546:66;6520:5;6541:1;6526:5;:12;:16;6520:23;;;;;;;;;;;;;:92;;;;;6629:5;6622:12;;6252:389;;;;;:::o;3718:338:8:-;3804:7;3901:1;3897;:5;3904:12;3889:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;3889:28:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3927:9;3943:1;3939;:5;;;;;;3927:17;;4048:1;4041:8;;;3718:338;;;;;:::o;218:12962:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", + "source": "pragma solidity >0.4.22;\nimport \"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC721/IERC721.sol\";\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\n\ncontract HappyRedPacket {\n\n struct RedPacket {\n bytes32 id;\n bytes32 hash;\n bool ifrandom;\n uint token_type;\n uint MAX_AMOUNT;\n Creator creator;\n uint8 total_number;\n uint8 claimed_number;\n uint expiration_time;\n uint remaining_tokens;\n address token_address;\n address[] claimer_addrs;\n uint256[] erc721_token_ids;\n mapping(address => bool) claimed;\n }\n\n struct Creator {\n string name;\n address addr;\n string message;\n }\n\n event CreationSuccess(\n uint total,\n bytes32 id,\n address creator,\n uint creation_time,\n address token_address,\n uint256[] erc721_token_ids\n );\n\n event ClaimSuccess(\n bytes32 id,\n address claimer,\n uint claimed_value,\n address token_address,\n uint256[] token_id\n );\n\n event RefundSuccess(\n bytes32 id,\n address token_address,\n uint remaining_balance\n );\n\n uint nonce;\n address public contract_creator;\n mapping(bytes32 => RedPacket) redpacket_by_id;\n bytes32 [] redpackets;\n string constant private magic = \"Former NBA Commissioner David St\"; // 32 bytes\n bytes32 private uuid;\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 _hash, uint8 _number, 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 create_red_packet(_hash, _number, _ifrandom, _duration, _seed, _message, _name,\n _token_type, _token_addr, _total_tokens, new uint256[](1));\n }\n\n // Inits a red packet instance\n // _token_type: 0 - ETH 1 - ERC20 2 - ERC721\n function create_red_packet (bytes32 _hash, uint8 _number, bool _ifrandom, uint _duration, \n bytes32 _seed, string memory _message, string memory _name,\n uint _token_type, address _token_addr, uint _total_tokens,\n uint256[] memory _erc721_token_ids) \n public payable {\n nonce ++;\n require(nonce > redpackets.length, \"000\");\n require(_total_tokens >= _number, \"001\");\n require(_number > 0, \"002\");\n\n if (_token_type == 0) {\n require(msg.value >= _total_tokens, \"008\");\n } \n else if (_token_type == 1) {\n require(IERC20(_token_addr).allowance(msg.sender, address(this)) >= _total_tokens, \"009\");\n uint256 [] memory token_ids_holder = new uint256[](0); \n transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, token_ids_holder);\n }\n else if (_token_type == 2) {\n require(IERC721(_token_addr).isApprovedForAll(msg.sender, address(this)), \"011\");\n transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, _erc721_token_ids);\n // IERC721(_token_addr).setApprovalForAll(address(this), false);\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 = _number;\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 = SafeMath.add(now, _duration);\n\n rp.claimed_number = 0;\n rp.ifrandom = _ifrandom;\n rp.hash = _hash;\n rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(_total_tokens, rp.total_number), 2);\n rp.erc721_token_ids = _erc721_token_ids;\n emit CreationSuccess(rp.remaining_tokens, rp.id, rp.creator.addr, now, rp.token_address, rp.erc721_token_ids);\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, uint256 [] memory erc721_token_ids) public payable{\n // ERC20\n if (token_type == 1) {\n require(IERC20(token_address).balanceOf(sender_address) >= amount, \"010\");\n IERC20(token_address).approve(sender_address, amount);\n IERC20(token_address).transferFrom(sender_address, recipient_address, amount);\n }\n\n else if (token_type == 2) {\n require(IERC721(token_address).balanceOf(sender_address) >= amount, \"012\");\n for (uint i=0; i < amount; i++) {\n if (recipient_address == address(this)){\n IERC721(token_address).approve(recipient_address, erc721_token_ids[i]);\n }\n IERC721(token_address).transferFrom(sender_address, recipient_address, erc721_token_ids[i]);\n }\n }\n\n }\n \n // A boring wrapper\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 function getTokenIdWithIndex(uint256[] memory array, uint index) internal view returns(uint256[] memory) {\n if (index >= array.length) return array;\n for (uint i = index; i < array.length - 1; i++){\n array[i] = array[i + 1];\n }\n array[array.length - 1] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;\n return array;\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\n RedPacket storage rp = redpacket_by_id[id];\n address payable recipient = address(uint160(_recipient));\n // uint256 token_id;\n // Unsuccessful\n require (rp.expiration_time > now, \"003\");\n require (rp.claimed_number < rp.total_number, \"004\");\n require (rp.claimed[recipient] == false, \"005\");\n require (keccak256(bytes(password)) == rp.hash, \"006\");\n require (validation == keccak256(toBytes(msg.sender)), \"007\");\n\n // Store claimer info\n rp.claimer_addrs.push(recipient);\n uint claimed_tokens;\n uint256 [] memory token_ids = new uint256[](1); //TODO: Optimize this behavior.\n // Todo get erc721 token id;\n if (rp.ifrandom == true) {\n if (rp.token_type == 2) {\n uint token_id_index = random(uuid, nonce) % rp.remaining_tokens;\n uint256[] memory _array = rp.erc721_token_ids;\n token_ids[0] = _array[token_id_index];\n rp.erc721_token_ids = getTokenIdWithIndex(_array, token_id_index);\n claimed_tokens = 1;\n rp.remaining_tokens -= 1;\n }\n else\n {\n if (rp.total_number - rp.claimed_number == 1){\n claimed_tokens = rp.remaining_tokens;\n }\n else{\n claimed_tokens = random(uuid, nonce) % rp.MAX_AMOUNT;\n if (claimed_tokens == 0) {\n claimed_tokens = 1;\n }\n else if (claimed_tokens >= rp.remaining_tokens) {\n claimed_tokens = rp.remaining_tokens - (rp.total_number - rp.claimed_number - 1);\n }\n rp.remaining_tokens -= claimed_tokens;\n }\n }\n }\n else {\n if (rp.token_type == 2) {\n // token_id_index = random(uuid, nonce) % rp.remaining_tokens;\n uint256[] memory _array = rp.erc721_token_ids;\n token_ids[0] = rp.erc721_token_ids[0];\n rp.erc721_token_ids = getTokenIdWithIndex(_array, 0);\n claimed_tokens = 1;\n rp.remaining_tokens -= 1;\n }\n else\n {\n if (rp.total_number - rp.claimed_number == 1){\n claimed_tokens = rp.remaining_tokens;\n }\n else{\n claimed_tokens = SafeMath.div(rp.remaining_tokens, (rp.total_number - rp.claimed_number));\n }\n rp.remaining_tokens -= claimed_tokens;\n }\n }\n\n rp.claimed[recipient] = true;\n\n rp.claimed_number ++;\n if (rp.token_type == 2) {\n rp.MAX_AMOUNT = rp.remaining_tokens;\n }\n else {\n if (rp.total_number != rp.claimed_number){\n rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(rp.remaining_tokens, rp.total_number - rp.claimed_number), 2);\n }\n\n }\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 uint256 [] memory token_ids_holder = new uint256[](0); \n transfer_token(rp.token_type, rp.token_address, address(this),\n recipient, claimed_tokens, token_ids_holder);\n }\n else if (rp.token_type == 2) {\n transfer_token(rp.token_type, rp.token_address, address(this),\n recipient, claimed_tokens, token_ids);\n }\n\n // Claim success event\n emit ClaimSuccess(rp.id, recipient, claimed_tokens, rp.token_address, token_ids);\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, uint total, \n uint claimed, bool expired, bool ifclaimed) {\n RedPacket storage rp = redpacket_by_id[id];\n return (rp.token_address, rp.remaining_tokens, rp.total_number, \n rp.claimed_number, now > rp.expiration_time, rp.claimed[msg.sender]);\n }\n\n // Returns a list of claimed addresses accordingly\n function check_claimed_list(bytes32 id) public view returns (address[] memory claimer_addrs) {\n RedPacket storage rp = redpacket_by_id[id];\n return (rp.claimer_addrs);\n }\n\n // Returns a list of claiming token id\n function check_erc721_token_ids(bytes32 id) public view returns (uint256[] memory erc721_token_ids) {\n RedPacket storage rp = redpacket_by_id[id];\n return (rp.erc721_token_ids);\n }\n\n function refund(bytes32 id) public {\n RedPacket storage rp = redpacket_by_id[id];\n require(msg.sender == rp.creator.addr, \"011\");\n require(rp.expiration_time < now, \"012\");\n\n if (rp.token_type == 0) {\n msg.sender.transfer(rp.remaining_tokens);\n }\n else if (rp.token_type == 1) {\n uint256[] memory token_ids_holder = new uint256[](0); \n IERC20(rp.token_address).approve(msg.sender, rp.remaining_tokens);\n transfer_token(rp.token_type, rp.token_address, address(this),\n msg.sender, rp.remaining_tokens, token_ids_holder);\n }\n else if (rp.token_type == 2) {\n uint256[] memory token_ids;\n for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){\n if (rp.erc721_token_ids[i] != 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) {\n token_ids[token_ids.length] = rp.erc721_token_ids[i];\n }\n }\n // IERC721(rp.token_address).approve(msg.sender, rp.remaining_tokens);\n transfer_token(rp.token_type, rp.token_address, address(this),\n msg.sender, rp.remaining_tokens, token_ids); \n }\n\n emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens);\n rp.remaining_tokens = 0;\n }\n\n // One cannot send tokens to this contract after constructor anymore\n // function () external payable {\n // }\n}\n", + "sourcePath": "/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol", "ast": { - "absolutePath": "/Users/yisiliu/Workspace/DimensionDev/RedPacket/test/contracts/redpacket.sol", + "absolutePath": "/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol", "exportedSymbols": { "HappyRedPacket": [ - 956 + 1367 ] }, - "id": 957, + "id": 1368, "nodeType": "SourceUnit", "nodes": [ { @@ -388,36 +486,58 @@ "file": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", "id": 59, "nodeType": "ImportDirective", - "scope": 957, - "sourceUnit": 1729, + "scope": 1368, + "sourceUnit": 2291, "src": "25:64:1", "symbolAliases": [], "unitAlias": "" }, + { + "absolutePath": "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol", + "file": "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol", + "id": 60, + "nodeType": "ImportDirective", + "scope": 1368, + "sourceUnit": 3503, + "src": "90:66:1", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", + "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", + "id": 61, + "nodeType": "ImportDirective", + "scope": 1368, + "sourceUnit": 1759, + "src": "157:59:1", + "symbolAliases": [], + "unitAlias": "" + }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, - "id": 956, + "id": 1367, "linearizedBaseContracts": [ - 956 + 1367 ], "name": "HappyRedPacket", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "HappyRedPacket.RedPacket", - "id": 95, + "id": 94, "members": [ { "constant": false, - "id": 61, + "id": 63, "name": "id", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "149:10:1", + "scope": 94, + "src": "276:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -425,10 +545,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 60, + "id": 62, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "149:7:1", + "src": "276:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -439,25 +559,25 @@ }, { "constant": false, - "id": 63, - "name": "ifrandom", + "id": 65, + "name": "hash", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "169:13:1", + "scope": 94, + "src": "296:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" }, "typeName": { - "id": 62, - "name": "bool", + "id": 64, + "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "169:4:1", + "src": "296:7:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, "value": null, @@ -465,35 +585,25 @@ }, { "constant": false, - "id": 66, - "name": "tokens", + "id": 67, + "name": "ifrandom", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "192:13:1", + "scope": 94, + "src": "318:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" + "typeIdentifier": "t_bool", + "typeString": "bool" }, "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", + "id": 66, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "318:4:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, "value": null, @@ -501,11 +611,11 @@ }, { "constant": false, - "id": 68, + "id": 69, "name": "token_type", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "215:15:1", + "scope": 94, + "src": "341:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -513,10 +623,10 @@ "typeString": "uint256" }, "typeName": { - "id": 67, + "id": 68, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "215:4:1", + "src": "341:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -527,27 +637,25 @@ }, { "constant": false, - "id": 70, - "name": "creator", + "id": 71, + "name": "MAX_AMOUNT", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "240:15:1", + "scope": 94, + "src": "366:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, "typeName": { - "contractScope": null, - "id": 69, - "name": "Creator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 102, - "src": "240:7:1", + "id": 70, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "366:4:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, "value": null, @@ -556,34 +664,26 @@ { "constant": false, "id": 73, - "name": "hashes", + "name": "creator", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "265:16:1", + "scope": 94, + "src": "391:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" + "typeIdentifier": "t_struct$_Creator_$101_storage_ptr", + "typeString": "struct HappyRedPacket.Creator" }, "typeName": { - "baseType": { - "id": 71, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "265:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, + "contractScope": null, "id": 72, - "length": null, - "nodeType": "ArrayTypeName", - "src": "265:9:1", + "name": "Creator", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 101, + "src": "391:7:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" + "typeIdentifier": "t_struct$_Creator_$101_storage_ptr", + "typeString": "struct HappyRedPacket.Creator" } }, "value": null, @@ -594,22 +694,22 @@ "id": 75, "name": "total_number", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "291:17:1", + "scope": 94, + "src": "416:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" }, "typeName": { "id": 74, - "name": "uint", + "name": "uint8", "nodeType": "ElementaryTypeName", - "src": "291:4:1", + "src": "416:5:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, "value": null, @@ -618,24 +718,24 @@ { "constant": false, "id": 77, - "name": "creator_name", + "name": "claimed_number", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "318:19:1", + "scope": 94, + "src": "444:20:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" + "typeIdentifier": "t_uint8", + "typeString": "uint8" }, "typeName": { "id": 76, - "name": "string", + "name": "uint8", "nodeType": "ElementaryTypeName", - "src": "318:6:1", + "src": "444:5:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, "value": null, @@ -644,10 +744,10 @@ { "constant": false, "id": 79, - "name": "claimed_number", + "name": "expiration_time", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "347:19:1", + "scope": 94, + "src": "474:20:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -658,7 +758,7 @@ "id": 78, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "347:4:1", + "src": "474:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -670,10 +770,10 @@ { "constant": false, "id": 81, - "name": "expiration_time", + "name": "remaining_tokens", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "376:20:1", + "scope": 94, + "src": "504:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -684,7 +784,7 @@ "id": 80, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "376:4:1", + "src": "504:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -696,36 +796,10 @@ { "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", + "scope": 94, + "src": "535:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -733,10 +807,10 @@ "typeString": "address" }, "typeName": { - "id": 84, + "id": 82, "name": "address", "nodeType": "ElementaryTypeName", - "src": "437:7:1", + "src": "535:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -748,37 +822,11 @@ }, { "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, + "id": 86, "name": "claimer_addrs", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "501:23:1", + "scope": 94, + "src": "566:23:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -787,20 +835,20 @@ }, "typeName": { "baseType": { - "id": 88, + "id": 84, "name": "address", "nodeType": "ElementaryTypeName", - "src": "501:7:1", + "src": "566:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "id": 89, + "id": 85, "length": null, "nodeType": "ArrayTypeName", - "src": "501:9:1", + "src": "566:9:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", "typeString": "address[]" @@ -811,45 +859,79 @@ }, { "constant": false, - "id": 94, - "name": "claimers", + "id": 89, + "name": "erc721_token_ids", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "534:36:1", + "scope": 94, + "src": "599:26:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer)" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" }, "typeName": { - "id": 93, + "baseType": { + "id": 87, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "599:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 88, + "length": null, + "nodeType": "ArrayTypeName", + "src": "599:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 93, + "name": "claimed", + "nodeType": "VariableDeclaration", + "scope": 94, + "src": "635:32:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + }, + "typeName": { + "id": 92, "keyType": { - "id": 91, + "id": 90, "name": "address", "nodeType": "ElementaryTypeName", - "src": "542:7:1", + "src": "643:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", - "src": "534:27:1", + "src": "635:24:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer)" + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" }, "valueType": { - "contractScope": null, - "id": 92, - "name": "Claimer", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 111, - "src": "553:7:1", + "id": 91, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "654:4:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage_ptr", - "typeString": "struct HappyRedPacket.Claimer" + "typeIdentifier": "t_bool", + "typeString": "bool" } } }, @@ -859,21 +941,21 @@ ], "name": "RedPacket", "nodeType": "StructDefinition", - "scope": 956, - "src": "122:455:1", + "scope": 1367, + "src": "249:425:1", "visibility": "public" }, { "canonicalName": "HappyRedPacket.Creator", - "id": 102, + "id": 101, "members": [ { "constant": false, - "id": 97, + "id": 96, "name": "name", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "608:11:1", + "scope": 101, + "src": "705:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -881,10 +963,10 @@ "typeString": "string" }, "typeName": { - "id": 96, + "id": 95, "name": "string", "nodeType": "ElementaryTypeName", - "src": "608:6:1", + "src": "705:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" @@ -895,11 +977,11 @@ }, { "constant": false, - "id": 99, + "id": 98, "name": "addr", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "629:12:1", + "scope": 101, + "src": "726:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -907,10 +989,10 @@ "typeString": "address" }, "typeName": { - "id": 98, + "id": 97, "name": "address", "nodeType": "ElementaryTypeName", - "src": "629:7:1", + "src": "726:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -922,11 +1004,11 @@ }, { "constant": false, - "id": 101, + "id": 100, "name": "message", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "651:14:1", + "scope": 101, + "src": "748:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -934,10 +1016,10 @@ "typeString": "string" }, "typeName": { - "id": 100, + "id": 99, "name": "string", "nodeType": "ElementaryTypeName", - "src": "651:6:1", + "src": "748:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" @@ -949,143 +1031,28 @@ ], "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", + "scope": 1367, + "src": "680:89:1", "visibility": "public" }, { "anonymous": false, "documentation": null, - "id": 123, + "id": 116, "name": "CreationSuccess", "nodeType": "EventDefinition", "parameters": { - "id": 122, + "id": 115, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 113, + "id": 103, "indexed": false, "name": "total", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "834:10:1", + "scope": 116, + "src": "806:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1093,10 +1060,10 @@ "typeString": "uint256" }, "typeName": { - "id": 112, + "id": 102, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "834:4:1", + "src": "806:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1107,12 +1074,12 @@ }, { "constant": false, - "id": 115, + "id": 105, "indexed": false, "name": "id", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "854:10:1", + "scope": 116, + "src": "826:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1120,10 +1087,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 114, + "id": 104, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "854:7:1", + "src": "826:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1134,12 +1101,12 @@ }, { "constant": false, - "id": 117, + "id": 107, "indexed": false, "name": "creator", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "874:15:1", + "scope": 116, + "src": "846:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1147,10 +1114,10 @@ "typeString": "address" }, "typeName": { - "id": 116, + "id": 106, "name": "address", "nodeType": "ElementaryTypeName", - "src": "874:7:1", + "src": "846:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1162,12 +1129,12 @@ }, { "constant": false, - "id": 119, + "id": 109, "indexed": false, "name": "creation_time", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "899:18:1", + "scope": 116, + "src": "871:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1175,10 +1142,10 @@ "typeString": "uint256" }, "typeName": { - "id": 118, + "id": 108, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "899:4:1", + "src": "871:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1189,12 +1156,12 @@ }, { "constant": false, - "id": 121, + "id": 111, "indexed": false, "name": "token_address", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "927:21:1", + "scope": 116, + "src": "899:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1202,10 +1169,10 @@ "typeString": "address" }, "typeName": { - "id": 120, + "id": 110, "name": "address", "nodeType": "ElementaryTypeName", - "src": "927:7:1", + "src": "899:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1214,30 +1181,67 @@ }, "value": null, "visibility": "internal" + }, + { + "constant": false, + "id": 114, + "indexed": false, + "name": "erc721_token_ids", + "nodeType": "VariableDeclaration", + "scope": 116, + "src": "930:26:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 112, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "930:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 113, + "length": null, + "nodeType": "ArrayTypeName", + "src": "930:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" } ], - "src": "824:130:1" + "src": "796:166:1" }, - "src": "803:152:1" + "src": "775:188:1" }, { "anonymous": false, "documentation": null, - "id": 133, + "id": 129, "name": "ClaimSuccess", "nodeType": "EventDefinition", "parameters": { - "id": 132, + "id": 128, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 125, + "id": 118, "indexed": false, "name": "id", "nodeType": "VariableDeclaration", - "scope": 133, - "src": "989:10:1", + "scope": 129, + "src": "997:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1245,10 +1249,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 124, + "id": 117, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "989:7:1", + "src": "997:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1259,12 +1263,12 @@ }, { "constant": false, - "id": 127, + "id": 120, "indexed": false, "name": "claimer", "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1009:15:1", + "scope": 129, + "src": "1017:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1272,10 +1276,10 @@ "typeString": "address" }, "typeName": { - "id": 126, + "id": 119, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1009:7:1", + "src": "1017:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1287,12 +1291,12 @@ }, { "constant": false, - "id": 129, + "id": 122, "indexed": false, "name": "claimed_value", "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1034:18:1", + "scope": 129, + "src": "1042:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1300,10 +1304,10 @@ "typeString": "uint256" }, "typeName": { - "id": 128, + "id": 121, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1034:4:1", + "src": "1042:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1314,12 +1318,12 @@ }, { "constant": false, - "id": 131, + "id": 124, "indexed": false, "name": "token_address", "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1062:21:1", + "scope": 129, + "src": "1070:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1327,10 +1331,10 @@ "typeString": "address" }, "typeName": { - "id": 130, + "id": 123, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1062:7:1", + "src": "1070:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1339,126 +1343,67 @@ }, "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, + "id": 127, "indexed": false, - "name": "hash2", + "name": "token_id", "nodeType": "VariableDeclaration", - "scope": 141, - "src": "1162:13:1", + "scope": 129, + "src": "1101:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" }, "typeName": { - "id": 138, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1162:7:1", + "baseType": { + "id": 125, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1101:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 126, + "length": null, + "nodeType": "ArrayTypeName", + "src": "1101:9:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, "value": null, "visibility": "internal" } ], - "src": "1109:72:1" + "src": "987:138:1" }, - "src": "1096:86:1" + "src": "969:157:1" }, { "anonymous": false, "documentation": null, - "id": 149, + "id": 137, "name": "RefundSuccess", "nodeType": "EventDefinition", "parameters": { - "id": 148, + "id": 136, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 143, + "id": 131, "indexed": false, "name": "id", "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1216:10:1", + "scope": 137, + "src": "1161:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1466,10 +1411,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 142, + "id": 130, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1216:7:1", + "src": "1161:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1480,12 +1425,12 @@ }, { "constant": false, - "id": 145, + "id": 133, "indexed": false, "name": "token_address", "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1236:21:1", + "scope": 137, + "src": "1181:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1493,10 +1438,10 @@ "typeString": "address" }, "typeName": { - "id": 144, + "id": 132, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1236:7:1", + "src": "1181:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1508,12 +1453,12 @@ }, { "constant": false, - "id": 147, + "id": 135, "indexed": false, "name": "remaining_balance", "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1267:22:1", + "scope": 137, + "src": "1212:22:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1521,10 +1466,10 @@ "typeString": "uint256" }, "typeName": { - "id": 146, + "id": 134, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1267:4:1", + "src": "1212:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1534,17 +1479,17 @@ "visibility": "internal" } ], - "src": "1206:89:1" + "src": "1151:89:1" }, - "src": "1187:109:1" + "src": "1132:109:1" }, { "constant": false, - "id": 151, + "id": 139, "name": "nonce", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1302:10:1", + "scope": 1367, + "src": "1247:10:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1552,10 +1497,10 @@ "typeString": "uint256" }, "typeName": { - "id": 150, + "id": 138, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1302:4:1", + "src": "1247:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1566,11 +1511,11 @@ }, { "constant": false, - "id": 153, + "id": 141, "name": "contract_creator", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1318:24:1", + "scope": 1367, + "src": "1263:31:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1578,10 +1523,10 @@ "typeString": "address" }, "typeName": { - "id": 152, + "id": 140, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1318:7:1", + "src": "1263:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -1589,48 +1534,48 @@ } }, "value": null, - "visibility": "internal" + "visibility": "public" }, { "constant": false, - "id": 157, + "id": 145, "name": "redpacket_by_id", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1348:45:1", + "scope": 1367, + "src": "1300:45:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" }, "typeName": { - "id": 156, + "id": 144, "keyType": { - "id": 154, + "id": 142, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1356:7:1", + "src": "1308:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", - "src": "1348:29:1", + "src": "1300:29:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" }, "valueType": { "contractScope": null, - "id": 155, + "id": 143, "name": "RedPacket", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "1367:9:1", + "referencedDeclaration": 94, + "src": "1319:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" } } @@ -1640,11 +1585,11 @@ }, { "constant": false, - "id": 160, + "id": 148, "name": "redpackets", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1399:21:1", + "scope": 1367, + "src": "1351:21:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1653,19 +1598,19 @@ }, "typeName": { "baseType": { - "id": 158, + "id": 146, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1399:7:1", + "src": "1351:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 159, + "id": 147, "length": null, "nodeType": "ArrayTypeName", - "src": "1399:10:1", + "src": "1351:10:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" @@ -1676,11 +1621,11 @@ }, { "constant": true, - "id": 163, + "id": 151, "name": "magic", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1426:105:1", + "scope": 1367, + "src": "1378:66:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1688,10 +1633,10 @@ "typeString": "string" }, "typeName": { - "id": 161, + "id": 149, "name": "string", "nodeType": "ElementaryTypeName", - "src": "1426:6:1", + "src": "1378:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" @@ -1699,31 +1644,31 @@ }, "value": { "argumentTypes": null, - "hexValue": "466f726d6572204e6174696f6e616c204261736b657462616c6c204173736f63696174696f6e20284e42412920436f6d6d697373696f6e657220446176696420537465726e2068617320646965642e", - "id": 162, + "hexValue": "466f726d6572204e424120436f6d6d697373696f6e6572204461766964205374", + "id": 150, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1450:81:1", + "src": "1410:34:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7d4f8d20362f4719f19c74721d909a5e78cf4a6c5c17229194ea4fc2e05eed05", - "typeString": "literal_string \"Former National Basketball Association (NBA) Commissioner David Stern has died.\"" + "typeIdentifier": "t_stringliteral_a58c4a8be3ed5c2bba4fce19b4e4fe34055a4a88c4449cf7cfcfe3110acfadba", + "typeString": "literal_string \"Former NBA Commissioner David St\"" }, - "value": "Former National Basketball Association (NBA) Commissioner David Stern has died." + "value": "Former NBA Commissioner David St" }, - "visibility": "internal" + "visibility": "private" }, { "constant": false, - "id": 165, + "id": 153, "name": "uuid", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1537:20:1", + "scope": 1367, + "src": "1462:20:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1731,10 +1676,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 164, + "id": 152, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1537:7:1", + "src": "1462:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1745,26 +1690,26 @@ }, { "body": { - "id": 184, + "id": 172, "nodeType": "Block", - "src": "1656:120:1", + "src": "1510:120:1", "statements": [ { "expression": { "argumentTypes": null, - "id": 171, + "id": 159, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 168, + "id": 156, "name": "contract_creator", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1666:16:1", + "referencedDeclaration": 141, + "src": "1520:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1776,18 +1721,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 169, + "id": 157, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "1685:3:1", + "referencedDeclaration": 3658, + "src": "1539:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 170, + "id": 158, "isConstant": false, "isLValue": false, "isPure": false, @@ -1795,38 +1740,38 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "1685:10:1", + "src": "1539:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, - "src": "1666:29:1", + "src": "1520:29:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "id": 172, + "id": 160, "nodeType": "ExpressionStatement", - "src": "1666:29:1" + "src": "1520:29:1" }, { "expression": { "argumentTypes": null, - "id": 182, + "id": 170, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 173, + "id": 161, "name": "uuid", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 165, - "src": "1705:4:1", + "referencedDeclaration": 153, + "src": "1559:4:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1842,12 +1787,12 @@ "arguments": [ { "argumentTypes": null, - "id": 177, + "id": 165, "name": "magic", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "1739:5:1", + "referencedDeclaration": 151, + "src": "1593:5:1", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string memory" @@ -1855,12 +1800,12 @@ }, { "argumentTypes": null, - "id": 178, + "id": 166, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "1746:3:1", + "referencedDeclaration": 3660, + "src": "1600:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1868,12 +1813,12 @@ }, { "argumentTypes": null, - "id": 179, + "id": 167, "name": "contract_creator", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1751:16:1", + "referencedDeclaration": 141, + "src": "1605:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -1897,18 +1842,18 @@ ], "expression": { "argumentTypes": null, - "id": 175, + "id": 163, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "1722:3:1", + "referencedDeclaration": 3645, + "src": "1576:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 176, + "id": 164, "isConstant": false, "isLValue": false, "isPure": true, @@ -1916,13 +1861,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "1722:16:1", + "src": "1576:16:1", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 180, + "id": 168, "isConstant": false, "isLValue": false, "isPure": false, @@ -1930,7 +1875,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1722:46:1", + "src": "1576:46:1", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -1944,18 +1889,18 @@ "typeString": "bytes memory" } ], - "id": 174, + "id": 162, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "1712:9:1", + "referencedDeclaration": 3652, + "src": "1566:9:1", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 181, + "id": 169, "isConstant": false, "isLValue": false, "isPure": false, @@ -1963,216 +1908,327 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1712:57:1", + "src": "1566:57:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "1705:64:1", + "src": "1559:64:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 183, + "id": 171, "nodeType": "ExpressionStatement", - "src": "1705:64:1" + "src": "1559:64:1" } ] }, "documentation": null, - "id": 185, + "id": 173, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { - "id": 166, + "id": 154, "nodeType": "ParameterList", "parameters": [], - "src": "1646:2:1" + "src": "1500:2:1" }, "returnParameters": { - "id": 167, + "id": 155, "nodeType": "ParameterList", "parameters": [], - "src": "1656:0:1" + "src": "1510:0:1" }, - "scope": 956, - "src": "1635:141:1", + "scope": 1367, + "src": "1489:141:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { - "id": 508, + "id": 214, "nodeType": "Block", - "src": "2156:2321:1", + "src": "2013:181: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": { + "id": 197, + "name": "_hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 175, + "src": "2041:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 198, + "name": "_number", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 177, + "src": "2048:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "id": 199, + "name": "_ifrandom", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 179, + "src": "2057:9:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "id": 200, + "name": "_duration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 181, + "src": "2068:9:1", + "typeDescriptions": { "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": 201, + "name": "_seed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 183, + "src": "2079:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 202, + "name": "_message", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 185, + "src": "2086:8:1", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "argumentTypes": null, + "id": 203, + "name": "_name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 187, + "src": "2096:5:1", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "argumentTypes": null, + "id": 204, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 189, + "src": "2129:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 205, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "2142:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 206, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "2155:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { "argumentTypes": null, - "id": 213, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "2202:10:1", + "hexValue": "31", + "id": 210, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2184:1:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" } - }, - "id": 214, + ], + "id": 209, "isConstant": false, - "isLValue": true, - "isPure": false, + "isLValue": false, + "isPure": true, "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2202:17:1", + "nodeType": "NewExpression", + "src": "2170:13:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", + "typeString": "function (uint256) pure returns (uint256[] memory)" + }, + "typeName": { + "baseType": { + "id": 207, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2174:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 208, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2174:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } } }, - "src": "2194:25:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "3030302074727920616761696e206c61746572", - "id": 216, + "id": 211, "isConstant": false, "isLValue": false, "isPure": true, - "kind": "string", + "kind": "functionCall", "lValueRequested": false, - "nodeType": "Literal", - "src": "2221:21:1", - "subdenomination": null, + "names": [], + "nodeType": "FunctionCall", + "src": "2170:16:1", "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9add011834ce6f1e96d072b9f48b75881e32c05397de40574f621d8ae7053c26", - "typeString": "literal_string \"000 try again later\"" - }, - "value": "000 try again later" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } } ], "expression": { "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, { "typeIdentifier": "t_bool", "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_9add011834ce6f1e96d072b9f48b75881e32c05397de40574f621d8ae7053c26", - "typeString": "literal_string \"000 try again later\"" + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" } ], - "id": 211, - "name": "require", + "id": 196, + "name": "create_red_packet", "nodeType": "Identifier", "overloadedDeclarations": [ - 1746, - 1747 + 215, + 508 ], - "referencedDeclaration": 1747, - "src": "2186:7:1", + "referencedDeclaration": 508, + "src": "2023:17:1", "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_uint8_$_t_bool_$_t_uint256_$_t_bytes32_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (bytes32,uint8,bool,uint256,bytes32,string memory,string memory,uint256,address,uint256,uint256[] memory)" } }, - "id": 217, + "id": 212, "isConstant": false, "isLValue": false, "isPure": false, @@ -2180,1171 +2236,682 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2186:57:1", + "src": "2023:164:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 218, + "id": 213, "nodeType": "ExpressionStatement", - "src": "2186:57:1" - }, + "src": "2023:164:1" + } + ] + }, + "documentation": null, + "id": 215, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "create_red_packet", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 194, + "nodeType": "ParameterList", + "parameters": [ { - "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", + "constant": false, + "id": 175, + "name": "_hash", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1748:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 174, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1748:7:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "id": 226, - "nodeType": "ExpressionStatement", - "src": "2254:123:1" + "value": null, + "visibility": "internal" }, { - "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", + "constant": false, + "id": 177, + "name": "_number", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1763:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 176, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "1763:5:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "id": 234, - "nodeType": "ExpressionStatement", - "src": "2387:78:1" + "value": null, + "visibility": "internal" }, { - "condition": { - "argumentTypes": null, - "commonType": { + "constant": false, + "id": 179, + "name": "_ifrandom", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1778:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 178, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1778:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 181, + "name": "_duration", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1794:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 180, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1794:4:1", + "typeDescriptions": { "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", + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 183, + "name": "_seed", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1843:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 182, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1843:7:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "falseBody": { - "condition": { + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 185, + "name": "_message", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1858:22:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 184, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1858:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 187, + "name": "_name", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1882:19:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 186, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1882:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 189, + "name": "_token_type", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1935:16:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 188, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1935:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 191, + "name": "_token_addr", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1953:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 190, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1953:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 193, + "name": "_total_tokens", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1974:18:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 192, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1974:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1747:246:1" + }, + "returnParameters": { + "id": 195, + "nodeType": "ParameterList", + "parameters": [], + "src": "2013:0:1" + }, + "scope": 1367, + "src": "1720:474:1", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 507, + "nodeType": "Block", + "src": "2646:1875:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 242, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "2656:8:1", + "subExpression": { "argumentTypes": null, - "commonType": { + "id": 241, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "2656:5:1", + "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" - }, - "id": 248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 243, + "nodeType": "ExpressionStatement", + "src": "2656:8:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { "argumentTypes": null, - "id": 246, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "2603:11:1", - "typeDescriptions": { + "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 247, + }, + "id": 248, "isConstant": false, "isLValue": false, - "isPure": true, - "kind": "number", + "isPure": false, "lValueRequested": false, - "nodeType": "Literal", - "src": "2618:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" + "leftExpression": { + "argumentTypes": null, + "id": 245, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "2682:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, - "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": [ - { + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, "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", + "id": 246, + "name": "redpackets", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 148, + "src": "2690:10:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", + "typeString": "bytes32[] storage ref" } }, - "id": 264, - "nodeType": "ExpressionStatement", - "src": "2635:143:1" + "id": 247, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2690:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2682:25:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303030", + "id": 249, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2709:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_35b5b8bece53958bb309db665734c38515f37439f69bfdbc64808f1af9a97c31", + "typeString": "literal_string \"000\"" }, + "value": "000" + } + ], + "expression": { + "argumentTypes": [ { - "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" + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_35b5b8bece53958bb309db665734c38515f37439f69bfdbc64808f1af9a97c31", + "typeString": "literal_string \"000\"" } - ] + ], + "id": 244, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "2674:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2674:41:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "id": 278, - "nodeType": "IfStatement", - "src": "2476:409:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "arguments": [ - { + "id": 251, + "nodeType": "ExpressionStatement", + "src": "2674:41:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 255, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "commonType": { + "id": 253, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "2733:13:1", + "typeDescriptions": { "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" } }, - { + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { "argumentTypes": null, - "hexValue": "30303820596f75206861766520746f2073656e6420656e6f75676820746f6b656e732e", - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2546:37:1", - "subdenomination": null, + "id": 254, + "name": "_number", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 219, + "src": "2750:7:1", "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.\"" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } - ], - "id": 238, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2510:7:1", + }, + "src": "2733:24:1", "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "id": 244, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2510:74:1", + { + "argumentTypes": null, + "hexValue": "303031", + "id": 256, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2759:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_724f6bdc92705714b251fdfe205b952f71c1b25dac823eb448ff509b43ca2005", + "typeString": "literal_string \"001\"" + }, + "value": "001" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_724f6bdc92705714b251fdfe205b952f71c1b25dac823eb448ff509b43ca2005", + "typeString": "literal_string \"001\"" + } + ], + "id": 252, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "2725:7:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } }, - "id": 245, - "nodeType": "ExpressionStatement", - "src": "2510:74:1" - } + "id": 257, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2725:40:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 258, + "nodeType": "ExpressionStatement", + "src": "2725:40: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": { + "expression": { "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" - } + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 262, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 260, + "name": "_number", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 219, + "src": "2783:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" } - ], - "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, + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 261, "isConstant": false, "isLValue": false, "isPure": true, + "kind": "number", "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2919:16:1", + "nodeType": "Literal", + "src": "2793:1:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" }, - "id": 290, + "src": "2783:11:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303032", + "id": 263, "isConstant": false, "isLValue": false, - "isPure": false, - "kind": "functionCall", + "isPure": true, + "kind": "string", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2919:53:1", + "nodeType": "Literal", + "src": "2796:5:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } + "typeIdentifier": "t_stringliteral_06c34db6f65efc7a8a660fab3d9cc5dd13bff15dd1af935465134c67942a95e6", + "typeString": "literal_string \"002\"" + }, + "value": "002" } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_06c34db6f65efc7a8a660fab3d9cc5dd13bff15dd1af935465134c67942a95e6", + "typeString": "literal_string \"002\"" } ], - "id": 281, - "name": "keccak256", + "id": 259, + "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "2909:9:1", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "2775:7:1", "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } }, - "id": 291, + "id": 264, "isConstant": false, "isLValue": false, "isPure": false, @@ -3352,307 +2919,1920 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2909:64:1", + "src": "2775:27:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "nodeType": "VariableDeclarationStatement", - "src": "2895:78:1" + "id": 265, + "nodeType": "ExpressionStatement", + "src": "2775:27: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": { + "condition": { "argumentTypes": null, - "baseExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "id": 295, - "name": "redpacket_by_id", + "id": 266, + "name": "_token_type", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "3006:15:1", + "referencedDeclaration": 231, + "src": "2817:11:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 297, - "indexExpression": { + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { "argumentTypes": null, - "id": 296, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 280, - "src": "3022:3:1", + "hexValue": "30", + "id": 267, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2832:1:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3006:20:1", + "src": "2817:16:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "nodeType": "VariableDeclarationStatement", - "src": "2983:43:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { + "falseBody": { + "condition": { "argumentTypes": null, - "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "id": 299, - "name": "rp", + "id": 278, + "name": "_token_type", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3036:2:1", + "referencedDeclaration": 231, + "src": "2928:11:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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", + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 279, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2943:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "2928:16:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "src": "3036:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 304, - "nodeType": "ExpressionStatement", - "src": "3036:11:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { + "falseBody": { + "condition": { "argumentTypes": null, - "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 322, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "id": 308, - "name": "rp", + "id": 320, + "name": "_token_type", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3073:2:1", + "referencedDeclaration": 231, + "src": "3260:11:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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", + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 321, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3275:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "3260:16:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "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" + "falseBody": null, + "id": 350, + "nodeType": "IfStatement", + "src": "3256:319:1", + "trueBody": { + "id": 349, + "nodeType": "Block", + "src": "3278:297:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 328, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "3338:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 329, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3338:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 331, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "3358:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 330, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3350:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3350: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": 325, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 233, + "src": "3308:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 324, + "name": "IERC721", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3502, + "src": "3300:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", + "typeString": "type(contract IERC721)" + } + }, + "id": 326, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3300:20:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC721_$3502", + "typeString": "contract IERC721" + } + }, + "id": 327, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "isApprovedForAll", + "nodeType": "MemberAccess", + "referencedDeclaration": 3490, + "src": "3300:37:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_bool_$", + "typeString": "function (address,address) view external returns (bool)" + } + }, + "id": 333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3300:64:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303131", + "id": 334, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3366:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", + "typeString": "literal_string \"011\"" + }, + "value": "011" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", + "typeString": "literal_string \"011\"" + } + ], + "id": 323, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "3292:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3292:80:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 336, + "nodeType": "ExpressionStatement", + "src": "3292:80:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 338, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 231, + "src": "3401:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 339, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 233, + "src": "3414:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 340, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "3427:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3427:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 343, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "3447:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 342, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3439:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3439:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 345, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "3454:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 346, + "name": "_erc721_token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 238, + "src": "3469:17:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + ], + "id": 337, + "name": "transfer_token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 616, + "src": "3386:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" + } + }, + "id": 347, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3386:101:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 348, + "nodeType": "ExpressionStatement", + "src": "3386:101:1" + } + ] + } + }, + "id": 351, + "nodeType": "IfStatement", + "src": "2924:651:1", + "trueBody": { + "id": 319, + "nodeType": "Block", + "src": "2946:296:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 286, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "2998:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2998:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 289, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "3018:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 288, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3010:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 290, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3010: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": 283, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 233, + "src": "2975:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 282, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2290, + "src": "2968:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 284, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2968:19:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" + } + }, + "id": 285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "allowance", + "nodeType": "MemberAccess", + "referencedDeclaration": 2253, + "src": "2968:29:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", + "typeString": "function (address,address) view external returns (uint256)" + } + }, + "id": 291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2968:56:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 292, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "3028:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2968:73:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303039", + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3043:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_f1f53a772d6477eea2442888ded82401b11c74ea298b046a645e45bcb19dec14", + "typeString": "literal_string \"009\"" + }, + "value": "009" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_f1f53a772d6477eea2442888ded82401b11c74ea298b046a645e45bcb19dec14", + "typeString": "literal_string \"009\"" + } + ], + "id": 281, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "2960:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 295, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2960:89:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 296, + "nodeType": "ExpressionStatement", + "src": "2960:89:1" + }, + { + "assignments": [ + 300 + ], + "declarations": [ + { + "constant": false, + "id": 300, + "name": "token_ids_holder", + "nodeType": "VariableDeclaration", + "scope": 319, + "src": "3063:34:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 298, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3063:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 299, + "length": null, + "nodeType": "ArrayTypeName", + "src": "3063:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 306, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 304, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3114:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 303, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "3100:13: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": 301, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3104:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 302, + "length": null, + "nodeType": "ArrayTypeName", + "src": "3104:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3100:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3063:53:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 308, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 231, + "src": "3146:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 309, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 233, + "src": "3159:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 310, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "3172:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 311, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3172:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 313, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "3192:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 312, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3184:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 314, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3184:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 315, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "3199:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 316, + "name": "token_ids_holder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 300, + "src": "3214:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + ], + "id": 307, + "name": "transfer_token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 616, + "src": "3131:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" + } + }, + "id": 317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3131:100:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 318, + "nodeType": "ExpressionStatement", + "src": "3131:100:1" + } + ] + } + }, + "id": 352, + "nodeType": "IfStatement", + "src": "2813:762:1", + "trueBody": { + "id": 277, + "nodeType": "Block", + "src": "2835:67:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 270, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "2857:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2857:9:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 272, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "2870:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2857:26:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303038", + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2885:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_02548246e64702b5865ec88120494d1082d4d663fdcca59525f26e7037975219", + "typeString": "literal_string \"008\"" + }, + "value": "008" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_02548246e64702b5865ec88120494d1082d4d663fdcca59525f26e7037975219", + "typeString": "literal_string \"008\"" + } + ], + "id": 269, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "2849:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 275, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2849:42:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 276, + "nodeType": "ExpressionStatement", + "src": "2849:42:1" + } + ] + } + }, + { + "assignments": [ + 354 + ], + "declarations": [ + { + "constant": false, + "id": 354, + "name": "_id", + "nodeType": "VariableDeclaration", + "scope": 507, + "src": "3585:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 353, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3585:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 366, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 358, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "3626:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 359, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3626:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 360, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "3638:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 361, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "3643:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 362, + "name": "uuid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "3650:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 363, + "name": "_seed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "3656: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": 356, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3645, + "src": "3609:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 357, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3609:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 364, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3609:53:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 355, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3652, + "src": "3599:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 365, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3599:64:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3585:78:1" + }, + { + "assignments": [ + 368 + ], + "declarations": [ + { + "constant": false, + "id": 368, + "name": "rp", + "nodeType": "VariableDeclaration", + "scope": 507, + "src": "3673:20:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + }, + "typeName": { + "contractScope": null, + "id": 367, + "name": "RedPacket", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 94, + "src": "3673:9:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 372, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 369, + "name": "redpacket_by_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 145, + "src": "3696:15:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", + "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" + } + }, + "id": 371, + "indexExpression": { + "argumentTypes": null, + "id": 370, + "name": "_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 354, + "src": "3712:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3696:20:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage", + "typeString": "struct HappyRedPacket.RedPacket storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3673:43:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 377, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 373, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3726:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 375, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "3726:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 376, + "name": "_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 354, + "src": "3734:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3726:11:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 378, + "nodeType": "ExpressionStatement", + "src": "3726:11:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 382, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3763:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 383, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "3763:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 379, + "name": "redpackets", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 148, + "src": "3747:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", + "typeString": "bytes32[] storage ref" + } + }, + "id": 381, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3747:15:1", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", + "typeString": "function (bytes32) returns (uint256)" + } + }, + "id": 384, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3747:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 385, + "nodeType": "ExpressionStatement", + "src": "3747:22:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 386, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3780:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 388, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "3780:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 389, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 231, + "src": "3796:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3780:27:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 391, + "nodeType": "ExpressionStatement", + "src": "3780:27:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 396, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 392, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3817:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 394, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "3817:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 315, - "name": "_token_type", + "id": 395, + "name": "_token_addr", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "3106:11:1", + "referencedDeclaration": 233, + "src": "3836:11:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } }, - "src": "3090:27:1", + "src": "3817:30:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } }, - "id": 317, + "id": 397, "nodeType": "ExpressionStatement", - "src": "3090:27:1" + "src": "3817:30:1" }, { "expression": { "argumentTypes": null, - "id": 322, + "id": 402, "isConstant": false, "isLValue": false, "isPure": false, @@ -3661,26 +4841,166 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 318, + "id": 398, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3127:2:1", + "referencedDeclaration": 368, + "src": "3858:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 320, + "id": 400, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "token_address", + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "3858:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 401, + "name": "_number", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 219, + "src": "3876:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "3858:25:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "id": 403, + "nodeType": "ExpressionStatement", + "src": "3858:25:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 408, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 404, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3893:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 406, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "3893:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 407, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "3915:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3893:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 409, + "nodeType": "ExpressionStatement", + "src": "3893:35:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 417, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 410, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3939:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 413, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "creator", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "3939:10:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Creator_$101_storage", + "typeString": "struct HappyRedPacket.Creator storage ref" + } + }, + "id": 414, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "addr", "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "3127:16:1", + "referencedDeclaration": 98, + "src": "3939:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -3690,109 +5010,310 @@ "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 321, - "name": "_token_addr", + "expression": { + "argumentTypes": null, + "id": 415, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "3957:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3957:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "src": "3939:28:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 418, + "nodeType": "ExpressionStatement", + "src": "3939:28:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 425, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 419, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3977:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 422, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "creator", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "3977:10:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Creator_$101_storage", + "typeString": "struct HappyRedPacket.Creator storage ref" + } + }, + "id": 423, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "name", + "nodeType": "MemberAccess", + "referencedDeclaration": 96, + "src": "3977:15:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 424, + "name": "_name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 229, + "src": "3995:5:1", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "src": "3977:23:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "id": 426, + "nodeType": "ExpressionStatement", + "src": "3977:23:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 427, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4010:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 430, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "creator", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "4010:10:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Creator_$101_storage", + "typeString": "struct HappyRedPacket.Creator storage ref" + } + }, + "id": 431, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "message", + "nodeType": "MemberAccess", + "referencedDeclaration": 100, + "src": "4010:18:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 432, + "name": "_message", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "3146:11:1", + "referencedDeclaration": 227, + "src": "4031:8:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" } }, - "src": "3127:30:1", + "src": "4010:29:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" } }, - "id": 323, + "id": 434, "nodeType": "ExpressionStatement", - "src": "3127:30:1" + "src": "4010:29:1" }, { - "expression": { + "condition": { "argumentTypes": null, - "id": 329, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 437, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftHandSide": { + "leftExpression": { "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", + "id": 435, + "name": "_duration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 223, + "src": "4054:9:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { "argumentTypes": null, - "expression": { + "hexValue": "30", + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4067:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4054:14:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 442, + "nodeType": "IfStatement", + "src": "4050:49:1", + "trueBody": { + "expression": { + "argumentTypes": null, + "id": 440, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { "argumentTypes": null, - "id": 327, - "name": "_hashes", + "id": 438, + "name": "_duration", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "3186:7:1", + "referencedDeclaration": 223, + "src": "4082:9:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 328, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3186:14:1", + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "3836343030", + "id": 439, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4094:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_86400_by_1", + "typeString": "int_const 86400" + }, + "value": "86400" + }, + "src": "4082:17: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" + "id": 441, + "nodeType": "ExpressionStatement", + "src": "4082:17:1" + } }, { "expression": { "argumentTypes": null, - "id": 335, + "id": 451, "isConstant": false, "isLValue": false, "isPure": false, @@ -3801,26 +5322,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 331, + "id": 443, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3210:2:1", + "referencedDeclaration": 368, + "src": "4120:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 333, + "id": 445, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "remaining_tokens", + "memberName": "expiration_time", "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3210:19:1", + "referencedDeclaration": 79, + "src": "4120:18:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3830,31 +5351,100 @@ "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 334, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "3232:13:1", + "arguments": [ + { + "argumentTypes": null, + "id": 448, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "4154:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 449, + "name": "_duration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 223, + "src": "4159:9:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 446, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "4141:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "add", + "nodeType": "MemberAccess", + "referencedDeclaration": 1598, + "src": "4141:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 450, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4141:28:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3210:35:1", + "src": "4120:49:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 336, + "id": 452, "nodeType": "ExpressionStatement", - "src": "3210:35:1" + "src": "4120:49:1" }, { "expression": { "argumentTypes": null, - "id": 344, + "id": 457, "isConstant": false, "isLValue": false, "isPure": false, @@ -3863,92 +5453,65 @@ "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", + "id": 453, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4180:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 341, + "id": 455, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "addr", + "memberName": "claimed_number", "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "3256:15:1", + "referencedDeclaration": 77, + "src": "4180:17:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, "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, + "hexValue": "30", + "id": 456, "isConstant": false, "isLValue": false, - "isPure": false, + "isPure": true, + "kind": "number", "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3274:10:1", + "nodeType": "Literal", + "src": "4200:1:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" }, - "src": "3256:28:1", + "src": "4180:21:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "id": 345, + "id": 458, "nodeType": "ExpressionStatement", - "src": "3256:28:1" + "src": "4180:21:1" }, { "expression": { "argumentTypes": null, - "id": 352, + "id": 463, "isConstant": false, "isLValue": false, "isPure": false, @@ -3957,76 +5520,60 @@ "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", + "id": 459, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4211:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 350, + "id": 461, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "name", + "memberName": "ifrandom", "nodeType": "MemberAccess", - "referencedDeclaration": 97, - "src": "3294:15:1", + "referencedDeclaration": 67, + "src": "4211:11:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 351, - "name": "_name", + "id": 462, + "name": "_ifrandom", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 198, - "src": "3312:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" + "referencedDeclaration": 221, + "src": "4225:9:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "src": "3294:23:1", + "src": "4211:23:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "id": 353, + "id": 464, "nodeType": "ExpressionStatement", - "src": "3294:23:1" + "src": "4211:23:1" }, { "expression": { "argumentTypes": null, - "id": 360, + "id": 469, "isConstant": false, "isLValue": false, "isPure": false, @@ -4035,183 +5582,60 @@ "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", + "id": 465, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4244:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 358, + "id": 467, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "message", + "memberName": "hash", "nodeType": "MemberAccess", - "referencedDeclaration": 101, - "src": "3327:18:1", + "referencedDeclaration": 65, + "src": "4244:7:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 359, - "name": "_message", + "id": 468, + "name": "_hash", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 196, - "src": "3348:8:1", + "referencedDeclaration": 217, + "src": "4254:5:1", "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "src": "3327:29:1", + "src": "4244:15:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "id": 361, + "id": 470, "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" - } + "src": "4244:15:1" }, { "expression": { "argumentTypes": null, - "id": 376, + "id": 484, "isConstant": false, "isLValue": false, "isPure": false, @@ -4220,26 +5644,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 370, + "id": 471, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3437:2:1", + "referencedDeclaration": 368, + "src": "4269:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 372, + "id": 473, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "expiration_time", + "memberName": "MAX_AMOUNT", "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "3437:18:1", + "referencedDeclaration": 71, + "src": "4269:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4249,63 +5673,190 @@ "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" + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 478, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "4311:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 479, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4326:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 480, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "4326:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "argumentTypes": null, + "id": 476, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "4298:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 1691, + "src": "4298:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4298:44:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "32", + "id": 482, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4344:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 374, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 192, - "src": "3464:9:1", + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + } + ], + "expression": { + "argumentTypes": null, + "id": 474, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "4285:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 1675, + "src": "4285:12:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" } }, - "src": "3458:15:1", + "id": 483, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4285:61:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3437:36:1", + "src": "4269:77:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 377, + "id": 485, "nodeType": "ExpressionStatement", - "src": "3437:36:1" + "src": "4269:77:1" }, { "expression": { "argumentTypes": null, - "id": 382, + "id": 490, "isConstant": false, "isLValue": false, "isPure": false, @@ -4314,1002 +5865,1699 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 378, + "id": 486, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3484:2:1", + "referencedDeclaration": 368, + "src": "4356:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 380, + "id": 488, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "claimed_number", + "memberName": "erc721_token_ids", "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "3484:17:1", + "referencedDeclaration": 89, + "src": "4356:19:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } }, "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, + "id": 489, + "name": "_erc721_token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 238, + "src": "4378:17:1", "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "src": "4356:39:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 491, + "nodeType": "ExpressionStatement", + "src": "4356:39:1" + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 493, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4426:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 494, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "4426:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, - "value": "0" + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 495, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4447:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 496, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "4447:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 497, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4454:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 498, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "creator", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "4454:10:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Creator_$101_storage", + "typeString": "struct HappyRedPacket.Creator storage ref" + } + }, + "id": 499, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "addr", + "nodeType": "MemberAccess", + "referencedDeclaration": 98, + "src": "4454:15:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 500, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "4471:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 501, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4476:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 502, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "4476:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 503, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4494:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 504, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "4494:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + ], + "id": 492, + "name": "CreationSuccess", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 116, + "src": "4410:15:1", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,bytes32,address,uint256,address,uint256[] memory)" + } }, - "src": "3484:21:1", + "id": 505, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4410:104:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 506, + "nodeType": "EmitStatement", + "src": "4405:109:1" + } + ] + }, + "documentation": null, + "id": 508, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "create_red_packet", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 239, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 217, + "name": "_hash", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2312:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 216, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2312:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 219, + "name": "_number", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2327:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 218, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "2327:5:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "id": 383, - "nodeType": "ExpressionStatement", - "src": "3484:21:1" + "value": null, + "visibility": "internal" }, { - "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", + "constant": false, + "id": 221, + "name": "_ifrandom", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2342:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 220, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2342:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 389, - "nodeType": "ExpressionStatement", - "src": "3515:23:1" + "value": null, + "visibility": "internal" }, { - "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", + "constant": false, + "id": 223, + "name": "_duration", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2358:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 222, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2358:4:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 395, - "nodeType": "ExpressionStatement", - "src": "3548:19:1" + "value": null, + "visibility": "internal" }, { - "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" + "constant": false, + "id": 225, + "name": "_seed", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2407:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 224, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2407:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } - ], - "id": 398, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "3578:16:1" + }, + "value": null, + "visibility": "internal" }, { - "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" + "constant": false, + "id": 227, + "name": "_message", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2422:22:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 226, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2422:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" } - ], - "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", + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 229, + "name": "_name", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2446:19:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 228, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2446:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 231, + "name": "_token_type", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2499:16:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 230, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2499:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "nodeType": "VariableDeclarationStatement", - "src": "3604:39:1" + "value": null, + "visibility": "internal" }, { - "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" + "constant": false, + "id": 233, + "name": "_token_addr", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2517:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 232, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2517:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" } - ], - "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, + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 235, + "name": "_total_tokens", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2538:18:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 234, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2538:4:1", "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, - "nodeType": "VariableDeclarationStatement", - "src": "3653:19:1" + "value": null, + "visibility": "internal" }, { - "assignments": [ - 409 - ], - "declarations": [ - { - "constant": false, - "id": 409, - "name": "MAX_AMOUNT", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "3682:15:1", - "stateVariable": false, - "storageLocation": "default", + "constant": false, + "id": 238, + "name": "_erc721_token_ids", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2590:34:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 236, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2590:7:1", "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": 237, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2590:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } - ], - "id": 416, - "initialValue": { + }, + "value": null, + "visibility": "internal" + } + ], + "src": "2311:314:1" + }, + "returnParameters": { + "id": 240, + "nodeType": "ParameterList", + "parameters": [], + "src": "2646:0:1" + }, + "scope": 1367, + "src": "2284:2237:1", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 615, + "nodeType": "Block", + "src": "4777:782:1", + "statements": [ + { + "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 415, + "id": 526, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { + "argumentTypes": null, + "id": 524, + "name": "token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 510, + "src": "4808:10:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 525, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4822:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "4808:15:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 413, + "id": 559, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 410, - "name": "total_tokens", + "id": 557, + "name": "token_type", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "3700:12:1", + "referencedDeclaration": 510, + "src": "5100:10:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", - "operator": "/", + "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, + "hexValue": "32", + "id": 558, "isConstant": false, - "isLValue": true, - "isPure": false, + "isLValue": false, + "isPure": true, + "kind": "number", "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3715:15:1", + "nodeType": "Literal", + "src": "5114:1:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" }, - "src": "3700:30:1", + "src": "5100:15:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } - }, - "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": { + }, + "falseBody": null, + "id": 613, + "nodeType": "IfStatement", + "src": "5096:456:1", + "trueBody": { + "id": 612, + "nodeType": "Block", + "src": "5117:435:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { "argumentTypes": null, - "id": 465, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 568, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftHandSide": { + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 565, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "5172:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 562, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "5147:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 561, + "name": "IERC721", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3502, + "src": "5139:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", + "typeString": "type(contract IERC721)" + } + }, + "id": 563, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5139:22:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC721_$3502", + "typeString": "contract IERC721" + } + }, + "id": 564, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 3435, + "src": "5139:32:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 566, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5139:48:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { "argumentTypes": null, - "id": 461, - "name": "rand_tokens", + "id": 567, + "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4156:11:1", + "referencedDeclaration": 518, + "src": "5191:6:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { + "src": "5139:58:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303132", + "id": 569, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5199:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", + "typeString": "literal_string \"012\"" + }, + "value": "012" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", + "typeString": "literal_string \"012\"" + } + ], + "id": 560, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "5131:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 570, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5131:74:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 571, + "nodeType": "ExpressionStatement", + "src": "5131:74:1" + }, + { + "body": { + "id": 610, + "nodeType": "Block", + "src": "5251:291:1", + "statements": [ + { + "condition": { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" }, - "id": 464, + "id": 586, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 462, - "name": "MAX_AMOUNT", + "id": 582, + "name": "recipient_address", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 409, - "src": "4171:10:1", + "referencedDeclaration": 516, + "src": "5273:17:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } }, "nodeType": "BinaryOperation", - "operator": "/", + "operator": "==", "rightExpression": { "argumentTypes": null, - "hexValue": "32", - "id": 463, + "arguments": [ + { + "argumentTypes": null, + "id": 584, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "5302:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 583, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5294:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 585, "isConstant": false, "isLValue": false, - "isPure": true, - "kind": "number", + "isPure": false, + "kind": "typeConversion", "lValueRequested": false, - "nodeType": "Literal", - "src": "4184:1:1", - "subdenomination": null, + "names": [], + "nodeType": "FunctionCall", + "src": "5294:13:1", "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" + "typeIdentifier": "t_address", + "typeString": "address" + } }, - "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", + "src": "5273:34:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "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": [ - { + "falseBody": null, + "id": 598, + "nodeType": "IfStatement", + "src": "5269:150:1", + "trueBody": { + "id": 597, + "nodeType": "Block", + "src": "5308:111:1", + "statements": [ + { + "expression": { "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 432, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3855:2:1", + "arguments": [ + { + "argumentTypes": null, + "id": 591, + "name": "recipient_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "5361:17:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 592, + "name": "erc721_token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 521, + "src": "5380:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 594, + "indexExpression": { + "argumentTypes": null, + "id": 593, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 573, + "src": "5397:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5380:19: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": 588, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "5338:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 587, + "name": "IERC721", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3502, + "src": "5330:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", + "typeString": "type(contract IERC721)" + } + }, + "id": 589, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5330:22:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC721_$3502", + "typeString": "contract IERC721" + } + }, + "id": 590, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "approve", + "nodeType": "MemberAccess", + "referencedDeclaration": 3467, + "src": "5330:30:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256) external" } }, - "id": 433, + "id": 595, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3855:5:1", + "names": [], + "nodeType": "FunctionCall", + "src": "5330:70:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - { + "id": 596, + "nodeType": "ExpressionStatement", + "src": "5330:70:1" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 603, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "5472:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 604, + "name": "recipient_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "5488:17:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "baseExpression": { "argumentTypes": null, - "commonType": { + "id": 605, + "name": "erc721_token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 521, + "src": "5507:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 607, + "indexExpression": { + "argumentTypes": null, + "id": 606, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 573, + "src": "5524:1:1", + "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5507:19: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": 434, - "name": "nonce", + "id": 600, + "name": "token_address", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "3862:5:1", + "referencedDeclaration": 512, + "src": "5444:13:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } - }, - "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" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" } - }, - "src": "3862:7:1", + ], + "id": 599, + "name": "IERC721", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3502, + "src": "5436:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", + "typeString": "type(contract IERC721)" + } + }, + "id": 601, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5436:22:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC721_$3502", + "typeString": "contract IERC721" + } + }, + "id": 602, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 3460, + "src": "5436:35:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256) external" + } + }, + "id": 608, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5436:91:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 609, + "nodeType": "ExpressionStatement", + "src": "5436:91:1" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 578, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 576, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 573, + "src": "5234:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 577, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "5238:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5234:10:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 611, + "initializationExpression": { + "assignments": [ + 573 + ], + "declarations": [ + { + "constant": false, + "id": 573, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5224:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 572, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5224:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 575, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 574, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5231:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "5224:8:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 580, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "5246:3:1", + "subExpression": { + "argumentTypes": null, + "id": 579, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 573, + "src": "5246:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 581, + "nodeType": "ExpressionStatement", + "src": "5246:3:1" + }, + "nodeType": "ForStatement", + "src": "5219:323:1" + } + ] + } + }, + "id": 614, + "nodeType": "IfStatement", + "src": "4804:748:1", + "trueBody": { + "id": 556, + "nodeType": "Block", + "src": "4825:256:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 535, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 532, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "4879:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 529, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "4854:13:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } ], - "id": 431, - "name": "random", + "id": 528, + "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 580, - "src": "3848:6:1", + "referencedDeclaration": 2290, + "src": "4847:6:1", "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" } }, - "id": 437, + "id": 530, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "functionCall", + "kind": "typeConversion", "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", + "src": "4847:21:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" } }, - "src": "3848:37:1", + "id": 531, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 2235, + "src": "4847:31:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" } }, - "src": "3834:51:1", + "id": 533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4847:47:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 441, - "nodeType": "ExpressionStatement", - "src": "3834:51:1" - }, - { - "condition": { + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { "argumentTypes": null, - "commonType": { + "id": 534, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "4898:6:1", + "typeDescriptions": { "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" - } - ] - } + "src": "4847:57:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303130", + "id": 536, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4906:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_a775955c4ebf9a14a86ce326379f653bbb58908658ea96ba1b295aaa41291bcf", + "typeString": "literal_string \"010\"" }, - "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" - } - ] + "value": "010" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_a775955c4ebf9a14a86ce326379f653bbb58908658ea96ba1b295aaa41291bcf", + "typeString": "literal_string \"010\"" } + ], + "id": 527, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "4839:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } - ] - } + }, + "id": 537, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4839:73:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 538, + "nodeType": "ExpressionStatement", + "src": "4839:73:1" }, { "expression": { @@ -5317,12 +7565,25 @@ "arguments": [ { "argumentTypes": null, - "id": 474, - "name": "rand_tokens", + "id": 543, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "4956:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 544, + "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4228:11:1", + "referencedDeclaration": 518, + "src": "4972:6:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5331,6 +7592,10 @@ ], "expression": { "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + }, { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5338,48 +7603,68 @@ ], "expression": { "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 540, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "4933:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], "expression": { - "argumentTypes": null, - "id": 469, - "name": "rp", + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 539, + "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4213:2:1", + "referencedDeclaration": 2290, + "src": "4926:6:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" } }, - "id": 472, + "id": 541, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, + "kind": "typeConversion", "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4213:9:1", + "names": [], + "nodeType": "FunctionCall", + "src": "4926:21:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" } }, - "id": 473, + "id": 542, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "memberName": "push", + "memberName": "approve", "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4213:14:1", + "referencedDeclaration": 2262, + "src": "4926:29:1", "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) returns (uint256)" + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" } }, - "id": 475, + "id": 545, "isConstant": false, "isLValue": false, "isPure": false, @@ -5387,647 +7672,608 @@ "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", + "src": "4926:53: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" + "typeIdentifier": "t_bool", + "typeString": "bool" + } }, - "id": 489, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { + "id": 546, + "nodeType": "ExpressionStatement", + "src": "4926:53:1" + }, + { + "expression": { "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { + "arguments": [ + { "argumentTypes": null, - "id": 485, - "name": "rp", + "id": 551, + "name": "sender_address", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4337:2:1", + "referencedDeclaration": 514, + "src": "5028:14:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 552, + "name": "recipient_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "5044:17:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 553, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "5063: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": 548, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "5000:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 547, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2290, + "src": "4993:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 549, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4993:21:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" } }, - "id": 486, + "id": 550, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, "lValueRequested": false, - "memberName": "tokens", + "memberName": "transferFrom", "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4337:9:1", + "referencedDeclaration": 2273, + "src": "4993:34:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,address,uint256) external returns (bool)" } }, - "id": 487, + "id": 554, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4337:16:1", + "names": [], + "nodeType": "FunctionCall", + "src": "4993:77:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "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" + "id": 555, + "nodeType": "ExpressionStatement", + "src": "4993:77:1" } - }, - "nodeType": "Assignment", - "operator": "+=", - "rightHandSide": { - "argumentTypes": null, - "id": 492, - "name": "total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 400, - "src": "4360:12:1", + ] + } + } + ] + }, + "documentation": null, + "id": 616, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "transfer_token", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 522, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 510, + "name": "token_type", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4595:15:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 509, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4595:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 512, + "name": "token_address", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4612:21:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 511, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4612:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 514, + "name": "sender_address", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4635:22:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 513, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4635:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 516, + "name": "recipient_address", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4687:25:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 515, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4687:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 518, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4714:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 517, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4714:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 521, + "name": "erc721_token_ids", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4727:34:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 519, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4727:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "4327:45:1", + "id": 520, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4727:10:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, - "id": 494, - "nodeType": "ExpressionStatement", - "src": "4327:45:1" - }, + "value": null, + "visibility": "internal" + } + ], + "src": "4594:168:1" + }, + "returnParameters": { + "id": 523, + "nodeType": "ParameterList", + "parameters": [], + "src": "4777:0:1" + }, + "scope": 1367, + "src": "4571:988:1", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 638, + "nodeType": "Block", + "src": "5674:92:1", + "statements": [ { - "eventCall": { + "expression": { "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": { + "arguments": [ + { "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, + "arguments": [ + { + "argumentTypes": null, + "id": 629, + "name": "nonce_rand", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 620, + "src": "5723:10:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 630, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "5735:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 631, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5735:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 632, + "name": "seed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 618, + "src": "5747:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 633, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "5753: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": 627, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3645, + "src": "5706:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 628, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5706:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" + } + }, + "id": 634, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5706:51:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], "expression": { - "argumentTypes": null, - "id": 504, - "name": "rp", + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 626, + "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4453:2:1", + "referencedDeclaration": 3652, + "src": "5696:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 505, + "id": 635, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "4453:16:1", + "names": [], + "nodeType": "FunctionCall", + "src": "5696:62:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } } ], "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", + "id": 625, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5691:4: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)" - } + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" }, - "id": 506, + "id": 636, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "functionCall", + "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4387:83:1", + "src": "5691:68:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 507, - "nodeType": "EmitStatement", - "src": "4382:88:1" + "functionReturnParameters": 624, + "id": 637, + "nodeType": "Return", + "src": "5684:75:1" } ] }, "documentation": null, - "id": 509, + "id": 639, "implemented": true, "kind": "function", "modifiers": [], - "name": "create_red_packet", + "name": "random", "nodeType": "FunctionDefinition", "parameters": { - "id": 205, + "id": 621, "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", + "id": 618, + "name": "seed", "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1920:14:1", + "scope": 639, + "src": "5609:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" }, "typeName": { - "id": 189, - "name": "bool", + "id": 617, + "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1920:4:1", + "src": "5609:7:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, "value": null, @@ -6035,11 +8281,11 @@ }, { "constant": false, - "id": 192, - "name": "_duration", + "id": 620, + "name": "nonce_rand", "nodeType": "VariableDeclaration", - "scope": 509, - "src": "1936:14:1", + "scope": 639, + "src": "5623:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6047,10 +8293,10 @@ "typeString": "uint256" }, "typeName": { - "id": 191, + "id": 619, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1936:4:1", + "src": "5623:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6058,92 +8304,21 @@ }, "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" - }, + } + ], + "src": "5608:31:1" + }, + "returnParameters": { + "id": 624, + "nodeType": "ParameterList", + "parameters": [ { "constant": false, - "id": 200, - "name": "_token_type", + "id": 623, + "name": "rand", "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2077:16:1", + "scope": 639, + "src": "5663:9:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6151,10 +8326,10 @@ "typeString": "uint256" }, "typeName": { - "id": 199, + "id": 622, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "2077:4:1", + "src": "5663:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6162,14 +8337,86 @@ }, "value": null, "visibility": "internal" - }, + } + ], + "src": "5662:11:1" + }, + "scope": 1367, + "src": "5593:173:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 647, + "nodeType": "Block", + "src": "5968:278:1", + "statements": [ + { + "externalReferences": [ + { + "a": { + "declaration": 641, + "isOffset": false, + "isSlot": false, + "src": "6171:1:1", + "valueSize": 1 + } + }, + { + "b": { + "declaration": 644, + "isOffset": false, + "isSlot": false, + "src": "6224:1:1", + "valueSize": 1 + } + }, + { + "a": { + "declaration": 641, + "isOffset": false, + "isSlot": false, + "src": "6034:1:1", + "valueSize": 1 + } + }, + { + "a": { + "declaration": 641, + "isOffset": false, + "isSlot": false, + "src": "6043:1:1", + "valueSize": 1 + } + } + ], + "id": 646, + "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": "5978:262:1" + } + ] + }, + "documentation": null, + "id": 648, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toBytes", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 642, + "nodeType": "ParameterList", + "parameters": [ { "constant": false, - "id": 202, - "name": "_token_addr", + "id": 641, + "name": "a", "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2095:19:1", + "scope": 648, + "src": "5920:9:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6177,10 +8424,10 @@ "typeString": "address" }, "typeName": { - "id": 201, + "id": 640, "name": "address", "nodeType": "ElementaryTypeName", - "src": "2095:7:1", + "src": "5920:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -6189,53 +8436,54 @@ }, "value": null, "visibility": "internal" - }, + } + ], + "src": "5919:11:1" + }, + "returnParameters": { + "id": 645, + "nodeType": "ParameterList", + "parameters": [ { "constant": false, - "id": 204, - "name": "_total_tokens", + "id": 644, + "name": "b", "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2116:18:1", + "scope": 648, + "src": "5952:14:1", "stateVariable": false, - "storageLocation": "default", + "storageLocation": "memory", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" }, "typeName": { - "id": 203, - "name": "uint", + "id": 643, + "name": "bytes", "nodeType": "ElementaryTypeName", - "src": "2116:4:1", + "src": "5952:5:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], - "src": "1893:242:1" - }, - "returnParameters": { - "id": 206, - "nodeType": "ParameterList", - "parameters": [], - "src": "2156:0:1" + "src": "5951:16:1" }, - "scope": 956, - "src": "1866:2611:1", - "stateMutability": "payable", + "scope": 1367, + "src": "5903:343:1", + "stateMutability": "pure", "superFunction": null, "visibility": "public" }, { "body": { - "id": 556, + "id": 702, "nodeType": "Block", - "src": "4697:320:1", + "src": "6357:284:1", "statements": [ { "condition": { @@ -6244,639 +8492,609 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 524, + "id": 662, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 522, - "name": "token_type", + "id": 659, + "name": "index", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 511, - "src": "4728:10:1", + "referencedDeclaration": 653, + "src": "6371:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", - "operator": "==", + "operator": ">=", "rightExpression": { "argumentTypes": null, - "hexValue": "31", - "id": 523, + "expression": { + "argumentTypes": null, + "id": 660, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6380:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 661, "isConstant": false, "isLValue": false, - "isPure": true, - "kind": "number", + "isPure": false, "lValueRequested": false, - "nodeType": "Literal", - "src": "4742:1:1", - "subdenomination": null, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6380:12:1", "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, - "src": "4728:15:1", + "src": "6371:21:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, - "id": 555, + "id": 665, "nodeType": "IfStatement", - "src": "4724:287:1", + "src": "6367:39:1", "trueBody": { - "id": 554, + "expression": { + "argumentTypes": null, + "id": 663, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6401:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "functionReturnParameters": 658, + "id": 664, + "nodeType": "Return", + "src": "6394:12:1" + } + }, + { + "body": { + "id": 689, "nodeType": "Block", - "src": "4745:266:1", + "src": "6463:48: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, + "id": 687, "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": [ - { + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { "argumentTypes": null, - "id": 541, - "name": "recipient_address", + "id": 679, + "name": "array", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 517, - "src": "4883:17:1", + "referencedDeclaration": 651, + "src": "6477:5:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } }, - { + "id": 681, + "indexExpression": { "argumentTypes": null, - "id": 542, - "name": "amount", + "id": 680, + "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "4902:6:1", + "referencedDeclaration": 667, + "src": "6483:1:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "6477:8:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 682, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6488:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 686, + "indexExpression": { + "argumentTypes": null, + "commonType": { "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, + "id": 685, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "typeConversion", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4853:21:1", + "leftExpression": { + "argumentTypes": null, + "id": 683, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 667, + "src": "6494:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 684, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6498:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6494:5:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", - "typeString": "contract IERC20" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 540, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 1700, - "src": "4853:29:1", + "nodeType": "IndexAccess", + "src": "6488:12:1", "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 543, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4853:56:1", + "src": "6477:23:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 544, + "id": 688, "nodeType": "ExpressionStatement", - "src": "4853:56:1" + "src": "6477:23:1" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 675, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 670, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 667, + "src": "6437:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, - { + "id": 674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, "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" - } - } - ], + "id": 671, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6441:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 672, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6441:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 673, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6456:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6441:16:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6437:20:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 690, + "initializationExpression": { + "assignments": [ + 667 + ], + "declarations": [ + { + "constant": false, + "id": 667, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 690, + "src": "6421:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 666, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "6421:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 669, + "initialValue": { + "argumentTypes": null, + "id": 668, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 653, + "src": "6430:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6421:14:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 677, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "6459:3:1", + "subExpression": { + "argumentTypes": null, + "id": 676, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 667, + "src": "6459:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 678, + "nodeType": "ExpressionStatement", + "src": "6459:3:1" + }, + "nodeType": "ForStatement", + "src": "6416:95:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 698, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 691, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6520:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 696, + "indexExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 695, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, "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", + "argumentTypes": null, + "id": 692, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6526:5:1", "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } }, - "id": 552, + "id": 693, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "functionCall", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4923:77:1", + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6526:12:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 553, - "nodeType": "ExpressionStatement", - "src": "4923:77:1" + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 694, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6541:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6526:16:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "6520:23:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" } - ] - } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "307846464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646", + "id": 697, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6546:66:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", + "typeString": "int_const 1157...(70 digits omitted)...9935" + }, + "value": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + "src": "6520:92:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 699, + "nodeType": "ExpressionStatement", + "src": "6520:92:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 700, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6629:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "functionReturnParameters": 658, + "id": 701, + "nodeType": "Return", + "src": "6622:12:1" } ] }, "documentation": null, - "id": 557, + "id": 703, "implemented": true, "kind": "function", "modifiers": [], - "name": "transfer_token", + "name": "getTokenIdWithIndex", "nodeType": "FunctionDefinition", "parameters": { - "id": 520, + "id": 654, "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", + "id": 651, + "name": "array", "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4643:25:1", + "scope": 703, + "src": "6281:22:1", "stateVariable": false, - "storageLocation": "default", + "storageLocation": "memory", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" }, "typeName": { - "id": 516, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4643:7:1", - "stateMutability": "nonpayable", + "baseType": { + "id": 649, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6281:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 650, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6281:9:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, "value": null, @@ -6884,11 +9102,11 @@ }, { "constant": false, - "id": 519, - "name": "amount", + "id": 653, + "name": "index", "nodeType": "VariableDeclaration", - "scope": 557, - "src": "4670:11:1", + "scope": 703, + "src": "6305:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6896,10 +9114,10 @@ "typeString": "uint256" }, "typeName": { - "id": 518, + "id": 652, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "4670:4:1", + "src": "6305:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6909,28 +9127,176 @@ "visibility": "internal" } ], - "src": "4550:132:1" + "src": "6280:36:1" }, "returnParameters": { - "id": 521, + "id": 658, "nodeType": "ParameterList", - "parameters": [], - "src": "4697:0:1" + "parameters": [ + { + "constant": false, + "id": 657, + "name": "", + "nodeType": "VariableDeclaration", + "scope": 703, + "src": "6339:16:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 655, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6339:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 656, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6339:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "6338:18:1" }, - "scope": 956, - "src": "4527:490:1", - "stateMutability": "payable", + "scope": 1367, + "src": "6252:389:1", + "stateMutability": "view", "superFunction": null, - "visibility": "public" + "visibility": "internal" }, { "body": { - "id": 579, + "id": 1122, "nodeType": "Block", - "src": "5233:92:1", + "src": "6860:3782:1", "statements": [ { - "expression": { + "assignments": [ + 717 + ], + "declarations": [ + { + "constant": false, + "id": 717, + "name": "rp", + "nodeType": "VariableDeclaration", + "scope": 1122, + "src": "6871:20:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + }, + "typeName": { + "contractScope": null, + "id": 716, + "name": "RedPacket", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 94, + "src": "6871:9:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 721, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 718, + "name": "redpacket_by_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 145, + "src": "6894:15:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", + "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" + } + }, + "id": 720, + "indexExpression": { + "argumentTypes": null, + "id": 719, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 705, + "src": "6910:2:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6894:19:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage", + "typeString": "struct HappyRedPacket.RedPacket storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6871:42:1" + }, + { + "assignments": [ + 723 + ], + "declarations": [ + { + "constant": false, + "id": 723, + "name": "recipient", + "nodeType": "VariableDeclaration", + "scope": 1122, + "src": "6923:25:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 722, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6923:15:1", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 729, + "initialValue": { "argumentTypes": null, "arguments": [ { @@ -6938,191 +9304,74 @@ "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", + "id": 726, + "name": "_recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 709, + "src": "6967:10:1", "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" + "typeIdentifier": "t_address", + "typeString": "address" } } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" + "typeIdentifier": "t_address", + "typeString": "address" } ], - "id": 567, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "5255:9:1", + "id": 725, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6959:7:1", "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": "uint160" }, - "id": 576, + "id": 727, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "functionCall", + "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5255:62:1", + "src": "6959:19:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint160", + "typeString": "uint160" } } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint160", + "typeString": "uint160" } ], - "id": 566, + "id": 724, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "5250:4:1", + "src": "6951:7:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" }, - "typeName": "uint" + "typeName": "address" }, - "id": 577, + "id": 728, "isConstant": false, "isLValue": false, "isPure": false, @@ -7130,465 +9379,644 @@ "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", + "src": "6951:28:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "value": null, - "visibility": "internal" + "nodeType": "VariableDeclarationStatement", + "src": "6923:56:1" }, { - "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 + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 734, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 731, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7051:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 732, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "expiration_time", + "nodeType": "MemberAccess", + "referencedDeclaration": 79, + "src": "7051:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 733, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "7072:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7051:24:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303033", + "id": 735, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7077:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e07a04e280e3297d905849ae173374e70a63466da0c147cb1dc3eddf1adc47fd", + "typeString": "literal_string \"003\"" + }, + "value": "003" } - }, - { - "a": { - "declaration": 582, - "isOffset": false, - "isSlot": false, - "src": "5730:1:1", - "valueSize": 1 + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e07a04e280e3297d905849ae173374e70a63466da0c147cb1dc3eddf1adc47fd", + "typeString": "literal_string \"003\"" + } + ], + "id": 730, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7042:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } - } - ], - "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", + }, + "id": 736, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7042:41:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "value": null, - "visibility": "internal" - } - ], - "src": "5478:11:1" - }, - "returnParameters": { - "id": 586, - "nodeType": "ParameterList", - "parameters": [ + "id": 737, + "nodeType": "ExpressionStatement", + "src": "7042:41:1" + }, { - "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", + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 743, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 739, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7102:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 740, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "7102:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 741, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7122:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 742, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "7122:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "7102:35:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303034", + "id": 744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7139:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_334057113ad66ac6ad2c739ea6af3f43062313ec754cf4ee576b916e9ef852be", + "typeString": "literal_string \"004\"" + }, + "value": "004" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_334057113ad66ac6ad2c739ea6af3f43062313ec754cf4ee576b916e9ef852be", + "typeString": "literal_string \"004\"" + } + ], + "id": 738, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7093:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 745, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7093:52:1", "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "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": [ + "id": 746, + "nodeType": "ExpressionStatement", + "src": "7093:52:1" + }, { - "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", + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 753, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 748, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7164:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 749, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed", + "nodeType": "MemberAccess", + "referencedDeclaration": 93, + "src": "7164:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 751, + "indexExpression": { + "argumentTypes": null, + "id": 750, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "7175:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7164:21:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 752, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7189:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "7164:30:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "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)" + { + "argumentTypes": null, + "hexValue": "303035", + "id": 754, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7196:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_455d4b967493b29d0d995e675e1e17e44fa9a8488bfbfe9456da6496ca978090", + "typeString": "literal_string \"005\"" + }, + "value": "005" } - }, - "id": 606, - "indexExpression": { - "argumentTypes": null, - "id": 605, - "name": "id", + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_455d4b967493b29d0d995e675e1e17e44fa9a8488bfbfe9456da6496ca978090", + "typeString": "literal_string \"005\"" + } + ], + "id": 747, + "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 591, - "src": "6073:2:1", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7155:7:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } }, + "id": 755, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6057:19:1", + "names": [], + "nodeType": "FunctionCall", + "src": "7155:47:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "nodeType": "VariableDeclarationStatement", - "src": "6034:42:1" + "id": 756, + "nodeType": "ExpressionStatement", + "src": "7155:47: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": { + "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 612, - "name": "_recipient", + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 765, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 760, + "name": "password", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 707, + "src": "7237:8:1", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + ], + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7231:5:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": "bytes" + }, + "id": 761, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7231:15:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 758, + "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 595, - "src": "6130:10:1", + "referencedDeclaration": 3652, + "src": "7221:9:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } - ], - "id": 611, + }, + "id": 762, "isConstant": false, "isLValue": false, - "isPure": true, + "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6122:7:1", + "names": [], + "nodeType": "FunctionCall", + "src": "7221:26:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint160_$", - "typeString": "type(uint160)" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 763, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7251:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } }, - "typeName": "uint160" + "id": 764, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "hash", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "7251:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } }, - "id": 613, + "src": "7221:37:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303036", + "id": 766, "isConstant": false, "isLValue": false, - "isPure": false, - "kind": "typeConversion", + "isPure": true, + "kind": "string", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6122:19:1", + "nodeType": "Literal", + "src": "7260:5:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } + "typeIdentifier": "t_stringliteral_1564f9bd55fc54819c3c6e158d9a00b635174ac7541b6517a7ba0553da91d60d", + "typeString": "literal_string \"006\"" + }, + "value": "006" } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_uint160", - "typeString": "uint160" + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_1564f9bd55fc54819c3c6e158d9a00b635174ac7541b6517a7ba0553da91d60d", + "typeString": "literal_string \"006\"" } ], - "id": 610, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6114:7:1", + "id": 757, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7212:7:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } }, - "id": 614, + "id": 767, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "typeConversion", + "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6114:28:1", + "src": "7212:54:1", "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "nodeType": "VariableDeclarationStatement", - "src": "6086:56:1" + "id": 768, + "nodeType": "ExpressionStatement", + "src": "7212:54:1" }, { "expression": { @@ -7597,59 +10025,131 @@ { "argumentTypes": null, "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 777, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 770, + "name": "validation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 711, + "src": "7285:10:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } }, - "id": 620, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 773, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "7317:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 774, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7317:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "id": 772, + "name": "toBytes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 648, + "src": "7309:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address) pure returns (bytes memory)" + } + }, + "id": 775, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7309:19:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], "expression": { - "argumentTypes": null, - "id": 617, - "name": "rp", + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 771, + "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6186:2:1", + "referencedDeclaration": 3652, + "src": "7299:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 618, + "id": 776, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, + "kind": "functionCall", "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", + "names": [], + "nodeType": "FunctionCall", + "src": "7299:30:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "src": "6186:24:1", + "src": "7285:44:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7657,21 +10157,21 @@ }, { "argumentTypes": null, - "hexValue": "30303320457870697265642e", - "id": 621, + "hexValue": "303037", + "id": 778, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "6212:14:1", + "src": "7331:5:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_f833742dfe7fbdc9ca55286e79cd3ab04267c4e4354a00d8d89d45eb5d5b219d", - "typeString": "literal_string \"003 Expired.\"" + "typeIdentifier": "t_stringliteral_adafce779496806a67cd1ef67cfc3ac7e72c67c4eadb74565f826b325436f38b", + "typeString": "literal_string \"007\"" }, - "value": "003 Expired." + "value": "007" } ], "expression": { @@ -7681,25 +10181,25 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_f833742dfe7fbdc9ca55286e79cd3ab04267c4e4354a00d8d89d45eb5d5b219d", - "typeString": "literal_string \"003 Expired.\"" + "typeIdentifier": "t_stringliteral_adafce779496806a67cd1ef67cfc3ac7e72c67c4eadb74565f826b325436f38b", + "typeString": "literal_string \"007\"" } ], - "id": 616, + "id": 769, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1746, - 1747 + 3661, + 3662 ], - "referencedDeclaration": 1747, - "src": "6177:7:1", + "referencedDeclaration": 3662, + "src": "7276:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 622, + "id": 779, "isConstant": false, "isLValue": false, "isPure": false, @@ -7707,15 +10207,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6177:50:1", + "src": "7276:61:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 623, + "id": 780, "nodeType": "ExpressionStatement", - "src": "6177:50:1" + "src": "7276:61:1" }, { "expression": { @@ -7723,1164 +10223,2769 @@ "arguments": [ { "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 629, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { + "id": 786, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "7400: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, - "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", + "id": 781, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7378:2:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "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", + "id": 784, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimer_addrs", + "nodeType": "MemberAccess", + "referencedDeclaration": 86, + "src": "7378:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 785, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7378:21:1", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" + } + }, + "id": 787, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7378:32:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 788, + "nodeType": "ExpressionStatement", + "src": "7378:32:1" + }, + { + "assignments": [ + 790 + ], + "declarations": [ + { + "constant": false, + "id": 790, + "name": "claimed_tokens", + "nodeType": "VariableDeclaration", + "scope": 1122, + "src": "7420:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 789, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7420:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 791, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "7420:19:1" + }, + { + "assignments": [ + 795 + ], + "declarations": [ + { + "constant": false, + "id": 795, + "name": "token_ids", + "nodeType": "VariableDeclaration", + "scope": 1122, + "src": "7449:27:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 793, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7449:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "6246:35:1", + "id": 794, + "length": null, + "nodeType": "ArrayTypeName", + "src": "7449:10:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, + "value": null, + "visibility": "internal" + } + ], + "id": 801, + "initialValue": { + "argumentTypes": null, + "arguments": [ { "argumentTypes": null, - "hexValue": "303034204f7574206f662053746f636b2e", - "id": 630, + "hexValue": "31", + "id": 799, "isConstant": false, "isLValue": false, "isPure": true, - "kind": "string", + "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "6283:19:1", + "src": "7493:1:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_0682e79e4aaa50aee21676ee92bdd9c9f3db32a9b3cf7c35db38035443e713e9", - "typeString": "literal_string \"004 Out of Stock.\"" + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" }, - "value": "004 Out of Stock." + "value": "1" } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_0682e79e4aaa50aee21676ee92bdd9c9f3db32a9b3cf7c35db38035443e713e9", - "typeString": "literal_string \"004 Out of Stock.\"" + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" } ], - "id": 624, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "6237:7:1", + "id": 798, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "7479:13:1", "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", + "typeString": "function (uint256) pure returns (uint256[] memory)" + }, + "typeName": { + "baseType": { + "id": 796, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7483:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 797, + "length": null, + "nodeType": "ArrayTypeName", + "src": "7483:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } } }, - "id": 631, + "id": 800, "isConstant": false, "isLValue": false, - "isPure": false, + "isPure": true, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6237:66:1", + "src": "7479:16:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" } }, - "id": 632, - "nodeType": "ExpressionStatement", - "src": "6237:66:1" + "nodeType": "VariableDeclarationStatement", + "src": "7449:46:1" }, { - "expression": { + "condition": { "argumentTypes": null, - "arguments": [ - { + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 805, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 640, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { + "id": 802, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7578:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 803, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "ifrandom", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "7578:11:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 804, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7593:4:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" + }, + "src": "7578:19:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 995, + "nodeType": "Block", + "src": "8700:798:1", + "statements": [ + { + "condition": { "argumentTypes": null, - "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "baseExpression": { + "expression": { "argumentTypes": null, + "id": 918, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8718:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 919, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "8718:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 920, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8735:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "8718:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 993, + "nodeType": "Block", + "src": "9128:360:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 962, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 958, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9150:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 959, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "9150:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 960, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9168:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 961, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "9168:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "9150:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9189:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9150:40:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 985, + "nodeType": "Block", + "src": "9289:130:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 983, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 971, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "9311:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 974, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9341:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 975, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9341:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 976, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9363:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 977, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "9363:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 978, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9381:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 979, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "9381:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "9363:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "id": 981, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "9362:37:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "argumentTypes": null, + "id": 972, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "9328:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 973, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 1691, + "src": "9328:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 982, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9328:72:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9311:89:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 984, + "nodeType": "ExpressionStatement", + "src": "9311:89:1" + } + ] + }, + "id": 986, + "nodeType": "IfStatement", + "src": "9146:273:1", + "trueBody": { + "id": 970, + "nodeType": "Block", + "src": "9191:77:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 965, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "9213:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 966, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9230:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 967, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9230:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9213:36:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 969, + "nodeType": "ExpressionStatement", + "src": "9213:36:1" + } + ] + } + }, + { "expression": { "argumentTypes": null, - "id": 634, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6322:2:1", + "id": 991, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 987, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9436:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 989, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9436:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "id": 990, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "9459:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9436:37:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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": 992, + "nodeType": "ExpressionStatement", + "src": "9436:37:1" } - }, - "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": [ + ] + }, + "id": 994, + "nodeType": "IfStatement", + "src": "8714:774:1", + "trueBody": { + "id": 957, + "nodeType": "Block", + "src": "8738:360:1", + "statements": [ { - "argumentTypes": null, - "arguments": [ + "assignments": [ + 925 + ], + "declarations": [ { + "constant": false, + "id": 925, + "name": "_array", + "nodeType": "VariableDeclaration", + "scope": 957, + "src": "8835:23:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 923, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8835:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 924, + "length": null, + "nodeType": "ArrayTypeName", + "src": "8835:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 928, + "initialValue": { + "argumentTypes": null, + "expression": { "argumentTypes": null, - "id": 647, - "name": "password", + "id": 926, + "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 593, - "src": "6423:8:1", + "referencedDeclaration": 717, + "src": "8861:2:1", "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } - ], - "id": 646, + }, + "id": 927, "isConstant": false, - "isLValue": false, - "isPure": true, + "isLValue": true, + "isPure": false, "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6417:5:1", + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "8861:19:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", - "typeString": "type(bytes storage pointer)" - }, - "typeName": "bytes" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } }, - "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" - } + "nodeType": "VariableDeclarationStatement", + "src": "8835:45:1" }, - "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": [ - { + "expression": { + "argumentTypes": null, + "id": 936, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { "argumentTypes": null, - "expression": { + "baseExpression": { "argumentTypes": null, - "id": 663, - "name": "msg", + "id": 929, + "name": "token_ids", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "6540:3:1", + "referencedDeclaration": 795, + "src": "8898:9:1", "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } }, - "id": 664, + "id": 931, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 930, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8908:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6540:10:1", + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8898:12:1", "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } - ], - "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" + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 932, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8913:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 933, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "8913:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 935, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 934, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8933: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": "8913:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8898:37:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 937, + "nodeType": "ExpressionStatement", + "src": "8898:37:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 945, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 938, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8953:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 940, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "8953:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 942, + "name": "_array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 925, + "src": "8995:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9003:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 941, + "name": "getTokenIdWithIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 703, + "src": "8975:19:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", + "typeString": "function (uint256[] memory,uint256) view returns (uint256[] memory)" + } + }, + "id": 944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8975:30:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "src": "8953:52:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 946, + "nodeType": "ExpressionStatement", + "src": "8953:52:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 949, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 947, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "9023:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 948, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9040:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9023:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 950, + "nodeType": "ExpressionStatement", + "src": "9023:18:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 951, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9059:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 953, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9059:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 954, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9082:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9059:24:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 956, + "nodeType": "ExpressionStatement", + "src": "9059:24:1" + } + ] } - }, - "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, + "id": 996, + "nodeType": "IfStatement", + "src": "7574:1924:1", + "trueBody": { + "id": 917, "nodeType": "Block", - "src": "6857:54:1", + "src": "7599:1087:1", "statements": [ { - "expression": { + "condition": { "argumentTypes": null, - "id": 700, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 809, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftHandSide": { + "leftExpression": { "argumentTypes": null, - "id": 695, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "6871:14:1", + "expression": { + "argumentTypes": null, + "id": 806, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7617:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 807, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "7617:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7634:1:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "7617:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 915, + "nodeType": "Block", + "src": "8042:634:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 861, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 855, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8064:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 856, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "8064:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 857, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8082:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 858, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "8082:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "8064:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 860, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8103:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8064:40:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 913, + "nodeType": "Block", + "src": "8203:459:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 876, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 868, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8225:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 875, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 870, + "name": "uuid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "8249:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 871, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "8255:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 869, + "name": "random", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 639, + "src": "8242:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bytes32,uint256) view returns (uint256)" + } + }, + "id": 872, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8242:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 873, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8264:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 874, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "MAX_AMOUNT", + "nodeType": "MemberAccess", + "referencedDeclaration": 71, + "src": "8264:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8242:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8225:52:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 877, + "nodeType": "ExpressionStatement", + "src": "8225:52:1" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 880, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 878, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8303:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 879, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8321:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "8303:19:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 889, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 886, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8421:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 887, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8439:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 888, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "8439:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8421:37:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 905, + "nodeType": "IfStatement", + "src": "8417:172:1", + "trueBody": { + "id": 904, + "nodeType": "Block", + "src": "8460:129:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 902, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 890, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8486:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 901, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 891, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8503:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 892, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "8503:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 893, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8526:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 894, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "8526:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 895, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8544:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 896, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "8544:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "8526:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 898, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8564:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8526:39:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "id": 900, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "8525:41:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "8503:63:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8486:80:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 903, + "nodeType": "ExpressionStatement", + "src": "8486:80:1" + } + ] + } + }, + "id": 906, + "nodeType": "IfStatement", + "src": "8299:290:1", + "trueBody": { + "id": 885, + "nodeType": "Block", + "src": "8324:67:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 883, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 881, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8350:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 882, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8367:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8350:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 884, + "nodeType": "ExpressionStatement", + "src": "8350:18:1" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 911, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 907, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8606:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 909, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "8606:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "id": 910, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8629:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8606:37:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 912, + "nodeType": "ExpressionStatement", + "src": "8606:37:1" + } + ] + }, + "id": 914, + "nodeType": "IfStatement", + "src": "8060:602:1", + "trueBody": { + "id": 867, + "nodeType": "Block", + "src": "8105:77:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 862, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8127:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 863, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8144:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 864, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "8144:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8127:36:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 866, + "nodeType": "ExpressionStatement", + "src": "8127:36:1" + } + ] + } } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, + ] + }, + "id": 916, + "nodeType": "IfStatement", + "src": "7613:1063:1", + "trueBody": { + "id": 854, + "nodeType": "Block", + "src": "7637:375:1", + "statements": [ + { + "assignments": [ + 811 + ], + "declarations": [ + { + "constant": false, + "id": 811, + "name": "token_id_index", + "nodeType": "VariableDeclaration", + "scope": 854, + "src": "7655:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 810, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7655:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 819, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 813, + "name": "uuid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "7684:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 814, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "7690:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 812, + "name": "random", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 639, + "src": "7677:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bytes32,uint256) view returns (uint256)" + } + }, + "id": 815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7677:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 816, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7699:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 817, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "7699:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7677:41:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7655:63:1" + }, + { + "assignments": [ + 823 + ], + "declarations": [ + { + "constant": false, + "id": 823, + "name": "_array", + "nodeType": "VariableDeclaration", + "scope": 854, + "src": "7736:23:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 821, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7736:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 822, + "length": null, + "nodeType": "ArrayTypeName", + "src": "7736:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 826, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 824, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7762:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 825, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "7762:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7736:45:1" + }, + { "expression": { "argumentTypes": null, - "id": 696, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6888:2:1", + "id": 833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 827, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 795, + "src": "7799:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 829, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 828, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7809:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "7799:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 830, + "name": "_array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 823, + "src": "7814:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 832, + "indexExpression": { + "argumentTypes": null, + "id": 831, + "name": "token_id_index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "7821:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7814:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7799:37:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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": 834, + "nodeType": "ExpressionStatement", + "src": "7799:37:1" }, - "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" + { + "expression": { + "argumentTypes": null, + "id": 842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 835, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7854:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 837, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "7854:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 839, + "name": "_array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 823, + "src": "7896:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + { + "argumentTypes": null, + "id": 840, + "name": "token_id_index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "7904:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 838, + "name": "getTokenIdWithIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 703, + "src": "7876:19:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", + "typeString": "function (uint256[] memory,uint256) view returns (uint256[] memory)" + } + }, + "id": 841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7876:43:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "src": "7854:65:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } }, - "value": "0" + "id": 843, + "nodeType": "ExpressionStatement", + "src": "7854:65:1" }, - "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", + "id": 846, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 844, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "7937:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 845, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7954:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "7937:18:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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": 847, + "nodeType": "ExpressionStatement", + "src": "7937:18:1" }, - "id": 691, - "indexExpression": { - "argumentTypes": null, + { "expression": { "argumentTypes": null, - "id": 689, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6814:2:1", + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 848, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7973:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 850, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "7973:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7996:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "7973:24:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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" + "id": 853, + "nodeType": "ExpressionStatement", + "src": "7973:24:1" } - }, - "src": "6787:45:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 693, - "nodeType": "ExpressionStatement", - "src": "6787:45:1" + ] + } } ] } @@ -8888,400 +12993,101 @@ { "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, + "id": 1003, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "expression": { + "baseExpression": { "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": { + "expression": { "argumentTypes": null, - "id": 712, - "name": "recipient", + "id": 997, + "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "6979:9:1", + "referencedDeclaration": 717, + "src": "9508:2:1", "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, + "id": 1000, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6967:22:1", + "memberName": "claimed", + "nodeType": "MemberAccess", + "referencedDeclaration": 93, + "src": "9508:10:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" } }, - "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": { + "id": 1001, + "indexExpression": { "argumentTypes": null, - "id": 716, - "name": "rp", + "id": 999, + "name": "recipient", "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", + "referencedDeclaration": 723, + "src": "9519:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "id": 734, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "claimed_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 108, - "src": "7089:35:1", + "nodeType": "IndexAccess", + "src": "9508:21:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 735, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "7127:3:1", + "hexValue": "74727565", + "id": 1002, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9532:4:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "true" }, - "src": "7089:41:1", + "src": "9508:28:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "id": 737, + "id": 1004, "nodeType": "ExpressionStatement", - "src": "7089:41:1" + "src": "9508:28:1" }, { "expression": { "argumentTypes": null, - "id": 741, + "id": 1008, "isConstant": false, "isLValue": false, "isPure": false, @@ -9289,44 +13095,44 @@ "nodeType": "UnaryOperation", "operator": "++", "prefix": false, - "src": "7140:20:1", + "src": "9547:20:1", "subExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 738, + "id": 1005, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7140:2:1", + "referencedDeclaration": 717, + "src": "9547:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 740, + "id": 1007, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "memberName": "claimed_number", "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "7140:17:1", + "referencedDeclaration": 77, + "src": "9547:17:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "id": 742, + "id": 1009, "nodeType": "ExpressionStatement", - "src": "7140:20:1" + "src": "9547:20:1" }, { "condition": { @@ -9335,7 +13141,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 746, + "id": 1013, "isConstant": false, "isLValue": false, "isPure": false, @@ -9344,26 +13150,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 743, + "id": 1010, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7231:2:1", + "referencedDeclaration": 717, + "src": "9581:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 744, + "id": 1011, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7231:13:1", + "referencedDeclaration": 69, + "src": "9581:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9373,866 +13179,1397 @@ "operator": "==", "rightExpression": { "argumentTypes": null, - "hexValue": "30", - "id": 745, + "hexValue": "32", + "id": 1012, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7248:1:1", + "src": "9598:1:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" }, - "value": "0" + "value": "2" }, - "src": "7231:18:1", + "src": "9581: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": { + "id": 1048, + "nodeType": "Block", + "src": "9675:202:1", + "statements": [ + { + "condition": { "argumentTypes": null, - "id": 754, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7328:2:1", + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 1026, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1022, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9693:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1023, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "9693:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1024, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9712:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1025, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "9712:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "9693:36:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "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": [ - { + "falseBody": null, + "id": 1047, + "nodeType": "IfStatement", + "src": "9689:177:1", + "trueBody": { + "id": 1046, + "nodeType": "Block", + "src": "9730:136:1", + "statements": [ + { + "expression": { "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, + "id": 1044, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7377:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { + "leftHandSide": { "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": [ - { + "expression": { "argumentTypes": null, - "id": 764, - "name": "this", + "id": 1027, + "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "7418:4:1", + "referencedDeclaration": 717, + "src": "9748:2:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } + }, + "id": 1029, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "MAX_AMOUNT", + "nodeType": "MemberAccess", + "referencedDeclaration": 71, + "src": "9748:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" } - ], - "expression": { - "argumentTypes": [ + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1034, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9790:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1035, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9790:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 1040, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1036, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9811:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1037, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "9811:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1038, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9829:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1039, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "9829:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "9811:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "argumentTypes": null, + "id": 1032, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "9777:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 1033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 1691, + "src": "9777:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9777:70:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", - "typeString": "contract HappyRedPacket" + "argumentTypes": null, + "hexValue": "32", + "id": 1042, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9849:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" } ], - "id": 763, + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + } + ], + "expression": { + "argumentTypes": null, + "id": 1030, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "9764:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 1031, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 1675, + "src": "9764:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1043, "isConstant": false, "isLValue": false, - "isPure": true, + "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7410:7:1", + "names": [], + "nodeType": "FunctionCall", + "src": "9764:87:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7410:13:1", + "src": "9748:103: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": 1045, + "nodeType": "ExpressionStatement", + "src": "9748:103:1" } - }, - "id": 769, - "nodeType": "ExpressionStatement", - "src": "7362:117:1" + ] } - ] - } + } + ] }, - "id": 772, + "id": 1049, "nodeType": "IfStatement", - "src": "7227:263:1", + "src": "9577:300:1", "trueBody": { - "id": 753, + "id": 1021, "nodeType": "Block", - "src": "7251:59:1", + "src": "9601:60:1", "statements": [ { "expression": { "argumentTypes": null, - "arguments": [ - { + "id": 1019, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { "argumentTypes": null, - "id": 750, - "name": "claimed_tokens", + "id": 1014, + "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7284:14:1", + "referencedDeclaration": 717, + "src": "9615:2:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } + }, + "id": 1016, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "MAX_AMOUNT", + "nodeType": "MemberAccess", + "referencedDeclaration": 71, + "src": "9615:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 747, - "name": "recipient", + "id": 1017, + "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7265:9:1", + "referencedDeclaration": 717, + "src": "9631:2:1", "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 749, + "id": 1018, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "transfer", + "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7265:18:1", + "referencedDeclaration": 81, + "src": "9631:19: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", + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9615:35:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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": 1020, + "nodeType": "ExpressionStatement", + "src": "9615:35:1" } - }, - "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": { + "condition": { "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": { + "commonType": { "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", + }, + "id": 1053, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1050, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9947:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1051, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "9947:13:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 1052, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9964:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "9947:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, - "typeName": { - "contractScope": null, - "id": 800, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "7955:9:1", + "id": 1064, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1061, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10044:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1062, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "10044:13:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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", + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 1063, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10061:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "10044:18:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "id": 804, - "indexExpression": { - "argumentTypes": null, - "id": 803, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 787, - "src": "7994:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1092, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1089, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10310:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1090, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "10310:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1091, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10327:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "10310:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1107, + "nodeType": "IfStatement", + "src": "10306:177:1", + "trueBody": { + "id": 1106, + "nodeType": "Block", + "src": "10330:153:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1094, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10359:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1095, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "10359:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1096, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10374:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1097, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "10374:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1099, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "10400:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 1098, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10392:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1100, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10392:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1101, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10435:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1102, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "10446:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1103, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 795, + "src": "10462:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + ], + "id": 1093, + "name": "transfer_token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 616, + "src": "10344:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" + } + }, + "id": 1104, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10344:128:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1105, + "nodeType": "ExpressionStatement", + "src": "10344:128:1" + } + ] } }, - "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" + "id": 1108, + "nodeType": "IfStatement", + "src": "10040:443:1", + "trueBody": { + "id": 1088, + "nodeType": "Block", + "src": "10064:228:1", + "statements": [ + { + "assignments": [ + 1068 + ], + "declarations": [ + { + "constant": false, + "id": 1068, + "name": "token_ids_holder", + "nodeType": "VariableDeclaration", + "scope": 1088, + "src": "10078:34:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 1066, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10078:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1067, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10078:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1074, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1072, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10129:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1071, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "10115:13: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": 1069, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10119:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1070, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10119:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 1073, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10115:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10078:53:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1076, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10161:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1077, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "10161:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1078, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10176:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1079, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "10176:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1081, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "10202:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 1080, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10194:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1082, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10194:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1083, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10237:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1084, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "10248:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1085, + "name": "token_ids_holder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1068, + "src": "10264:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + ], + "id": 1075, + "name": "transfer_token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 616, + "src": "10146:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" + } + }, + "id": 1086, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10146:135:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1087, + "nodeType": "ExpressionStatement", + "src": "10146:135:1" + } + ] } }, - "nodeType": "VariableDeclarationStatement", - "src": "7955:42:1" + "id": 1109, + "nodeType": "IfStatement", + "src": "9943:540:1", + "trueBody": { + "id": 1060, + "nodeType": "Block", + "src": "9967:59:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1057, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "10000:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "id": 1054, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "9981:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "id": 1056, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transfer", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "9981:18:1", + "typeDescriptions": { + "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", + "typeString": "function (uint256)" + } + }, + "id": 1058, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9981:34:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1059, + "nodeType": "ExpressionStatement", + "src": "9981:34:1" + } + ] + } }, { - "expression": { + "eventCall": { "argumentTypes": null, - "components": [ + "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 806, + "id": 1111, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8015:2:1", + "referencedDeclaration": 717, + "src": "10542:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 807, + "id": 1112, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "token_address", + "memberName": "id", "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "8015:16:1", + "referencedDeclaration": 63, + "src": "10542:5:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, { "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", + "id": 1113, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10549:9:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, { "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", + "id": 1114, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "10560:14:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10242,131 +14579,136 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 812, + "id": 1115, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8071:2:1", + "referencedDeclaration": 717, + "src": "10576:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 813, + "id": 1116, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "claimed_number", + "memberName": "token_address", "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8071:17:1", + "referencedDeclaration": 83, + "src": "10576:16:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } }, { "argumentTypes": null, - "commonType": { + "id": 1117, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 795, + "src": "10594:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { "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" - } + { + "typeIdentifier": "t_address", + "typeString": "address" }, - "src": "8090:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } + ], + "id": 1110, + "name": "ClaimSuccess", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 129, + "src": "10529:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (bytes32,address,uint256,address,uint256[] memory)" } - ], - "id": 818, + }, + "id": 1118, "isConstant": false, - "isInlineArray": false, "isLValue": false, "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "8014:101:1", + "names": [], + "nodeType": "FunctionCall", + "src": "10529:75:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1119, + "nodeType": "EmitStatement", + "src": "10524:80:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 1120, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "10621:14:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$", - "typeString": "tuple(address,uint256,uint256,uint256,bool)" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "functionReturnParameters": 799, - "id": 819, + "functionReturnParameters": 715, + "id": 1121, "nodeType": "Return", - "src": "8007:108:1" + "src": "10614:21:1" } ] }, "documentation": null, - "id": 821, + "id": 1123, "implemented": true, "kind": "function", "modifiers": [], - "name": "check_availability", + "name": "claim", "nodeType": "FunctionDefinition", "parameters": { - "id": 788, + "id": 712, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 787, + "id": 705, "name": "id", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7770:10:1", + "scope": 1123, + "src": "6749:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10374,10 +14716,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 786, + "id": 704, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7770:7:1", + "src": "6749:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10385,62 +14727,28 @@ }, "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", + "id": 707, + "name": "password", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7826:12:1", + "scope": 1123, + "src": "6761:22:1", "stateVariable": false, - "storageLocation": "default", + "storageLocation": "memory", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" }, "typeName": { - "id": 791, - "name": "uint", + "id": 706, + "name": "string", "nodeType": "ElementaryTypeName", - "src": "7826:4:1", + "src": "6761:6:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" } }, "value": null, @@ -10448,25 +14756,26 @@ }, { "constant": false, - "id": 794, - "name": "total", + "id": 709, + "name": "_recipient", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7905:10:1", + "scope": 1123, + "src": "6785:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" }, "typeName": { - "id": 793, - "name": "uint", + "id": 708, + "name": "address", "nodeType": "ElementaryTypeName", - "src": "7905:4:1", + "src": "6785:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } }, "value": null, @@ -10474,98 +14783,105 @@ }, { "constant": false, - "id": 796, - "name": "claimed", + "id": 711, + "name": "validation", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7917:12:1", + "scope": 1123, + "src": "6805:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" }, "typeName": { - "id": 795, - "name": "uint", + "id": 710, + "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7917:4:1", + "src": "6805:7:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, "value": null, "visibility": "internal" - }, + } + ], + "src": "6748:76:1" + }, + "returnParameters": { + "id": 715, + "nodeType": "ParameterList", + "parameters": [ { "constant": false, - "id": 798, - "name": "expired", + "id": 714, + "name": "claimed", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7931:12:1", + "scope": 1123, + "src": "6846:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, "typeName": { - "id": 797, - "name": "bool", + "id": 713, + "name": "uint", "nodeType": "ElementaryTypeName", - "src": "7931:4:1", + "src": "6846:4:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], - "src": "7802:142:1" + "src": "6845:14:1" }, - "scope": 956, - "src": "7742:380:1", - "stateMutability": "view", + "scope": 1367, + "src": "6734:3908:1", + "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { - "id": 880, + "id": 1165, "nodeType": "Block", - "src": "8340:325:1", + "src": "10969:218:1", "statements": [ { "assignments": [ - 833 + 1141 ], "declarations": [ { "constant": false, - "id": 833, + "id": 1141, "name": "rp", "nodeType": "VariableDeclaration", - "scope": 880, - "src": "8350:20:1", + "scope": 1165, + "src": "10979:20:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" }, "typeName": { "contractScope": null, - "id": 832, + "id": 1140, "name": "RedPacket", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "8350:9:1", + "referencedDeclaration": 94, + "src": "10979:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" } }, @@ -10573,31 +14889,31 @@ "visibility": "internal" } ], - "id": 837, + "id": 1145, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 834, + "id": 1142, "name": "redpacket_by_id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "8373:15:1", + "referencedDeclaration": 145, + "src": "11002:15:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" } }, - "id": 836, + "id": 1144, "indexExpression": { "argumentTypes": null, - "id": 835, + "id": 1143, "name": "id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 823, - "src": "8389:2:1", + "referencedDeclaration": 1125, + "src": "11018:2:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10608,568 +14924,883 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "8373:19:1", + "src": "11002:19:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", + "typeIdentifier": "t_struct$_RedPacket_$94_storage", "typeString": "struct HappyRedPacket.RedPacket storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "8350:42:1" + "src": "10979: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", + "expression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1146, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "11039:2:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 840, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8402:6:1", + "id": 1147, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "11039:16:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" + "typeIdentifier": "t_address", + "typeString": "address" } }, - "value": null, - "visibility": "internal" - } - ], - "id": 848, - "initialValue": { - "argumentTypes": null, - "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 845, + "id": 1148, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8444:2:1", + "referencedDeclaration": 1141, + "src": "11057:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 846, + "id": 1149, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "claimed_number", + "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8444:17:1", + "referencedDeclaration": 81, + "src": "11057:19:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1150, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "11078:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1151, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "11078:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" } - ], - "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", + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1152, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "11112:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1153, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "11112:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1157, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1154, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "11131:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1155, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "11137:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1156, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "expiration_time", + "nodeType": "MemberAccess", + "referencedDeclaration": 79, + "src": "11137:18:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 843, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8437:6:1", + "src": "11131:24:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1158, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "11157:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1159, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed", + "nodeType": "MemberAccess", + "referencedDeclaration": 93, + "src": "11157:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 1162, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1160, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "11168:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11168:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11157:22:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" + "typeIdentifier": "t_bool", + "typeString": "bool" } } - }, - "id": 847, + ], + "id": 1163, "isConstant": false, + "isInlineArray": false, "isLValue": false, "isPure": false, - "kind": "functionCall", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8433:29:1", + "nodeType": "TupleExpression", + "src": "11038:142:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" + "typeIdentifier": "t_tuple$_t_address_$_t_uint256_$_t_uint8_$_t_uint8_$_t_bool_$_t_bool_$", + "typeString": "tuple(address,uint256,uint8,uint8,bool,bool)" } }, - "nodeType": "VariableDeclarationStatement", - "src": "8402:60:1" + "functionReturnParameters": 1139, + "id": 1164, + "nodeType": "Return", + "src": "11031:149:1" + } + ] + }, + "documentation": null, + "id": 1166, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "check_availability", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1126, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1125, + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 1166, + "src": "10774:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1124, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "10774:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10773:12:1" + }, + "returnParameters": { + "id": 1139, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1128, + "name": "token_address", + "nodeType": "VariableDeclaration", + "scope": 1166, + "src": "10807:21:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 1127, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "10807:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" }, { - "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" - } - ] + "constant": false, + "id": 1130, + "name": "balance", + "nodeType": "VariableDeclaration", + "scope": 1166, + "src": "10830:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1129, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10830:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1132, + "name": "total", + "nodeType": "VariableDeclaration", + "scope": 1166, + "src": "10844:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1131, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10844:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1134, + "name": "claimed", + "nodeType": "VariableDeclaration", + "scope": 1166, + "src": "10925:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, - "condition": { - "argumentTypes": null, - "commonType": { + "typeName": { + "id": 1133, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "10925:4:1", + "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" - }, - "id": 856, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1136, + "name": "expired", + "nodeType": "VariableDeclaration", + "scope": 1166, + "src": "10939:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1135, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10939:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1138, + "name": "ifclaimed", + "nodeType": "VariableDeclaration", + "scope": 1166, + "src": "10953:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1137, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10953:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "10806:162:1" + }, + "scope": 1367, + "src": "10746:441:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1184, + "nodeType": "Block", + "src": "11341:94:1", + "statements": [ + { + "assignments": [ + 1175 + ], + "declarations": [ + { + "constant": false, + "id": 1175, + "name": "rp", + "nodeType": "VariableDeclaration", + "scope": 1184, + "src": "11351:20:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + }, + "typeName": { + "contractScope": null, + "id": 1174, + "name": "RedPacket", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 94, + "src": "11351:9:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1179, + "initialValue": { + "argumentTypes": null, + "baseExpression": { "argumentTypes": null, - "id": 853, - "name": "i", + "id": 1176, + "name": "redpacket_by_id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8489:1:1", + "referencedDeclaration": 145, + "src": "11374:15:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", + "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" } }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { + "id": 1178, + "indexExpression": { "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", + "id": 1177, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1168, + "src": "11390:2:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "src": "8489:21:1", + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11374:19:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_struct$_RedPacket_$94_storage", + "typeString": "struct HappyRedPacket.RedPacket storage ref" } }, - "id": 874, - "initializationExpression": { - "assignments": [ - 850 - ], - "declarations": [ + "nodeType": "VariableDeclarationStatement", + "src": "11351:42:1" + }, + { + "expression": { + "argumentTypes": null, + "components": [ { - "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", + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1180, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1175, + "src": "11411:2:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "value": null, - "visibility": "internal" + "id": 1181, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimer_addrs", + "nodeType": "MemberAccess", + "referencedDeclaration": 86, + "src": "11411:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } } ], - "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, + "id": 1182, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "11410:18:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 1173, + "id": 1183, + "nodeType": "Return", + "src": "11403:25:1" + } + ] + }, + "documentation": null, + "id": 1185, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "check_claimed_list", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1169, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1168, + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 1185, + "src": "11276:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1167, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11276:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11275:12:1" + }, + "returnParameters": { + "id": 1173, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1172, + "name": "claimer_addrs", + "nodeType": "VariableDeclaration", + "scope": 1185, + "src": "11309:30:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1170, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11309:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" + "typeIdentifier": "t_address", + "typeString": "address" + } }, - "nodeType": "VariableDeclarationStatement", - "src": "8477:10:1" + "id": 1171, + "length": null, + "nodeType": "ArrayTypeName", + "src": "11309:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } }, - "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", + "value": null, + "visibility": "internal" + } + ], + "src": "11308:32:1" + }, + "scope": 1367, + "src": "11248:187:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1203, + "nodeType": "Block", + "src": "11584:97:1", + "statements": [ + { + "assignments": [ + 1194 + ], + "declarations": [ + { + "constant": false, + "id": 1194, + "name": "rp", + "nodeType": "VariableDeclaration", + "scope": 1203, + "src": "11594:20:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + }, + "typeName": { + "contractScope": null, + "id": 1193, + "name": "RedPacket", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 94, + "src": "11594:9:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" } }, + "value": null, + "visibility": "internal" + } + ], + "id": 1198, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1195, + "name": "redpacket_by_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 145, + "src": "11617:15:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", + "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" } }, - "id": 859, - "nodeType": "ExpressionStatement", - "src": "8512:3:1" + "id": 1197, + "indexExpression": { + "argumentTypes": null, + "id": 1196, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1187, + "src": "11633:2:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11617:19:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage", + "typeString": "struct HappyRedPacket.RedPacket storage ref" + } }, - "nodeType": "ForStatement", - "src": "8472:136:1" + "nodeType": "VariableDeclarationStatement", + "src": "11594:42: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, + "id": 1199, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8641:2:1", + "referencedDeclaration": 1194, + "src": "11654:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 877, + "id": 1200, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "claimer_addrs", + "memberName": "erc721_token_ids", "nodeType": "MemberAccess", - "referencedDeclaration": 90, - "src": "8641:16:1", + "referencedDeclaration": 89, + "src": "11654:19:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } } ], - "id": 878, + "id": 1201, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "8624:34:1", + "src": "11653:21: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)" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } }, - "functionReturnParameters": 831, - "id": 879, + "functionReturnParameters": 1192, + "id": 1202, "nodeType": "Return", - "src": "8617:41:1" + "src": "11646:28:1" } ] }, "documentation": null, - "id": 881, + "id": 1204, "implemented": true, "kind": "function", "modifiers": [], - "name": "check_claimed_list", + "name": "check_erc721_token_ids", "nodeType": "FunctionDefinition", "parameters": { - "id": 824, + "id": 1188, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 823, + "id": 1187, "name": "id", "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8242:10:1", + "scope": 1204, + "src": "11516:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -11177,10 +15808,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 822, + "id": 1186, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8242:7:1", + "src": "11516:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11190,19 +15821,19 @@ "visibility": "internal" } ], - "src": "8241:12:1" + "src": "11515:12:1" }, "returnParameters": { - "id": 831, + "id": 1192, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 827, - "name": "claimed_list", + "id": 1191, + "name": "erc721_token_ids", "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8280:26:1", + "scope": 1204, + "src": "11549:33:1", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { @@ -11211,19 +15842,19 @@ }, "typeName": { "baseType": { - "id": 825, - "name": "uint", + "id": 1189, + "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "8280:4:1", + "src": "11549:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 826, + "id": 1190, "length": null, "nodeType": "ArrayTypeName", - "src": "8280:6:1", + "src": "11549:9:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", "typeString": "uint256[]" @@ -11231,86 +15862,49 @@ }, "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" + "src": "11548:35:1" }, - "scope": 956, - "src": "8214:451:1", + "scope": 1367, + "src": "11484:197:1", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { - "id": 954, + "id": 1365, "nodeType": "Block", - "src": "8706:620:1", + "src": "11722:1335:1", "statements": [ { "assignments": [ - 887 + 1210 ], "declarations": [ { "constant": false, - "id": 887, + "id": 1210, "name": "rp", "nodeType": "VariableDeclaration", - "scope": 954, - "src": "8716:20:1", + "scope": 1365, + "src": "11732:20:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" }, "typeName": { "contractScope": null, - "id": 886, + "id": 1209, "name": "RedPacket", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "8716:9:1", + "referencedDeclaration": 94, + "src": "11732:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" } }, @@ -11318,31 +15912,31 @@ "visibility": "internal" } ], - "id": 891, + "id": 1214, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 888, + "id": 1211, "name": "redpacket_by_id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "8739:15:1", + "referencedDeclaration": 145, + "src": "11755:15:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" } }, - "id": 890, + "id": 1213, "indexExpression": { "argumentTypes": null, - "id": 889, + "id": 1212, "name": "id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 883, - "src": "8755:2:1", + "referencedDeclaration": 1206, + "src": "11771:2:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -11353,14 +15947,14 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "8739:19:1", + "src": "11755:19:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", + "typeIdentifier": "t_struct$_RedPacket_$94_storage", "typeString": "struct HappyRedPacket.RedPacket storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "8716:42:1" + "src": "11732:42:1" }, { "expression": { @@ -11372,7 +15966,7 @@ "typeIdentifier": "t_address", "typeString": "address" }, - "id": 898, + "id": 1221, "isConstant": false, "isLValue": false, "isPure": false, @@ -11381,18 +15975,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 893, + "id": 1216, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "8776:3:1", + "referencedDeclaration": 3658, + "src": "11792:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 894, + "id": 1217, "isConstant": false, "isLValue": false, "isPure": false, @@ -11400,7 +15994,7 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "8776:10:1", + "src": "11792:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" @@ -11414,46 +16008,46 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 895, + "id": 1218, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8790:2:1", + "referencedDeclaration": 1210, + "src": "11806:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 896, + "id": 1219, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "creator", "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "8790:10:1", + "referencedDeclaration": 73, + "src": "11806:10:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", + "typeIdentifier": "t_struct$_Creator_$101_storage", "typeString": "struct HappyRedPacket.Creator storage ref" } }, - "id": 897, + "id": 1220, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "addr", "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "8790:15:1", + "referencedDeclaration": 98, + "src": "11806:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "src": "8776:29:1", + "src": "11792:29:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11461,21 +16055,21 @@ }, { "argumentTypes": null, - "hexValue": "303038204f6e6c792074686520726564207061636b65742063726561746f722063616e20726566756e6420746865206d6f6e6579", - "id": 899, + "hexValue": "303131", + "id": 1222, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "8807:54:1", + "src": "11823:5:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_bc53fa365cb20c8143df9a0166321d7a480df48fc715dae4b4ff50e8ffee4ec5", - "typeString": "literal_string \"008 Only the red packet creator can refund the money\"" + "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", + "typeString": "literal_string \"011\"" }, - "value": "008 Only the red packet creator can refund the money" + "value": "011" } ], "expression": { @@ -11485,25 +16079,25 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_bc53fa365cb20c8143df9a0166321d7a480df48fc715dae4b4ff50e8ffee4ec5", - "typeString": "literal_string \"008 Only the red packet creator can refund the money\"" + "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", + "typeString": "literal_string \"011\"" } ], - "id": 892, + "id": 1215, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1746, - 1747 + 3661, + 3662 ], - "referencedDeclaration": 1747, - "src": "8768:7:1", + "referencedDeclaration": 3662, + "src": "11784:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 900, + "id": 1223, "isConstant": false, "isLValue": false, "isPure": false, @@ -11511,15 +16105,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8768:94:1", + "src": "11784:45:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 901, + "id": 1224, "nodeType": "ExpressionStatement", - "src": "8768:94:1" + "src": "11784:45:1" }, { "expression": { @@ -11531,7 +16125,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 906, + "id": 1229, "isConstant": false, "isLValue": false, "isPure": false, @@ -11540,26 +16134,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 903, + "id": 1226, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8880:2:1", + "referencedDeclaration": 1210, + "src": "11847:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 904, + "id": 1227, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "expiration_time", "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8880:18:1", + "referencedDeclaration": 79, + "src": "11847:18:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -11567,206 +16161,70 @@ }, "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": { + "rightExpression": { "argumentTypes": null, - "id": 915, - "name": "rp", + "id": 1228, + "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9015:2:1", + "referencedDeclaration": 3660, + "src": "11868:3:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 916, + "src": "11847:24:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303132", + "id": 1230, "isConstant": false, - "isLValue": true, - "isPure": false, + "isLValue": false, + "isPure": true, + "kind": "string", "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9015:19:1", + "nodeType": "Literal", + "src": "11873:5:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } + "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", + "typeString": "literal_string \"012\"" + }, + "value": "012" } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_bool", + "typeString": "bool" }, { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", + "typeString": "literal_string \"012\"" } ], - "id": 910, - "name": "RefundSuccess", + "id": 1225, + "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 149, - "src": "8976:13:1", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "11839:7:1", "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256)" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } }, - "id": 917, + "id": 1231, "isConstant": false, "isLValue": false, "isPure": false, @@ -11774,15 +16232,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8976:59:1", + "src": "11839:40:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 918, - "nodeType": "EmitStatement", - "src": "8971:64:1" + "id": 1232, + "nodeType": "ExpressionStatement", + "src": "11839:40:1" }, { "condition": { @@ -11791,7 +16249,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 922, + "id": 1236, "isConstant": false, "isLValue": false, "isPure": false, @@ -11800,26 +16258,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 919, + "id": 1233, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9049:2:1", + "referencedDeclaration": 1210, + "src": "11894:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 920, + "id": 1234, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9049:13:1", + "referencedDeclaration": 69, + "src": "11894:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -11830,14 +16288,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "30", - "id": 921, + "id": 1235, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "9066:1:1", + "src": "11911:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -11845,7 +16303,7 @@ }, "value": "0" }, - "src": "9049:18:1", + "src": "11894:18:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -11858,7 +16316,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 936, + "id": 1250, "isConstant": false, "isLValue": false, "isPure": false, @@ -11867,66 +16325,1176 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 933, + "id": 1247, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9152:2:1", + "referencedDeclaration": 1210, + "src": "11997:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_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" + }, + "id": 1248, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "11997:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 1249, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12014:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "11997:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1288, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12347:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1289, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "12347:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1290, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12364:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "12347:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1347, + "nodeType": "IfStatement", + "src": "12343:600:1", + "trueBody": { + "id": 1346, + "nodeType": "Block", + "src": "12367:576:1", + "statements": [ + { + "assignments": [ + 1295 + ], + "declarations": [ + { + "constant": false, + "id": 1295, + "name": "token_ids", + "nodeType": "VariableDeclaration", + "scope": 1346, + "src": "12381:26:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 1293, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12381:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1294, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12381:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1296, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "12381:26:1" + }, + { + "body": { + "id": 1329, + "nodeType": "Block", + "src": "12478:223:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1316, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1311, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12500:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1312, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "12500:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 1314, + "indexExpression": { + "argumentTypes": null, + "id": 1313, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1298, + "src": "12520:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12500:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "307846464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646", + "id": 1315, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12526:66:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", + "typeString": "int_const 1157...(70 digits omitted)...9935" + }, + "value": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + "src": "12500:92:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1328, + "nodeType": "IfStatement", + "src": "12496:191:1", + "trueBody": { + "id": 1327, + "nodeType": "Block", + "src": "12594:93:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1325, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1317, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1295, + "src": "12616:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 1320, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1318, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1295, + "src": "12626:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 1319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12626:16:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "12616:27:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1321, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12646:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1322, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "12646:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 1324, + "indexExpression": { + "argumentTypes": null, + "id": 1323, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1298, + "src": "12666:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12646:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12616:52:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1326, + "nodeType": "ExpressionStatement", + "src": "12616:52:1" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1301, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1298, + "src": "12438:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1302, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12442:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1303, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "12442:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 1304, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12442:26:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12471:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "12442:30:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12438:34:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1330, + "initializationExpression": { + "assignments": [ + 1298 + ], + "declarations": [ + { + "constant": false, + "id": 1298, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1330, + "src": "12426:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1297, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12426:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1300, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 1299, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12435:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "12426:10:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 1309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "12474:3:1", + "subExpression": { + "argumentTypes": null, + "id": 1308, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1298, + "src": "12474:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1310, + "nodeType": "ExpressionStatement", + "src": "12474:3:1" + }, + "nodeType": "ForStatement", + "src": "12421:280:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1332, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12812:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1333, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "12812:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1334, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12827:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1335, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "12827:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1337, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "12853:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 1336, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12845:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1338, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12845:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1339, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "12888:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12888:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1341, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12900:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1342, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "12900:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1343, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1295, + "src": "12921:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + ], + "id": 1331, + "name": "transfer_token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 616, + "src": "12797:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" + } + }, + "id": 1344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12797:134:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1345, + "nodeType": "ExpressionStatement", + "src": "12797:134:1" + } + ] } }, - "falseBody": null, - "id": 952, + "id": 1348, "nodeType": "IfStatement", - "src": "9148:172:1", + "src": "11993:950:1", "trueBody": { - "id": 951, + "id": 1287, "nodeType": "Block", - "src": "9172:148:1", + "src": "12017:312:1", "statements": [ + { + "assignments": [ + 1254 + ], + "declarations": [ + { + "constant": false, + "id": 1254, + "name": "token_ids_holder", + "nodeType": "VariableDeclaration", + "scope": 1287, + "src": "12031:33:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 1252, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12031:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1253, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12031:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1260, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1258, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12081:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1257, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "12067:13: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": 1255, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12071:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1256, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12071:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 1259, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12067:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12031:52:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1266, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "12131:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1267, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12131:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1268, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12143:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1269, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "12143:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1262, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12105:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1263, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "12105:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1261, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2290, + "src": "12098:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 1264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12098:24:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" + } + }, + "id": 1265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "approve", + "nodeType": "MemberAccess", + "referencedDeclaration": 2262, + "src": "12098:32:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 1270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12098:65:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1271, + "nodeType": "ExpressionStatement", + "src": "12098:65:1" + }, { "expression": { "argumentTypes": null, @@ -11935,26 +17503,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 938, + "id": 1273, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9201:2:1", + "referencedDeclaration": 1210, + "src": "12192:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 939, + "id": 1274, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9201:13:1", + "referencedDeclaration": 69, + "src": "12192:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -11964,26 +17532,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 940, + "id": 1275, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9216:2:1", + "referencedDeclaration": 1210, + "src": "12207:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 941, + "id": 1276, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_address", "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "9216:16:1", + "referencedDeclaration": 83, + "src": "12207:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -11994,14 +17562,14 @@ "arguments": [ { "argumentTypes": null, - "id": 943, + "id": 1278, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "9242:4:1", + "referencedDeclaration": 3680, + "src": "12233:4:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } } @@ -12009,24 +17577,24 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } ], - "id": 942, + "id": 1277, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "9234:7:1", + "src": "12225:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 944, + "id": 1279, "isConstant": false, "isLValue": false, "isPure": false, @@ -12034,7 +17602,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9234:13:1", + "src": "12225:13:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -12044,18 +17612,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 945, + "id": 1280, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "9277:3:1", + "referencedDeclaration": 3658, + "src": "12268:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 946, + "id": 1281, "isConstant": false, "isLValue": false, "isPure": false, @@ -12063,7 +17631,7 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "9277:10:1", + "src": "12268:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" @@ -12073,30 +17641,43 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 947, + "id": 1282, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9289:2:1", + "referencedDeclaration": 1210, + "src": "12280:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 948, + "id": 1283, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9289:19:1", + "referencedDeclaration": 81, + "src": "12280:19:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } + }, + { + "argumentTypes": null, + "id": 1284, + "name": "token_ids_holder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1254, + "src": "12301:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } } ], "expression": { @@ -12120,20 +17701,24 @@ { "typeIdentifier": "t_uint256", "typeString": "uint256" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } ], - "id": 937, + "id": 1272, "name": "transfer_token", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "9186:14:1", + "referencedDeclaration": 616, + "src": "12177: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)" + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" } }, - "id": 949, + "id": 1285, "isConstant": false, "isLValue": false, "isPure": false, @@ -12141,26 +17726,26 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9186:123:1", + "src": "12177:141:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 950, + "id": 1286, "nodeType": "ExpressionStatement", - "src": "9186:123:1" + "src": "12177:141:1" } ] } }, - "id": 953, + "id": 1349, "nodeType": "IfStatement", - "src": "9045:275:1", + "src": "11890:1053:1", "trueBody": { - "id": 932, + "id": 1246, "nodeType": "Block", - "src": "9069:65:1", + "src": "11914:65:1", "statements": [ { "expression": { @@ -12170,26 +17755,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 928, + "id": 1242, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9103:2:1", + "referencedDeclaration": 1210, + "src": "11948:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 929, + "id": 1243, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9103:19:1", + "referencedDeclaration": 81, + "src": "11948:19:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -12207,18 +17792,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 923, + "id": 1237, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "9083:3:1", + "referencedDeclaration": 3658, + "src": "11928:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 926, + "id": 1240, "isConstant": false, "isLValue": false, "isPure": false, @@ -12226,13 +17811,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "9083:10:1", + "src": "11928:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, - "id": 927, + "id": 1241, "isConstant": false, "isLValue": false, "isPure": false, @@ -12240,13 +17825,13 @@ "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "9083:19:1", + "src": "11928:19:1", "typeDescriptions": { "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256)" } }, - "id": 930, + "id": 1244, "isConstant": false, "isLValue": false, "isPure": false, @@ -12254,39 +17839,242 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9083:40:1", + "src": "11928:40:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1245, + "nodeType": "ExpressionStatement", + "src": "11928:40:1" + } + ] + } + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1351, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12972:2:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 931, - "nodeType": "ExpressionStatement", - "src": "9083:40:1" + "id": 1352, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "12972:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1353, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12979:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1354, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "12979:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1355, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12997:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1356, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "12997: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": 1350, + "name": "RefundSuccess", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "12958:13:1", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,uint256)" + } + }, + "id": 1357, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12958:59:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1358, + "nodeType": "EmitStatement", + "src": "12953:64:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 1363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1359, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "13027:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1361, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "13027:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1362, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13049:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13027:23:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1364, + "nodeType": "ExpressionStatement", + "src": "13027:23:1" } ] }, "documentation": null, - "id": 955, + "id": 1366, "implemented": true, "kind": "function", "modifiers": [], "name": "refund", "nodeType": "FunctionDefinition", "parameters": { - "id": 884, + "id": 1207, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 883, + "id": 1206, "name": "id", "nodeType": "VariableDeclaration", - "scope": 955, - "src": "8687:10:1", + "scope": 1366, + "src": "11703:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12294,10 +18082,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 882, + "id": 1205, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8687:7:1", + "src": "11703:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12307,35 +18095,35 @@ "visibility": "internal" } ], - "src": "8686:12:1" + "src": "11702:12:1" }, "returnParameters": { - "id": 885, + "id": 1208, "nodeType": "ParameterList", "parameters": [], - "src": "8706:0:1" + "src": "11722:0:1" }, - "scope": 956, - "src": "8671:655:1", + "scope": 1367, + "src": "11687:1370:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], - "scope": 957, - "src": "91:9358:1" + "scope": 1368, + "src": "218:12962:1" } ], - "src": "0:9450:1" + "src": "0:13181:1" }, "legacyAST": { - "absolutePath": "/Users/yisiliu/Workspace/DimensionDev/RedPacket/test/contracts/redpacket.sol", + "absolutePath": "/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol", "exportedSymbols": { "HappyRedPacket": [ - 956 + 1367 ] }, - "id": 957, + "id": 1368, "nodeType": "SourceUnit", "nodes": [ { @@ -12354,36 +18142,58 @@ "file": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol", "id": 59, "nodeType": "ImportDirective", - "scope": 957, - "sourceUnit": 1729, + "scope": 1368, + "sourceUnit": 2291, "src": "25:64:1", "symbolAliases": [], "unitAlias": "" }, + { + "absolutePath": "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol", + "file": "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol", + "id": 60, + "nodeType": "ImportDirective", + "scope": 1368, + "sourceUnit": 3503, + "src": "90:66:1", + "symbolAliases": [], + "unitAlias": "" + }, + { + "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", + "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", + "id": 61, + "nodeType": "ImportDirective", + "scope": 1368, + "sourceUnit": 1759, + "src": "157:59:1", + "symbolAliases": [], + "unitAlias": "" + }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, - "id": 956, + "id": 1367, "linearizedBaseContracts": [ - 956 + 1367 ], "name": "HappyRedPacket", "nodeType": "ContractDefinition", "nodes": [ { "canonicalName": "HappyRedPacket.RedPacket", - "id": 95, + "id": 94, "members": [ { "constant": false, - "id": 61, + "id": 63, "name": "id", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "149:10:1", + "scope": 94, + "src": "276:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12391,10 +18201,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 60, + "id": 62, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "149:7:1", + "src": "276:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -12405,25 +18215,25 @@ }, { "constant": false, - "id": 63, - "name": "ifrandom", + "id": 65, + "name": "hash", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "169:13:1", + "scope": 94, + "src": "296:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" }, "typeName": { - "id": 62, - "name": "bool", + "id": 64, + "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "169:4:1", + "src": "296:7:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, "value": null, @@ -12431,35 +18241,25 @@ }, { "constant": false, - "id": 66, - "name": "tokens", + "id": 67, + "name": "ifrandom", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "192:13:1", + "scope": 94, + "src": "318:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" + "typeIdentifier": "t_bool", + "typeString": "bool" }, "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", + "id": 66, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "318:4:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, "value": null, @@ -12467,11 +18267,11 @@ }, { "constant": false, - "id": 68, + "id": 69, "name": "token_type", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "215:15:1", + "scope": 94, + "src": "341:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12479,10 +18279,10 @@ "typeString": "uint256" }, "typeName": { - "id": 67, + "id": 68, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "215:4:1", + "src": "341:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -12493,27 +18293,25 @@ }, { "constant": false, - "id": 70, - "name": "creator", + "id": 71, + "name": "MAX_AMOUNT", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "240:15:1", + "scope": 94, + "src": "366:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, "typeName": { - "contractScope": null, - "id": 69, - "name": "Creator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 102, - "src": "240:7:1", + "id": 70, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "366:4:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, "value": null, @@ -12522,60 +18320,26 @@ { "constant": false, "id": 73, - "name": "hashes", + "name": "creator", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "265:16:1", + "scope": 94, + "src": "391:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" + "typeIdentifier": "t_struct$_Creator_$101_storage_ptr", + "typeString": "struct HappyRedPacket.Creator" }, "typeName": { - "baseType": { - "id": 71, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "265:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, + "contractScope": null, "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", + "name": "Creator", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 101, + "src": "391:7:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_struct$_Creator_$101_storage_ptr", + "typeString": "struct HappyRedPacket.Creator" } }, "value": null, @@ -12583,25 +18347,25 @@ }, { "constant": false, - "id": 77, - "name": "creator_name", + "id": 75, + "name": "total_number", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "318:19:1", + "scope": 94, + "src": "416:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" + "typeIdentifier": "t_uint8", + "typeString": "uint8" }, "typeName": { - "id": 76, - "name": "string", + "id": 74, + "name": "uint8", "nodeType": "ElementaryTypeName", - "src": "318:6:1", + "src": "416:5:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, "value": null, @@ -12609,25 +18373,25 @@ }, { "constant": false, - "id": 79, + "id": 77, "name": "claimed_number", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "347:19:1", + "scope": 94, + "src": "444:20:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" }, "typeName": { - "id": 78, - "name": "uint", + "id": 76, + "name": "uint8", "nodeType": "ElementaryTypeName", - "src": "347:4:1", + "src": "444:5:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, "value": null, @@ -12635,11 +18399,11 @@ }, { "constant": false, - "id": 81, + "id": 79, "name": "expiration_time", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "376:20:1", + "scope": 94, + "src": "474:20:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12647,10 +18411,10 @@ "typeString": "uint256" }, "typeName": { - "id": 80, + "id": 78, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "376:4:1", + "src": "474:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -12661,11 +18425,11 @@ }, { "constant": false, - "id": 83, + "id": 81, "name": "remaining_tokens", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "406:21:1", + "scope": 94, + "src": "504:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12673,10 +18437,10 @@ "typeString": "uint256" }, "typeName": { - "id": 82, + "id": 80, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "406:4:1", + "src": "504:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -12687,11 +18451,11 @@ }, { "constant": false, - "id": 85, + "id": 83, "name": "token_address", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "437:21:1", + "scope": 94, + "src": "535:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12699,10 +18463,10 @@ "typeString": "address" }, "typeName": { - "id": 84, + "id": 82, "name": "address", "nodeType": "ElementaryTypeName", - "src": "437:7:1", + "src": "535:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -12714,25 +18478,36 @@ }, { "constant": false, - "id": 87, - "name": "claimed_list_str", + "id": 86, + "name": "claimer_addrs", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "468:23:1", + "scope": 94, + "src": "566:23:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" }, "typeName": { - "id": 86, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "468:6:1", + "baseType": { + "id": 84, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "566:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 85, + "length": null, + "nodeType": "ArrayTypeName", + "src": "566:9:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" } }, "value": null, @@ -12740,36 +18515,35 @@ }, { "constant": false, - "id": 90, - "name": "claimer_addrs", + "id": 89, + "name": "erc721_token_ids", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "501:23:1", + "scope": 94, + "src": "599:26:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" }, "typeName": { "baseType": { - "id": 88, - "name": "address", + "id": 87, + "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "501:7:1", - "stateMutability": "nonpayable", + "src": "599:7:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 89, + "id": 88, "length": null, "nodeType": "ArrayTypeName", - "src": "501:9:1", + "src": "599:9:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, "value": null, @@ -12777,45 +18551,43 @@ }, { "constant": false, - "id": 94, - "name": "claimers", + "id": 93, + "name": "claimed", "nodeType": "VariableDeclaration", - "scope": 95, - "src": "534:36:1", + "scope": 94, + "src": "635:32:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer)" + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" }, "typeName": { - "id": 93, + "id": 92, "keyType": { - "id": 91, + "id": 90, "name": "address", "nodeType": "ElementaryTypeName", - "src": "542:7:1", + "src": "643:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", - "src": "534:27:1", + "src": "635:24:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Claimer_$111_storage_$", - "typeString": "mapping(address => struct HappyRedPacket.Claimer)" + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" }, "valueType": { - "contractScope": null, - "id": 92, - "name": "Claimer", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 111, - "src": "553:7:1", + "id": 91, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "654:4:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage_ptr", - "typeString": "struct HappyRedPacket.Claimer" + "typeIdentifier": "t_bool", + "typeString": "bool" } } }, @@ -12825,21 +18597,21 @@ ], "name": "RedPacket", "nodeType": "StructDefinition", - "scope": 956, - "src": "122:455:1", + "scope": 1367, + "src": "249:425:1", "visibility": "public" }, { "canonicalName": "HappyRedPacket.Creator", - "id": 102, + "id": 101, "members": [ { "constant": false, - "id": 97, + "id": 96, "name": "name", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "608:11:1", + "scope": 101, + "src": "705:11:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12847,10 +18619,10 @@ "typeString": "string" }, "typeName": { - "id": 96, + "id": 95, "name": "string", "nodeType": "ElementaryTypeName", - "src": "608:6:1", + "src": "705:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" @@ -12861,11 +18633,11 @@ }, { "constant": false, - "id": 99, + "id": 98, "name": "addr", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "629:12:1", + "scope": 101, + "src": "726:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12873,10 +18645,10 @@ "typeString": "address" }, "typeName": { - "id": 98, + "id": 97, "name": "address", "nodeType": "ElementaryTypeName", - "src": "629:7:1", + "src": "726:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -12888,11 +18660,11 @@ }, { "constant": false, - "id": 101, + "id": 100, "name": "message", "nodeType": "VariableDeclaration", - "scope": 102, - "src": "651:14:1", + "scope": 101, + "src": "748:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -12900,10 +18672,10 @@ "typeString": "string" }, "typeName": { - "id": 100, + "id": 99, "name": "string", "nodeType": "ElementaryTypeName", - "src": "651:6:1", + "src": "748:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" @@ -12915,143 +18687,28 @@ ], "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", + "scope": 1367, + "src": "680:89:1", "visibility": "public" }, { "anonymous": false, "documentation": null, - "id": 123, + "id": 116, "name": "CreationSuccess", "nodeType": "EventDefinition", "parameters": { - "id": 122, + "id": 115, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 113, + "id": 103, "indexed": false, "name": "total", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "834:10:1", + "scope": 116, + "src": "806:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13059,10 +18716,10 @@ "typeString": "uint256" }, "typeName": { - "id": 112, + "id": 102, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "834:4:1", + "src": "806:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -13073,12 +18730,12 @@ }, { "constant": false, - "id": 115, + "id": 105, "indexed": false, "name": "id", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "854:10:1", + "scope": 116, + "src": "826:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13086,10 +18743,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 114, + "id": 104, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "854:7:1", + "src": "826:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -13100,12 +18757,12 @@ }, { "constant": false, - "id": 117, + "id": 107, "indexed": false, "name": "creator", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "874:15:1", + "scope": 116, + "src": "846:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13113,10 +18770,10 @@ "typeString": "address" }, "typeName": { - "id": 116, + "id": 106, "name": "address", "nodeType": "ElementaryTypeName", - "src": "874:7:1", + "src": "846:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -13128,12 +18785,12 @@ }, { "constant": false, - "id": 119, + "id": 109, "indexed": false, "name": "creation_time", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "899:18:1", + "scope": 116, + "src": "871:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13141,10 +18798,10 @@ "typeString": "uint256" }, "typeName": { - "id": 118, + "id": 108, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "899:4:1", + "src": "871:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -13155,12 +18812,12 @@ }, { "constant": false, - "id": 121, + "id": 111, "indexed": false, "name": "token_address", "nodeType": "VariableDeclaration", - "scope": 123, - "src": "927:21:1", + "scope": 116, + "src": "899:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13168,10 +18825,10 @@ "typeString": "address" }, "typeName": { - "id": 120, + "id": 110, "name": "address", "nodeType": "ElementaryTypeName", - "src": "927:7:1", + "src": "899:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -13180,30 +18837,67 @@ }, "value": null, "visibility": "internal" + }, + { + "constant": false, + "id": 114, + "indexed": false, + "name": "erc721_token_ids", + "nodeType": "VariableDeclaration", + "scope": 116, + "src": "930:26:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 112, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "930:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 113, + "length": null, + "nodeType": "ArrayTypeName", + "src": "930:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" } ], - "src": "824:130:1" + "src": "796:166:1" }, - "src": "803:152:1" + "src": "775:188:1" }, { "anonymous": false, "documentation": null, - "id": 133, + "id": 129, "name": "ClaimSuccess", "nodeType": "EventDefinition", "parameters": { - "id": 132, + "id": 128, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 125, + "id": 118, "indexed": false, "name": "id", "nodeType": "VariableDeclaration", - "scope": 133, - "src": "989:10:1", + "scope": 129, + "src": "997:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13211,10 +18905,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 124, + "id": 117, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "989:7:1", + "src": "997:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -13225,12 +18919,12 @@ }, { "constant": false, - "id": 127, + "id": 120, "indexed": false, "name": "claimer", "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1009:15:1", + "scope": 129, + "src": "1017:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13238,10 +18932,10 @@ "typeString": "address" }, "typeName": { - "id": 126, + "id": 119, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1009:7:1", + "src": "1017:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -13253,12 +18947,12 @@ }, { "constant": false, - "id": 129, + "id": 122, "indexed": false, "name": "claimed_value", "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1034:18:1", + "scope": 129, + "src": "1042:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13266,10 +18960,10 @@ "typeString": "uint256" }, "typeName": { - "id": 128, + "id": 121, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1034:4:1", + "src": "1042:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -13280,12 +18974,12 @@ }, { "constant": false, - "id": 131, + "id": 124, "indexed": false, "name": "token_address", "nodeType": "VariableDeclaration", - "scope": 133, - "src": "1062:21:1", + "scope": 129, + "src": "1070:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13293,83 +18987,14 @@ "typeString": "address" }, "typeName": { - "id": 130, + "id": 123, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1062:7:1", + "src": "1070: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" + "typeIdentifier": "t_address", + "typeString": "address" } }, "value": null, @@ -13377,54 +19002,64 @@ }, { "constant": false, - "id": 139, + "id": 127, "indexed": false, - "name": "hash2", + "name": "token_id", "nodeType": "VariableDeclaration", - "scope": 141, - "src": "1162:13:1", + "scope": 129, + "src": "1101:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" }, "typeName": { - "id": 138, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1162:7:1", + "baseType": { + "id": 125, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "1101:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 126, + "length": null, + "nodeType": "ArrayTypeName", + "src": "1101:9:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, "value": null, "visibility": "internal" } ], - "src": "1109:72:1" + "src": "987:138:1" }, - "src": "1096:86:1" + "src": "969:157:1" }, { "anonymous": false, "documentation": null, - "id": 149, + "id": 137, "name": "RefundSuccess", "nodeType": "EventDefinition", "parameters": { - "id": 148, + "id": 136, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 143, + "id": 131, "indexed": false, "name": "id", "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1216:10:1", + "scope": 137, + "src": "1161:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13432,10 +19067,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 142, + "id": 130, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1216:7:1", + "src": "1161:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -13446,12 +19081,12 @@ }, { "constant": false, - "id": 145, + "id": 133, "indexed": false, "name": "token_address", "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1236:21:1", + "scope": 137, + "src": "1181:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13459,10 +19094,10 @@ "typeString": "address" }, "typeName": { - "id": 144, + "id": 132, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1236:7:1", + "src": "1181:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -13474,12 +19109,12 @@ }, { "constant": false, - "id": 147, + "id": 135, "indexed": false, "name": "remaining_balance", "nodeType": "VariableDeclaration", - "scope": 149, - "src": "1267:22:1", + "scope": 137, + "src": "1212:22:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -13487,10 +19122,10 @@ "typeString": "uint256" }, "typeName": { - "id": 146, + "id": 134, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1267:4:1", + "src": "1212:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -13500,17 +19135,17 @@ "visibility": "internal" } ], - "src": "1206:89:1" + "src": "1151:89:1" }, - "src": "1187:109:1" + "src": "1132:109:1" }, { "constant": false, - "id": 151, + "id": 139, "name": "nonce", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1302:10:1", + "scope": 1367, + "src": "1247:10:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -13518,10 +19153,10 @@ "typeString": "uint256" }, "typeName": { - "id": 150, + "id": 138, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "1302:4:1", + "src": "1247:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -13532,11 +19167,11 @@ }, { "constant": false, - "id": 153, + "id": 141, "name": "contract_creator", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1318:24:1", + "scope": 1367, + "src": "1263:31:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -13544,10 +19179,10 @@ "typeString": "address" }, "typeName": { - "id": 152, + "id": 140, "name": "address", "nodeType": "ElementaryTypeName", - "src": "1318:7:1", + "src": "1263:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -13555,48 +19190,48 @@ } }, "value": null, - "visibility": "internal" + "visibility": "public" }, { "constant": false, - "id": 157, + "id": 145, "name": "redpacket_by_id", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1348:45:1", + "scope": 1367, + "src": "1300:45:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" }, "typeName": { - "id": 156, + "id": 144, "keyType": { - "id": 154, + "id": 142, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1356:7:1", + "src": "1308:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Mapping", - "src": "1348:29:1", + "src": "1300:29:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" }, "valueType": { "contractScope": null, - "id": 155, + "id": 143, "name": "RedPacket", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "1367:9:1", + "referencedDeclaration": 94, + "src": "1319:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" } } @@ -13606,11 +19241,11 @@ }, { "constant": false, - "id": 160, + "id": 148, "name": "redpackets", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1399:21:1", + "scope": 1367, + "src": "1351:21:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -13619,19 +19254,19 @@ }, "typeName": { "baseType": { - "id": 158, + "id": 146, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1399:7:1", + "src": "1351:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 159, + "id": 147, "length": null, "nodeType": "ArrayTypeName", - "src": "1399:10:1", + "src": "1351:10:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", "typeString": "bytes32[]" @@ -13642,11 +19277,11 @@ }, { "constant": true, - "id": 163, + "id": 151, "name": "magic", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1426:105:1", + "scope": 1367, + "src": "1378:66:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -13654,10 +19289,10 @@ "typeString": "string" }, "typeName": { - "id": 161, + "id": 149, "name": "string", "nodeType": "ElementaryTypeName", - "src": "1426:6:1", + "src": "1378:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" @@ -13665,31 +19300,31 @@ }, "value": { "argumentTypes": null, - "hexValue": "466f726d6572204e6174696f6e616c204261736b657462616c6c204173736f63696174696f6e20284e42412920436f6d6d697373696f6e657220446176696420537465726e2068617320646965642e", - "id": 162, + "hexValue": "466f726d6572204e424120436f6d6d697373696f6e6572204461766964205374", + "id": 150, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "1450:81:1", + "src": "1410:34:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7d4f8d20362f4719f19c74721d909a5e78cf4a6c5c17229194ea4fc2e05eed05", - "typeString": "literal_string \"Former National Basketball Association (NBA) Commissioner David Stern has died.\"" + "typeIdentifier": "t_stringliteral_a58c4a8be3ed5c2bba4fce19b4e4fe34055a4a88c4449cf7cfcfe3110acfadba", + "typeString": "literal_string \"Former NBA Commissioner David St\"" }, - "value": "Former National Basketball Association (NBA) Commissioner David Stern has died." + "value": "Former NBA Commissioner David St" }, - "visibility": "internal" + "visibility": "private" }, { "constant": false, - "id": 165, + "id": 153, "name": "uuid", "nodeType": "VariableDeclaration", - "scope": 956, - "src": "1537:20:1", + "scope": 1367, + "src": "1462:20:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -13697,10 +19332,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 164, + "id": 152, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1537:7:1", + "src": "1462:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -13711,26 +19346,26 @@ }, { "body": { - "id": 184, + "id": 172, "nodeType": "Block", - "src": "1656:120:1", + "src": "1510:120:1", "statements": [ { "expression": { "argumentTypes": null, - "id": 171, + "id": 159, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 168, + "id": 156, "name": "contract_creator", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1666:16:1", + "referencedDeclaration": 141, + "src": "1520:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -13742,18 +19377,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 169, + "id": 157, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "1685:3:1", + "referencedDeclaration": 3658, + "src": "1539:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 170, + "id": 158, "isConstant": false, "isLValue": false, "isPure": false, @@ -13761,38 +19396,38 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "1685:10:1", + "src": "1539:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, - "src": "1666:29:1", + "src": "1520:29:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "id": 172, + "id": 160, "nodeType": "ExpressionStatement", - "src": "1666:29:1" + "src": "1520:29:1" }, { "expression": { "argumentTypes": null, - "id": 182, + "id": 170, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, - "id": 173, + "id": 161, "name": "uuid", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 165, - "src": "1705:4:1", + "referencedDeclaration": 153, + "src": "1559:4:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -13808,12 +19443,12 @@ "arguments": [ { "argumentTypes": null, - "id": 177, + "id": 165, "name": "magic", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 163, - "src": "1739:5:1", + "referencedDeclaration": 151, + "src": "1593:5:1", "typeDescriptions": { "typeIdentifier": "t_string_memory", "typeString": "string memory" @@ -13821,12 +19456,12 @@ }, { "argumentTypes": null, - "id": 178, + "id": 166, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "1746:3:1", + "referencedDeclaration": 3660, + "src": "1600:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -13834,12 +19469,12 @@ }, { "argumentTypes": null, - "id": 179, + "id": 167, "name": "contract_creator", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1751:16:1", + "referencedDeclaration": 141, + "src": "1605:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -13863,18 +19498,18 @@ ], "expression": { "argumentTypes": null, - "id": 175, + "id": 163, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "1722:3:1", + "referencedDeclaration": 3645, + "src": "1576:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 176, + "id": 164, "isConstant": false, "isLValue": false, "isPure": true, @@ -13882,13 +19517,13 @@ "memberName": "encodePacked", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "1722:16:1", + "src": "1576:16:1", "typeDescriptions": { "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 180, + "id": 168, "isConstant": false, "isLValue": false, "isPure": false, @@ -13896,7 +19531,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1722:46:1", + "src": "1576:46:1", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" @@ -13910,18 +19545,18 @@ "typeString": "bytes memory" } ], - "id": 174, + "id": 162, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "1712:9:1", + "referencedDeclaration": 3652, + "src": "1566:9:1", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 181, + "id": 169, "isConstant": false, "isLValue": false, "isPure": false, @@ -13929,105 +19564,672 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1712:57:1", + "src": "1566:57:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "1559:64:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 171, + "nodeType": "ExpressionStatement", + "src": "1559:64:1" + } + ] + }, + "documentation": null, + "id": 173, + "implemented": true, + "kind": "constructor", + "modifiers": [], + "name": "", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 154, + "nodeType": "ParameterList", + "parameters": [], + "src": "1500:2:1" + }, + "returnParameters": { + "id": 155, + "nodeType": "ParameterList", + "parameters": [], + "src": "1510:0:1" + }, + "scope": 1367, + "src": "1489:141:1", + "stateMutability": "nonpayable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 214, + "nodeType": "Block", + "src": "2013:181:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 197, + "name": "_hash", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 175, + "src": "2041:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 198, + "name": "_number", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 177, + "src": "2048:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + { + "argumentTypes": null, + "id": 199, + "name": "_ifrandom", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 179, + "src": "2057:9:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "id": 200, + "name": "_duration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 181, + "src": "2068:9:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 201, + "name": "_seed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 183, + "src": "2079:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 202, + "name": "_message", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 185, + "src": "2086:8:1", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "argumentTypes": null, + "id": 203, + "name": "_name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 187, + "src": "2096:5:1", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + { + "argumentTypes": null, + "id": 204, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 189, + "src": "2129:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 205, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 191, + "src": "2142:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 206, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 193, + "src": "2155:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "31", + "id": 210, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2184:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 209, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "2170:13: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": 207, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2174:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 208, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2174:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 211, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2170:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_address", + "typeString": "address" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + ], + "id": 196, + "name": "create_red_packet", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 215, + 508 + ], + "referencedDeclaration": 508, + "src": "2023:17:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_uint8_$_t_bool_$_t_uint256_$_t_bytes32_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (bytes32,uint8,bool,uint256,bytes32,string memory,string memory,uint256,address,uint256,uint256[] memory)" } }, - "src": "1705:64:1", + "id": 212, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2023:164:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "id": 183, + "id": 213, "nodeType": "ExpressionStatement", - "src": "1705:64:1" + "src": "2023:164:1" } ] }, "documentation": null, - "id": 185, + "id": 215, "implemented": true, - "kind": "constructor", + "kind": "function", "modifiers": [], - "name": "", + "name": "create_red_packet", "nodeType": "FunctionDefinition", "parameters": { - "id": 166, + "id": 194, "nodeType": "ParameterList", - "parameters": [], - "src": "1646:2:1" + "parameters": [ + { + "constant": false, + "id": 175, + "name": "_hash", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1748:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 174, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1748:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 177, + "name": "_number", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1763:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 176, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "1763:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 179, + "name": "_ifrandom", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1778:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 178, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1778:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 181, + "name": "_duration", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1794:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 180, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1794:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 183, + "name": "_seed", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1843:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 182, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "1843:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 185, + "name": "_message", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1858:22:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 184, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1858:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 187, + "name": "_name", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1882:19:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 186, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "1882:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 189, + "name": "_token_type", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1935:16:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 188, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1935:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 191, + "name": "_token_addr", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1953:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 190, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "1953:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 193, + "name": "_total_tokens", + "nodeType": "VariableDeclaration", + "scope": 215, + "src": "1974:18:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 192, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "1974:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "1747:246:1" }, "returnParameters": { - "id": 167, + "id": 195, "nodeType": "ParameterList", "parameters": [], - "src": "1656:0:1" + "src": "2013:0:1" }, - "scope": 956, - "src": "1635:141:1", - "stateMutability": "nonpayable", + "scope": 1367, + "src": "1720:474:1", + "stateMutability": "payable", "superFunction": null, "visibility": "public" }, { "body": { - "id": 508, + "id": 507, "nodeType": "Block", - "src": "2156:2321:1", + "src": "2646:1875:1", "statements": [ { "expression": { "argumentTypes": null, - "id": 209, + "id": 242, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftHandSide": { + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "2656:8:1", + "subExpression": { "argumentTypes": null, - "id": 207, + "id": 241, "name": "nonce", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "2166:5:1", + "referencedDeclaration": 139, + "src": "2656: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, + "id": 243, "nodeType": "ExpressionStatement", - "src": "2166:10:1" + "src": "2656:8:1" }, { "expression": { @@ -14039,19 +20241,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 215, + "id": 248, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 212, + "id": 245, "name": "nonce", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "2194:5:1", + "referencedDeclaration": 139, + "src": "2682:5:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -14063,18 +20265,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 213, + "id": 246, "name": "redpackets", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "2202:10:1", + "referencedDeclaration": 148, + "src": "2690:10:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", "typeString": "bytes32[] storage ref" } }, - "id": 214, + "id": 247, "isConstant": false, "isLValue": true, "isPure": false, @@ -14082,13 +20284,13 @@ "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2202:17:1", + "src": "2690:17:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2194:25:1", + "src": "2682:25:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -14096,21 +20298,21 @@ }, { "argumentTypes": null, - "hexValue": "3030302074727920616761696e206c61746572", - "id": 216, + "hexValue": "303030", + "id": 249, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2221:21:1", + "src": "2709:5:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9add011834ce6f1e96d072b9f48b75881e32c05397de40574f621d8ae7053c26", - "typeString": "literal_string \"000 try again later\"" + "typeIdentifier": "t_stringliteral_35b5b8bece53958bb309db665734c38515f37439f69bfdbc64808f1af9a97c31", + "typeString": "literal_string \"000\"" }, - "value": "000 try again later" + "value": "000" } ], "expression": { @@ -14120,25 +20322,25 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_9add011834ce6f1e96d072b9f48b75881e32c05397de40574f621d8ae7053c26", - "typeString": "literal_string \"000 try again later\"" + "typeIdentifier": "t_stringliteral_35b5b8bece53958bb309db665734c38515f37439f69bfdbc64808f1af9a97c31", + "typeString": "literal_string \"000\"" } ], - "id": 211, + "id": 244, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1746, - 1747 + 3661, + 3662 ], - "referencedDeclaration": 1747, - "src": "2186:7:1", + "referencedDeclaration": 3662, + "src": "2674:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 217, + "id": 250, "isConstant": false, "isLValue": false, "isPure": false, @@ -14146,15 +20348,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2186:57:1", + "src": "2674:41:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 218, + "id": 251, "nodeType": "ExpressionStatement", - "src": "2186:57:1" + "src": "2674:41:1" }, { "expression": { @@ -14166,19 +20368,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 223, + "id": 255, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 220, + "id": 253, "name": "_total_tokens", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2262:13:1", + "referencedDeclaration": 235, + "src": "2733:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -14188,34 +20390,18 @@ "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", + "id": 254, + "name": "_number", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 219, + "src": "2750:7:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "src": "2262:31:1", + "src": "2733:24:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -14223,21 +20409,21 @@ }, { "argumentTypes": null, - "hexValue": "303031204174206c65617374205b6e756d626572206f6620726564207061636b6574735d20746f6b656e7320746f20796f757220726564207061636b65742e", - "id": 224, + "hexValue": "303031", + "id": 256, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "2311:65:1", + "src": "2759:5:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_11d6ebd9aff304f907e6eb3e95d72a807d0943fd9daef427f13cfb099a04b7fd", - "typeString": "literal_string \"001 At least [number of red packets] tokens to your red packet.\"" + "typeIdentifier": "t_stringliteral_724f6bdc92705714b251fdfe205b952f71c1b25dac823eb448ff509b43ca2005", + "typeString": "literal_string \"001\"" }, - "value": "001 At least [number of red packets] tokens to your red packet." + "value": "001" } ], "expression": { @@ -14247,25 +20433,25 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_11d6ebd9aff304f907e6eb3e95d72a807d0943fd9daef427f13cfb099a04b7fd", - "typeString": "literal_string \"001 At least [number of red packets] tokens to your red packet.\"" + "typeIdentifier": "t_stringliteral_724f6bdc92705714b251fdfe205b952f71c1b25dac823eb448ff509b43ca2005", + "typeString": "literal_string \"001\"" } ], - "id": 219, + "id": 252, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1746, - 1747 + 3661, + 3662 ], - "referencedDeclaration": 1747, - "src": "2254:7:1", + "referencedDeclaration": 3662, + "src": "2725:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 225, + "id": 257, "isConstant": false, "isLValue": false, "isPure": false, @@ -14273,258 +20459,735 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2254:123:1", + "src": "2725:40:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 226, + "id": 258, "nodeType": "ExpressionStatement", - "src": "2254:123:1" + "src": "2725:40:1" }, { "expression": { "argumentTypes": null, "arguments": [ { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 262, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 260, + "name": "_number", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 219, + "src": "2783:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 261, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2793:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2783:11:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303032", + "id": 263, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2796:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_06c34db6f65efc7a8a660fab3d9cc5dd13bff15dd1af935465134c67942a95e6", + "typeString": "literal_string \"002\"" + }, + "value": "002" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_06c34db6f65efc7a8a660fab3d9cc5dd13bff15dd1af935465134c67942a95e6", + "typeString": "literal_string \"002\"" + } + ], + "id": 259, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "2775:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2775:27:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 265, + "nodeType": "ExpressionStatement", + "src": "2775:27:1" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 268, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 266, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 231, + "src": "2817:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 267, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2832:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "2817:16:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 280, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 278, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 231, + "src": "2928:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 279, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2943:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "2928:16:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 231, + "id": 322, "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": 320, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 231, + "src": "3260:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 321, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3275:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "3260:16:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 350, + "nodeType": "IfStatement", + "src": "3256:319:1", + "trueBody": { + "id": 349, + "nodeType": "Block", + "src": "3278:297:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 328, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "3338:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 329, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3338:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 331, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "3358:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 330, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3350:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 332, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3350: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": 325, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 233, + "src": "3308:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 324, + "name": "IERC721", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3502, + "src": "3300:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", + "typeString": "type(contract IERC721)" + } + }, + "id": 326, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3300:20:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC721_$3502", + "typeString": "contract IERC721" + } + }, + "id": 327, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "isApprovedForAll", + "nodeType": "MemberAccess", + "referencedDeclaration": 3490, + "src": "3300:37:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_bool_$", + "typeString": "function (address,address) view external returns (bool)" + } + }, + "id": 333, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3300:64:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303131", + "id": 334, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3366:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", + "typeString": "literal_string \"011\"" + }, + "value": "011" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", + "typeString": "literal_string \"011\"" + } + ], + "id": 323, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "3292:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3292:80:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 336, + "nodeType": "ExpressionStatement", + "src": "3292:80:1" }, - "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" + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 338, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 231, + "src": "3401:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 339, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 233, + "src": "3414:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 340, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "3427:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 341, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3427:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 343, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "3447:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 342, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "3439:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3439:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 345, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "3454:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 346, + "name": "_erc721_token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 238, + "src": "3469:17:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + ], + "id": 337, + "name": "transfer_token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 616, + "src": "3386:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" + } + }, + "id": 347, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3386:101:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 348, + "nodeType": "ExpressionStatement", + "src": "3386:101:1" } - }, - "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, + "id": 351, "nodeType": "IfStatement", - "src": "2599:286:1", + "src": "2924:651:1", "trueBody": { - "id": 276, + "id": 319, "nodeType": "Block", - "src": "2621:264:1", + "src": "2946:296:1", "statements": [ { "expression": { @@ -14536,7 +21199,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 261, + "id": 293, "isConstant": false, "isLValue": false, "isPure": false, @@ -14548,18 +21211,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 254, + "id": 286, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2673:3:1", + "referencedDeclaration": 3658, + "src": "2998:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 255, + "id": 287, "isConstant": false, "isLValue": false, "isPure": false, @@ -14567,7 +21230,7 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2673:10:1", + "src": "2998:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" @@ -14578,14 +21241,14 @@ "arguments": [ { "argumentTypes": null, - "id": 257, + "id": 289, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "2693:4:1", + "referencedDeclaration": 3680, + "src": "3018:4:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } } @@ -14593,24 +21256,24 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } ], - "id": 256, + "id": 288, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "2685:7:1", + "src": "3010:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 258, + "id": 290, "isConstant": false, "isLValue": false, "isPure": false, @@ -14618,7 +21281,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2685:13:1", + "src": "3010:13:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -14641,12 +21304,12 @@ "arguments": [ { "argumentTypes": null, - "id": 251, + "id": 283, "name": "_token_addr", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "2650:11:1", + "referencedDeclaration": 233, + "src": "2975:11:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -14660,18 +21323,18 @@ "typeString": "address" } ], - "id": 250, + "id": 282, "name": "IERC20", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "2643:6:1", + "referencedDeclaration": 2290, + "src": "2968:6:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", "typeString": "type(contract IERC20)" } }, - "id": 252, + "id": 284, "isConstant": false, "isLValue": false, "isPure": false, @@ -14679,27 +21342,27 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2643:19:1", + "src": "2968:19:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$1728", + "typeIdentifier": "t_contract$_IERC20_$2290", "typeString": "contract IERC20" } }, - "id": 253, + "id": 285, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "allowance", "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "2643:29:1", + "referencedDeclaration": 2253, + "src": "2968: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, + "id": 291, "isConstant": false, "isLValue": false, "isPure": false, @@ -14707,7 +21370,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2643:56:1", + "src": "2968:56:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -14717,84 +21380,205 @@ "operator": ">=", "rightExpression": { "argumentTypes": null, - "id": 260, + "id": 292, "name": "_total_tokens", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2703:13:1", + "referencedDeclaration": 235, + "src": "3028:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2968:73:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303039", + "id": 294, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3043:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_f1f53a772d6477eea2442888ded82401b11c74ea298b046a645e45bcb19dec14", + "typeString": "literal_string \"009\"" + }, + "value": "009" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_f1f53a772d6477eea2442888ded82401b11c74ea298b046a645e45bcb19dec14", + "typeString": "literal_string \"009\"" + } + ], + "id": 281, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "2960:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 295, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2960:89:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 296, + "nodeType": "ExpressionStatement", + "src": "2960:89:1" + }, + { + "assignments": [ + 300 + ], + "declarations": [ + { + "constant": false, + "id": 300, + "name": "token_ids_holder", + "nodeType": "VariableDeclaration", + "scope": 319, + "src": "3063:34:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 298, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3063:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "2643:73:1", + "id": 299, + "length": null, + "nodeType": "ArrayTypeName", + "src": "3063:10:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, + "value": null, + "visibility": "internal" + } + ], + "id": 306, + "initialValue": { + "argumentTypes": null, + "arguments": [ { "argumentTypes": null, - "hexValue": "30303920596f75206861766520746f2073657420656e6f75676820616c6c6f77616e63652e", - "id": 262, + "hexValue": "30", + "id": 304, "isConstant": false, "isLValue": false, "isPure": true, - "kind": "string", + "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "2738:39:1", + "src": "3114:1:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_045c3fdbe9be7c410557980ae9d07d09e642d6b0a93c8a557bf0962856b8cac8", - "typeString": "literal_string \"009 You have to set enough allowance.\"" + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" }, - "value": "009 You have to set enough allowance." + "value": "0" } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_045c3fdbe9be7c410557980ae9d07d09e642d6b0a93c8a557bf0962856b8cac8", - "typeString": "literal_string \"009 You have to set enough allowance.\"" + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" } ], - "id": 249, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2635:7:1", + "id": 303, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "3100:13:1", "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", + "typeString": "function (uint256) pure returns (uint256[] memory)" + }, + "typeName": { + "baseType": { + "id": 301, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "3104:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 302, + "length": null, + "nodeType": "ArrayTypeName", + "src": "3104:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } } }, - "id": 263, + "id": 305, "isConstant": false, "isLValue": false, - "isPure": false, + "isPure": true, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2635:143:1", + "src": "3100:16:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" } }, - "id": 264, - "nodeType": "ExpressionStatement", - "src": "2635:143:1" + "nodeType": "VariableDeclarationStatement", + "src": "3063:53:1" }, { "expression": { @@ -14802,12 +21586,12 @@ "arguments": [ { "argumentTypes": null, - "id": 266, + "id": 308, "name": "_token_type", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "2807:11:1", + "referencedDeclaration": 231, + "src": "3146:11:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -14815,12 +21599,12 @@ }, { "argumentTypes": null, - "id": 267, + "id": 309, "name": "_token_addr", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "2820:11:1", + "referencedDeclaration": 233, + "src": "3159:11:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -14830,18 +21614,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 268, + "id": 310, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2833:3:1", + "referencedDeclaration": 3658, + "src": "3172:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 269, + "id": 311, "isConstant": false, "isLValue": false, "isPure": false, @@ -14849,7 +21633,7 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2833:10:1", + "src": "3172:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" @@ -14860,14 +21644,14 @@ "arguments": [ { "argumentTypes": null, - "id": 271, + "id": 313, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "2853:4:1", + "referencedDeclaration": 3680, + "src": "3192:4:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } } @@ -14875,24 +21659,24 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } ], - "id": 270, + "id": 312, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "2845:7:1", + "src": "3184:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 272, + "id": 314, "isConstant": false, "isLValue": false, "isPure": false, @@ -14900,7 +21684,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2845:13:1", + "src": "3184:13:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -14908,16 +21692,29 @@ }, { "argumentTypes": null, - "id": 273, + "id": 315, "name": "_total_tokens", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2860:13:1", + "referencedDeclaration": 235, + "src": "3199:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } + }, + { + "argumentTypes": null, + "id": 316, + "name": "token_ids_holder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 300, + "src": "3214:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } } ], "expression": { @@ -14941,20 +21738,24 @@ { "typeIdentifier": "t_uint256", "typeString": "uint256" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } ], - "id": 265, + "id": 307, "name": "transfer_token", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "2792:14:1", + "referencedDeclaration": 616, + "src": "3131: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)" + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" } }, - "id": 274, + "id": 317, "isConstant": false, "isLValue": false, "isPure": false, @@ -14962,453 +21763,1213 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "2792:82:1", + "src": "3131:100:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 275, + "id": 318, "nodeType": "ExpressionStatement", - "src": "2792:82:1" + "src": "3131:100:1" } ] } }, - "id": 278, + "id": 352, "nodeType": "IfStatement", - "src": "2476:409:1", + "src": "2813:762:1", "trueBody": { - "expression": { - "argumentTypes": null, - "arguments": [ - { + "id": 277, + "nodeType": "Block", + "src": "2835:67:1", + "statements": [ + { + "expression": { "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 273, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 270, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "2857:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "value", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "2857:9:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 272, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "2870:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "2857:26:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303038", + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2885:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_02548246e64702b5865ec88120494d1082d4d663fdcca59525f26e7037975219", + "typeString": "literal_string \"008\"" + }, + "value": "008" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_02548246e64702b5865ec88120494d1082d4d663fdcca59525f26e7037975219", + "typeString": "literal_string \"008\"" + } + ], + "id": 269, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "2849:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } }, - "id": 242, + "id": 275, "isConstant": false, "isLValue": false, "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "leftExpression": { + "names": [], + "nodeType": "FunctionCall", + "src": "2849:42:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 276, + "nodeType": "ExpressionStatement", + "src": "2849:42:1" + } + ] + } + }, + { + "assignments": [ + 354 + ], + "declarations": [ + { + "constant": false, + "id": 354, + "name": "_id", + "nodeType": "VariableDeclaration", + "scope": 507, + "src": "3585:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 353, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "3585:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 366, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 239, + "id": 358, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "2518:3:1", + "referencedDeclaration": 3658, + "src": "3626:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 240, + "id": 359, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "memberName": "value", + "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "2518:9:1", + "src": "3626:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 360, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "3638:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { + { + "argumentTypes": null, + "id": 361, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "3643:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 362, + "name": "uuid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "3650:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 363, + "name": "_seed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 225, + "src": "3656: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": 241, - "name": "_total_tokens", + "id": 356, + "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "2531:13:1", + "referencedDeclaration": 3645, + "src": "3609:3:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_magic_abi", + "typeString": "abi" } }, - "src": "2518:26:1", + "id": 357, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3609:16:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" } }, + "id": 364, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3609:53:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 355, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3652, + "src": "3599:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 365, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3599:64:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3585:78:1" + }, + { + "assignments": [ + 368 + ], + "declarations": [ + { + "constant": false, + "id": 368, + "name": "rp", + "nodeType": "VariableDeclaration", + "scope": 507, + "src": "3673:20:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + }, + "typeName": { + "contractScope": null, + "id": 367, + "name": "RedPacket", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 94, + "src": "3673:9:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 372, + "initialValue": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 369, + "name": "redpacket_by_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 145, + "src": "3696:15:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", + "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" + } + }, + "id": 371, + "indexExpression": { + "argumentTypes": null, + "id": 370, + "name": "_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 354, + "src": "3712:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "3696:20:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage", + "typeString": "struct HappyRedPacket.RedPacket storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "3673:43:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 377, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 373, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3726:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 375, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "3726:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 376, + "name": "_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 354, + "src": "3734:3:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "3726:11:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "id": 378, + "nodeType": "ExpressionStatement", + "src": "3726:11:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { "argumentTypes": null, - "hexValue": "30303820596f75206861766520746f2073656e6420656e6f75676820746f6b656e732e", - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2546:37:1", - "subdenomination": null, + "id": 382, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3763:2:1", "typeDescriptions": { - "typeIdentifier": "t_stringliteral_7056057dcb86c508a9987cd8948bb05c548c32af095f20744e77091b4c57ce0c", - "typeString": "literal_string \"008 You have to send enough tokens.\"" - }, - "value": "008 You have to send enough tokens." + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 383, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "3763:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "expression": { + "argumentTypes": null, + "id": 379, + "name": "redpackets", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 148, + "src": "3747:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", + "typeString": "bytes32[] storage ref" + } + }, + "id": 381, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3747:15:1", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", + "typeString": "function (bytes32) returns (uint256)" + } + }, + "id": 384, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3747:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 385, + "nodeType": "ExpressionStatement", + "src": "3747:22:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 386, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3780:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } - ], + }, + "id": 388, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "3780:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 389, + "name": "_token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 231, + "src": "3796:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3780:27:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 391, + "nodeType": "ExpressionStatement", + "src": "3780:27:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 396, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, "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", + "argumentTypes": null, + "id": 392, + "name": "rp", "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "2510:7:1", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3817:2:1", "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 244, + "id": 394, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2510:74:1", + "lValueRequested": true, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "3817:16:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_address", + "typeString": "address" } }, - "id": 245, - "nodeType": "ExpressionStatement", - "src": "2510:74:1" - } + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 395, + "name": "_token_addr", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 233, + "src": "3836:11:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "3817:30:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 397, + "nodeType": "ExpressionStatement", + "src": "3817:30: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", + "expression": { + "argumentTypes": null, + "id": 402, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 398, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3858:2:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "value": null, - "visibility": "internal" + "id": 400, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "3858:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 401, + "name": "_number", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 219, + "src": "3876:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "3858:25:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" } - ], - "id": 292, - "initialValue": { + }, + "id": 403, + "nodeType": "ExpressionStatement", + "src": "3858:25:1" + }, + { + "expression": { "argumentTypes": null, - "arguments": [ - { + "id": 408, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 404, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3893:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 406, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "3893:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 407, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "3915:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "3893:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 409, + "nodeType": "ExpressionStatement", + "src": "3893:35:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 417, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { "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", + "argumentTypes": null, + "id": 410, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3939:2:1", "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 290, + "id": 413, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, - "kind": "functionCall", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2919:53:1", + "memberName": "creator", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "3939:10:1", "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" + "typeIdentifier": "t_struct$_Creator_$101_storage", + "typeString": "struct HappyRedPacket.Creator storage ref" } + }, + "id": 414, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "addr", + "nodeType": "MemberAccess", + "referencedDeclaration": 98, + "src": "3939:15:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 415, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "3957:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" } - ], - "id": 281, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "2909:9:1", + }, + "id": 416, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "3957:10:1", "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "id": 291, + "src": "3939:28:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 418, + "nodeType": "ExpressionStatement", + "src": "3939:28:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 425, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "functionCall", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2909:64:1", + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 419, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "3977:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 422, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "creator", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "3977:10:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Creator_$101_storage", + "typeString": "struct HappyRedPacket.Creator storage ref" + } + }, + "id": 423, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "name", + "nodeType": "MemberAccess", + "referencedDeclaration": 96, + "src": "3977:15:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "id": 424, + "name": "_name", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 229, + "src": "3995:5:1", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" + } + }, + "src": "3977:23:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" } }, - "nodeType": "VariableDeclarationStatement", - "src": "2895:78:1" + "id": 426, + "nodeType": "ExpressionStatement", + "src": "3977:23: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", + "expression": { + "argumentTypes": null, + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 427, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4010:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 430, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "creator", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "4010:10:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" + "typeIdentifier": "t_struct$_Creator_$101_storage", + "typeString": "struct HappyRedPacket.Creator storage ref" } }, - "value": null, - "visibility": "internal" - } - ], - "id": 298, - "initialValue": { - "argumentTypes": null, - "baseExpression": { + "id": 431, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "message", + "nodeType": "MemberAccess", + "referencedDeclaration": 100, + "src": "4010:18:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { "argumentTypes": null, - "id": 295, - "name": "redpacket_by_id", + "id": 432, + "name": "_message", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "3006:15:1", + "referencedDeclaration": 227, + "src": "4031:8:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" } }, - "id": 297, - "indexExpression": { + "src": "4010:29:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage", + "typeString": "string storage ref" + } + }, + "id": 434, + "nodeType": "ExpressionStatement", + "src": "4010:29:1" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "id": 296, - "name": "_id", + "id": 435, + "name": "_duration", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 280, - "src": "3022:3:1", + "referencedDeclaration": 223, + "src": "4054:9:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3006:20:1", + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4067:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4054:14:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "nodeType": "VariableDeclarationStatement", - "src": "2983:43:1" + "falseBody": null, + "id": 442, + "nodeType": "IfStatement", + "src": "4050:49:1", + "trueBody": { + "expression": { + "argumentTypes": null, + "id": 440, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 438, + "name": "_duration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 223, + "src": "4082:9:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "3836343030", + "id": 439, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4094:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_86400_by_1", + "typeString": "int_const 86400" + }, + "value": "86400" + }, + "src": "4082:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 441, + "nodeType": "ExpressionStatement", + "src": "4082:17:1" + } }, { "expression": { "argumentTypes": null, - "id": 303, + "id": 451, "isConstant": false, "isLValue": false, "isPure": false, @@ -15417,146 +22978,196 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 299, + "id": 443, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3036:2:1", + "referencedDeclaration": 368, + "src": "4120:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 301, + "id": 445, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "id", + "memberName": "expiration_time", "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3036:5:1", + "referencedDeclaration": 79, + "src": "4120:18:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, "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, + "arguments": [ + { + "argumentTypes": null, + "id": 448, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "4154:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 449, + "name": "_duration", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 223, + "src": "4159:9:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], "expression": { "argumentTypes": null, - "id": 308, - "name": "rp", + "id": 446, + "name": "SafeMath", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3073:2:1", + "referencedDeclaration": 1758, + "src": "4141:8:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" } }, - "id": 309, + "id": 447, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, "lValueRequested": false, - "memberName": "id", + "memberName": "add", "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "3073:5:1", + "referencedDeclaration": 1598, + "src": "4141:12:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" } + }, + "id": 450, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4141:28:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], + }, + "src": "4120:49:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 452, + "nodeType": "ExpressionStatement", + "src": "4120:49:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 457, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 305, - "name": "redpackets", + "id": 453, + "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 160, - "src": "3057:10:1", + "referencedDeclaration": 368, + "src": "4180:2:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 307, + "id": 455, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, - "lValueRequested": false, - "memberName": "push", + "lValueRequested": true, + "memberName": "claimed_number", "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3057:15:1", + "referencedDeclaration": 77, + "src": "4180:17:1", "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) returns (uint256)" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "id": 310, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3057:22:1", + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 456, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4200:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "4180:21:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "id": 311, + "id": 458, "nodeType": "ExpressionStatement", - "src": "3057:22:1" + "src": "4180:21:1" }, { "expression": { "argumentTypes": null, - "id": 316, + "id": 463, "isConstant": false, "isLValue": false, "isPure": false, @@ -15565,60 +23176,60 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 312, + "id": 459, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3090:2:1", + "referencedDeclaration": 368, + "src": "4211:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 314, + "id": 461, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "token_type", + "memberName": "ifrandom", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "3090:13:1", + "referencedDeclaration": 67, + "src": "4211:11:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 315, - "name": "_token_type", + "id": 462, + "name": "_ifrandom", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 200, - "src": "3106:11:1", + "referencedDeclaration": 221, + "src": "4225:9:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "src": "3090:27:1", + "src": "4211:23:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "id": 317, + "id": 464, "nodeType": "ExpressionStatement", - "src": "3090:27:1" + "src": "4211:23:1" }, { "expression": { "argumentTypes": null, - "id": 322, + "id": 469, "isConstant": false, "isLValue": false, "isPure": false, @@ -15627,60 +23238,60 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 318, + "id": 465, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3127:2:1", + "referencedDeclaration": 368, + "src": "4244:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 320, + "id": 467, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "token_address", + "memberName": "hash", "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "3127:16:1", + "referencedDeclaration": 65, + "src": "4244:7:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 321, - "name": "_token_addr", + "id": 468, + "name": "_hash", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 202, - "src": "3146:11:1", + "referencedDeclaration": 217, + "src": "4254:5:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "src": "3127:30:1", + "src": "4244:15:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "id": 323, + "id": 470, "nodeType": "ExpressionStatement", - "src": "3127:30:1" + "src": "4244:15:1" }, { "expression": { "argumentTypes": null, - "id": 329, + "id": 484, "isConstant": false, "isLValue": false, "isPure": false, @@ -15689,26 +23300,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 324, + "id": 471, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3168:2:1", + "referencedDeclaration": 368, + "src": "4269:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 326, + "id": 473, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "total_number", + "memberName": "MAX_AMOUNT", "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3168:15:1", + "referencedDeclaration": 71, + "src": "4269:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -15718,47 +23329,190 @@ "operator": "=", "rightHandSide": { "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 478, + "name": "_total_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 235, + "src": "4311:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 479, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4326:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 480, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "4326:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "argumentTypes": null, + "id": 476, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "4298:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 477, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 1691, + "src": "4298:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4298:44:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "32", + "id": 482, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4344:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + } + ], "expression": { - "argumentTypes": null, - "id": 327, - "name": "_hashes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 188, - "src": "3186:7:1", + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + } + ], + "expression": { + "argumentTypes": null, + "id": 474, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "4285:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 1675, + "src": "4285:12:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_memory_ptr", - "typeString": "bytes32[] memory" + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" } }, - "id": 328, + "id": 483, "isConstant": false, "isLValue": false, "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3186:14:1", + "names": [], + "nodeType": "FunctionCall", + "src": "4285:61:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3168:32:1", + "src": "4269:77:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 330, + "id": 485, "nodeType": "ExpressionStatement", - "src": "3168:32:1" + "src": "4269:77:1" }, { "expression": { "argumentTypes": null, - "id": 335, + "id": 490, "isConstant": false, "isLValue": false, "isPure": false, @@ -15767,1647 +23521,2854 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 331, + "id": 486, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3210:2:1", + "referencedDeclaration": 368, + "src": "4356:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 333, + "id": 488, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "remaining_tokens", + "memberName": "erc721_token_ids", "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3210:19:1", + "referencedDeclaration": 89, + "src": "4356:19:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, - "id": 334, - "name": "_total_tokens", + "id": 489, + "name": "_erc721_token_ids", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 204, - "src": "3232:13:1", + "referencedDeclaration": 238, + "src": "4378:17:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } }, - "src": "3210:35:1", + "src": "4356:39:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } }, - "id": 336, + "id": 491, "nodeType": "ExpressionStatement", - "src": "3210:35:1" + "src": "4356:39:1" }, { - "expression": { + "eventCall": { "argumentTypes": null, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { + "arguments": [ + { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 337, + "id": 493, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3256:2:1", + "referencedDeclaration": 368, + "src": "4426:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 340, + "id": 494, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "creator", + "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "3256:10:1", + "referencedDeclaration": 81, + "src": "4426:19:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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", + "expression": { + "argumentTypes": null, + "id": 495, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4447:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 496, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "4447:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 497, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4454:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 498, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "creator", + "nodeType": "MemberAccess", + "referencedDeclaration": 73, + "src": "4454:10:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_Creator_$101_storage", + "typeString": "struct HappyRedPacket.Creator storage ref" + } + }, + "id": 499, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "addr", + "nodeType": "MemberAccess", + "referencedDeclaration": 98, + "src": "4454:15:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 500, + "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "3274:3:1", + "referencedDeclaration": 3660, + "src": "4471:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 501, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 368, + "src": "4476:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 502, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "4476:16:1", "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" + "typeIdentifier": "t_address", + "typeString": "address" } }, - "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, + "id": 503, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3294:2:1", + "referencedDeclaration": 368, + "src": "4494:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 349, + "id": 504, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "creator", + "memberName": "erc721_token_ids", "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "3294:10:1", + "referencedDeclaration": 89, + "src": "4494:19:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] 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", + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + ], + "id": 492, + "name": "CreationSuccess", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 198, - "src": "3312:5:1", + "referencedDeclaration": 116, + "src": "4410:15:1", "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,bytes32,address,uint256,address,uint256[] memory)" } }, - "src": "3294:23:1", + "id": 505, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4410:104:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 506, + "nodeType": "EmitStatement", + "src": "4405:109:1" + } + ] + }, + "documentation": null, + "id": 508, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "create_red_packet", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 239, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 217, + "name": "_hash", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2312:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 216, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2312:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 219, + "name": "_number", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2327:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "typeName": { + "id": 218, + "name": "uint8", + "nodeType": "ElementaryTypeName", + "src": "2327:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 221, + "name": "_ifrandom", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2342:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 220, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "2342:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 223, + "name": "_duration", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2358:14:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 222, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2358:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 225, + "name": "_seed", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2407:13:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 224, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "2407:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 227, + "name": "_message", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2422:22:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 226, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2422:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 229, + "name": "_name", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2446:19:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string" + }, + "typeName": { + "id": 228, + "name": "string", + "nodeType": "ElementaryTypeName", + "src": "2446:6:1", + "typeDescriptions": { + "typeIdentifier": "t_string_storage_ptr", + "typeString": "string" } }, - "id": 353, - "nodeType": "ExpressionStatement", - "src": "3294:23:1" + "value": null, + "visibility": "internal" }, { - "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", + "constant": false, + "id": 231, + "name": "_token_type", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2499:16:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 230, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2499:4:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 361, - "nodeType": "ExpressionStatement", - "src": "3327:29:1" + "value": null, + "visibility": "internal" }, { - "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", + "constant": false, + "id": 233, + "name": "_token_addr", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2517:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 232, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "2517:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_address", + "typeString": "address" } }, - "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" - } + "value": null, + "visibility": "internal" }, { - "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", + "constant": false, + "id": 235, + "name": "_total_tokens", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2538:18:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 234, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "2538:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 238, + "name": "_erc721_token_ids", + "nodeType": "VariableDeclaration", + "scope": 508, + "src": "2590:34:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 236, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2590:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3437:36:1", + "id": 237, + "length": null, + "nodeType": "ArrayTypeName", + "src": "2590:9:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, - "id": 377, - "nodeType": "ExpressionStatement", - "src": "3437:36:1" - }, + "value": null, + "visibility": "internal" + } + ], + "src": "2311:314:1" + }, + "returnParameters": { + "id": 240, + "nodeType": "ParameterList", + "parameters": [], + "src": "2646:0:1" + }, + "scope": 1367, + "src": "2284:2237:1", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 615, + "nodeType": "Block", + "src": "4777:782:1", + "statements": [ { - "expression": { + "condition": { "argumentTypes": null, - "id": 382, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 526, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftHandSide": { + "leftExpression": { "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", + "id": 524, + "name": "token_type", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 510, + "src": "4808:10:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { "argumentTypes": null, - "hexValue": "30", - "id": 381, + "hexValue": "31", + "id": 525, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "3504:1:1", + "src": "4822:1:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" }, - "value": "0" + "value": "1" }, - "src": "3484:21:1", + "src": "4808:15:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "id": 383, - "nodeType": "ExpressionStatement", - "src": "3484:21:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 388, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { + "falseBody": { + "condition": { "argumentTypes": null, - "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 559, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "id": 384, - "name": "rp", + "id": 557, + "name": "token_type", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3515:2:1", + "referencedDeclaration": 510, + "src": "5100:10:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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", + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 558, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5114:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "5100:15: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" + "falseBody": null, + "id": 613, + "nodeType": "IfStatement", + "src": "5096:456:1", + "trueBody": { + "id": 612, + "nodeType": "Block", + "src": "5117:435:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 568, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 565, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "5172:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 562, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "5147:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 561, + "name": "IERC721", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3502, + "src": "5139:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", + "typeString": "type(contract IERC721)" + } + }, + "id": 563, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5139:22:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC721_$3502", + "typeString": "contract IERC721" + } + }, + "id": 564, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 3435, + "src": "5139:32:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 566, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5139:48:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 567, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "5191:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5139:58:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303132", + "id": 569, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5199:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", + "typeString": "literal_string \"012\"" + }, + "value": "012" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", + "typeString": "literal_string \"012\"" + } + ], + "id": 560, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "5131:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 570, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5131:74:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 571, + "nodeType": "ExpressionStatement", + "src": "5131:74:1" + }, + { + "body": { + "id": 610, + "nodeType": "Block", + "src": "5251:291:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "id": 586, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 582, + "name": "recipient_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "5273:17:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 584, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "5302:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 583, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5294:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 585, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5294:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "src": "5273:34:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 598, + "nodeType": "IfStatement", + "src": "5269:150:1", + "trueBody": { + "id": 597, + "nodeType": "Block", + "src": "5308:111:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 591, + "name": "recipient_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "5361:17:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 592, + "name": "erc721_token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 521, + "src": "5380:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 594, + "indexExpression": { + "argumentTypes": null, + "id": 593, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 573, + "src": "5397:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5380:19: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": 588, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "5338:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 587, + "name": "IERC721", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3502, + "src": "5330:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", + "typeString": "type(contract IERC721)" + } + }, + "id": 589, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5330:22:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC721_$3502", + "typeString": "contract IERC721" + } + }, + "id": 590, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "approve", + "nodeType": "MemberAccess", + "referencedDeclaration": 3467, + "src": "5330:30:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,uint256) external" + } + }, + "id": 595, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5330:70:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 596, + "nodeType": "ExpressionStatement", + "src": "5330:70:1" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 603, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "5472:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 604, + "name": "recipient_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "5488:17:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 605, + "name": "erc721_token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 521, + "src": "5507:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 607, + "indexExpression": { + "argumentTypes": null, + "id": 606, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 573, + "src": "5524:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "5507:19: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": 600, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "5444:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 599, + "name": "IERC721", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3502, + "src": "5436:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", + "typeString": "type(contract IERC721)" + } + }, + "id": 601, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5436:22:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC721_$3502", + "typeString": "contract IERC721" + } + }, + "id": 602, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 3460, + "src": "5436:35:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (address,address,uint256) external" + } + }, + "id": 608, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5436:91:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 609, + "nodeType": "ExpressionStatement", + "src": "5436:91:1" + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 578, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 576, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 573, + "src": "5234:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "id": 577, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "5238:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5234:10:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 611, + "initializationExpression": { + "assignments": [ + 573 + ], + "declarations": [ + { + "constant": false, + "id": 573, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 611, + "src": "5224:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 572, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5224:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 575, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 574, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5231:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "5224:8:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 580, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "5246:3:1", + "subExpression": { + "argumentTypes": null, + "id": 579, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 573, + "src": "5246:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 581, + "nodeType": "ExpressionStatement", + "src": "5246:3:1" + }, + "nodeType": "ForStatement", + "src": "5219:323:1" } - }, - "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" + "id": 614, + "nodeType": "IfStatement", + "src": "4804:748:1", + "trueBody": { + "id": 556, + "nodeType": "Block", + "src": "4825:256:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 535, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 532, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "4879:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 529, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "4854:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 528, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2290, + "src": "4847:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 530, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4847:21:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" + } + }, + "id": 531, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "balanceOf", + "nodeType": "MemberAccess", + "referencedDeclaration": 2235, + "src": "4847:31:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) view external returns (uint256)" + } + }, + "id": 533, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4847:47:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "id": 534, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "4898:6:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4847:57:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303130", + "id": 536, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4906:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_a775955c4ebf9a14a86ce326379f653bbb58908658ea96ba1b295aaa41291bcf", + "typeString": "literal_string \"010\"" + }, + "value": "010" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_a775955c4ebf9a14a86ce326379f653bbb58908658ea96ba1b295aaa41291bcf", + "typeString": "literal_string \"010\"" + } + ], + "id": 527, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "4839:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 537, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4839:73:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 538, + "nodeType": "ExpressionStatement", + "src": "4839:73:1" }, - "typeName": { - "id": 399, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3604:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 543, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "4956:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 544, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "4972: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": 540, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "4933:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 539, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2290, + "src": "4926:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 541, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4926:21:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" + } + }, + "id": 542, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "approve", + "nodeType": "MemberAccess", + "referencedDeclaration": 2262, + "src": "4926:29:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 545, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4926:53:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 546, + "nodeType": "ExpressionStatement", + "src": "4926:53:1" }, - "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" + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 551, + "name": "sender_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 514, + "src": "5028:14:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 552, + "name": "recipient_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 516, + "src": "5044:17:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 553, + "name": "amount", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 518, + "src": "5063: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": 548, + "name": "token_address", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 512, + "src": "5000:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 547, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2290, + "src": "4993:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 549, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4993:21:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" + } + }, + "id": 550, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "transferFrom", + "nodeType": "MemberAccess", + "referencedDeclaration": 2273, + "src": "4993: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": 554, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4993:77:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 555, + "nodeType": "ExpressionStatement", + "src": "4993:77:1" } - }, - "id": 402, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3624:19:1", + ] + } + } + ] + }, + "documentation": null, + "id": 616, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "transfer_token", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 522, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 510, + "name": "token_type", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4595:15:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 509, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4595:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "nodeType": "VariableDeclarationStatement", - "src": "3604:39:1" + "value": null, + "visibility": "internal" }, { - "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, + "constant": false, + "id": 512, + "name": "token_address", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4612:21:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 511, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4612:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" + "typeIdentifier": "t_address", + "typeString": "address" + } }, - "nodeType": "VariableDeclarationStatement", - "src": "3653:19:1" + "value": null, + "visibility": "internal" }, { - "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", + "constant": false, + "id": 514, + "name": "sender_address", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4635:22:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 513, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4635:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 516, + "name": "recipient_address", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4687:25:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 515, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "4687:7:1", + "stateMutability": "nonpayable", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_address", + "typeString": "address" } }, - "nodeType": "VariableDeclarationStatement", - "src": "3682:52:1" + "value": null, + "visibility": "internal" }, { - "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", + "constant": false, + "id": 518, + "name": "amount", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4714:11:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 517, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "4714:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 521, + "name": "erc721_token_ids", + "nodeType": "VariableDeclaration", + "scope": 616, + "src": "4727:34:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 519, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4727:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 520, + "length": null, + "nodeType": "ArrayTypeName", + "src": "4727:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "4594:168:1" + }, + "returnParameters": { + "id": 523, + "nodeType": "ParameterList", + "parameters": [], + "src": "4777:0:1" + }, + "scope": 1367, + "src": "4571:988:1", + "stateMutability": "payable", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 638, + "nodeType": "Block", + "src": "5674:92:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 629, + "name": "nonce_rand", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 620, + "src": "5723:10: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": { + "expression": { "argumentTypes": null, - "id": 443, - "name": "MIN_AMOUNT", + "id": 630, + "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 405, - "src": "3921:10:1", + "referencedDeclaration": 3658, + "src": "5735:3:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_magic_message", + "typeString": "msg" } }, - "src": "3907:24:1", + "id": 631, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5735:10:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "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" - } - ] + { + "argumentTypes": null, + "id": 632, + "name": "seed", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 618, + "src": "5747:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "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" - } - ] + { + "argumentTypes": null, + "id": 633, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "5753: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": 627, + "name": "abi", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3645, + "src": "5706:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_abi", + "typeString": "abi" + } + }, + "id": 628, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "encodePacked", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "5706:16:1", + "typeDescriptions": { + "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", + "typeString": "function () pure returns (bytes memory)" } + }, + "id": 634, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5706:51:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" } - ] + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + ], + "id": 626, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3652, + "src": "5696:9:1", + "typeDescriptions": { + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" + } + }, + "id": 635, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5696:62:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + ], + "id": 625, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "5691:4:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint256_$", + "typeString": "type(uint256)" + }, + "typeName": "uint" + }, + "id": 636, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5691:68:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 624, + "id": 637, + "nodeType": "Return", + "src": "5684:75:1" + } + ] + }, + "documentation": null, + "id": 639, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "random", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 621, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 618, + "name": "seed", + "nodeType": "VariableDeclaration", + "scope": 639, + "src": "5609:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 617, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "5609:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 620, + "name": "nonce_rand", + "nodeType": "VariableDeclaration", + "scope": 639, + "src": "5623:15:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 619, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5623:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5608:31:1" + }, + "returnParameters": { + "id": 624, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 623, + "name": "rand", + "nodeType": "VariableDeclaration", + "scope": 639, + "src": "5663:9:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 622, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "5663:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5662:11:1" + }, + "scope": 1367, + "src": "5593:173:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "internal" + }, + { + "body": { + "id": 647, + "nodeType": "Block", + "src": "5968:278:1", + "statements": [ + { + "externalReferences": [ + { + "a": { + "declaration": 641, + "isOffset": false, + "isSlot": false, + "src": "6171:1:1", + "valueSize": 1 + } + }, + { + "b": { + "declaration": 644, + "isOffset": false, + "isSlot": false, + "src": "6224:1:1", + "valueSize": 1 + } + }, + { + "a": { + "declaration": 641, + "isOffset": false, + "isSlot": false, + "src": "6034:1:1", + "valueSize": 1 + } + }, + { + "a": { + "declaration": 641, + "isOffset": false, + "isSlot": false, + "src": "6043:1:1", + "valueSize": 1 + } + } + ], + "id": 646, + "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": "5978:262:1" + } + ] + }, + "documentation": null, + "id": 648, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "toBytes", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 642, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 641, + "name": "a", + "nodeType": "VariableDeclaration", + "scope": 648, + "src": "5920:9:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + }, + "typeName": { + "id": 640, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "5920:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5919:11:1" + }, + "returnParameters": { + "id": 645, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 644, + "name": "b", + "nodeType": "VariableDeclaration", + "scope": 648, + "src": "5952:14:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 643, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "5952:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "5951:16:1" + }, + "scope": 1367, + "src": "5903:343:1", + "stateMutability": "pure", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 702, + "nodeType": "Block", + "src": "6357:284:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 662, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 659, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 653, + "src": "6371:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 660, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6380:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } }, + "id": 661, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6380:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "6371:21:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 665, + "nodeType": "IfStatement", + "src": "6367:39:1", + "trueBody": { + "expression": { + "argumentTypes": null, + "id": 663, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6401:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "functionReturnParameters": 658, + "id": 664, + "nodeType": "Return", + "src": "6394:12:1" + } + }, + { + "body": { + "id": 689, + "nodeType": "Block", + "src": "6463:48:1", + "statements": [ { "expression": { "argumentTypes": null, - "arguments": [ - { + "id": 687, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 679, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6477:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 681, + "indexExpression": { "argumentTypes": null, - "id": 474, - "name": "rand_tokens", + "id": 680, + "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 397, - "src": "4228:11:1", + "referencedDeclaration": 667, + "src": "6483:1:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "6477:8:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 682, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6488:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } - ], - "expression": { + }, + "id": 686, + "indexExpression": { "argumentTypes": null, - "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 685, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "id": 469, - "name": "rp", + "id": 683, + "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "4213:2:1", + "referencedDeclaration": 667, + "src": "6494:1:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 472, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 66, - "src": "4213:9:1", + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 684, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6498:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6494:5:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 473, "isConstant": false, - "isLValue": false, + "isLValue": true, "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", + "nodeType": "IndexAccess", + "src": "6488:12:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "4254:27:1", + "src": "6477:23:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 480, + "id": 688, "nodeType": "ExpressionStatement", - "src": "4254:27:1" + "src": "6477:23:1" } ] }, @@ -17417,19 +26378,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 424, + "id": 675, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 421, + "id": 670, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 418, - "src": "3761:1:1", + "referencedDeclaration": 667, + "src": "6437:1:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -17439,52 +26400,89 @@ "operator": "<", "rightExpression": { "argumentTypes": null, - "expression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 674, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "id": 422, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 294, - "src": "3765:2:1", + "expression": { + "argumentTypes": null, + "id": 671, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6441:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 672, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6441:12:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 423, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3765:15:1", + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 673, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6456:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "6441:16:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3761:19:1", + "src": "6437:20:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 482, + "id": 690, "initializationExpression": { "assignments": [ - 418 + 667 ], "declarations": [ { "constant": false, - "id": 418, + "id": 667, "name": "i", "nodeType": "VariableDeclaration", - "scope": 482, - "src": "3749:6:1", + "scope": 690, + "src": "6421:6:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -17492,10 +26490,10 @@ "typeString": "uint256" }, "typeName": { - "id": 417, + "id": 666, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "3749:4:1", + "src": "6421:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -17505,32 +26503,27 @@ "visibility": "internal" } ], - "id": 420, + "id": 669, "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, + "id": 668, + "name": "index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 653, + "src": "6430:5:1", "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, "nodeType": "VariableDeclarationStatement", - "src": "3749:10:1" + "src": "6421:14:1" }, "loopExpression": { "expression": { "argumentTypes": null, - "id": 426, + "id": 677, "isConstant": false, "isLValue": false, "isPure": false, @@ -17538,15 +26531,15 @@ "nodeType": "UnaryOperation", "operator": "++", "prefix": false, - "src": "3782:3:1", + "src": "6459:3:1", "subExpression": { "argumentTypes": null, - "id": 425, + "id": 676, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 418, - "src": "3782:1:1", + "referencedDeclaration": 667, + "src": "6459:1:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -17557,17 +26550,17 @@ "typeString": "uint256" } }, - "id": 427, + "id": 678, "nodeType": "ExpressionStatement", - "src": "3782:3:1" + "src": "6459:3:1" }, "nodeType": "ForStatement", - "src": "3744:548:1" + "src": "6416:95:1" }, { "expression": { "argumentTypes": null, - "id": 493, + "id": 698, "isConstant": false, "isLValue": false, "isPure": false, @@ -17576,554 +26569,188 @@ "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", + "id": 691, + "name": "array", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "4448:3:1", + "referencedDeclaration": 651, + "src": "6520:5:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } }, - { + "id": 696, + "indexExpression": { "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" - } + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, - "id": 505, + "id": 695, "isConstant": false, - "isLValue": true, + "isLValue": false, "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" + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 692, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6526:5:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 693, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "6526:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, - { - "typeIdentifier": "t_address", - "typeString": "address" + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 694, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6541:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" }, - { + "src": "6526:16:1", + "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" } - ], - "id": 495, - "name": "CreationSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 123, - "src": "4387:15:1", + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "6520:23: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)" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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", + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "307846464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646", + "id": 697, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "6546:66:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } + "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", + "typeString": "int_const 1157...(70 digits omitted)...9935" + }, + "value": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" }, - "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", + "src": "6520:92: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" + "id": 699, + "nodeType": "ExpressionStatement", + "src": "6520:92:1" }, { - "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", + "expression": { + "argumentTypes": null, + "id": 700, + "name": "array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 651, + "src": "6629:5:1", "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } }, - "value": null, - "visibility": "internal" - }, + "functionReturnParameters": 658, + "id": 701, + "nodeType": "Return", + "src": "6622:12:1" + } + ] + }, + "documentation": null, + "id": 703, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getTokenIdWithIndex", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 654, + "nodeType": "ParameterList", + "parameters": [ { "constant": false, - "id": 200, - "name": "_token_type", + "id": 651, + "name": "array", "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2077:16:1", + "scope": 703, + "src": "6281:22:1", "stateVariable": false, - "storageLocation": "default", + "storageLocation": "memory", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" }, "typeName": { - "id": 199, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2077:4:1", + "baseType": { + "id": 649, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6281:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 650, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6281:9:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, "value": null, @@ -18131,415 +26758,777 @@ }, { "constant": false, - "id": 202, - "name": "_token_addr", + "id": 653, + "name": "index", "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2095:19:1", + "scope": 703, + "src": "6305:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, "typeName": { - "id": 201, - "name": "address", + "id": 652, + "name": "uint", "nodeType": "ElementaryTypeName", - "src": "2095:7:1", - "stateMutability": "nonpayable", + "src": "6305:4:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, "value": null, "visibility": "internal" - }, + } + ], + "src": "6280:36:1" + }, + "returnParameters": { + "id": 658, + "nodeType": "ParameterList", + "parameters": [ { "constant": false, - "id": 204, - "name": "_total_tokens", + "id": 657, + "name": "", "nodeType": "VariableDeclaration", - "scope": 509, - "src": "2116:18:1", + "scope": 703, + "src": "6339:16:1", "stateVariable": false, - "storageLocation": "default", + "storageLocation": "memory", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" }, "typeName": { - "id": 203, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2116:4:1", + "baseType": { + "id": 655, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "6339:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 656, + "length": null, + "nodeType": "ArrayTypeName", + "src": "6339:9:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, "value": null, "visibility": "internal" } ], - "src": "1893:242:1" - }, - "returnParameters": { - "id": 206, - "nodeType": "ParameterList", - "parameters": [], - "src": "2156:0:1" + "src": "6338:18:1" }, - "scope": 956, - "src": "1866:2611:1", - "stateMutability": "payable", + "scope": 1367, + "src": "6252:389:1", + "stateMutability": "view", "superFunction": null, - "visibility": "public" + "visibility": "internal" }, { "body": { - "id": 556, + "id": 1122, "nodeType": "Block", - "src": "4697:320:1", + "src": "6860:3782:1", "statements": [ { - "condition": { + "assignments": [ + 717 + ], + "declarations": [ + { + "constant": false, + "id": 717, + "name": "rp", + "nodeType": "VariableDeclaration", + "scope": 1122, + "src": "6871:20:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + }, + "typeName": { + "contractScope": null, + "id": 716, + "name": "RedPacket", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 94, + "src": "6871:9:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 721, + "initialValue": { "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "baseExpression": { + "argumentTypes": null, + "id": 718, + "name": "redpacket_by_id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 145, + "src": "6894:15:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", + "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" + } + }, + "id": 720, + "indexExpression": { + "argumentTypes": null, + "id": 719, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 705, + "src": "6910:2:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "6894:19:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage", + "typeString": "struct HappyRedPacket.RedPacket storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6871:42:1" + }, + { + "assignments": [ + 723 + ], + "declarations": [ + { + "constant": false, + "id": 723, + "name": "recipient", + "nodeType": "VariableDeclaration", + "scope": 1122, + "src": "6923:25:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + "typeName": { + "id": 722, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "6923:15:1", + "stateMutability": "payable", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 729, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 726, + "name": "_recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 709, + "src": "6967:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 725, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6959:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_uint160_$", + "typeString": "type(uint160)" + }, + "typeName": "uint160" + }, + "id": 727, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6959:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint160", + "typeString": "uint160" + } + ], + "id": 724, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "6951:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 728, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "6951:28:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "6923:56:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 734, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 731, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7051:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 732, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "expiration_time", + "nodeType": "MemberAccess", + "referencedDeclaration": 79, + "src": "7051:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "argumentTypes": null, + "id": 733, + "name": "now", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3660, + "src": "7072:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7051:24:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303033", + "id": 735, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7077:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_e07a04e280e3297d905849ae173374e70a63466da0c147cb1dc3eddf1adc47fd", + "typeString": "literal_string \"003\"" + }, + "value": "003" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_e07a04e280e3297d905849ae173374e70a63466da0c147cb1dc3eddf1adc47fd", + "typeString": "literal_string \"003\"" + } + ], + "id": 730, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7042:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } }, - "id": 524, + "id": 736, "isConstant": false, "isLValue": false, "isPure": false, + "kind": "functionCall", "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", + "names": [], + "nodeType": "FunctionCall", + "src": "7042:41:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "falseBody": null, - "id": 555, - "nodeType": "IfStatement", - "src": "4724:287:1", - "trueBody": { - "id": 554, - "nodeType": "Block", - "src": "4745:266:1", - "statements": [ + "id": 737, + "nodeType": "ExpressionStatement", + "src": "7042:41:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ { - "expression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 743, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "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": null, + "id": 739, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7102:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } - ], + }, + "id": 740, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "7102:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_7011343f7537059a90db546368183fdbe3c33cbdd9f65235d24a095b397eec61", - "typeString": "literal_string \"Not enough\"" - } - ], - "id": 525, - "name": "require", + "argumentTypes": null, + "id": 741, + "name": "rp", "nodeType": "Identifier", - "overloadedDeclarations": [ - 1746, - 1747 - ], - "referencedDeclaration": 1747, - "src": "4759:7:1", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7122:2:1", "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 535, + "id": 742, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, - "kind": "functionCall", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4759:80:1", + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "7122:15:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "id": 536, - "nodeType": "ExpressionStatement", - "src": "4759:80:1" + "src": "7102:35:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } }, { - "expression": { + "argumentTypes": null, + "hexValue": "303034", + "id": 744, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7139:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_334057113ad66ac6ad2c739ea6af3f43062313ec754cf4ee576b916e9ef852be", + "typeString": "literal_string \"004\"" + }, + "value": "004" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_334057113ad66ac6ad2c739ea6af3f43062313ec754cf4ee576b916e9ef852be", + "typeString": "literal_string \"004\"" + } + ], + "id": 738, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7093:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 745, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7093:52:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 746, + "nodeType": "ExpressionStatement", + "src": "7093:52:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 753, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "arguments": [ - { + "baseExpression": { + "argumentTypes": null, + "expression": { "argumentTypes": null, - "id": 541, - "name": "recipient_address", + "id": 748, + "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 517, - "src": "4883:17:1", + "referencedDeclaration": 717, + "src": "7164:2:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - { - "argumentTypes": null, - "id": 542, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 519, - "src": "4902:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } + "id": 749, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed", + "nodeType": "MemberAccess", + "referencedDeclaration": 93, + "src": "7164:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { + }, + "id": 751, + "indexExpression": { + "argumentTypes": null, + "id": 750, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "7175:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7164:21:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "66616c7365", + "id": 752, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7189:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + }, + "src": "7164:30:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303035", + "id": 754, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7196:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_455d4b967493b29d0d995e675e1e17e44fa9a8488bfbfe9456da6496ca978090", + "typeString": "literal_string \"005\"" + }, + "value": "005" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_455d4b967493b29d0d995e675e1e17e44fa9a8488bfbfe9456da6496ca978090", + "typeString": "literal_string \"005\"" + } + ], + "id": 747, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7155:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 755, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7155:47:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 756, + "nodeType": "ExpressionStatement", + "src": "7155:47:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 765, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { "argumentTypes": null, "arguments": [ { "argumentTypes": null, - "id": 538, - "name": "token_address", + "id": 760, + "name": "password", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 513, - "src": "4860:13:1", + "referencedDeclaration": 707, + "src": "7237:8:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" } } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_string_memory_ptr", + "typeString": "string memory" } ], - "id": 537, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1728, - "src": "4853:6:1", + "id": 759, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "7231:5:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$1728_$", - "typeString": "type(contract IERC20)" - } + "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", + "typeString": "type(bytes storage pointer)" + }, + "typeName": "bytes" }, - "id": 539, + "id": 761, "isConstant": false, "isLValue": false, "isPure": false, @@ -18547,167 +27536,32 @@ "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", + "src": "7231:15:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" } ], - "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", + "id": 758, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3652, + "src": "7221:9:1", "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,address,uint256) external returns (bool)" + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 552, + "id": 762, "isConstant": false, "isLValue": false, "isPure": false, @@ -18715,1912 +27569,3160 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4923:77:1", + "src": "7221:26:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "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", + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 763, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7251:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 764, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "hash", + "nodeType": "MemberAccess", + "referencedDeclaration": 65, + "src": "7251:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "src": "7221:37:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303036", + "id": 766, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7260:5:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1564f9bd55fc54819c3c6e158d9a00b635174ac7541b6517a7ba0553da91d60d", + "typeString": "literal_string \"006\"" + }, + "value": "006" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_1564f9bd55fc54819c3c6e158d9a00b635174ac7541b6517a7ba0553da91d60d", + "typeString": "literal_string \"006\"" + } + ], + "id": 757, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7212:7:1", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 767, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7212:54:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "value": null, - "visibility": "internal" + "id": 768, + "nodeType": "ExpressionStatement", + "src": "7212:54:1" }, - { - "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": { + "commonType": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "id": 777, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 770, + "name": "validation", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 711, + "src": "7285:10:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { "argumentTypes": null, - "id": 571, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "5294:3:1", + "expression": { + "argumentTypes": null, + "id": 773, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "7317:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 774, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7317:10:1", "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } - }, - "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", + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "id": 772, + "name": "toBytes", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1730, - "src": "5265:3:1", + "referencedDeclaration": 648, + "src": "7309:7:1", "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" + "typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_bytes_memory_ptr_$", + "typeString": "function (address) pure returns (bytes memory)" } }, - "id": 569, + "id": 775, "isConstant": false, "isLValue": false, - "isPure": true, + "isPure": false, + "kind": "functionCall", "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5265:16:1", + "names": [], + "nodeType": "FunctionCall", + "src": "7309:19:1", "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes_memory_ptr", + "typeString": "bytes memory" } - }, - "id": 575, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5265:51:1", + ], + "id": 771, + "name": "keccak256", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3652, + "src": "7299:9:1", "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" + "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", + "typeString": "function (bytes memory) pure returns (bytes32)" } - ], - "id": 567, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1737, - "src": "5255:9:1", + }, + "id": 776, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7299:30:1", "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "id": 576, + "src": "7285:44:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "hexValue": "303037", + "id": 778, "isConstant": false, "isLValue": false, - "isPure": false, - "kind": "functionCall", + "isPure": true, + "kind": "string", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5255:62:1", + "nodeType": "Literal", + "src": "7331:5:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } + "typeIdentifier": "t_stringliteral_adafce779496806a67cd1ef67cfc3ac7e72c67c4eadb74565f826b325436f38b", + "typeString": "literal_string \"007\"" + }, + "value": "007" } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_adafce779496806a67cd1ef67cfc3ac7e72c67c4eadb74565f826b325436f38b", + "typeString": "literal_string \"007\"" } ], - "id": 566, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5250:4:1", + "id": 769, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "7276:7:1", "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } }, - "id": 577, + "id": 779, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "typeConversion", + "kind": "functionCall", "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", + "src": "7276:61:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" } }, - "value": null, - "visibility": "internal" + "id": 780, + "nodeType": "ExpressionStatement", + "src": "7276:61:1" }, { - "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 + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 786, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "7400:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } } - }, - { - "a": { - "declaration": 582, - "isOffset": false, - "isSlot": false, - "src": "5730:1:1", - "valueSize": 1 + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + ], + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 781, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7378:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 784, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimer_addrs", + "nodeType": "MemberAccess", + "referencedDeclaration": 86, + "src": "7378:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "id": 785, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "push", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "7378:21:1", + "typeDescriptions": { + "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", + "typeString": "function (address) returns (uint256)" } - } - ], - "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", + }, + "id": 787, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7378:32:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "value": null, - "visibility": "internal" - } - ], - "src": "5478:11:1" - }, - "returnParameters": { - "id": 586, - "nodeType": "ParameterList", - "parameters": [ + "id": 788, + "nodeType": "ExpressionStatement", + "src": "7378:32:1" + }, { - "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" + "assignments": [ + 790 + ], + "declarations": [ + { + "constant": false, + "id": 790, + "name": "claimed_tokens", + "nodeType": "VariableDeclaration", + "scope": 1122, + "src": "7420:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 789, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7420:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" } - }, - "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": [ + ], + "id": 791, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "7420:19:1" + }, { "assignments": [ - 603 + 795 ], "declarations": [ { "constant": false, - "id": 603, - "name": "rp", + "id": 795, + "name": "token_ids", "nodeType": "VariableDeclaration", - "scope": 784, - "src": "6034:20:1", + "scope": 1122, + "src": "7449:27:1", "stateVariable": false, - "storageLocation": "storage", + "storageLocation": "memory", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" }, "typeName": { - "contractScope": null, - "id": 602, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "6034:9:1", + "baseType": { + "id": 793, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7449:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 794, + "length": null, + "nodeType": "ArrayTypeName", + "src": "7449:10:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" } }, "value": null, "visibility": "internal" } ], - "id": 607, + "id": 801, "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)" + "arguments": [ + { + "argumentTypes": null, + "hexValue": "31", + "id": 799, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7493:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" } - }, - "id": 606, - "indexExpression": { - "argumentTypes": null, - "id": 605, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 591, - "src": "6073:2:1", + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 798, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "7479:13:1", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$", + "typeString": "function (uint256) pure returns (uint256[] memory)" + }, + "typeName": { + "baseType": { + "id": 796, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7483:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 797, + "length": null, + "nodeType": "ArrayTypeName", + "src": "7483:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } } }, + "id": 800, "isConstant": false, - "isLValue": true, - "isPure": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6057:19:1", + "names": [], + "nodeType": "FunctionCall", + "src": "7479:16:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" } }, "nodeType": "VariableDeclarationStatement", - "src": "6034:42:1" + "src": "7449:46:1" }, { - "assignments": [ - 609 - ], - "declarations": [ - { - "constant": false, - "id": 609, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 784, - "src": "6086:25:1", - "stateVariable": false, - "storageLocation": "default", + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "id": 805, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 802, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7578:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 803, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "ifrandom", + "nodeType": "MemberAccess", + "referencedDeclaration": 67, + "src": "7578:11:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "74727565", + "id": 804, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7593:4:1", + "subdenomination": null, "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" - } + "typeIdentifier": "t_bool", + "typeString": "bool" }, - "value": null, - "visibility": "internal" + "value": "true" + }, + "src": "7578:19:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" } - ], - "id": 615, - "initialValue": { - "argumentTypes": null, - "arguments": [ + }, + "falseBody": { + "id": 995, + "nodeType": "Block", + "src": "8700:798:1", + "statements": [ { - "argumentTypes": null, - "arguments": [ - { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 921, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { "argumentTypes": null, - "id": 612, - "name": "_recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 595, - "src": "6130:10:1", + "expression": { + "argumentTypes": null, + "id": 918, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8718:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 919, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "8718:13:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 920, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8735:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "8718:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 993, + "nodeType": "Block", + "src": "9128:360:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 964, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 962, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 958, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9150:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 959, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "9150:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 960, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9168:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 961, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "9168:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "9150:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 963, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9189:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9150:40:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 985, + "nodeType": "Block", + "src": "9289:130:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 983, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 971, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "9311:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 974, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9341:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 975, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9341:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 980, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 976, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9363:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 977, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "9363:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 978, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9381:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 979, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "9381:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "9363:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "id": 981, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "9362:37:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "argumentTypes": null, + "id": 972, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "9328:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 973, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 1691, + "src": "9328:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 982, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9328:72:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9311:89:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 984, + "nodeType": "ExpressionStatement", + "src": "9311:89:1" + } + ] + }, + "id": 986, + "nodeType": "IfStatement", + "src": "9146:273:1", + "trueBody": { + "id": 970, + "nodeType": "Block", + "src": "9191:77:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 968, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 965, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "9213:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 966, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9230:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 967, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9230:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9213:36:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 969, + "nodeType": "ExpressionStatement", + "src": "9213:36:1" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 991, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 987, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9436:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 989, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9436:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "id": 990, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "9459:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9436:37:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 992, + "nodeType": "ExpressionStatement", + "src": "9436:37:1" } - } - ], - "expression": { - "argumentTypes": [ + ] + }, + "id": 994, + "nodeType": "IfStatement", + "src": "8714:774:1", + "trueBody": { + "id": 957, + "nodeType": "Block", + "src": "8738:360:1", + "statements": [ + { + "assignments": [ + 925 + ], + "declarations": [ + { + "constant": false, + "id": 925, + "name": "_array", + "nodeType": "VariableDeclaration", + "scope": 957, + "src": "8835:23:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 923, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "8835:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 924, + "length": null, + "nodeType": "ArrayTypeName", + "src": "8835:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 928, + "initialValue": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 926, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8861:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 927, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "8861:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "8835:45:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 936, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 929, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 795, + "src": "8898:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 931, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 930, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8908:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "8898:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 932, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8913:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 933, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "8913:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 935, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 934, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8933: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": "8913:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8898:37:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 937, + "nodeType": "ExpressionStatement", + "src": "8898:37:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 945, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 938, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8953:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 940, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "8953:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 942, + "name": "_array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 925, + "src": "8995:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + { + "argumentTypes": null, + "hexValue": "30", + "id": 943, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9003:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + }, + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 941, + "name": "getTokenIdWithIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 703, + "src": "8975:19:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", + "typeString": "function (uint256[] memory,uint256) view returns (uint256[] memory)" + } + }, + "id": 944, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8975:30:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "src": "8953:52:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 946, + "nodeType": "ExpressionStatement", + "src": "8953:52:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 949, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 947, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "9023:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 948, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9040:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9023:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 950, + "nodeType": "ExpressionStatement", + "src": "9023:18:1" + }, { - "typeIdentifier": "t_address", - "typeString": "address" + "expression": { + "argumentTypes": null, + "id": 955, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 951, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9059:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 953, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9059:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 954, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9082:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9059:24:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 956, + "nodeType": "ExpressionStatement", + "src": "9059:24:1" } - ], - "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": [ + "id": 996, + "nodeType": "IfStatement", + "src": "7574:1924:1", + "trueBody": { + "id": 917, + "nodeType": "Block", + "src": "7599:1087:1", + "statements": [ { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 620, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { + "condition": { "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" - } + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, - "id": 618, + "id": 809, "isConstant": false, - "isLValue": true, + "isLValue": false, "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": { + "leftExpression": { "argumentTypes": null, - "id": 625, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6246:2:1", + "expression": { + "argumentTypes": null, + "id": 806, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7617:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 807, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "7617:13:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 626, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "6246:17:1", + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 808, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7634:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "7617:18:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "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" + "falseBody": { + "id": 915, + "nodeType": "Block", + "src": "8042:634:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 861, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 855, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8064:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 856, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "8064:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 857, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8082:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 858, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "8082:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "8064:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 860, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8103:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8064:40:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 913, + "nodeType": "Block", + "src": "8203:459:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 876, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 868, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8225:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 875, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 870, + "name": "uuid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "8249:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 871, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "8255:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 869, + "name": "random", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 639, + "src": "8242:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bytes32,uint256) view returns (uint256)" + } + }, + "id": 872, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "8242:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 873, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8264:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 874, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "MAX_AMOUNT", + "nodeType": "MemberAccess", + "referencedDeclaration": 71, + "src": "8264:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8242:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8225:52:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 877, + "nodeType": "ExpressionStatement", + "src": "8225:52:1" + }, + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 880, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 878, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8303:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 879, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8321:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "8303:19:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 889, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 886, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8421:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 887, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8439:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 888, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "8439:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8421:37:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 905, + "nodeType": "IfStatement", + "src": "8417:172:1", + "trueBody": { + "id": 904, + "nodeType": "Block", + "src": "8460:129:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 902, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 890, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8486:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 901, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 891, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8503:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 892, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "8503:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "components": [ + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 899, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 897, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 893, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8526:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 894, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "8526:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 895, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8544:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 896, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "8544:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "8526:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 898, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8564:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8526:39:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "id": 900, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "8525:41:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "8503:63:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8486:80:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 903, + "nodeType": "ExpressionStatement", + "src": "8486:80:1" + } + ] + } + }, + "id": 906, + "nodeType": "IfStatement", + "src": "8299:290:1", + "trueBody": { + "id": 885, + "nodeType": "Block", + "src": "8324:67:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 883, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 881, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8350:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 882, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "8367:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "8350:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 884, + "nodeType": "ExpressionStatement", + "src": "8350:18:1" + } + ] + } + }, + { + "expression": { + "argumentTypes": null, + "id": 911, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 907, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8606:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 909, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "8606:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "id": 910, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8629:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8606:37:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 912, + "nodeType": "ExpressionStatement", + "src": "8606:37:1" + } + ] + }, + "id": 914, + "nodeType": "IfStatement", + "src": "8060:602:1", + "trueBody": { + "id": 867, + "nodeType": "Block", + "src": "8105:77:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 865, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "id": 862, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "8127:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 863, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "8144:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 864, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "8144:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "8127:36:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 866, + "nodeType": "ExpressionStatement", + "src": "8127:36:1" + } + ] + } } - }, - "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": { + "id": 916, + "nodeType": "IfStatement", + "src": "7613:1063:1", + "trueBody": { + "id": 854, + "nodeType": "Block", + "src": "7637:375:1", + "statements": [ + { + "assignments": [ + 811 + ], + "declarations": [ + { + "constant": false, + "id": 811, + "name": "token_id_index", + "nodeType": "VariableDeclaration", + "scope": 854, + "src": "7655:19:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 810, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "7655:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 819, + "initialValue": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 818, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 813, + "name": "uuid", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 153, + "src": "7684:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "id": 814, + "name": "nonce", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 139, + "src": "7690:5:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 812, + "name": "random", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 639, + "src": "7677:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (bytes32,uint256) view returns (uint256)" + } + }, + "id": 815, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7677:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 816, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7699:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 817, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "7699:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7677:41:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "7655:63:1" + }, + { + "assignments": [ + 823 + ], + "declarations": [ + { + "constant": false, + "id": 823, + "name": "_array", + "nodeType": "VariableDeclaration", + "scope": 854, + "src": "7736:23:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 821, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "7736:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 822, + "length": null, + "nodeType": "ArrayTypeName", + "src": "7736:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 826, + "initialValue": { "argumentTypes": null, - "id": 634, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6322:2:1", + "expression": { + "argumentTypes": null, + "id": 824, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7762:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 825, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "7762:19:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } }, - "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)" - } + "nodeType": "VariableDeclarationStatement", + "src": "7736:45:1" }, - "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" - } + { + "expression": { + "argumentTypes": null, + "id": 833, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 827, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 795, + "src": "7799:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 829, + "indexExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 828, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7809:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "7799:12:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 830, + "name": "_array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 823, + "src": "7814:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 832, + "indexExpression": { + "argumentTypes": null, + "id": 831, + "name": "token_id_index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "7821:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "7814:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7799:37:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 834, + "nodeType": "ExpressionStatement", + "src": "7799:37:1" }, - "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": [ - { + "expression": { + "argumentTypes": null, + "id": 842, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 835, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "7854:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 837, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "7854:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { "argumentTypes": null, - "id": 647, - "name": "password", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 593, - "src": "6423:8:1", + "arguments": [ + { + "argumentTypes": null, + "id": 839, + "name": "_array", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 823, + "src": "7896:6:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + { + "argumentTypes": null, + "id": 840, + "name": "token_id_index", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 811, + "src": "7904:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 838, + "name": "getTokenIdWithIndex", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 703, + "src": "7876:19:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", + "typeString": "function (uint256[] memory,uint256) view returns (uint256[] memory)" + } + }, + "id": 841, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7876:43:1", "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } + }, + "src": "7854:65:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } - ], + }, + "id": 843, + "nodeType": "ExpressionStatement", + "src": "7854:65:1" + }, + { "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - ], - "id": 646, + "argumentTypes": null, + "id": 846, "isConstant": false, "isLValue": false, - "isPure": true, + "isPure": false, "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": [ + "leftHandSide": { + "argumentTypes": null, + "id": 844, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "7937:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 845, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7954:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "7937:18:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 847, + "nodeType": "ExpressionStatement", + "src": "7937:18:1" + }, { - "argumentTypes": null, - "arguments": [ - { + "expression": { + "argumentTypes": null, + "id": 852, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 663, - "name": "msg", + "id": 848, + "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "6540:3:1", + "referencedDeclaration": 717, + "src": "7973:2:1", "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 664, + "id": 850, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, - "lValueRequested": false, - "memberName": "sender", + "lValueRequested": true, + "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6540:10:1", + "referencedDeclaration": 81, + "src": "7973:19:1", "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } - ], - "id": 662, - "name": "toBytes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 589, - "src": "6532:7:1", + }, + "nodeType": "Assignment", + "operator": "-=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "31", + "id": 851, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "7996:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "7973:24: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" + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 853, + "nodeType": "ExpressionStatement", + "src": "7973:24:1" + } + ] } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 681, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "6719:19:1" + } + ] + } }, { - "condition": { + "expression": { "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 685, + "id": 1003, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftExpression": { + "leftHandSide": { "argumentTypes": null, - "expression": { + "baseExpression": { "argumentTypes": null, - "id": 682, - "name": "rp", + "expression": { + "argumentTypes": null, + "id": 997, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9508:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1000, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed", + "nodeType": "MemberAccess", + "referencedDeclaration": 93, + "src": "9508:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 1001, + "indexExpression": { + "argumentTypes": null, + "id": 999, + "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6752:2:1", + "referencedDeclaration": 723, + "src": "9519:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_address_payable", + "typeString": "address payable" } }, - "id": 683, "isConstant": false, "isLValue": true, "isPure": false, - "lValueRequested": false, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "6752:11:1", + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "9508:21:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", - "id": 684, + "id": 1002, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", - "src": "6767:4:1", + "src": "9532:4:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", @@ -20628,671 +30730,603 @@ }, "value": "true" }, - "src": "6752:19:1", + "src": "9508:28: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" - } - ] - } + "id": 1004, + "nodeType": "ExpressionStatement", + "src": "9508:28:1" }, { "expression": { "argumentTypes": null, - "id": 708, + "id": 1008, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftHandSide": { + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "9547:20:1", + "subExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 704, + "id": 1005, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "6920:2:1", + "referencedDeclaration": 717, + "src": "9547:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 706, + "id": 1007, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, - "memberName": "remaining_tokens", + "memberName": "claimed_number", "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", + "referencedDeclaration": 77, + "src": "9547:17:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "src": "6920:37:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, - "id": 709, + "id": 1009, "nodeType": "ExpressionStatement", - "src": "6920:37:1" + "src": "9547:20:1" }, { - "expression": { + "condition": { "argumentTypes": null, - "id": 718, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1013, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftHandSide": { + "leftExpression": { "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", + "id": 1010, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9581:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Claimer_$111_storage", - "typeString": "struct HappyRedPacket.Claimer storage ref" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 715, + "id": 1011, "isConstant": false, "isLValue": true, "isPure": false, - "lValueRequested": true, - "memberName": "index", + "lValueRequested": false, + "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 104, - "src": "6967:28:1", + "referencedDeclaration": 69, + "src": "9581:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { "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" + "hexValue": "32", + "id": 1012, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9598:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "9581:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "id": 1048, + "nodeType": "Block", + "src": "9675:202:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 1026, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1022, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9693:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1023, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "9693:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1024, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9712:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1025, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "9712:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "9693:36:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1047, + "nodeType": "IfStatement", + "src": "9689:177:1", + "trueBody": { + "id": 1046, + "nodeType": "Block", + "src": "9730:136:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1044, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1027, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9748:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1029, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "MAX_AMOUNT", + "nodeType": "MemberAccess", + "referencedDeclaration": 71, + "src": "9748:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1034, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9790:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1035, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9790:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + }, + "id": 1040, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1036, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9811:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1037, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "total_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 75, + "src": "9811:15:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1038, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9829:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1039, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed_number", + "nodeType": "MemberAccess", + "referencedDeclaration": 77, + "src": "9829:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "9811:35:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + ], + "expression": { + "argumentTypes": null, + "id": 1032, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "9777:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 1033, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "div", + "nodeType": "MemberAccess", + "referencedDeclaration": 1691, + "src": "9777:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1041, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9777:70:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "hexValue": "32", + "id": 1042, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9849:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + } + ], + "expression": { + "argumentTypes": null, + "id": 1030, + "name": "SafeMath", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1758, + "src": "9764:8:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", + "typeString": "type(library SafeMath)" + } + }, + "id": 1031, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "mul", + "nodeType": "MemberAccess", + "referencedDeclaration": 1675, + "src": "9764:12:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256,uint256) pure returns (uint256)" + } + }, + "id": 1043, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9764:87:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9748:103:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1045, + "nodeType": "ExpressionStatement", + "src": "9748:103:1" + } + ] } - }, - "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": { + "id": 1049, + "nodeType": "IfStatement", + "src": "9577:300:1", + "trueBody": { + "id": 1021, + "nodeType": "Block", + "src": "9601:60:1", + "statements": [ + { + "expression": { "argumentTypes": null, - "expression": { + "id": 1019, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { "argumentTypes": null, - "id": 720, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7025:2:1", + "expression": { + "argumentTypes": null, + "id": 1014, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9615:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1016, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "MAX_AMOUNT", + "nodeType": "MemberAccess", + "referencedDeclaration": 71, + "src": "9615:13:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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": { + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { "argumentTypes": null, - "id": 729, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7089:2:1", + "expression": { + "argumentTypes": null, + "id": 1017, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "9631:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1018, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "9631:19:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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", + "src": "9615:35:1", "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "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" + "id": 1020, + "nodeType": "ExpressionStatement", + "src": "9615:35:1" } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 742, - "nodeType": "ExpressionStatement", - "src": "7140:20:1" + ] + } }, { "condition": { @@ -21301,7 +31335,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 746, + "id": 1053, "isConstant": false, "isLValue": false, "isPure": false, @@ -21310,26 +31344,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 743, + "id": 1050, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7231:2:1", + "referencedDeclaration": 717, + "src": "9947:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 744, + "id": 1051, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7231:13:1", + "referencedDeclaration": 69, + "src": "9947:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -21340,14 +31374,14 @@ "rightExpression": { "argumentTypes": null, "hexValue": "30", - "id": 745, + "id": 1052, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7248:1:1", + "src": "9964:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", @@ -21355,7 +31389,7 @@ }, "value": "0" }, - "src": "7231:18:1", + "src": "9947:18:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -21368,7 +31402,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 757, + "id": 1064, "isConstant": false, "isLValue": false, "isPure": false, @@ -21377,26 +31411,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 754, + "id": 1061, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7328:2:1", + "referencedDeclaration": 717, + "src": "10044:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 755, + "id": 1062, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7328:13:1", + "referencedDeclaration": 69, + "src": "10044:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -21407,36 +31441,444 @@ "rightExpression": { "argumentTypes": null, "hexValue": "31", - "id": 756, + "id": 1063, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7345:1:1", + "src": "10061: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": [ + "value": "1" + }, + "src": "10044:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1092, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1089, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10310:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1090, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "10310:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1091, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10327:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "10310:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1107, + "nodeType": "IfStatement", + "src": "10306:177:1", + "trueBody": { + "id": 1106, + "nodeType": "Block", + "src": "10330:153:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1094, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10359:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1095, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "10359:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1096, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 717, + "src": "10374:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1097, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "10374:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1099, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "10400:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 1098, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "10392:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1100, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10392:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "id": 1101, + "name": "recipient", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 723, + "src": "10435:9:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "id": 1102, + "name": "claimed_tokens", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 790, + "src": "10446:14:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1103, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 795, + "src": "10462:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + ], + "id": 1093, + "name": "transfer_token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 616, + "src": "10344:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" + } + }, + "id": 1104, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10344:128:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1105, + "nodeType": "ExpressionStatement", + "src": "10344:128:1" + } + ] + } + }, + "id": 1108, + "nodeType": "IfStatement", + "src": "10040:443:1", + "trueBody": { + "id": 1088, + "nodeType": "Block", + "src": "10064:228:1", + "statements": [ + { + "assignments": [ + 1068 + ], + "declarations": [ + { + "constant": false, + "id": 1068, + "name": "token_ids_holder", + "nodeType": "VariableDeclaration", + "scope": 1088, + "src": "10078:34:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 1066, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10078:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1067, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10078:10:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1074, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1072, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "10129:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1071, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "10115:13: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": 1069, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "10119:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1070, + "length": null, + "nodeType": "ArrayTypeName", + "src": "10119:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 1073, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "10115:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "10078:53:1" + }, { "expression": { "argumentTypes": null, @@ -21445,26 +31887,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 759, + "id": 1076, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7377:2:1", + "referencedDeclaration": 717, + "src": "10161:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 760, + "id": 1077, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "7377:13:1", + "referencedDeclaration": 69, + "src": "10161:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -21474,26 +31916,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 761, + "id": 1078, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7392:2:1", + "referencedDeclaration": 717, + "src": "10176:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 762, + "id": 1079, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_address", "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "7392:16:1", + "referencedDeclaration": 83, + "src": "10176:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -21504,14 +31946,14 @@ "arguments": [ { "argumentTypes": null, - "id": 764, + "id": 1081, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "7418:4:1", + "referencedDeclaration": 3680, + "src": "10202:4:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } } @@ -21519,24 +31961,24 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } ], - "id": 763, + "id": 1080, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "7410:7:1", + "src": "10194:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 765, + "id": 1082, "isConstant": false, "isLValue": false, "isPure": false, @@ -21544,7 +31986,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7410:13:1", + "src": "10194:13:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -21552,12 +31994,12 @@ }, { "argumentTypes": null, - "id": 766, + "id": 1083, "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7453:9:1", + "referencedDeclaration": 723, + "src": "10237:9:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" @@ -21565,16 +32007,29 @@ }, { "argumentTypes": null, - "id": 767, + "id": 1084, "name": "claimed_tokens", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7464:14:1", + "referencedDeclaration": 790, + "src": "10248:14:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } + }, + { + "argumentTypes": null, + "id": 1085, + "name": "token_ids_holder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1068, + "src": "10264:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } } ], "expression": { @@ -21598,20 +32053,24 @@ { "typeIdentifier": "t_uint256", "typeString": "uint256" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } ], - "id": 758, + "id": 1075, "name": "transfer_token", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "7362:14:1", + "referencedDeclaration": 616, + "src": "10146: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)" + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" } }, - "id": 768, + "id": 1086, "isConstant": false, "isLValue": false, "isPure": false, @@ -21619,26 +32078,26 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7362:117:1", + "src": "10146:135:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 769, + "id": 1087, "nodeType": "ExpressionStatement", - "src": "7362:117:1" + "src": "10146:135:1" } ] } }, - "id": 772, + "id": 1109, "nodeType": "IfStatement", - "src": "7227:263:1", + "src": "9943:540:1", "trueBody": { - "id": 753, + "id": 1060, "nodeType": "Block", - "src": "7251:59:1", + "src": "9967:59:1", "statements": [ { "expression": { @@ -21646,12 +32105,12 @@ "arguments": [ { "argumentTypes": null, - "id": 750, + "id": 1057, "name": "claimed_tokens", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7284:14:1", + "referencedDeclaration": 790, + "src": "10000:14:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -21667,18 +32126,18 @@ ], "expression": { "argumentTypes": null, - "id": 747, + "id": 1054, "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7265:9:1", + "referencedDeclaration": 723, + "src": "9981:9:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, - "id": 749, + "id": 1056, "isConstant": false, "isLValue": false, "isPure": false, @@ -21686,13 +32145,13 @@ "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "7265:18:1", + "src": "9981:18:1", "typeDescriptions": { "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256)" } }, - "id": 751, + "id": 1058, "isConstant": false, "isLValue": false, "isPure": false, @@ -21700,15 +32159,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7265:34:1", + "src": "9981:34:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 752, + "id": 1059, "nodeType": "ExpressionStatement", - "src": "7265:34:1" + "src": "9981:34:1" } ] } @@ -21721,26 +32180,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 774, + "id": 1111, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7549:2:1", + "referencedDeclaration": 717, + "src": "10542:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 775, + "id": 1112, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "id", "nodeType": "MemberAccess", - "referencedDeclaration": 61, - "src": "7549:5:1", + "referencedDeclaration": 63, + "src": "10542:5:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -21748,12 +32207,12 @@ }, { "argumentTypes": null, - "id": 776, + "id": 1113, "name": "recipient", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 609, - "src": "7556:9:1", + "referencedDeclaration": 723, + "src": "10549:9:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" @@ -21761,12 +32220,12 @@ }, { "argumentTypes": null, - "id": 777, + "id": 1114, "name": "claimed_tokens", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7567:14:1", + "referencedDeclaration": 790, + "src": "10560:14:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -21776,30 +32235,43 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 778, + "id": 1115, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 603, - "src": "7583:2:1", + "referencedDeclaration": 717, + "src": "10576:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 779, + "id": 1116, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_address", "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "7583:16:1", + "referencedDeclaration": 83, + "src": "10576:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } + }, + { + "argumentTypes": null, + "id": 1117, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 795, + "src": "10594:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } } ], "expression": { @@ -21819,20 +32291,24 @@ { "typeIdentifier": "t_address", "typeString": "address" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } ], - "id": 773, + "id": 1110, "name": "ClaimSuccess", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 133, - "src": "7536:12:1", + "referencedDeclaration": 129, + "src": "10529:12:1", "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$returns$__$", - "typeString": "function (bytes32,address,uint256,address)" + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (bytes32,address,uint256,address,uint256[] memory)" } }, - "id": 780, + "id": 1118, "isConstant": false, "isLValue": false, "isPure": false, @@ -21840,55 +32316,55 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7536:64:1", + "src": "10529:75:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 781, + "id": 1119, "nodeType": "EmitStatement", - "src": "7531:69:1" + "src": "10524:80:1" }, { "expression": { "argumentTypes": null, - "id": 782, + "id": 1120, "name": "claimed_tokens", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 680, - "src": "7617:14:1", + "referencedDeclaration": 790, + "src": "10621:14:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "functionReturnParameters": 601, - "id": 783, + "functionReturnParameters": 715, + "id": 1121, "nodeType": "Return", - "src": "7610:21:1" + "src": "10614:21:1" } ] }, "documentation": null, - "id": 785, + "id": 1123, "implemented": true, "kind": "function", "modifiers": [], "name": "claim", "nodeType": "FunctionDefinition", "parameters": { - "id": 598, + "id": 712, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 591, + "id": 705, "name": "id", "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5913:10:1", + "scope": 1123, + "src": "6749:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -21896,10 +32372,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 590, + "id": 704, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "5913:7:1", + "src": "6749:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -21910,11 +32386,11 @@ }, { "constant": false, - "id": 593, + "id": 707, "name": "password", "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5925:22:1", + "scope": 1123, + "src": "6761:22:1", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { @@ -21922,10 +32398,10 @@ "typeString": "string" }, "typeName": { - "id": 592, + "id": 706, "name": "string", "nodeType": "ElementaryTypeName", - "src": "5925:6:1", + "src": "6761:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" @@ -21936,11 +32412,11 @@ }, { "constant": false, - "id": 595, + "id": 709, "name": "_recipient", "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5949:18:1", + "scope": 1123, + "src": "6785:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -21948,10 +32424,10 @@ "typeString": "address" }, "typeName": { - "id": 594, + "id": 708, "name": "address", "nodeType": "ElementaryTypeName", - "src": "5949:7:1", + "src": "6785:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -21963,11 +32439,11 @@ }, { "constant": false, - "id": 597, + "id": 711, "name": "validation", "nodeType": "VariableDeclaration", - "scope": 785, - "src": "5969:18:1", + "scope": 1123, + "src": "6805:18:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -21975,10 +32451,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 596, + "id": 710, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "5969:7:1", + "src": "6805:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -21988,19 +32464,19 @@ "visibility": "internal" } ], - "src": "5912:76:1" + "src": "6748:76:1" }, "returnParameters": { - "id": 601, + "id": 715, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 600, + "id": 714, "name": "claimed", "nodeType": "VariableDeclaration", - "scope": 785, - "src": "6010:12:1", + "scope": 1123, + "src": "6846:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -22008,10 +32484,10 @@ "typeString": "uint256" }, "typeName": { - "id": 599, + "id": 713, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "6010:4:1", + "src": "6846:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -22021,47 +32497,47 @@ "visibility": "internal" } ], - "src": "6009:14:1" + "src": "6845:14:1" }, - "scope": 956, - "src": "5898:1740:1", + "scope": 1367, + "src": "6734:3908:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { - "id": 820, + "id": 1165, "nodeType": "Block", - "src": "7945:177:1", + "src": "10969:218:1", "statements": [ { "assignments": [ - 801 + 1141 ], "declarations": [ { "constant": false, - "id": 801, + "id": 1141, "name": "rp", "nodeType": "VariableDeclaration", - "scope": 820, - "src": "7955:20:1", + "scope": 1165, + "src": "10979:20:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" }, "typeName": { "contractScope": null, - "id": 800, + "id": 1140, "name": "RedPacket", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "7955:9:1", + "referencedDeclaration": 94, + "src": "10979:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" } }, @@ -22069,31 +32545,31 @@ "visibility": "internal" } ], - "id": 805, + "id": 1145, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 802, + "id": 1142, "name": "redpacket_by_id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "7978:15:1", + "referencedDeclaration": 145, + "src": "11002:15:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" } }, - "id": 804, + "id": 1144, "indexExpression": { "argumentTypes": null, - "id": 803, + "id": 1143, "name": "id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 787, - "src": "7994:2:1", + "referencedDeclaration": 1125, + "src": "11018:2:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -22104,14 +32580,14 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "7978:19:1", + "src": "11002:19:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", + "typeIdentifier": "t_struct$_RedPacket_$94_storage", "typeString": "struct HappyRedPacket.RedPacket storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "7955:42:1" + "src": "10979:42:1" }, { "expression": { @@ -22121,26 +32597,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 806, + "id": 1146, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8015:2:1", + "referencedDeclaration": 1141, + "src": "11039:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 807, + "id": 1147, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_address", "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "8015:16:1", + "referencedDeclaration": 83, + "src": "11039:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -22150,26 +32626,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 808, + "id": 1148, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8033:2:1", + "referencedDeclaration": 1141, + "src": "11057:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 809, + "id": 1149, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "8033:19:1", + "referencedDeclaration": 81, + "src": "11057:19:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -22179,18 +32655,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 810, + "id": 1150, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8054:2:1", + "referencedDeclaration": 1141, + "src": "11078:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 811, + "id": 1151, "isConstant": false, "isLValue": true, "isPure": false, @@ -22198,39 +32674,39 @@ "memberName": "total_number", "nodeType": "MemberAccess", "referencedDeclaration": 75, - "src": "8054:15:1", + "src": "11078:15:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, { "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 812, + "id": 1152, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8071:2:1", + "referencedDeclaration": 1141, + "src": "11112:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 813, + "id": 1153, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "claimed_number", "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "8071:17:1", + "referencedDeclaration": 77, + "src": "11112:17:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_uint8", + "typeString": "uint8" } }, { @@ -22239,19 +32715,19 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 817, + "id": 1157, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, - "id": 814, + "id": 1154, "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1745, - "src": "8090:3:1", + "referencedDeclaration": 3660, + "src": "11131:3:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -22263,76 +32739,148 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 815, + "id": 1155, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 801, - "src": "8096:2:1", + "referencedDeclaration": 1141, + "src": "11137:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 816, + "id": 1156, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "expiration_time", "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8096:18:1", + "referencedDeclaration": 79, + "src": "11137:18:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "8090:24:1", + "src": "11131:24:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1158, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1141, + "src": "11157:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1159, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimed", + "nodeType": "MemberAccess", + "referencedDeclaration": 93, + "src": "11157:10:1", + "typeDescriptions": { + "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", + "typeString": "mapping(address => bool)" + } + }, + "id": 1162, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1160, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "11168:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1161, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "11168:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11157:22:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], - "id": 818, + "id": 1163, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "8014:101:1", + "src": "11038:142:1", "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_address_$_t_uint256_$_t_uint256_$_t_uint256_$_t_bool_$", - "typeString": "tuple(address,uint256,uint256,uint256,bool)" + "typeIdentifier": "t_tuple$_t_address_$_t_uint256_$_t_uint8_$_t_uint8_$_t_bool_$_t_bool_$", + "typeString": "tuple(address,uint256,uint8,uint8,bool,bool)" } }, - "functionReturnParameters": 799, - "id": 819, + "functionReturnParameters": 1139, + "id": 1164, "nodeType": "Return", - "src": "8007:108:1" + "src": "11031:149:1" } ] }, "documentation": null, - "id": 821, + "id": 1166, "implemented": true, "kind": "function", "modifiers": [], "name": "check_availability", "nodeType": "FunctionDefinition", "parameters": { - "id": 788, + "id": 1126, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 787, + "id": 1125, "name": "id", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7770:10:1", + "scope": 1166, + "src": "10774:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -22340,10 +32888,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 786, + "id": 1124, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7770:7:1", + "src": "10774:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -22353,19 +32901,19 @@ "visibility": "internal" } ], - "src": "7769:12:1" + "src": "10773:12:1" }, "returnParameters": { - "id": 799, + "id": 1139, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 790, + "id": 1128, "name": "token_address", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7803:21:1", + "scope": 1166, + "src": "10807:21:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -22373,10 +32921,10 @@ "typeString": "address" }, "typeName": { - "id": 789, + "id": 1127, "name": "address", "nodeType": "ElementaryTypeName", - "src": "7803:7:1", + "src": "10807:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", @@ -22388,11 +32936,11 @@ }, { "constant": false, - "id": 792, + "id": 1130, "name": "balance", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7826:12:1", + "scope": 1166, + "src": "10830:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -22400,10 +32948,10 @@ "typeString": "uint256" }, "typeName": { - "id": 791, + "id": 1129, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "7826:4:1", + "src": "10830:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -22414,11 +32962,11 @@ }, { "constant": false, - "id": 794, + "id": 1132, "name": "total", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7905:10:1", + "scope": 1166, + "src": "10844:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -22426,10 +32974,10 @@ "typeString": "uint256" }, "typeName": { - "id": 793, + "id": 1131, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "7905:4:1", + "src": "10844:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -22440,11 +32988,11 @@ }, { "constant": false, - "id": 796, + "id": 1134, "name": "claimed", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7917:12:1", + "scope": 1166, + "src": "10925:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -22452,10 +33000,10 @@ "typeString": "uint256" }, "typeName": { - "id": 795, + "id": 1133, "name": "uint", "nodeType": "ElementaryTypeName", - "src": "7917:4:1", + "src": "10925:4:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -22466,11 +33014,37 @@ }, { "constant": false, - "id": 798, + "id": 1136, "name": "expired", "nodeType": "VariableDeclaration", - "scope": 821, - "src": "7931:12:1", + "scope": 1166, + "src": "10939:12:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 1135, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "10939:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "value": null, + "visibility": "internal" + }, + { + "constant": false, + "id": 1138, + "name": "ifclaimed", + "nodeType": "VariableDeclaration", + "scope": 1166, + "src": "10953:14:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -22478,10 +33052,10 @@ "typeString": "bool" }, "typeName": { - "id": 797, + "id": 1137, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "7931:4:1", + "src": "10953:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -22491,47 +33065,47 @@ "visibility": "internal" } ], - "src": "7802:142:1" + "src": "10806:162:1" }, - "scope": 956, - "src": "7742:380:1", + "scope": 1367, + "src": "10746:441:1", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { - "id": 880, + "id": 1184, "nodeType": "Block", - "src": "8340:325:1", + "src": "11341:94:1", "statements": [ { "assignments": [ - 833 + 1175 ], "declarations": [ { "constant": false, - "id": 833, + "id": 1175, "name": "rp", "nodeType": "VariableDeclaration", - "scope": 880, - "src": "8350:20:1", + "scope": 1184, + "src": "11351:20:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" }, "typeName": { "contractScope": null, - "id": 832, + "id": 1174, "name": "RedPacket", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "8350:9:1", + "referencedDeclaration": 94, + "src": "11351:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" } }, @@ -22539,31 +33113,31 @@ "visibility": "internal" } ], - "id": 837, + "id": 1179, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 834, + "id": 1176, "name": "redpacket_by_id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "8373:15:1", + "referencedDeclaration": 145, + "src": "11374:15:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" } }, - "id": 836, + "id": 1178, "indexExpression": { "argumentTypes": null, - "id": 835, + "id": 1177, "name": "id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 823, - "src": "8389:2:1", + "referencedDeclaration": 1168, + "src": "11390:2:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -22574,568 +33148,315 @@ "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", + "src": "11374:19:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" + "typeIdentifier": "t_struct$_RedPacket_$94_storage", + "typeString": "struct HappyRedPacket.RedPacket storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "8402:60:1" + "src": "11351:42:1" }, { - "body": { - "id": 873, - "nodeType": "Block", - "src": "8516:92:1", - "statements": [ + "expression": { + "argumentTypes": null, + "components": [ { + "argumentTypes": null, "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", + "id": 1180, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1175, + "src": "11411:2:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 872, - "nodeType": "ExpressionStatement", - "src": "8530:67:1" + "id": 1181, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "claimer_addrs", + "nodeType": "MemberAccess", + "referencedDeclaration": 86, + "src": "11411:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 856, + ], + "id": 1182, "isConstant": false, + "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, - "leftExpression": { + "nodeType": "TupleExpression", + "src": "11410:18:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage", + "typeString": "address[] storage ref" + } + }, + "functionReturnParameters": 1173, + "id": 1183, + "nodeType": "Return", + "src": "11403:25:1" + } + ] + }, + "documentation": null, + "id": 1185, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "check_claimed_list", + "nodeType": "FunctionDefinition", + "parameters": { + "id": 1169, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1168, + "name": "id", + "nodeType": "VariableDeclaration", + "scope": 1185, + "src": "11276:10:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 1167, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "11276:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11275:12:1" + }, + "returnParameters": { + "id": 1173, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 1172, + "name": "claimer_addrs", + "nodeType": "VariableDeclaration", + "scope": 1185, + "src": "11309:30:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", + "typeString": "address[]" + }, + "typeName": { + "baseType": { + "id": 1170, + "name": "address", + "nodeType": "ElementaryTypeName", + "src": "11309:7:1", + "stateMutability": "nonpayable", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + "id": 1171, + "length": null, + "nodeType": "ArrayTypeName", + "src": "11309:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", + "typeString": "address[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "src": "11308:32:1" + }, + "scope": 1367, + "src": "11248:187:1", + "stateMutability": "view", + "superFunction": null, + "visibility": "public" + }, + { + "body": { + "id": 1203, + "nodeType": "Block", + "src": "11584:97:1", + "statements": [ + { + "assignments": [ + 1194 + ], + "declarations": [ + { + "constant": false, + "id": 1194, + "name": "rp", + "nodeType": "VariableDeclaration", + "scope": 1203, + "src": "11594:20:1", + "stateVariable": false, + "storageLocation": "storage", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + }, + "typeName": { + "contractScope": null, + "id": 1193, + "name": "RedPacket", + "nodeType": "UserDefinedTypeName", + "referencedDeclaration": 94, + "src": "11594:9:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1198, + "initialValue": { + "argumentTypes": null, + "baseExpression": { "argumentTypes": null, - "id": 853, - "name": "i", + "id": 1195, + "name": "redpacket_by_id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 850, - "src": "8489:1:1", + "referencedDeclaration": 145, + "src": "11617:15:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", + "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" } }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { + "id": 1197, + "indexExpression": { "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", + "id": 1196, + "name": "id", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1187, + "src": "11633:2:1", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" } }, - "src": "8489:21:1", + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "11617:19:1", "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" + "typeIdentifier": "t_struct$_RedPacket_$94_storage", + "typeString": "struct HappyRedPacket.RedPacket storage ref" } }, - "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" + "nodeType": "VariableDeclarationStatement", + "src": "11594:42: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, + "id": 1199, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 833, - "src": "8641:2:1", + "referencedDeclaration": 1194, + "src": "11654:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 877, + "id": 1200, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, - "memberName": "claimer_addrs", + "memberName": "erc721_token_ids", "nodeType": "MemberAccess", - "referencedDeclaration": 90, - "src": "8641:16:1", + "referencedDeclaration": 89, + "src": "11654:19:1", "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } } ], - "id": 878, + "id": 1201, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "8624:34:1", + "src": "11653:21: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)" + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" } }, - "functionReturnParameters": 831, - "id": 879, + "functionReturnParameters": 1192, + "id": 1202, "nodeType": "Return", - "src": "8617:41:1" + "src": "11646:28:1" } ] }, "documentation": null, - "id": 881, + "id": 1204, "implemented": true, "kind": "function", "modifiers": [], - "name": "check_claimed_list", + "name": "check_erc721_token_ids", "nodeType": "FunctionDefinition", "parameters": { - "id": 824, + "id": 1188, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 823, + "id": 1187, "name": "id", "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8242:10:1", + "scope": 1204, + "src": "11516:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -23143,10 +33464,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 822, + "id": 1186, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8242:7:1", + "src": "11516:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -23156,19 +33477,19 @@ "visibility": "internal" } ], - "src": "8241:12:1" + "src": "11515:12:1" }, "returnParameters": { - "id": 831, + "id": 1192, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 827, - "name": "claimed_list", + "id": 1191, + "name": "erc721_token_ids", "nodeType": "VariableDeclaration", - "scope": 881, - "src": "8280:26:1", + "scope": 1204, + "src": "11549:33:1", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { @@ -23177,19 +33498,19 @@ }, "typeName": { "baseType": { - "id": 825, - "name": "uint", + "id": 1189, + "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "8280:4:1", + "src": "11549:7:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 826, + "id": 1190, "length": null, "nodeType": "ArrayTypeName", - "src": "8280:6:1", + "src": "11549:9:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", "typeString": "uint256[]" @@ -23197,86 +33518,49 @@ }, "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" + "src": "11548:35:1" }, - "scope": 956, - "src": "8214:451:1", + "scope": 1367, + "src": "11484:197:1", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { - "id": 954, + "id": 1365, "nodeType": "Block", - "src": "8706:620:1", + "src": "11722:1335:1", "statements": [ { "assignments": [ - 887 + 1210 ], "declarations": [ { "constant": false, - "id": 887, + "id": 1210, "name": "rp", "nodeType": "VariableDeclaration", - "scope": 954, - "src": "8716:20:1", + "scope": 1365, + "src": "11732:20:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" }, "typeName": { "contractScope": null, - "id": 886, + "id": 1209, "name": "RedPacket", "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 95, - "src": "8716:9:1", + "referencedDeclaration": 94, + "src": "11732:9:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket" } }, @@ -23284,31 +33568,31 @@ "visibility": "internal" } ], - "id": 891, + "id": 1214, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, - "id": 888, + "id": 1211, "name": "redpacket_by_id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 157, - "src": "8739:15:1", + "referencedDeclaration": 145, + "src": "11755:15:1", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$95_storage_$", + "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" } }, - "id": 890, + "id": 1213, "indexExpression": { "argumentTypes": null, - "id": 889, + "id": 1212, "name": "id", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 883, - "src": "8755:2:1", + "referencedDeclaration": 1206, + "src": "11771:2:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -23319,14 +33603,14 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "8739:19:1", + "src": "11755:19:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage", + "typeIdentifier": "t_struct$_RedPacket_$94_storage", "typeString": "struct HappyRedPacket.RedPacket storage ref" } }, "nodeType": "VariableDeclarationStatement", - "src": "8716:42:1" + "src": "11732:42:1" }, { "expression": { @@ -23338,7 +33622,7 @@ "typeIdentifier": "t_address", "typeString": "address" }, - "id": 898, + "id": 1221, "isConstant": false, "isLValue": false, "isPure": false, @@ -23347,18 +33631,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 893, + "id": 1216, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "8776:3:1", + "referencedDeclaration": 3658, + "src": "11792:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 894, + "id": 1217, "isConstant": false, "isLValue": false, "isPure": false, @@ -23366,7 +33650,7 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "8776:10:1", + "src": "11792:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" @@ -23380,46 +33664,46 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 895, + "id": 1218, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8790:2:1", + "referencedDeclaration": 1210, + "src": "11806:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 896, + "id": 1219, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "creator", "nodeType": "MemberAccess", - "referencedDeclaration": 70, - "src": "8790:10:1", + "referencedDeclaration": 73, + "src": "11806:10:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$102_storage", + "typeIdentifier": "t_struct$_Creator_$101_storage", "typeString": "struct HappyRedPacket.Creator storage ref" } }, - "id": 897, + "id": 1220, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "addr", "nodeType": "MemberAccess", - "referencedDeclaration": 99, - "src": "8790:15:1", + "referencedDeclaration": 98, + "src": "11806:15:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, - "src": "8776:29:1", + "src": "11792:29:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -23427,21 +33711,21 @@ }, { "argumentTypes": null, - "hexValue": "303038204f6e6c792074686520726564207061636b65742063726561746f722063616e20726566756e6420746865206d6f6e6579", - "id": 899, + "hexValue": "303131", + "id": 1222, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "8807:54:1", + "src": "11823:5:1", "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_stringliteral_bc53fa365cb20c8143df9a0166321d7a480df48fc715dae4b4ff50e8ffee4ec5", - "typeString": "literal_string \"008 Only the red packet creator can refund the money\"" + "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", + "typeString": "literal_string \"011\"" }, - "value": "008 Only the red packet creator can refund the money" + "value": "011" } ], "expression": { @@ -23451,25 +33735,25 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_bc53fa365cb20c8143df9a0166321d7a480df48fc715dae4b4ff50e8ffee4ec5", - "typeString": "literal_string \"008 Only the red packet creator can refund the money\"" + "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", + "typeString": "literal_string \"011\"" } ], - "id": 892, + "id": 1215, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ - 1746, - 1747 + 3661, + 3662 ], - "referencedDeclaration": 1747, - "src": "8768:7:1", + "referencedDeclaration": 3662, + "src": "11784:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 900, + "id": 1223, "isConstant": false, "isLValue": false, "isPure": false, @@ -23477,15 +33761,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8768:94:1", + "src": "11784:45:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 901, + "id": 1224, "nodeType": "ExpressionStatement", - "src": "8768:94:1" + "src": "11784:45:1" }, { "expression": { @@ -23497,7 +33781,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 906, + "id": 1229, "isConstant": false, "isLValue": false, "isPure": false, @@ -23506,26 +33790,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 903, + "id": 1226, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8880:2:1", + "referencedDeclaration": 1210, + "src": "11847:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 904, + "id": 1227, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "expiration_time", "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8880:18:1", + "referencedDeclaration": 79, + "src": "11847:18:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -23535,204 +33819,68 @@ "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", + "id": 1228, + "name": "now", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "8997:2:1", + "referencedDeclaration": 3660, + "src": "11868:3:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 914, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "8997:16:1", + "src": "11847:24:1", "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, { "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, + "hexValue": "303132", + "id": 1230, "isConstant": false, - "isLValue": true, - "isPure": false, + "isLValue": false, + "isPure": true, + "kind": "string", "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9015:19:1", + "nodeType": "Literal", + "src": "11873:5:1", + "subdenomination": null, "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } + "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", + "typeString": "literal_string \"012\"" + }, + "value": "012" } ], "expression": { "argumentTypes": [ { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" + "typeIdentifier": "t_bool", + "typeString": "bool" }, { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", + "typeString": "literal_string \"012\"" } ], - "id": 910, - "name": "RefundSuccess", + "id": 1225, + "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 149, - "src": "8976:13:1", + "overloadedDeclarations": [ + 3661, + 3662 + ], + "referencedDeclaration": 3662, + "src": "11839:7:1", "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256)" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } }, - "id": 917, + "id": 1231, "isConstant": false, "isLValue": false, "isPure": false, @@ -23740,15 +33888,15 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8976:59:1", + "src": "11839:40:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 918, - "nodeType": "EmitStatement", - "src": "8971:64:1" + "id": 1232, + "nodeType": "ExpressionStatement", + "src": "11839:40:1" }, { "condition": { @@ -23757,7 +33905,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 922, + "id": 1236, "isConstant": false, "isLValue": false, "isPure": false, @@ -23766,133 +33914,1243 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 919, + "id": 1233, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9049:2:1", + "referencedDeclaration": 1210, + "src": "11894:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 920, + "id": 1234, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9049:13:1", + "referencedDeclaration": 69, + "src": "11894:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "30", + "id": 1235, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "11911:1:1", + "subdenomination": null, "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "11894:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" + }, + "id": 1250, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1247, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "11997:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1248, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "11997:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 1249, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12014:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "11997:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1291, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1288, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12347:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1289, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "12347:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "argumentTypes": null, + "hexValue": "32", + "id": 1290, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12364:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "src": "12347:18:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1347, + "nodeType": "IfStatement", + "src": "12343:600:1", + "trueBody": { + "id": 1346, + "nodeType": "Block", + "src": "12367:576:1", + "statements": [ + { + "assignments": [ + 1295 + ], + "declarations": [ + { + "constant": false, + "id": 1295, + "name": "token_ids", + "nodeType": "VariableDeclaration", + "scope": 1346, + "src": "12381:26:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 1293, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12381:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1294, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12381:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1296, + "initialValue": null, + "nodeType": "VariableDeclarationStatement", + "src": "12381:26:1" + }, + { + "body": { + "id": 1329, + "nodeType": "Block", + "src": "12478:223:1", + "statements": [ + { + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1316, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1311, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12500:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1312, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "12500:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 1314, + "indexExpression": { + "argumentTypes": null, + "id": 1313, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1298, + "src": "12520:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12500:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "!=", + "rightExpression": { + "argumentTypes": null, + "hexValue": "307846464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646", + "id": 1315, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12526:66:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", + "typeString": "int_const 1157...(70 digits omitted)...9935" + }, + "value": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" + }, + "src": "12500:92:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseBody": null, + "id": 1328, + "nodeType": "IfStatement", + "src": "12496:191:1", + "trueBody": { + "id": 1327, + "nodeType": "Block", + "src": "12594:93:1", + "statements": [ + { + "expression": { + "argumentTypes": null, + "id": 1325, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "id": 1317, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1295, + "src": "12616:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 1320, + "indexExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1318, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1295, + "src": "12626:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + }, + "id": 1319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12626:16:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "nodeType": "IndexAccess", + "src": "12616:27:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "baseExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1321, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12646:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1322, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "12646:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 1324, + "indexExpression": { + "argumentTypes": null, + "id": 1323, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1298, + "src": "12666:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "12646:22:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12616:52:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1326, + "nodeType": "ExpressionStatement", + "src": "12616:52:1" + } + ] + } + } + ] + }, + "condition": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1307, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "id": 1301, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1298, + "src": "12438:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "argumentTypes": null, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 1306, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1302, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12442:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1303, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "erc721_token_ids", + "nodeType": "MemberAccess", + "referencedDeclaration": 89, + "src": "12442:19:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage", + "typeString": "uint256[] storage ref" + } + }, + "id": 1304, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "length", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12442:26:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "argumentTypes": null, + "hexValue": "31", + "id": 1305, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12471:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "12442:30:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "12438:34:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1330, + "initializationExpression": { + "assignments": [ + 1298 + ], + "declarations": [ + { + "constant": false, + "id": 1298, + "name": "i", + "nodeType": "VariableDeclaration", + "scope": 1330, + "src": "12426:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 1297, + "name": "uint", + "nodeType": "ElementaryTypeName", + "src": "12426:4:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1300, + "initialValue": { + "argumentTypes": null, + "hexValue": "30", + "id": 1299, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12435:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "nodeType": "VariableDeclarationStatement", + "src": "12426:10:1" + }, + "loopExpression": { + "expression": { + "argumentTypes": null, + "id": 1309, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "UnaryOperation", + "operator": "++", + "prefix": false, + "src": "12474:3:1", + "subExpression": { + "argumentTypes": null, + "id": 1308, + "name": "i", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1298, + "src": "12474:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1310, + "nodeType": "ExpressionStatement", + "src": "12474:3:1" + }, + "nodeType": "ForStatement", + "src": "12421:280:1" + }, + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1332, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12812:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1333, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_type", + "nodeType": "MemberAccess", + "referencedDeclaration": 69, + "src": "12812:13:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1334, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12827:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1335, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "12827:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "id": 1337, + "name": "this", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3680, + "src": "12853:4:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", + "typeString": "contract HappyRedPacket" + } + ], + "id": 1336, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "12845:7:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_address_$", + "typeString": "type(address)" + }, + "typeName": "address" + }, + "id": 1338, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12845:13:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1339, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "12888:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1340, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12888:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1341, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12900:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1342, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "12900:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "argumentTypes": null, + "id": 1343, + "name": "token_ids", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1295, + "src": "12921:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + } + ], + "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" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } + ], + "id": 1331, + "name": "transfer_token", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 616, + "src": "12797:14:1", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" + } + }, + "id": 1344, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12797:134:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1345, + "nodeType": "ExpressionStatement", + "src": "12797:134:1" + } + ] } }, - "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": 1348, + "nodeType": "IfStatement", + "src": "11993:950:1", + "trueBody": { + "id": 1287, + "nodeType": "Block", + "src": "12017:312:1", + "statements": [ + { + "assignments": [ + 1254 + ], + "declarations": [ + { + "constant": false, + "id": 1254, + "name": "token_ids_holder", + "nodeType": "VariableDeclaration", + "scope": 1287, + "src": "12031:33:1", + "stateVariable": false, + "storageLocation": "memory", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 1252, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12031:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1253, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12031:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "value": null, + "visibility": "internal" + } + ], + "id": 1260, + "initialValue": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "hexValue": "30", + "id": 1258, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "12081:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 1257, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "NewExpression", + "src": "12067:13: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": 1255, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "12071:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1256, + "length": null, + "nodeType": "ArrayTypeName", + "src": "12071:9:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + } + }, + "id": 1259, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12067:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory", + "typeString": "uint256[] memory" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "12031:52:1" }, - "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" + { + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1266, + "name": "msg", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3658, + "src": "12131:3:1", + "typeDescriptions": { + "typeIdentifier": "t_magic_message", + "typeString": "msg" + } + }, + "id": 1267, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "sender", + "nodeType": "MemberAccess", + "referencedDeclaration": null, + "src": "12131:10:1", + "typeDescriptions": { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1268, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12143:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1269, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "12143:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address_payable", + "typeString": "address payable" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1262, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12105:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1263, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "12105:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_address", + "typeString": "address" + } + ], + "id": 1261, + "name": "IERC20", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 2290, + "src": "12098:6:1", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", + "typeString": "type(contract IERC20)" + } + }, + "id": 1264, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12098:24:1", + "typeDescriptions": { + "typeIdentifier": "t_contract$_IERC20_$2290", + "typeString": "contract IERC20" + } + }, + "id": 1265, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "approve", + "nodeType": "MemberAccess", + "referencedDeclaration": 2262, + "src": "12098:32:1", + "typeDescriptions": { + "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", + "typeString": "function (address,uint256) external returns (bool)" + } + }, + "id": 1270, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12098:65:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 1271, + "nodeType": "ExpressionStatement", + "src": "12098:65: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, @@ -23901,26 +35159,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 938, + "id": 1273, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9201:2:1", + "referencedDeclaration": 1210, + "src": "12192:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 939, + "id": 1274, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_type", "nodeType": "MemberAccess", - "referencedDeclaration": 68, - "src": "9201:13:1", + "referencedDeclaration": 69, + "src": "12192:13:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -23930,26 +35188,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 940, + "id": 1275, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9216:2:1", + "referencedDeclaration": 1210, + "src": "12207:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 941, + "id": 1276, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "token_address", "nodeType": "MemberAccess", - "referencedDeclaration": 85, - "src": "9216:16:1", + "referencedDeclaration": 83, + "src": "12207:16:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -23960,14 +35218,14 @@ "arguments": [ { "argumentTypes": null, - "id": 943, + "id": 1278, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1759, - "src": "9242:4:1", + "referencedDeclaration": 3680, + "src": "12233:4:1", "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } } @@ -23975,24 +35233,24 @@ "expression": { "argumentTypes": [ { - "typeIdentifier": "t_contract$_HappyRedPacket_$956", + "typeIdentifier": "t_contract$_HappyRedPacket_$1367", "typeString": "contract HappyRedPacket" } ], - "id": 942, + "id": 1277, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "9234:7:1", + "src": "12225:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, - "id": 944, + "id": 1279, "isConstant": false, "isLValue": false, "isPure": false, @@ -24000,7 +35258,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9234:13:1", + "src": "12225:13:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" @@ -24010,18 +35268,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 945, + "id": 1280, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "9277:3:1", + "referencedDeclaration": 3658, + "src": "12268:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 946, + "id": 1281, "isConstant": false, "isLValue": false, "isPure": false, @@ -24029,7 +35287,7 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "9277:10:1", + "src": "12268:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" @@ -24039,30 +35297,43 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 947, + "id": 1282, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9289:2:1", + "referencedDeclaration": 1210, + "src": "12280:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 948, + "id": 1283, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9289:19:1", + "referencedDeclaration": 81, + "src": "12280:19:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } + }, + { + "argumentTypes": null, + "id": 1284, + "name": "token_ids_holder", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1254, + "src": "12301:16:1", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" + } } ], "expression": { @@ -24086,20 +35357,24 @@ { "typeIdentifier": "t_uint256", "typeString": "uint256" + }, + { + "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", + "typeString": "uint256[] memory" } ], - "id": 937, + "id": 1272, "name": "transfer_token", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 557, - "src": "9186:14:1", + "referencedDeclaration": 616, + "src": "12177: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)" + "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", + "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" } }, - "id": 949, + "id": 1285, "isConstant": false, "isLValue": false, "isPure": false, @@ -24107,26 +35382,26 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9186:123:1", + "src": "12177:141:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 950, + "id": 1286, "nodeType": "ExpressionStatement", - "src": "9186:123:1" + "src": "12177:141:1" } ] } }, - "id": 953, + "id": 1349, "nodeType": "IfStatement", - "src": "9045:275:1", + "src": "11890:1053:1", "trueBody": { - "id": 932, + "id": 1246, "nodeType": "Block", - "src": "9069:65:1", + "src": "11914:65:1", "statements": [ { "expression": { @@ -24136,26 +35411,26 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 928, + "id": 1242, "name": "rp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 887, - "src": "9103:2:1", + "referencedDeclaration": 1210, + "src": "11948:2:1", "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$95_storage_ptr", + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", "typeString": "struct HappyRedPacket.RedPacket storage pointer" } }, - "id": 929, + "id": 1243, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remaining_tokens", "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "9103:19:1", + "referencedDeclaration": 81, + "src": "11948:19:1", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -24173,18 +35448,18 @@ "argumentTypes": null, "expression": { "argumentTypes": null, - "id": 923, + "id": 1237, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 1743, - "src": "9083:3:1", + "referencedDeclaration": 3658, + "src": "11928:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, - "id": 926, + "id": 1240, "isConstant": false, "isLValue": false, "isPure": false, @@ -24192,13 +35467,13 @@ "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "9083:10:1", + "src": "11928:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, - "id": 927, + "id": 1241, "isConstant": false, "isLValue": false, "isPure": false, @@ -24206,13 +35481,13 @@ "memberName": "transfer", "nodeType": "MemberAccess", "referencedDeclaration": null, - "src": "9083:19:1", + "src": "11928:19:1", "typeDescriptions": { "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256)" } }, - "id": 930, + "id": 1244, "isConstant": false, "isLValue": false, "isPure": false, @@ -24220,39 +35495,242 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9083:40:1", + "src": "11928:40:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 931, + "id": 1245, "nodeType": "ExpressionStatement", - "src": "9083:40:1" + "src": "11928:40:1" } ] } + }, + { + "eventCall": { + "argumentTypes": null, + "arguments": [ + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1351, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12972:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1352, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "id", + "nodeType": "MemberAccess", + "referencedDeclaration": 63, + "src": "12972:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1353, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12979:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1354, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "token_address", + "nodeType": "MemberAccess", + "referencedDeclaration": 83, + "src": "12979:16:1", + "typeDescriptions": { + "typeIdentifier": "t_address", + "typeString": "address" + } + }, + { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1355, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "12997:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1356, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "12997: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": 1350, + "name": "RefundSuccess", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 137, + "src": "12958:13:1", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", + "typeString": "function (bytes32,address,uint256)" + } + }, + "id": 1357, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "12958:59:1", + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 1358, + "nodeType": "EmitStatement", + "src": "12953:64:1" + }, + { + "expression": { + "argumentTypes": null, + "id": 1363, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "argumentTypes": null, + "expression": { + "argumentTypes": null, + "id": 1359, + "name": "rp", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 1210, + "src": "13027:2:1", + "typeDescriptions": { + "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", + "typeString": "struct HappyRedPacket.RedPacket storage pointer" + } + }, + "id": 1361, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": true, + "memberName": "remaining_tokens", + "nodeType": "MemberAccess", + "referencedDeclaration": 81, + "src": "13027:19:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "argumentTypes": null, + "hexValue": "30", + "id": 1362, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "13049:1:1", + "subdenomination": null, + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "13027:23:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 1364, + "nodeType": "ExpressionStatement", + "src": "13027:23:1" } ] }, "documentation": null, - "id": 955, + "id": 1366, "implemented": true, "kind": "function", "modifiers": [], "name": "refund", "nodeType": "FunctionDefinition", "parameters": { - "id": 884, + "id": 1207, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 883, + "id": 1206, "name": "id", "nodeType": "VariableDeclaration", - "scope": 955, - "src": "8687:10:1", + "scope": 1366, + "src": "11703:10:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -24260,10 +35738,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 882, + "id": 1205, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8687:7:1", + "src": "11703:7:1", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -24273,30 +35751,30 @@ "visibility": "internal" } ], - "src": "8686:12:1" + "src": "11702:12:1" }, "returnParameters": { - "id": 885, + "id": 1208, "nodeType": "ParameterList", "parameters": [], - "src": "8706:0:1" + "src": "11722:0:1" }, - "scope": 956, - "src": "8671:655:1", + "scope": 1367, + "src": "11687:1370:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" } ], - "scope": 957, - "src": "91:9358:1" + "scope": 1368, + "src": "218:12962:1" } ], - "src": "0:9450:1" + "src": "0:13181:1" }, "compiler": { "name": "solc", - "version": "0.5.12+commit.7709ece9.Emscripten.clang" + "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": { "1576558570946": { @@ -24324,8 +35802,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0x7c5b30cb246ffca31f0c5b0bb7cc4ea9c9ef4b8ab6d9ead8c5ea87cbc5fcb83f": { "anonymous": false, @@ -24356,8 +35833,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0x7c5b30cb246ffca31f0c5b0bb7cc4ea9c9ef4b8ab6d9ead8c5ea87cbc5fcb83f" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -24382,8 +35858,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -24402,8 +35877,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -24434,8 +35908,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" } }, "links": {}, @@ -24467,8 +35940,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -24499,8 +35971,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -24525,8 +35996,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -24545,8 +36015,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -24578,8 +36047,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -24610,8 +36078,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -24636,8 +36103,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -24656,8 +36122,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -24689,8 +36154,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -24721,8 +36185,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -24747,8 +36210,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -24767,8 +36229,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -24800,8 +36261,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -24832,8 +36292,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -24858,8 +36317,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -24878,8 +36336,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -24911,8 +36368,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -24943,8 +36399,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -24969,8 +36424,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -24989,8 +36443,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -25022,8 +36475,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -25054,8 +36506,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -25080,8 +36531,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -25100,8 +36550,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -25133,8 +36582,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -25165,8 +36613,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -25191,8 +36638,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -25211,8 +36657,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -25244,8 +36689,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -25276,8 +36720,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -25302,8 +36745,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -25322,8 +36764,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -25355,8 +36796,7 @@ } ], "name": "ClaimSuccess", - "type": "event", - "signature": "0x0da6e58e25b68ae80386f6fd23922b75a31c9c10cb16c56b0dae168607f24379" + "type": "event" }, "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07": { "anonymous": false, @@ -25387,8 +36827,7 @@ } ], "name": "CreationSuccess", - "type": "event", - "signature": "0xeb3ba9f2a617d9a20f58737233a92b753d38dd0170359e689611f2824c793a07" + "type": "event" }, "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d": { "anonymous": false, @@ -25413,8 +36852,7 @@ } ], "name": "Failure", - "type": "event", - "signature": "0xf66c6666e1fb1aac5fdd867f4a4ce0731e8be23186d124a506cc53ae9fda724d" + "type": "event" }, "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee": { "anonymous": false, @@ -25433,8 +36871,7 @@ } ], "name": "RefundSuccess", - "type": "event", - "signature": "0x2b433b06b160533bffbaf230e4329d88d5101aa37ae3f4ee794f798e6387acee" + "type": "event" } }, "links": {}, @@ -25442,8 +36879,8 @@ "transactionHash": "0xe53f8b43eb721c4ad0a3145444d3e340a32e88820658e7bc40d387e195911dbb" } }, - "schemaVersion": "3.0.19", - "updatedAt": "2020-01-03T04:16:34.670Z", + "schemaVersion": "3.2.5", + "updatedAt": "2020-09-17T07:15:42.104Z", "devdoc": { "methods": {} }, diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index f8d55e2..a85ce2a 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -42,7 +42,7 @@ contract HappyRedPacket { address claimer, uint claimed_value, address token_address, - uint256 token_id + uint256[] token_id ); event RefundSuccess( @@ -90,7 +90,8 @@ 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); + uint256 [] memory token_ids_holder = new uint256[](0); + transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, token_ids_holder); } else if (_token_type == 2) { require(IERC721(_token_addr).isApprovedForAll(msg.sender, address(this)), "011"); @@ -127,7 +128,7 @@ contract HappyRedPacket { // 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"); @@ -135,19 +136,7 @@ contract HappyRedPacket { IERC20(token_address).transferFrom(sender_address, recipient_address, amount); } - } - - function transfer_token(uint token_type, address token_address, address sender_address, - address recipient_address, uint amount, uint256 erc721_token_ids) public payable{ - if (token_type == 2) { - require(IERC721(token_address).balanceOf(sender_address) >= amount, "012"); - IERC721(token_address).transferFrom(sender_address, recipient_address, erc721_token_ids); - } - } - - function transfer_token(uint token_type, address token_address, address sender_address, - address recipient_address, uint amount, uint256[] memory erc721_token_ids) public payable{ - if (token_type == 2) { + 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)){ @@ -156,6 +145,7 @@ contract HappyRedPacket { IERC721(token_address).transferFrom(sender_address, recipient_address, erc721_token_ids[i]); } } + } // A boring wrapper @@ -201,13 +191,13 @@ contract HappyRedPacket { // Store claimer info rp.claimer_addrs.push(recipient); uint claimed_tokens; - uint256 token_ids; + uint256 [] memory token_ids = new uint256[](1); //TODO: Optimize this behavior. // Todo get erc721 token id; if (rp.ifrandom == true) { if (rp.token_type == 2) { uint token_id_index = random(uuid, nonce) % rp.remaining_tokens; uint256[] memory _array = rp.erc721_token_ids; - token_ids = _array[token_id_index]; + token_ids[0] = _array[token_id_index]; rp.erc721_token_ids = getTokenIdWithIndex(_array, token_id_index); claimed_tokens = 1; rp.remaining_tokens -= 1; @@ -233,7 +223,7 @@ contract HappyRedPacket { if (rp.token_type == 2) { // token_id_index = random(uuid, nonce) % rp.remaining_tokens; uint256[] memory _array = rp.erc721_token_ids; - token_ids = rp.erc721_token_ids[0]; + token_ids[0] = rp.erc721_token_ids[0]; rp.erc721_token_ids = getTokenIdWithIndex(_array, 0); claimed_tokens = 1; rp.remaining_tokens -= 1; @@ -268,8 +258,9 @@ 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), @@ -310,20 +301,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; + 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]; + 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); + msg.sender, rp.remaining_tokens, token_ids); } emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens); From c275d219dada29c71b7165e0de8a4f2702c65c9c Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Thu, 17 Sep 2020 15:24:47 +0800 Subject: [PATCH 6/7] Remove the cache --- .gitignore | 3 - test/build/contracts/HappyRedPacket.json | 36890 --------------------- 2 files changed, 36893 deletions(-) delete mode 100644 test/build/contracts/HappyRedPacket.json diff --git a/.gitignore b/.gitignore index 812fd29..b38db2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -RedPacket.json -test/build/contracts/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 5ea39d9..0000000 --- a/test/build/contracts/HappyRedPacket.json +++ /dev/null @@ -1,36890 +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" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "token_id", - "type": "uint256[]" - } - ], - "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" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "erc721_token_ids", - "type": "uint256[]" - } - ], - "name": "CreationSuccess", - "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": [], - "name": "contract_creator", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "_hash", - "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "_number", - "type": "uint8" - }, - { - "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" - }, - { - "internalType": "uint256[]", - "name": "_erc721_token_ids", - "type": "uint256[]" - } - ], - "name": "create_red_packet", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "_hash", - "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "_number", - "type": "uint8" - }, - { - "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" - }, - { - "internalType": "uint256[]", - "name": "erc721_token_ids", - "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" - }, - { - "internalType": "bool", - "name": "ifclaimed", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "check_claimed_list", - "outputs": [ - { - "internalType": "address[]", - "name": "claimer_addrs", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "bytes32", - "name": "id", - "type": "bytes32" - } - ], - "name": "check_erc721_token_ids", - "outputs": [ - { - "internalType": "uint256[]", - "name": "erc721_token_ids", - "type": "uint256[]" - } - ], - "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.16+commit.9c3226ce\"},\"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\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"token_id\",\"type\":\"uint256[]\"}],\"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\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"erc721_token_ids\",\"type\":\"uint256[]\"}],\"name\":\"CreationSuccess\",\"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\"},{\"internalType\":\"bool\",\"name\":\"ifclaimed\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"check_claimed_list\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"claimer_addrs\",\"type\":\"address[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"check_erc721_token_ids\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"erc721_token_ids\",\"type\":\"uint256[]\"}],\"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\":true,\"inputs\":[],\"name\":\"contract_creator\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_number\",\"type\":\"uint8\"},{\"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\"},{\"internalType\":\"uint256[]\",\"name\":\"_erc721_token_ids\",\"type\":\"uint256[]\"}],\"name\":\"create_red_packet\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"_number\",\"type\":\"uint8\"},{\"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\"},{\"internalType\":\"uint256[]\",\"name\":\"erc721_token_ids\",\"type\":\"uint256[]\"}],\"name\":\"transfer_token\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol\":\"HappyRedPacket\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol\":{\"keccak256\":\"0xe003fb6d26b8831eb810cc324cc7ee54eeb9e6e9abcb71043534d7c271751d54\",\"urls\":[\"bzz-raw://690ba37f77adcc7c3a51f5ec5dfaa91115043ef2c82a3f1595788ce1761409ca\",\"dweb:/ipfs/QmU1Um2nk6Y86qYGw6nV5Rz4pBfBHdqnsSDH6CPEDikuzX\"]},\"openzeppelin-solidity/contracts/introspection/IERC165.sol\":{\"keccak256\":\"0xe0ed10f53955c35eecb02724538650a155aa940be3f0a54cd3bde6c6b0c6e48c\",\"urls\":[\"bzz-raw://7dcfda88e3225987245908c3296f3559752647036804325ebfaa9fd1545161c3\",\"dweb:/ipfs/QmXxx5rHfLL57zdgyyyG9MMv4XGN7bpVSc2MuDcaCgto6u\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0xe5bb0f57cff3e299f360052ba50f1ea0fff046df2be070b6943e0e3c3fdad8a9\",\"urls\":[\"bzz-raw://59fd025151435da35faa8093a5c7a17de02de9d08ad27275c5cdf05050820d91\",\"dweb:/ipfs/QmQMvwEcPhoRXzbXyrdoeRtvLoifUW9Qh7Luho7bmUPRkc\"]},\"openzeppelin-solidity/contracts/token/ERC721/IERC721.sol\":{\"keccak256\":\"0x680c11bc8173eef7d5db843baaf64ce499476de2c172f6aea631dbee54bcd2e6\",\"urls\":[\"bzz-raw://0f314963ab26fb65c6f364d57900f0f1aa8f6aeb4396e327e5e5c646815f060e\",\"dweb:/ipfs/Qmf6eSUtRUF4YDxGyhQq7TVDYzuHcYEvk9Us3RVy5iZQVH\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040518060400160405280602081526020017f466f726d6572204e424120436f6d6d697373696f6e657220446176696420537481525042600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516020018084805190602001908083835b602083106100e257805182526020820191506020810190506020830392506100bf565b6001836020036101000a0380198251168184511680821785525050505050509050018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b8152601401935050505060405160208183030381529060405280519060200120600481905550612f528061016f6000396000f3fe6080604052600436106100915760003560e01c80639224967c116100595780639224967c14610523578063a2f2d261146105b3578063bf5c2920146106df578063c807a6b614610736578063ffed49bc146108f457610091565b8063313f315814610096578063507249eb14610126578063593b79fe146103785780636bfdaece146104425780637249fbb6146104e8575b600080fd5b3480156100a257600080fd5b506100cf600480360360208110156100b957600080fd5b8101908080359060200190929190505050610a04565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156101125780820151818401526020810190506100f7565b505050509050019250505060405180910390f35b610376600480360361016081101561013d57600080fd5b8101908080359060200190929190803560ff16906020019092919080351515906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561019157600080fd5b8201836020820111156101a357600080fd5b803590602001918460018302840111640100000000831117156101c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184600183028401116401000000008311171561025c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102f357600080fd5b82018360208201111561030557600080fd5b8035906020019184602083028401116401000000008311171561032757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610a78565b005b34801561038457600080fd5b506103c76004803603602081101561039b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061136c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104075780820151818401526020810190506103ec565b50505050905090810190601f1680156104345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561044e57600080fd5b5061047b6004803603602081101561046557600080fd5b81019080803590602001909291905050506113b7565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018315151515815260200182151515158152602001965050505050505060405180910390f35b3480156104f457600080fd5b506105216004803603602081101561050b57600080fd5b810190808035906020019092919050505061149d565b005b34801561052f57600080fd5b5061055c6004803603602081101561054657600080fd5b8101908080359060200190929190505050611953565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561059f578082015181840152602081019050610584565b505050509050019250505060405180910390f35b6106dd600480360360c08110156105c957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561065a57600080fd5b82018360208201111561066c57600080fd5b8035906020019184602083028401116401000000008311171561068e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506119fd565b005b3480156106eb57600080fd5b506106f461201b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108f2600480360361014081101561074d57600080fd5b8101908080359060200190929190803560ff1690602001909291908035151590602001909291908035906020019092919080359060200190929190803590602001906401000000008111156107a157600080fd5b8201836020820111156107b357600080fd5b803590602001918460018302840111640100000000831117156107d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561083857600080fd5b82018360208201111561084a57600080fd5b8035906020019184600183028401116401000000008311171561086c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612041565b005b34801561090057600080fd5b506109ee6004803603608081101561091757600080fd5b81019080803590602001909291908035906020019064010000000081111561093e57600080fd5b82018360208201111561095057600080fd5b8035906020019184600183028401116401000000008311171561097257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612090565b6040518082815260200191505060405180910390f35b6060600060026000848152602001908152602001600020905080600d01805480602002602001604051908101604052809291908181526020018280548015610a6b57602002820191906000526020600020905b815481526020019060010190808311610a57575b5050505050915050919050565b600080815480929190600101919050555060038054905060005411610b05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303030000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8960ff16821015610b7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303031000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008a60ff1611610bf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303032000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000841415610c7b5781341015610c76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303038000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fa6565b6001841415610e2e57818373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d6020811015610d6057600080fd5b81019080805190602001909291905050501015610de5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303039000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60606000604051908082528060200260200182016040528015610e175781602001602082028038833980820191505090505b509050610e288585333087866119fd565b50610fa5565b6002841415610fa4578273ffffffffffffffffffffffffffffffffffffffff1663e985e9c533306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610ee857600080fd5b505afa158015610efc573d6000803e3d6000fd5b505050506040513d6020811015610f1257600080fd5b8101908080519060200190929190505050610f95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303131000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fa38484333086866119fd565b5b5b5b600033426000546004548b604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018581526020018481526020018381526020018281526020019550505050505060405160208183030381529060405280519060200120905060006002600083815260200190815260200160002090508181600001819055506003816000015490806001815401808255809150509060018203906000526020600020016000909192909190915055508581600301819055508481600b0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508b8160080160006101000a81548160ff021916908360ff1602179055508381600a0181905550338160050160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086816005016000019080519060200190611147929190612e0a565b5087816005016002019080519060200190611163929190612e0a565b5060008a1415611174576201518099505b61117e428b612ac9565b816009018190555060008160080160016101000a81548160ff021916908360ff1602179055508a8160020160006101000a81548160ff0219169083151502179055508c81600101819055506111f16111ea858360080160009054906101000a900460ff1660ff16612b51565b6002612b9b565b81600401819055508281600d019080519060200190611211929190612e8a565b507fdcb284c7587b44873346be2269371093618514e6af139985542910fed956590b81600a015482600001548360050160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff164285600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600d01604051808781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818154815260200191508054801561134a57602002820191906000526020600020905b815481526020019060010190808311611336575b505097505050505050505060405180910390a150505050505050505050505050565b606060405173ffffffffffffffffffffffffffffffffffffffff8316925082741400000000000000000000000000000000000000001860148201526034810160405280915050919050565b600080600080600080600060026000898152602001908152602001600020905080600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600a01548260080160009054906101000a900460ff168360080160019054906101000a900460ff168460090154421185600e0160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168360ff1693508260ff1692509650965096509650965096505091939550919395565b60006002600083815260200190815260200160002090508060050160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461157c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303131000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b428160090154106115f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303132000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081600301541415611652573373ffffffffffffffffffffffffffffffffffffffff166108fc82600a01549081150290604051600060405180830381858888f1935050505015801561164c573d6000803e3d6000fd5b506118a6565b6001816003015414156117bf57606060006040519080825280602002602001820160405280156116915781602001602082028038833980820191505090505b50905081600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b33384600a01546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174357600080fd5b505af1158015611757573d6000803e3d6000fd5b505050506040513d602081101561176d57600080fd5b8101908080519060200190929190505050506117b9826003015483600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303386600a0154866119fd565b506118a5565b6002816003015414156118a457606060008090505b600183600d018054905003811015611867577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83600d01828154811061181657fe5b90600052602060002001541461185a5782600d01818154811061183557fe5b90600052602060002001548283518151811061184d57fe5b6020026020010181815250505b80806001019150506117d4565b506118a2826003015483600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303386600a0154866119fd565b505b5b5b7f66c304c539e0bc7c8070207c09b9f6a5a9591b434dfed1867cc57fde7fb60093816000015482600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600a0154604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1600081600a01819055505050565b6060600060026000848152602001908152602001600020905080600c018054806020026020016040519081016040528092919081815260200182805480156119f057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116119a6575b5050505050915050919050565b6001861415611cf257818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611a8457600080fd5b505afa158015611a98573d6000803e3d6000fd5b505050506040513d6020811015611aae57600080fd5b81019080805190602001909291905050501015611b33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303130000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b385846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611bba57600080fd5b505af1158015611bce573d6000803e3d6000fd5b505050506040513d6020811015611be457600080fd5b8101908080519060200190929190505050508473ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611cb157600080fd5b505af1158015611cc5573d6000803e3d6000fd5b505050506040513d6020811015611cdb57600080fd5b810190808051906020019092919050505050612013565b600286141561201257818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611d7957600080fd5b505afa158015611d8d573d6000803e3d6000fd5b505050506040513d6020811015611da357600080fd5b81019080805190602001909291905050501015611e28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303132000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b82811015612010573073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611f1d578573ffffffffffffffffffffffffffffffffffffffff1663095ea7b385848481518110611e9357fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611f0457600080fd5b505af1158015611f18573d6000803e3d6000fd5b505050505b8573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686858581518110611f4757fe5b60200260200101516040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015611feb57600080fd5b505af1158015611fff573d6000803e3d6000fd5b505050508080600101915050611e2e565b505b5b505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6120848a8a8a8a8a8a8a8a8a8a600160405190808252806020026020018201604052801561207e5781602001602082028038833980820191505090505b50610a78565b50505050505050505050565b600080600260008781526020019081526020016000209050600084905042826009015411612126576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303033000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8160080160009054906101000a900460ff1660ff168260080160019054906101000a900460ff1660ff16106121c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303034000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000151582600e0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461228b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303035000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b816001015486805190602001201461230b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303036000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6123143361136c565b80519060200120841461238f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303037000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600c018190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060006060600160405190808252806020026020018201604052801561242b5781602001602082028038833980820191505090505b509050600115158460020160009054906101000a900460ff16151514156126005760028460030154141561253c57600084600a015461246e600454600054612c21565b8161247557fe5b069050606085600d018054806020026020016040519081016040528092919081815260200182805480156124c857602002820191906000526020600020905b8154815260200190600101908083116124b4575b505050505090508082815181106124db57fe5b6020026020010151836000815181106124f057fe5b6020026020010181815250506125068183612c9c565b86600d01908051906020019061251d929190612e8a565b5060019350600186600a016000828254039250508190555050506125fb565b60018460080160019054906101000a900460ff168560080160009054906101000a900460ff160360ff1614156125785783600a015491506125fa565b836004015461258b600454600054612c21565b8161259257fe5b06915060008214156125a757600191506125e7565b83600a015482106125e65760018460080160019054906101000a900460ff168560080160009054906101000a900460ff16030360ff1684600a01540391505b5b8184600a01600082825403925050819055505b5b612760565b6002846003015414156126d857606084600d0180548060200260200160405190810160405280929190818152602001828054801561265d57602002820191906000526020600020905b815481526020019060010190808311612649575b5050505050905084600d0160008154811061267457fe5b90600052602060002001548260008151811061268c57fe5b6020026020010181815250506126a3816000612c9c565b85600d0190805190602001906126ba929190612e8a565b5060019250600185600a01600082825403925050819055505061275f565b60018460080160019054906101000a900460ff168560080160009054906101000a900460ff160360ff1614156127145783600a0154915061274c565b61274984600a01548560080160019054906101000a900460ff168660080160009054906101000a900460ff160360ff16612b51565b91505b8184600a01600082825403925050819055505b5b600184600e0160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555083600801600181819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff1602179055505060028460030154141561280d5783600a01548460040181905550612885565b8360080160019054906101000a900460ff1660ff168460080160009054906101000a900460ff1660ff16146128845761287b61287485600a01548660080160019054906101000a900460ff168760080160009054906101000a900460ff160360ff16612b51565b6002612b9b565b84600401819055505b5b6000846003015414156128de578273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156128d8573d6000803e3d6000fd5b506129a2565b60018460030154141561295c576060600060405190808252806020026020018201604052801561291d5781602001602082028038833980820191505090505b509050612956856003015486600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308787866119fd565b506129a1565b6002846003015414156129a05761299f846003015485600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308686866119fd565b5b5b5b7f0fe6f2b72f83f5f793de367c980d289f086ddce851bb3d8be18a71b410a01e488460000154848487600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685604051808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015612aa3578082015181840152602081019050612a88565b50505050905001965050505050505060405180910390a181945050505050949350505050565b600080828401905083811015612b47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612b9383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d44565b905092915050565b600080831415612bae5760009050612c1b565b6000828402905082848281612bbf57fe5b0414612c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612efd6021913960400191505060405180910390fd5b809150505b92915050565b600081338442604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c905092915050565b606082518210612cae57829050612d3e565b60008290505b6001845103811015612cfc57836001820181518110612ccf57fe5b6020026020010151848281518110612ce357fe5b6020026020010181815250508080600101915050612cb4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83600185510381518110612d2e57fe5b6020026020010181815250508290505b92915050565b60008083118290612df0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612db5578082015181840152602081019050612d9a565b50505050905090810190601f168015612de25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612dfc57fe5b049050809150509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e4b57805160ff1916838001178555612e79565b82800160010185558215612e79579182015b82811115612e78578251825591602001919060010190612e5d565b5b509050612e869190612ed7565b5090565b828054828255906000526020600020908101928215612ec6579160200282015b82811115612ec5578251825591602001919060010190612eaa565b5b509050612ed39190612ed7565b5090565b612ef991905b80821115612ef5576000816000905550600101612edd565b5090565b9056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158208faa56b8e97bd75aa6a59df6ba3e1dd6e1eaef916561fcae60a87b58497b0fea64736f6c63430005100032", - "deployedBytecode": "0x6080604052600436106100915760003560e01c80639224967c116100595780639224967c14610523578063a2f2d261146105b3578063bf5c2920146106df578063c807a6b614610736578063ffed49bc146108f457610091565b8063313f315814610096578063507249eb14610126578063593b79fe146103785780636bfdaece146104425780637249fbb6146104e8575b600080fd5b3480156100a257600080fd5b506100cf600480360360208110156100b957600080fd5b8101908080359060200190929190505050610a04565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156101125780820151818401526020810190506100f7565b505050509050019250505060405180910390f35b610376600480360361016081101561013d57600080fd5b8101908080359060200190929190803560ff16906020019092919080351515906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561019157600080fd5b8201836020820111156101a357600080fd5b803590602001918460018302840111640100000000831117156101c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561022857600080fd5b82018360208201111561023a57600080fd5b8035906020019184600183028401116401000000008311171561025c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156102f357600080fd5b82018360208201111561030557600080fd5b8035906020019184602083028401116401000000008311171561032757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610a78565b005b34801561038457600080fd5b506103c76004803603602081101561039b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061136c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104075780820151818401526020810190506103ec565b50505050905090810190601f1680156104345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561044e57600080fd5b5061047b6004803603602081101561046557600080fd5b81019080803590602001909291905050506113b7565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018315151515815260200182151515158152602001965050505050505060405180910390f35b3480156104f457600080fd5b506105216004803603602081101561050b57600080fd5b810190808035906020019092919050505061149d565b005b34801561052f57600080fd5b5061055c6004803603602081101561054657600080fd5b8101908080359060200190929190505050611953565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561059f578082015181840152602081019050610584565b505050509050019250505060405180910390f35b6106dd600480360360c08110156105c957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561065a57600080fd5b82018360208201111561066c57600080fd5b8035906020019184602083028401116401000000008311171561068e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506119fd565b005b3480156106eb57600080fd5b506106f461201b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108f2600480360361014081101561074d57600080fd5b8101908080359060200190929190803560ff1690602001909291908035151590602001909291908035906020019092919080359060200190929190803590602001906401000000008111156107a157600080fd5b8201836020820111156107b357600080fd5b803590602001918460018302840111640100000000831117156107d557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561083857600080fd5b82018360208201111561084a57600080fd5b8035906020019184600183028401116401000000008311171561086c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612041565b005b34801561090057600080fd5b506109ee6004803603608081101561091757600080fd5b81019080803590602001909291908035906020019064010000000081111561093e57600080fd5b82018360208201111561095057600080fd5b8035906020019184600183028401116401000000008311171561097257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612090565b6040518082815260200191505060405180910390f35b6060600060026000848152602001908152602001600020905080600d01805480602002602001604051908101604052809291908181526020018280548015610a6b57602002820191906000526020600020905b815481526020019060010190808311610a57575b5050505050915050919050565b600080815480929190600101919050555060038054905060005411610b05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303030000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8960ff16821015610b7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303031000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008a60ff1611610bf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303032000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000841415610c7b5781341015610c76576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303038000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fa6565b6001841415610e2e57818373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d6020811015610d6057600080fd5b81019080805190602001909291905050501015610de5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303039000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60606000604051908082528060200260200182016040528015610e175781602001602082028038833980820191505090505b509050610e288585333087866119fd565b50610fa5565b6002841415610fa4578273ffffffffffffffffffffffffffffffffffffffff1663e985e9c533306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610ee857600080fd5b505afa158015610efc573d6000803e3d6000fd5b505050506040513d6020811015610f1257600080fd5b8101908080519060200190929190505050610f95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303131000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610fa38484333086866119fd565b5b5b5b600033426000546004548b604051602001808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018581526020018481526020018381526020018281526020019550505050505060405160208183030381529060405280519060200120905060006002600083815260200190815260200160002090508181600001819055506003816000015490806001815401808255809150509060018203906000526020600020016000909192909190915055508581600301819055508481600b0160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508b8160080160006101000a81548160ff021916908360ff1602179055508381600a0181905550338160050160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555086816005016000019080519060200190611147929190612e0a565b5087816005016002019080519060200190611163929190612e0a565b5060008a1415611174576201518099505b61117e428b612ac9565b816009018190555060008160080160016101000a81548160ff021916908360ff1602179055508a8160020160006101000a81548160ff0219169083151502179055508c81600101819055506111f16111ea858360080160009054906101000a900460ff1660ff16612b51565b6002612b9b565b81600401819055508281600d019080519060200190611211929190612e8a565b507fdcb284c7587b44873346be2269371093618514e6af139985542910fed956590b81600a015482600001548360050160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff164285600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600d01604051808781526020018681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818154815260200191508054801561134a57602002820191906000526020600020905b815481526020019060010190808311611336575b505097505050505050505060405180910390a150505050505050505050505050565b606060405173ffffffffffffffffffffffffffffffffffffffff8316925082741400000000000000000000000000000000000000001860148201526034810160405280915050919050565b600080600080600080600060026000898152602001908152602001600020905080600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600a01548260080160009054906101000a900460ff168360080160019054906101000a900460ff168460090154421185600e0160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168360ff1693508260ff1692509650965096509650965096505091939550919395565b60006002600083815260200190815260200160002090508060050160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461157c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303131000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b428160090154106115f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303132000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600081600301541415611652573373ffffffffffffffffffffffffffffffffffffffff166108fc82600a01549081150290604051600060405180830381858888f1935050505015801561164c573d6000803e3d6000fd5b506118a6565b6001816003015414156117bf57606060006040519080825280602002602001820160405280156116915781602001602082028038833980820191505090505b50905081600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b33384600a01546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174357600080fd5b505af1158015611757573d6000803e3d6000fd5b505050506040513d602081101561176d57600080fd5b8101908080519060200190929190505050506117b9826003015483600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303386600a0154866119fd565b506118a5565b6002816003015414156118a457606060008090505b600183600d018054905003811015611867577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83600d01828154811061181657fe5b90600052602060002001541461185a5782600d01818154811061183557fe5b90600052602060002001548283518151811061184d57fe5b6020026020010181815250505b80806001019150506117d4565b506118a2826003015483600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16303386600a0154866119fd565b505b5b5b7f66c304c539e0bc7c8070207c09b9f6a5a9591b434dfed1867cc57fde7fb60093816000015482600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600a0154604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1600081600a01819055505050565b6060600060026000848152602001908152602001600020905080600c018054806020026020016040519081016040528092919081815260200182805480156119f057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116119a6575b5050505050915050919050565b6001861415611cf257818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611a8457600080fd5b505afa158015611a98573d6000803e3d6000fd5b505050506040513d6020811015611aae57600080fd5b81019080805190602001909291905050501015611b33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303130000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1663095ea7b385846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611bba57600080fd5b505af1158015611bce573d6000803e3d6000fd5b505050506040513d6020811015611be457600080fd5b8101908080519060200190929190505050508473ffffffffffffffffffffffffffffffffffffffff166323b872dd8585856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611cb157600080fd5b505af1158015611cc5573d6000803e3d6000fd5b505050506040513d6020811015611cdb57600080fd5b810190808051906020019092919050505050612013565b600286141561201257818573ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611d7957600080fd5b505afa158015611d8d573d6000803e3d6000fd5b505050506040513d6020811015611da357600080fd5b81019080805190602001909291905050501015611e28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303132000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b82811015612010573073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611f1d578573ffffffffffffffffffffffffffffffffffffffff1663095ea7b385848481518110611e9357fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015611f0457600080fd5b505af1158015611f18573d6000803e3d6000fd5b505050505b8573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686858581518110611f4757fe5b60200260200101516040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015611feb57600080fd5b505af1158015611fff573d6000803e3d6000fd5b505050508080600101915050611e2e565b505b5b505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6120848a8a8a8a8a8a8a8a8a8a600160405190808252806020026020018201604052801561207e5781602001602082028038833980820191505090505b50610a78565b50505050505050505050565b600080600260008781526020019081526020016000209050600084905042826009015411612126576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303033000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8160080160009054906101000a900460ff1660ff168260080160019054906101000a900460ff1660ff16106121c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303034000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000151582600e0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461228b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303035000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b816001015486805190602001201461230b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303036000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6123143361136c565b80519060200120841461238f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260038152602001807f303037000000000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600c018190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060006060600160405190808252806020026020018201604052801561242b5781602001602082028038833980820191505090505b509050600115158460020160009054906101000a900460ff16151514156126005760028460030154141561253c57600084600a015461246e600454600054612c21565b8161247557fe5b069050606085600d018054806020026020016040519081016040528092919081815260200182805480156124c857602002820191906000526020600020905b8154815260200190600101908083116124b4575b505050505090508082815181106124db57fe5b6020026020010151836000815181106124f057fe5b6020026020010181815250506125068183612c9c565b86600d01908051906020019061251d929190612e8a565b5060019350600186600a016000828254039250508190555050506125fb565b60018460080160019054906101000a900460ff168560080160009054906101000a900460ff160360ff1614156125785783600a015491506125fa565b836004015461258b600454600054612c21565b8161259257fe5b06915060008214156125a757600191506125e7565b83600a015482106125e65760018460080160019054906101000a900460ff168560080160009054906101000a900460ff16030360ff1684600a01540391505b5b8184600a01600082825403925050819055505b5b612760565b6002846003015414156126d857606084600d0180548060200260200160405190810160405280929190818152602001828054801561265d57602002820191906000526020600020905b815481526020019060010190808311612649575b5050505050905084600d0160008154811061267457fe5b90600052602060002001548260008151811061268c57fe5b6020026020010181815250506126a3816000612c9c565b85600d0190805190602001906126ba929190612e8a565b5060019250600185600a01600082825403925050819055505061275f565b60018460080160019054906101000a900460ff168560080160009054906101000a900460ff160360ff1614156127145783600a0154915061274c565b61274984600a01548560080160019054906101000a900460ff168660080160009054906101000a900460ff160360ff16612b51565b91505b8184600a01600082825403925050819055505b5b600184600e0160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555083600801600181819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff1602179055505060028460030154141561280d5783600a01548460040181905550612885565b8360080160019054906101000a900460ff1660ff168460080160009054906101000a900460ff1660ff16146128845761287b61287485600a01548660080160019054906101000a900460ff168760080160009054906101000a900460ff160360ff16612b51565b6002612b9b565b84600401819055505b5b6000846003015414156128de578273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156128d8573d6000803e3d6000fd5b506129a2565b60018460030154141561295c576060600060405190808252806020026020018201604052801561291d5781602001602082028038833980820191505090505b509050612956856003015486600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308787866119fd565b506129a1565b6002846003015414156129a05761299f846003015485600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308686866119fd565b5b5b5b7f0fe6f2b72f83f5f793de367c980d289f086ddce851bb3d8be18a71b410a01e488460000154848487600b0160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685604051808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015612aa3578082015181840152602081019050612a88565b50505050905001965050505050505060405180910390a181945050505050949350505050565b600080828401905083811015612b47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612b9383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612d44565b905092915050565b600080831415612bae5760009050612c1b565b6000828402905082848281612bbf57fe5b0414612c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612efd6021913960400191505060405180910390fd5b809150505b92915050565b600081338442604051602001808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c905092915050565b606082518210612cae57829050612d3e565b60008290505b6001845103811015612cfc57836001820181518110612ccf57fe5b6020026020010151848281518110612ce357fe5b6020026020010181815250508080600101915050612cb4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83600185510381518110612d2e57fe5b6020026020010181815250508290505b92915050565b60008083118290612df0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612db5578082015181840152602081019050612d9a565b50505050905090810190601f168015612de25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612dfc57fe5b049050809150509392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e4b57805160ff1916838001178555612e79565b82800160010185558215612e79579182015b82811115612e78578251825591602001919060010190612e5d565b5b509050612e869190612ed7565b5090565b828054828255906000526020600020908101928215612ec6579160200282015b82811115612ec5578251825591602001919060010190612eaa565b5b509050612ed39190612ed7565b5090565b612ef991905b80821115612ef5576000816000905550600101612edd565b5090565b9056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158208faa56b8e97bd75aa6a59df6ba3e1dd6e1eaef916561fcae60a87b58497b0fea64736f6c63430005100032", - "sourceMap": "218:12962:1:-;;;1489:141;8:9:-1;5:2;;;30:1;27;20:12;5:2;1489:141:1;1539:10;1520:16;;:29;;;;;;;;;;;;;;;;;;1593:5;;;;;;;;;;;;;;;;;1600:3;1605:16;;;;;;;;;;;1576: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;;;1576:46:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1576:46:1;;;1566:57;;;;;;1559:4;:64;;;;218:12962;;;;;;", - "deployedSourceMap": "218:12962:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11484:197;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11484:197:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11484:197: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;11484:197:1;;;;;;;;;;;;;;;;;2284:2237;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;2284:2237:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2284:2237:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2284:2237: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;2284:2237: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;;2284:2237:1;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2284:2237:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2284:2237: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;2284:2237: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;;2284:2237:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2284:2237:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2284:2237: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;2284:2237: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;;2284:2237:1;;;;;;;;;;;;;;;:::i;:::-;;5903:343;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5903:343:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5903: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;5903:343:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10746:441;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10746:441:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;10746:441:1;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11687:1370;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11687:1370:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11687:1370:1;;;;;;;;;;;;;;;;;:::i;:::-;;11248:187;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11248:187:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;11248:187: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;11248:187:1;;;;;;;;;;;;;;;;;4571:988;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;4571:988:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;4571:988:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;4571:988: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;4571:988: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;;4571:988:1;;;;;;;;;;;;;;;:::i;:::-;;1263:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1263:31:1;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1720:474;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1720:474:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1720:474:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1720:474: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;1720:474: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;;1720:474:1;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1720:474:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1720:474: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;1720:474: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;;1720:474:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;6734:3908;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6734:3908:1;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;6734:3908:1;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;6734:3908:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;6734:3908: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;6734:3908: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;;6734:3908:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;11484:197;11549:33;11594:20;11617:15;:19;11633:2;11617:19;;;;;;;;;;;11594:42;;11654:2;:19;;11646:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11484:197;;;:::o;2284:2237::-;2656:5;;:8;;;;;;;;;;;;;2690:10;:17;;;;2682:5;;:25;2674:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2750:7;2733:24;;:13;:24;;2725:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2793:1;2783:7;:11;;;2775:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2832:1;2817:11;:16;2813:762;;;2870:13;2857:9;:26;;2849:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2813:762;;;2943:1;2928:11;:16;2924:651;;;3028:13;2975:11;2968:29;;;2998:10;3018:4;2968:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2968:56:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2968:56:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2968:56:1;;;;;;;;;;;;;;;;:73;;2960:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3063:34;3114:1;3100:16;;;;;;;;;;;;;;;;;;;;;;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;3100:16:1;;;;3063:53;;3131:100;3146:11;3159;3172:10;3192:4;3199:13;3214:16;3131:14;:100::i;:::-;2924:651;;;;3275:1;3260:11;:16;3256:319;;;3308:11;3300:37;;;3338:10;3358:4;3300:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3300:64:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3300:64:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3300:64:1;;;;;;;;;;;;;;;;3292:80;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3386:101;3401:11;3414;3427:10;3447:4;3454:13;3469:17;3386:14;:101::i;:::-;3256:319;2924:651;2813:762;3585:11;3626:10;3638:3;3643:5;;3650:4;;3656:5;3609:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3609:53:1;;;3599:64;;;;;;3585:78;;3673:20;3696:15;:20;3712:3;3696:20;;;;;;;;;;;3673:43;;3734:3;3726:2;:5;;:11;;;;3747:10;3763:2;:5;;;3747:22;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;3747:22:1;;;;;;;;;;;;;;;;;;;;;;3796:11;3780:2;:13;;:27;;;;3836:11;3817:2;:16;;;:30;;;;;;;;;;;;;;;;;;3876:7;3858:2;:15;;;:25;;;;;;;;;;;;;;;;;;3915:13;3893:2;:19;;:35;;;;3957:10;3939:2;:10;;:15;;;:28;;;;;;;;;;;;;;;;;;3995:5;3977:2;:10;;:15;;:23;;;;;;;;;;;;:::i;:::-;;4031:8;4010:2;:10;;:18;;:29;;;;;;;;;;;;:::i;:::-;;4067:1;4054:9;:14;4050:49;;;4094:5;4082:17;;4050:49;4141:28;4154:3;4159:9;4141:12;:28::i;:::-;4120:2;:18;;:49;;;;4200:1;4180:2;:17;;;:21;;;;;;;;;;;;;;;;;;4225:9;4211:2;:11;;;:23;;;;;;;;;;;;;;;;;;4254:5;4244:2;:7;;:15;;;;4285:61;4298:44;4311:13;4326:2;:15;;;;;;;;;;;;4298:44;;:12;:44::i;:::-;4344:1;4285:12;:61::i;:::-;4269:2;:13;;:77;;;;4378:17;4356:2;:19;;:39;;;;;;;;;;;;:::i;:::-;;4410:104;4426:2;:19;;;4447:2;:5;;;4454:2;:10;;:15;;;;;;;;;;;;4471:3;4476:2;:16;;;;;;;;;;;;4494:2;:19;;4410:104;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2284:2237;;;;;;;;;;;;;:::o;5903:343::-;5952:14;6016:4;6010:11;6046:42;6043:1;6039:50;6034:55;;6171:1;6125:44;6121:52;6116:2;6113:1;6109:10;6102:72;6207:2;6204:1;6200:10;6194:4;6187:24;6229:1;6224:6;;5987:253;;;;:::o;10746:441::-;10807:21;10830:12;10844:10;10925:12;10939;10953:14;10979:20;11002:15;:19;11018:2;11002:19;;;;;;;;;;;10979:42;;11039:2;:16;;;;;;;;;;;;11057:2;:19;;;11078:2;:15;;;;;;;;;;;;11112:2;:17;;;;;;;;;;;;11137:2;:18;;;11131:3;:24;11157:2;:10;;:22;11168:10;11157:22;;;;;;;;;;;;;;;;;;;;;;;;;11031:149;;;;;;;;;;;;;;;;;;;;;;;10746:441;;;;;;;:::o;11687:1370::-;11732:20;11755:15;:19;11771:2;11755:19;;;;;;;;;;;11732:42;;11806:2;:10;;:15;;;;;;;;;;;;11792:29;;:10;:29;;;11784:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11868:3;11847:2;:18;;;:24;11839:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11911:1;11894:2;:13;;;:18;11890:1053;;;11928:10;:19;;:40;11948:2;:19;;;11928:40;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11928:40:1;11890:1053;;;12014:1;11997:2;:13;;;:18;11993:950;;;12031:33;12081:1;12067:16;;;;;;;;;;;;;;;;;;;;;;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;12067:16:1;;;;12031:52;;12105:2;:16;;;;;;;;;;;;12098:32;;;12131:10;12143:2;:19;;;12098:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12098:65:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;12098:65:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;12098:65:1;;;;;;;;;;;;;;;;;12177:141;12192:2;:13;;;12207:2;:16;;;;;;;;;;;;12233:4;12268:10;12280:2;:19;;;12301:16;12177:14;:141::i;:::-;11993:950;;;;12364:1;12347:2;:13;;;:18;12343:600;;;12381:26;12426:6;12435:1;12426:10;;12421:280;12471:1;12442:2;:19;;:26;;;;:30;12438:1;:34;12421:280;;;12526:66;12500:2;:19;;12520:1;12500:22;;;;;;;;;;;;;;;;:92;12496:191;;12646:2;:19;;12666:1;12646:22;;;;;;;;;;;;;;;;12616:9;12626;:16;12616:27;;;;;;;;;;;;;:52;;;;;12496:191;12474:3;;;;;;;12421:280;;;;12797:134;12812:2;:13;;;12827:2;:16;;;;;;;;;;;;12853:4;12888:10;12900:2;:19;;;12921:9;12797:14;:134::i;:::-;12343:600;;11993:950;11890:1053;12958:59;12972:2;:5;;;12979:2;:16;;;;;;;;;;;;12997:2;:19;;;12958:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13049:1;13027:2;:19;;:23;;;;11687:1370;;:::o;11248:187::-;11309:30;11351:20;11374:15;:19;11390:2;11374:19;;;;;;;;;;;11351:42;;11411:2;:16;;11403:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11248:187;;;:::o;4571:988::-;4822:1;4808:10;:15;4804:748;;;4898:6;4854:13;4847:31;;;4879:14;4847:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4847:47:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4847:47:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4847:47:1;;;;;;;;;;;;;;;;:57;;4839:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4933:13;4926:29;;;4956:14;4972:6;4926:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4926:53:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4926:53:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4926:53:1;;;;;;;;;;;;;;;;;5000:13;4993:34;;;5028:14;5044:17;5063:6;4993:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4993:77:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4993:77:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;4993:77:1;;;;;;;;;;;;;;;;;4804:748;;;5114:1;5100:10;:15;5096:456;;;5191:6;5147:13;5139:32;;;5172:14;5139:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5139:48:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5139:48:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;5139:48:1;;;;;;;;;;;;;;;;:58;;5131:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5224:6;5231:1;5224:8;;5219:323;5238:6;5234:1;:10;5219:323;;;5302:4;5273:34;;:17;:34;;;5269:150;;;5338:13;5330:30;;;5361:17;5380:16;5397:1;5380:19;;;;;;;;;;;;;;5330:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5330:70:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5330:70:1;;;;5269:150;5444:13;5436:35;;;5472:14;5488:17;5507:16;5524:1;5507:19;;;;;;;;;;;;;;5436:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5436:91:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5436:91:1;;;;5246:3;;;;;;;5219:323;;;;5096:456;4804:748;4571:988;;;;;;:::o;1263:31::-;;;;;;;;;;;;;:::o;1720:474::-;2023:164;2041:5;2048:7;2057:9;2068;2079:5;2086:8;2096:5;2129:11;2142;2155:13;2184:1;2170:16;;;;;;;;;;;;;;;;;;;;;;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;2170:16:1;;;;2023:17;:164::i;:::-;1720:474;;;;;;;;;;:::o;6734:3908::-;6846:12;6871:20;6894:15;:19;6910:2;6894:19;;;;;;;;;;;6871:42;;6923:25;6967:10;6923:56;;7072:3;7051:2;:18;;;:24;7042:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7122:2;:15;;;;;;;;;;;;7102:35;;:2;:17;;;;;;;;;;;;:35;;;7093:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7189:5;7164:30;;:2;:10;;:21;7175:9;7164:21;;;;;;;;;;;;;;;;;;;;;;;;;:30;;;7155:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7251:2;:7;;;7237:8;7221:26;;;;;;:37;7212:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7309:19;7317:10;7309:7;:19::i;:::-;7299:30;;;;;;7285:10;:44;7276:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7378:2;:16;;7400:9;7378:32;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;7378:32:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7420:19;7449:27;7493:1;7479:16;;;;;;;;;;;;;;;;;;;;;;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;7479:16:1;;;;7449:46;;7593:4;7578:19;;:2;:11;;;;;;;;;;;;:19;;;7574:1924;;;7634:1;7617:2;:13;;;:18;7613:1063;;;7655:19;7699:2;:19;;;7677;7684:4;;7690:5;;7677:6;:19::i;:::-;:41;;;;;;7655:63;;7736:23;7762:2;:19;;7736:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7814:6;7821:14;7814:22;;;;;;;;;;;;;;7799:9;7809:1;7799:12;;;;;;;;;;;;;:37;;;;;7876:43;7896:6;7904:14;7876:19;:43::i;:::-;7854:2;:19;;:65;;;;;;;;;;;;:::i;:::-;;7954:1;7937:18;;7996:1;7973:2;:19;;;:24;;;;;;;;;;;7613:1063;;;;;8103:1;8082:2;:17;;;;;;;;;;;;8064:2;:15;;;;;;;;;;;;:35;:40;;;8060:602;;;8144:2;:19;;;8127:36;;8060:602;;;8264:2;:13;;;8242:19;8249:4;;8255:5;;8242:6;:19::i;:::-;:35;;;;;;8225:52;;8321:1;8303:14;:19;8299:290;;;8367:1;8350:18;;8299:290;;;8439:2;:19;;;8421:14;:37;8417:172;;8564:1;8544:2;:17;;;;;;;;;;;;8526:2;:15;;;;;;;;;;;;:35;:39;8503:63;;:2;:19;;;:63;8486:80;;8417:172;8299:290;8629:14;8606:2;:19;;;:37;;;;;;;;;;;8060:602;7613:1063;7574:1924;;;8735:1;8718:2;:13;;;:18;8714:774;;;8835:23;8861:2;:19;;8835:45;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8913:2;:19;;8933:1;8913:22;;;;;;;;;;;;;;;;8898:9;8908:1;8898:12;;;;;;;;;;;;;:37;;;;;8975:30;8995:6;9003:1;8975:19;:30::i;:::-;8953:2;:19;;:52;;;;;;;;;;;;:::i;:::-;;9040:1;9023:18;;9082:1;9059:2;:19;;;:24;;;;;;;;;;;8714:774;;;;9189:1;9168:2;:17;;;;;;;;;;;;9150:2;:15;;;;;;;;;;;;:35;:40;;;9146:273;;;9230:2;:19;;;9213:36;;9146:273;;;9328:72;9341:2;:19;;;9381:2;:17;;;;;;;;;;;;9363:2;:15;;;;;;;;;;;;:35;9328:72;;:12;:72::i;:::-;9311:89;;9146:273;9459:14;9436:2;:19;;;:37;;;;;;;;;;;8714:774;7574:1924;9532:4;9508:2;:10;;:21;9519:9;9508:21;;;;;;;;;;;;;;;;:28;;;;;;;;;;;;;;;;;;9547:2;:17;;;:20;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9598:1;9581:2;:13;;;:18;9577:300;;;9631:2;:19;;;9615:2;:13;;:35;;;;9577:300;;;9712:2;:17;;;;;;;;;;;;9693:36;;:2;:15;;;;;;;;;;;;:36;;;9689:177;;9764:87;9777:70;9790:2;:19;;;9829:2;:17;;;;;;;;;;;;9811:2;:15;;;;;;;;;;;;:35;9777:70;;:12;:70::i;:::-;9849:1;9764:12;:87::i;:::-;9748:2;:13;;:103;;;;9689:177;9577:300;9964:1;9947:2;:13;;;:18;9943:540;;;9981:9;:18;;:34;10000:14;9981:34;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;9981:34:1;9943:540;;;10061:1;10044:2;:13;;;:18;10040:443;;;10078:34;10129:1;10115:16;;;;;;;;;;;;;;;;;;;;;;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;10115:16:1;;;;10078:53;;10146:135;10161:2;:13;;;10176:2;:16;;;;;;;;;;;;10202:4;10237:9;10248:14;10264:16;10146:14;:135::i;:::-;10040:443;;;;10327:1;10310:2;:13;;;:18;10306:177;;;10344:128;10359:2;:13;;;10374:2;:16;;;;;;;;;;;;10400:4;10435:9;10446:14;10462:9;10344:14;:128::i;:::-;10306:177;10040:443;9943:540;10529:75;10542:2;:5;;;10549:9;10560:14;10576:2;:16;;;;;;;;;;;;10594:9;10529:75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;10529:75:1;;;;;;;;;;;;;;;;;;;;;10621:14;10614:21;;;;;;6734:3908;;;;;;:::o;834:176:8:-;892:7;911:9;927:1;923;:5;911:17;;951:1;946;:6;;938:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1002:1;995:8;;;834:176;;;;:::o;3073:130::-;3131:7;3157:39;3161:1;3164;3157:39;;;;;;;;;;;;;;;;;:3;:39::i;:::-;3150:46;;3073:130;;;;:::o;2159:459::-;2217:7;2463:1;2458;:6;2454:45;;;2487:1;2480:8;;;;2454:45;2509:9;2525:1;2521;:5;2509:17;;2553:1;2548;2544;:5;;;;;;:10;2536:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2610:1;2603:8;;;2159:459;;;;;:::o;5593:173:1:-;5663:9;5723:10;5735;5747:4;5753:3;5706:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;5706:51:1;;;5696:62;;;;;;5691:68;;5684:75;;5593:173;;;;:::o;6252:389::-;6339:16;6380:5;:12;6371:5;:21;6367:39;;6401:5;6394:12;;;;6367:39;6421:6;6430:5;6421:14;;6416:95;6456:1;6441:5;:12;:16;6437:1;:20;6416:95;;;6488:5;6498:1;6494;:5;6488:12;;;;;;;;;;;;;;6477:5;6483:1;6477:8;;;;;;;;;;;;;:23;;;;;6459:3;;;;;;;6416:95;;;;6546:66;6520:5;6541:1;6526:5;:12;:16;6520:23;;;;;;;;;;;;;:92;;;;;6629:5;6622:12;;6252:389;;;;;:::o;3718:338:8:-;3804:7;3901:1;3897;:5;3904:12;3889:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;3889:28:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3927:9;3943:1;3939;:5;;;;;;3927:17;;4048:1;4041:8;;;3718:338;;;;;:::o;218:12962:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity >0.4.22;\nimport \"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC721/IERC721.sol\";\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\n\ncontract HappyRedPacket {\n\n struct RedPacket {\n bytes32 id;\n bytes32 hash;\n bool ifrandom;\n uint token_type;\n uint MAX_AMOUNT;\n Creator creator;\n uint8 total_number;\n uint8 claimed_number;\n uint expiration_time;\n uint remaining_tokens;\n address token_address;\n address[] claimer_addrs;\n uint256[] erc721_token_ids;\n mapping(address => bool) claimed;\n }\n\n struct Creator {\n string name;\n address addr;\n string message;\n }\n\n event CreationSuccess(\n uint total,\n bytes32 id,\n address creator,\n uint creation_time,\n address token_address,\n uint256[] erc721_token_ids\n );\n\n event ClaimSuccess(\n bytes32 id,\n address claimer,\n uint claimed_value,\n address token_address,\n uint256[] token_id\n );\n\n event RefundSuccess(\n bytes32 id,\n address token_address,\n uint remaining_balance\n );\n\n uint nonce;\n address public contract_creator;\n mapping(bytes32 => RedPacket) redpacket_by_id;\n bytes32 [] redpackets;\n string constant private magic = \"Former NBA Commissioner David St\"; // 32 bytes\n bytes32 private uuid;\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 _hash, uint8 _number, 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 create_red_packet(_hash, _number, _ifrandom, _duration, _seed, _message, _name,\n _token_type, _token_addr, _total_tokens, new uint256[](1));\n }\n\n // Inits a red packet instance\n // _token_type: 0 - ETH 1 - ERC20 2 - ERC721\n function create_red_packet (bytes32 _hash, uint8 _number, bool _ifrandom, uint _duration, \n bytes32 _seed, string memory _message, string memory _name,\n uint _token_type, address _token_addr, uint _total_tokens,\n uint256[] memory _erc721_token_ids) \n public payable {\n nonce ++;\n require(nonce > redpackets.length, \"000\");\n require(_total_tokens >= _number, \"001\");\n require(_number > 0, \"002\");\n\n if (_token_type == 0) {\n require(msg.value >= _total_tokens, \"008\");\n } \n else if (_token_type == 1) {\n require(IERC20(_token_addr).allowance(msg.sender, address(this)) >= _total_tokens, \"009\");\n uint256 [] memory token_ids_holder = new uint256[](0); \n transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, token_ids_holder);\n }\n else if (_token_type == 2) {\n require(IERC721(_token_addr).isApprovedForAll(msg.sender, address(this)), \"011\");\n transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, _erc721_token_ids);\n // IERC721(_token_addr).setApprovalForAll(address(this), false);\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 = _number;\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 = SafeMath.add(now, _duration);\n\n rp.claimed_number = 0;\n rp.ifrandom = _ifrandom;\n rp.hash = _hash;\n rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(_total_tokens, rp.total_number), 2);\n rp.erc721_token_ids = _erc721_token_ids;\n emit CreationSuccess(rp.remaining_tokens, rp.id, rp.creator.addr, now, rp.token_address, rp.erc721_token_ids);\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, uint256 [] memory erc721_token_ids) public payable{\n // ERC20\n if (token_type == 1) {\n require(IERC20(token_address).balanceOf(sender_address) >= amount, \"010\");\n IERC20(token_address).approve(sender_address, amount);\n IERC20(token_address).transferFrom(sender_address, recipient_address, amount);\n }\n\n else if (token_type == 2) {\n require(IERC721(token_address).balanceOf(sender_address) >= amount, \"012\");\n for (uint i=0; i < amount; i++) {\n if (recipient_address == address(this)){\n IERC721(token_address).approve(recipient_address, erc721_token_ids[i]);\n }\n IERC721(token_address).transferFrom(sender_address, recipient_address, erc721_token_ids[i]);\n }\n }\n\n }\n \n // A boring wrapper\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 function getTokenIdWithIndex(uint256[] memory array, uint index) internal view returns(uint256[] memory) {\n if (index >= array.length) return array;\n for (uint i = index; i < array.length - 1; i++){\n array[i] = array[i + 1];\n }\n array[array.length - 1] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;\n return array;\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\n RedPacket storage rp = redpacket_by_id[id];\n address payable recipient = address(uint160(_recipient));\n // uint256 token_id;\n // Unsuccessful\n require (rp.expiration_time > now, \"003\");\n require (rp.claimed_number < rp.total_number, \"004\");\n require (rp.claimed[recipient] == false, \"005\");\n require (keccak256(bytes(password)) == rp.hash, \"006\");\n require (validation == keccak256(toBytes(msg.sender)), \"007\");\n\n // Store claimer info\n rp.claimer_addrs.push(recipient);\n uint claimed_tokens;\n uint256 [] memory token_ids = new uint256[](1); //TODO: Optimize this behavior.\n // Todo get erc721 token id;\n if (rp.ifrandom == true) {\n if (rp.token_type == 2) {\n uint token_id_index = random(uuid, nonce) % rp.remaining_tokens;\n uint256[] memory _array = rp.erc721_token_ids;\n token_ids[0] = _array[token_id_index];\n rp.erc721_token_ids = getTokenIdWithIndex(_array, token_id_index);\n claimed_tokens = 1;\n rp.remaining_tokens -= 1;\n }\n else\n {\n if (rp.total_number - rp.claimed_number == 1){\n claimed_tokens = rp.remaining_tokens;\n }\n else{\n claimed_tokens = random(uuid, nonce) % rp.MAX_AMOUNT;\n if (claimed_tokens == 0) {\n claimed_tokens = 1;\n }\n else if (claimed_tokens >= rp.remaining_tokens) {\n claimed_tokens = rp.remaining_tokens - (rp.total_number - rp.claimed_number - 1);\n }\n rp.remaining_tokens -= claimed_tokens;\n }\n }\n }\n else {\n if (rp.token_type == 2) {\n // token_id_index = random(uuid, nonce) % rp.remaining_tokens;\n uint256[] memory _array = rp.erc721_token_ids;\n token_ids[0] = rp.erc721_token_ids[0];\n rp.erc721_token_ids = getTokenIdWithIndex(_array, 0);\n claimed_tokens = 1;\n rp.remaining_tokens -= 1;\n }\n else\n {\n if (rp.total_number - rp.claimed_number == 1){\n claimed_tokens = rp.remaining_tokens;\n }\n else{\n claimed_tokens = SafeMath.div(rp.remaining_tokens, (rp.total_number - rp.claimed_number));\n }\n rp.remaining_tokens -= claimed_tokens;\n }\n }\n\n rp.claimed[recipient] = true;\n\n rp.claimed_number ++;\n if (rp.token_type == 2) {\n rp.MAX_AMOUNT = rp.remaining_tokens;\n }\n else {\n if (rp.total_number != rp.claimed_number){\n rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(rp.remaining_tokens, rp.total_number - rp.claimed_number), 2);\n }\n\n }\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 uint256 [] memory token_ids_holder = new uint256[](0); \n transfer_token(rp.token_type, rp.token_address, address(this),\n recipient, claimed_tokens, token_ids_holder);\n }\n else if (rp.token_type == 2) {\n transfer_token(rp.token_type, rp.token_address, address(this),\n recipient, claimed_tokens, token_ids);\n }\n\n // Claim success event\n emit ClaimSuccess(rp.id, recipient, claimed_tokens, rp.token_address, token_ids);\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, uint total, \n uint claimed, bool expired, bool ifclaimed) {\n RedPacket storage rp = redpacket_by_id[id];\n return (rp.token_address, rp.remaining_tokens, rp.total_number, \n rp.claimed_number, now > rp.expiration_time, rp.claimed[msg.sender]);\n }\n\n // Returns a list of claimed addresses accordingly\n function check_claimed_list(bytes32 id) public view returns (address[] memory claimer_addrs) {\n RedPacket storage rp = redpacket_by_id[id];\n return (rp.claimer_addrs);\n }\n\n // Returns a list of claiming token id\n function check_erc721_token_ids(bytes32 id) public view returns (uint256[] memory erc721_token_ids) {\n RedPacket storage rp = redpacket_by_id[id];\n return (rp.erc721_token_ids);\n }\n\n function refund(bytes32 id) public {\n RedPacket storage rp = redpacket_by_id[id];\n require(msg.sender == rp.creator.addr, \"011\");\n require(rp.expiration_time < now, \"012\");\n\n if (rp.token_type == 0) {\n msg.sender.transfer(rp.remaining_tokens);\n }\n else if (rp.token_type == 1) {\n uint256[] memory token_ids_holder = new uint256[](0); \n IERC20(rp.token_address).approve(msg.sender, rp.remaining_tokens);\n transfer_token(rp.token_type, rp.token_address, address(this),\n msg.sender, rp.remaining_tokens, token_ids_holder);\n }\n else if (rp.token_type == 2) {\n uint256[] memory token_ids;\n for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){\n if (rp.erc721_token_ids[i] != 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) {\n token_ids[token_ids.length] = rp.erc721_token_ids[i];\n }\n }\n // IERC721(rp.token_address).approve(msg.sender, rp.remaining_tokens);\n transfer_token(rp.token_type, rp.token_address, address(this),\n msg.sender, rp.remaining_tokens, token_ids); \n }\n\n emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens);\n rp.remaining_tokens = 0;\n }\n\n // One cannot send tokens to this contract after constructor anymore\n // function () external payable {\n // }\n}\n", - "sourcePath": "/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol", - "ast": { - "absolutePath": "/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol", - "exportedSymbols": { - "HappyRedPacket": [ - 1367 - ] - }, - "id": 1368, - "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": 1368, - "sourceUnit": 2291, - "src": "25:64:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol", - "file": "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol", - "id": 60, - "nodeType": "ImportDirective", - "scope": 1368, - "sourceUnit": 3503, - "src": "90:66:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 61, - "nodeType": "ImportDirective", - "scope": 1368, - "sourceUnit": 1759, - "src": "157:59:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1367, - "linearizedBaseContracts": [ - 1367 - ], - "name": "HappyRedPacket", - "nodeType": "ContractDefinition", - "nodes": [ - { - "canonicalName": "HappyRedPacket.RedPacket", - "id": 94, - "members": [ - { - "constant": false, - "id": 63, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "276:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 62, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "276:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 65, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "296:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 64, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "296:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 67, - "name": "ifrandom", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "318:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 66, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "318:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 69, - "name": "token_type", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "341:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 68, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "341:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 71, - "name": "MAX_AMOUNT", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "366:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 70, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "366:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 73, - "name": "creator", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "391:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" - }, - "typeName": { - "contractScope": null, - "id": 72, - "name": "Creator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 101, - "src": "391:7:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 75, - "name": "total_number", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "416:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 74, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "416:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 77, - "name": "claimed_number", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "444:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 76, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "444:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 79, - "name": "expiration_time", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "474:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "474:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 81, - "name": "remaining_tokens", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "504:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 80, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "504:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 83, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "535:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 82, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "535:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 86, - "name": "claimer_addrs", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "566:23:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "566:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 85, - "length": null, - "nodeType": "ArrayTypeName", - "src": "566:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 89, - "name": "erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "599:26:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 87, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "599:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 88, - "length": null, - "nodeType": "ArrayTypeName", - "src": "599:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 93, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "635:32:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - }, - "typeName": { - "id": 92, - "keyType": { - "id": 90, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "643:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "635:24:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - }, - "valueType": { - "id": 91, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "654:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "RedPacket", - "nodeType": "StructDefinition", - "scope": 1367, - "src": "249:425:1", - "visibility": "public" - }, - { - "canonicalName": "HappyRedPacket.Creator", - "id": 101, - "members": [ - { - "constant": false, - "id": 96, - "name": "name", - "nodeType": "VariableDeclaration", - "scope": 101, - "src": "705:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 95, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "705:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 98, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 101, - "src": "726:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 97, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "726:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 100, - "name": "message", - "nodeType": "VariableDeclaration", - "scope": 101, - "src": "748:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 99, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "748:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Creator", - "nodeType": "StructDefinition", - "scope": 1367, - "src": "680:89:1", - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 116, - "name": "CreationSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 115, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 103, - "indexed": false, - "name": "total", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "806:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 102, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "806:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 105, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "826:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 104, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "826:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 107, - "indexed": false, - "name": "creator", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "846:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 106, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "846:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 109, - "indexed": false, - "name": "creation_time", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "871:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 108, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "871:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 111, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "899:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 110, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "899:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 114, - "indexed": false, - "name": "erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "930:26:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 112, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "930:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 113, - "length": null, - "nodeType": "ArrayTypeName", - "src": "930:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "796:166:1" - }, - "src": "775:188:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 129, - "name": "ClaimSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 128, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 118, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "997:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 117, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "997:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 120, - "indexed": false, - "name": "claimer", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "1017:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 119, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1017:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 122, - "indexed": false, - "name": "claimed_value", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "1042:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 121, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1042:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "1070:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 123, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1070:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 127, - "indexed": false, - "name": "token_id", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "1101:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 125, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1101:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 126, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1101:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "987:138:1" - }, - "src": "969:157:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 137, - "name": "RefundSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 136, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 131, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "1161:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 130, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1161:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 133, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "1181:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 132, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1181:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 135, - "indexed": false, - "name": "remaining_balance", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "1212:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 134, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1212:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1151:89:1" - }, - "src": "1132:109:1" - }, - { - "constant": false, - "id": 139, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1247:10:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 138, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1247:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 141, - "name": "contract_creator", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1263:31:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 140, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1263:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 145, - "name": "redpacket_by_id", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1300:45:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" - }, - "typeName": { - "id": 144, - "keyType": { - "id": 142, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1308:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1300:29:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" - }, - "valueType": { - "contractScope": null, - "id": 143, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "1319:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 148, - "name": "redpackets", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1351:21:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 146, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1351:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 147, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1351:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": true, - "id": 151, - "name": "magic", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1378:66:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_memory", - "typeString": "string" - }, - "typeName": { - "id": 149, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1378:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "466f726d6572204e424120436f6d6d697373696f6e6572204461766964205374", - "id": 150, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1410:34:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_a58c4a8be3ed5c2bba4fce19b4e4fe34055a4a88c4449cf7cfcfe3110acfadba", - "typeString": "literal_string \"Former NBA Commissioner David St\"" - }, - "value": "Former NBA Commissioner David St" - }, - "visibility": "private" - }, - { - "constant": false, - "id": 153, - "name": "uuid", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1462:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 152, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1462:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "private" - }, - { - "body": { - "id": 172, - "nodeType": "Block", - "src": "1510:120:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 156, - "name": "contract_creator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "1520:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 157, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "1539:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 158, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1539:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1520:29:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 160, - "nodeType": "ExpressionStatement", - "src": "1520:29:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 161, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1559:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 165, - "name": "magic", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "1593:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 166, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "1600:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 167, - "name": "contract_creator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "1605: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": 163, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3645, - "src": "1576:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 164, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1576:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 168, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1576:46:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 162, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "1566:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 169, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1566:57:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "1559:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 171, - "nodeType": "ExpressionStatement", - "src": "1559:64:1" - } - ] - }, - "documentation": null, - "id": 173, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 154, - "nodeType": "ParameterList", - "parameters": [], - "src": "1500:2:1" - }, - "returnParameters": { - "id": 155, - "nodeType": "ParameterList", - "parameters": [], - "src": "1510:0:1" - }, - "scope": 1367, - "src": "1489:141:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 214, - "nodeType": "Block", - "src": "2013:181:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 197, - "name": "_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 175, - "src": "2041:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 198, - "name": "_number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 177, - "src": "2048:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - { - "argumentTypes": null, - "id": 199, - "name": "_ifrandom", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 179, - "src": "2057:9:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "id": 200, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 181, - "src": "2068:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 201, - "name": "_seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 183, - "src": "2079:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 202, - "name": "_message", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 185, - "src": "2086:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 203, - "name": "_name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 187, - "src": "2096:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 204, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 189, - "src": "2129:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 205, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "2142:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 206, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "2155:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "31", - "id": 210, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2184:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "2170:13: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": 207, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2174:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 208, - "length": null, - "nodeType": "ArrayTypeName", - "src": "2174:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 211, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2170:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - ], - "id": 196, - "name": "create_red_packet", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 215, - 508 - ], - "referencedDeclaration": 508, - "src": "2023:17:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_uint8_$_t_bool_$_t_uint256_$_t_bytes32_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (bytes32,uint8,bool,uint256,bytes32,string memory,string memory,uint256,address,uint256,uint256[] memory)" - } - }, - "id": 212, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2023:164:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 213, - "nodeType": "ExpressionStatement", - "src": "2023:164:1" - } - ] - }, - "documentation": null, - "id": 215, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "create_red_packet", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 194, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 175, - "name": "_hash", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1748:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 174, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1748:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 177, - "name": "_number", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1763:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 176, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "1763:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 179, - "name": "_ifrandom", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1778:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 178, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1778:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 181, - "name": "_duration", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1794:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 180, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1794:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 183, - "name": "_seed", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1843:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 182, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1843:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 185, - "name": "_message", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1858:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 184, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1858:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 187, - "name": "_name", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1882:19:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 186, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1882:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 189, - "name": "_token_type", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1935:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 188, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1935:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 191, - "name": "_token_addr", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1953:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 190, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1953:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 193, - "name": "_total_tokens", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1974:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 192, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1974:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1747:246:1" - }, - "returnParameters": { - "id": 195, - "nodeType": "ParameterList", - "parameters": [], - "src": "2013:0:1" - }, - "scope": 1367, - "src": "1720:474:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 507, - "nodeType": "Block", - "src": "2646:1875:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 242, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "2656:8:1", - "subExpression": { - "argumentTypes": null, - "id": 241, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "2656:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 243, - "nodeType": "ExpressionStatement", - "src": "2656:8:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 245, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "2682:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 246, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "2690:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 247, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2690:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2682:25:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303030", - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2709:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_35b5b8bece53958bb309db665734c38515f37439f69bfdbc64808f1af9a97c31", - "typeString": "literal_string \"000\"" - }, - "value": "000" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_35b5b8bece53958bb309db665734c38515f37439f69bfdbc64808f1af9a97c31", - "typeString": "literal_string \"000\"" - } - ], - "id": 244, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2674:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 250, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2674:41:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 251, - "nodeType": "ExpressionStatement", - "src": "2674:41:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 253, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "2733:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 254, - "name": "_number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 219, - "src": "2750:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "2733:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303031", - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2759:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_724f6bdc92705714b251fdfe205b952f71c1b25dac823eb448ff509b43ca2005", - "typeString": "literal_string \"001\"" - }, - "value": "001" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_724f6bdc92705714b251fdfe205b952f71c1b25dac823eb448ff509b43ca2005", - "typeString": "literal_string \"001\"" - } - ], - "id": 252, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2725:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 257, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2725:40:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 258, - "nodeType": "ExpressionStatement", - "src": "2725:40:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 262, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 260, - "name": "_number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 219, - "src": "2783:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 261, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2793:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2783:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303032", - "id": 263, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2796:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06c34db6f65efc7a8a660fab3d9cc5dd13bff15dd1af935465134c67942a95e6", - "typeString": "literal_string \"002\"" - }, - "value": "002" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06c34db6f65efc7a8a660fab3d9cc5dd13bff15dd1af935465134c67942a95e6", - "typeString": "literal_string \"002\"" - } - ], - "id": 259, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2775:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2775:27:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 265, - "nodeType": "ExpressionStatement", - "src": "2775:27:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 268, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 266, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "2817:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 267, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2832:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2817:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "2928:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2943:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2928:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 320, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "3260:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 321, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3275:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "3260:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 350, - "nodeType": "IfStatement", - "src": "3256:319:1", - "trueBody": { - "id": 349, - "nodeType": "Block", - "src": "3278:297:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 328, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3338:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 329, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3338:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 331, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "3358:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3350:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 332, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3350: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": 325, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "3308:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 324, - "name": "IERC721", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3502, - "src": "3300:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", - "typeString": "type(contract IERC721)" - } - }, - "id": 326, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3300:20:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC721_$3502", - "typeString": "contract IERC721" - } - }, - "id": 327, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "isApprovedForAll", - "nodeType": "MemberAccess", - "referencedDeclaration": 3490, - "src": "3300:37:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_bool_$", - "typeString": "function (address,address) view external returns (bool)" - } - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3300:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303131", - "id": 334, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3366:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", - "typeString": "literal_string \"011\"" - }, - "value": "011" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", - "typeString": "literal_string \"011\"" - } - ], - "id": 323, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "3292:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3292:80:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 336, - "nodeType": "ExpressionStatement", - "src": "3292:80:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 338, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "3401:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 339, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "3414:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 340, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3427:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 341, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3427:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 343, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "3447:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 342, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3439:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3439:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 345, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "3454:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 346, - "name": "_erc721_token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 238, - "src": "3469:17:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 337, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "3386:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 347, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3386:101:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 348, - "nodeType": "ExpressionStatement", - "src": "3386:101:1" - } - ] - } - }, - "id": 351, - "nodeType": "IfStatement", - "src": "2924:651:1", - "trueBody": { - "id": 319, - "nodeType": "Block", - "src": "2946:296:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 286, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "2998:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2998:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 289, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "3018:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 288, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3010:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3010: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": 283, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "2975:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 282, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "2968:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 284, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2968:19:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "allowance", - "nodeType": "MemberAccess", - "referencedDeclaration": 2253, - "src": "2968:29:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", - "typeString": "function (address,address) view external returns (uint256)" - } - }, - "id": 291, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2968:56:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 292, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "3028:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2968:73:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303039", - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3043:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_f1f53a772d6477eea2442888ded82401b11c74ea298b046a645e45bcb19dec14", - "typeString": "literal_string \"009\"" - }, - "value": "009" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_f1f53a772d6477eea2442888ded82401b11c74ea298b046a645e45bcb19dec14", - "typeString": "literal_string \"009\"" - } - ], - "id": 281, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2960:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 295, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2960:89:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 296, - "nodeType": "ExpressionStatement", - "src": "2960:89:1" - }, - { - "assignments": [ - 300 - ], - "declarations": [ - { - "constant": false, - "id": 300, - "name": "token_ids_holder", - "nodeType": "VariableDeclaration", - "scope": 319, - "src": "3063:34:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 298, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3063:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 299, - "length": null, - "nodeType": "ArrayTypeName", - "src": "3063:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 306, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 304, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3114:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "3100:13: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": 301, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3104:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 302, - "length": null, - "nodeType": "ArrayTypeName", - "src": "3104:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 305, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3100:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3063:53:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 308, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "3146:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 309, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "3159:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 310, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3172:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 311, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3172:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 313, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "3192:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 312, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3184:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 314, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3184:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 315, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "3199:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 316, - "name": "token_ids_holder", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "3214:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 307, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "3131:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 317, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3131:100:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 318, - "nodeType": "ExpressionStatement", - "src": "3131:100:1" - } - ] - } - }, - "id": 352, - "nodeType": "IfStatement", - "src": "2813:762:1", - "trueBody": { - "id": 277, - "nodeType": "Block", - "src": "2835:67:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 270, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "2857:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 271, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2857:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 272, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "2870:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2857:26:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303038", - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2885:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_02548246e64702b5865ec88120494d1082d4d663fdcca59525f26e7037975219", - "typeString": "literal_string \"008\"" - }, - "value": "008" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_02548246e64702b5865ec88120494d1082d4d663fdcca59525f26e7037975219", - "typeString": "literal_string \"008\"" - } - ], - "id": 269, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2849:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2849:42:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 276, - "nodeType": "ExpressionStatement", - "src": "2849:42:1" - } - ] - } - }, - { - "assignments": [ - 354 - ], - "declarations": [ - { - "constant": false, - "id": 354, - "name": "_id", - "nodeType": "VariableDeclaration", - "scope": 507, - "src": "3585:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 353, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3585:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 366, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 358, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3626:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3626:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 360, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "3638:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 361, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "3643:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 362, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "3650:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 363, - "name": "_seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "3656: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": 356, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3645, - "src": "3609:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 357, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3609:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 364, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3609:53:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 355, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "3599:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 365, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3599:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3585:78:1" - }, - { - "assignments": [ - 368 - ], - "declarations": [ - { - "constant": false, - "id": 368, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 507, - "src": "3673:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 367, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "3673:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 372, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 369, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "3696:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 371, - "indexExpression": { - "argumentTypes": null, - "id": 370, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "3712:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3696:20:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3673:43:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 377, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 373, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3726:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 375, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "3726:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 376, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "3734:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "3726:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 378, - "nodeType": "ExpressionStatement", - "src": "3726:11:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 382, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3763:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 383, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "3763:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 379, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "3747:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 381, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3747:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) returns (uint256)" - } - }, - "id": 384, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3747:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 385, - "nodeType": "ExpressionStatement", - "src": "3747:22:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 386, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3780:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 388, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "3780:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 389, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "3796:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3780:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 391, - "nodeType": "ExpressionStatement", - "src": "3780:27:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 396, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 392, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3817:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 394, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3817:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 395, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "3836:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "3817:30:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 397, - "nodeType": "ExpressionStatement", - "src": "3817:30:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 402, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 398, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3858:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 400, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3858:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 401, - "name": "_number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 219, - "src": "3876:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "3858:25:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 403, - "nodeType": "ExpressionStatement", - "src": "3858:25:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 408, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 404, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3893:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 406, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "3893:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 407, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "3915:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3893:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 409, - "nodeType": "ExpressionStatement", - "src": "3893:35:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 417, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 410, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3939:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 413, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "3939:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 414, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 98, - "src": "3939:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 415, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3957:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 416, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3957:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "3939:28:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 418, - "nodeType": "ExpressionStatement", - "src": "3939:28:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 425, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 419, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3977:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 422, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "3977:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 423, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "name", - "nodeType": "MemberAccess", - "referencedDeclaration": 96, - "src": "3977:15:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 424, - "name": "_name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 229, - "src": "3995:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "3977:23:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 426, - "nodeType": "ExpressionStatement", - "src": "3977:23:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 427, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4010:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 430, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "4010:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 431, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "message", - "nodeType": "MemberAccess", - "referencedDeclaration": 100, - "src": "4010:18:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 432, - "name": "_message", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 227, - "src": "4031:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "4010:29:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 434, - "nodeType": "ExpressionStatement", - "src": "4010:29:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 437, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 435, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 223, - "src": "4054:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4067:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4054:14:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 442, - "nodeType": "IfStatement", - "src": "4050:49:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 440, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 438, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 223, - "src": "4082:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "3836343030", - "id": 439, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4094:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_86400_by_1", - "typeString": "int_const 86400" - }, - "value": "86400" - }, - "src": "4082:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 441, - "nodeType": "ExpressionStatement", - "src": "4082:17:1" - } - }, - { - "expression": { - "argumentTypes": null, - "id": 451, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 443, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4120:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 445, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "4120:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 448, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "4154:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 449, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 223, - "src": "4159:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 446, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "4141:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1598, - "src": "4141:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 450, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4141:28:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4120:49:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 452, - "nodeType": "ExpressionStatement", - "src": "4120:49:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 457, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 453, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4180:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 455, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "4180:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 456, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4200:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4180:21:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 458, - "nodeType": "ExpressionStatement", - "src": "4180:21:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 463, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 459, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4211:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 461, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 67, - "src": "4211:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 462, - "name": "_ifrandom", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "4225:9:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "4211:23:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 464, - "nodeType": "ExpressionStatement", - "src": "4211:23:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 469, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 465, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4244:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 467, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "hash", - "nodeType": "MemberAccess", - "referencedDeclaration": 65, - "src": "4244:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 468, - "name": "_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 217, - "src": "4254:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "4244:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 470, - "nodeType": "ExpressionStatement", - "src": "4244:15:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 484, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 471, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4269:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 473, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "MAX_AMOUNT", - "nodeType": "MemberAccess", - "referencedDeclaration": 71, - "src": "4269:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 478, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "4311:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 479, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4326:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 480, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "4326:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "expression": { - "argumentTypes": null, - "id": 476, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "4298:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 477, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "4298:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 481, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4298:44:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "32", - "id": 482, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4344:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - } - ], - "expression": { - "argumentTypes": null, - "id": 474, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "4285:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1675, - "src": "4285:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 483, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4285:61:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4269:77:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 485, - "nodeType": "ExpressionStatement", - "src": "4269:77:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 490, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 486, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4356:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 488, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "4356:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 489, - "name": "_erc721_token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 238, - "src": "4378:17:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "src": "4356:39:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 491, - "nodeType": "ExpressionStatement", - "src": "4356:39:1" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 493, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4426:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 494, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "4426:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 495, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4447:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 496, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "4447:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 497, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4454:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 498, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "4454:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 98, - "src": "4454:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 500, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "4471:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 501, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4476:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 502, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "4476:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 503, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4494:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 504, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "4494:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - ], - "id": 492, - "name": "CreationSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "4410:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,bytes32,address,uint256,address,uint256[] memory)" - } - }, - "id": 505, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4410:104:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 506, - "nodeType": "EmitStatement", - "src": "4405:109:1" - } - ] - }, - "documentation": null, - "id": 508, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "create_red_packet", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 239, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 217, - "name": "_hash", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2312:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 216, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2312:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 219, - "name": "_number", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2327:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 218, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "2327:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 221, - "name": "_ifrandom", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2342:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 220, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2342:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 223, - "name": "_duration", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2358:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 222, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2358:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 225, - "name": "_seed", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2407:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 224, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2407:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 227, - "name": "_message", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2422:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 226, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2422:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 229, - "name": "_name", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2446:19:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 228, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2446:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 231, - "name": "_token_type", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2499:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 230, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2499:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 233, - "name": "_token_addr", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2517:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 232, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2517:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 235, - "name": "_total_tokens", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2538:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 234, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2538:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 238, - "name": "_erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2590:34:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 236, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2590:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 237, - "length": null, - "nodeType": "ArrayTypeName", - "src": "2590:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2311:314:1" - }, - "returnParameters": { - "id": 240, - "nodeType": "ParameterList", - "parameters": [], - "src": "2646:0:1" - }, - "scope": 1367, - "src": "2284:2237:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 615, - "nodeType": "Block", - "src": "4777:782:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 526, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 524, - "name": "token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 510, - "src": "4808:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 525, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4822:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "4808:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 559, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 557, - "name": "token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 510, - "src": "5100:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 558, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5114:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "5100:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 613, - "nodeType": "IfStatement", - "src": "5096:456:1", - "trueBody": { - "id": 612, - "nodeType": "Block", - "src": "5117:435:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 568, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 565, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "5172:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 562, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "5147:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 561, - "name": "IERC721", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3502, - "src": "5139:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", - "typeString": "type(contract IERC721)" - } - }, - "id": 563, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5139:22:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC721_$3502", - "typeString": "contract IERC721" - } - }, - "id": 564, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 3435, - "src": "5139:32:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 566, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5139:48:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 567, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "5191:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5139:58:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303132", - "id": 569, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5199:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", - "typeString": "literal_string \"012\"" - }, - "value": "012" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", - "typeString": "literal_string \"012\"" - } - ], - "id": 560, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "5131:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 570, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5131:74:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 571, - "nodeType": "ExpressionStatement", - "src": "5131:74:1" - }, - { - "body": { - "id": 610, - "nodeType": "Block", - "src": "5251:291:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 586, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 582, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 516, - "src": "5273:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 584, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "5302:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 583, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5294:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5294:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "5273:34:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 598, - "nodeType": "IfStatement", - "src": "5269:150:1", - "trueBody": { - "id": 597, - "nodeType": "Block", - "src": "5308:111:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 591, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 516, - "src": "5361:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 592, - "name": "erc721_token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 521, - "src": "5380:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 594, - "indexExpression": { - "argumentTypes": null, - "id": 593, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 573, - "src": "5397:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5380:19: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": 588, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "5338:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 587, - "name": "IERC721", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3502, - "src": "5330:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", - "typeString": "type(contract IERC721)" - } - }, - "id": 589, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5330:22:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC721_$3502", - "typeString": "contract IERC721" - } - }, - "id": 590, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 3467, - "src": "5330:30:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256) external" - } - }, - "id": 595, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5330:70:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 596, - "nodeType": "ExpressionStatement", - "src": "5330:70:1" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 603, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "5472:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 604, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 516, - "src": "5488:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 605, - "name": "erc721_token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 521, - "src": "5507:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 607, - "indexExpression": { - "argumentTypes": null, - "id": 606, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 573, - "src": "5524:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5507:19: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": 600, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "5444:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 599, - "name": "IERC721", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3502, - "src": "5436:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", - "typeString": "type(contract IERC721)" - } - }, - "id": 601, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5436:22:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC721_$3502", - "typeString": "contract IERC721" - } - }, - "id": 602, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 3460, - "src": "5436:35:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256) external" - } - }, - "id": 608, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5436:91:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 609, - "nodeType": "ExpressionStatement", - "src": "5436:91:1" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 578, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 576, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 573, - "src": "5234:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 577, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "5238:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5234:10:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 611, - "initializationExpression": { - "assignments": [ - 573 - ], - "declarations": [ - { - "constant": false, - "id": 573, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5224:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 572, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5224:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 575, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 574, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5231:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "5224:8:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 580, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "5246:3:1", - "subExpression": { - "argumentTypes": null, - "id": 579, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 573, - "src": "5246:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 581, - "nodeType": "ExpressionStatement", - "src": "5246:3:1" - }, - "nodeType": "ForStatement", - "src": "5219:323:1" - } - ] - } - }, - "id": 614, - "nodeType": "IfStatement", - "src": "4804:748:1", - "trueBody": { - "id": 556, - "nodeType": "Block", - "src": "4825:256:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 532, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "4879:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 529, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "4854:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 528, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "4847:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 530, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4847:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 2235, - "src": "4847:31:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4847:47:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 534, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "4898:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4847:57:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303130", - "id": 536, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4906:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_a775955c4ebf9a14a86ce326379f653bbb58908658ea96ba1b295aaa41291bcf", - "typeString": "literal_string \"010\"" - }, - "value": "010" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_a775955c4ebf9a14a86ce326379f653bbb58908658ea96ba1b295aaa41291bcf", - "typeString": "literal_string \"010\"" - } - ], - "id": 527, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "4839:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 537, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4839:73:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 538, - "nodeType": "ExpressionStatement", - "src": "4839:73:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 543, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "4956:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 544, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "4972: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": 540, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "4933:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 539, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "4926:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 541, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4926:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 542, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 2262, - "src": "4926:29:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 545, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4926:53:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 546, - "nodeType": "ExpressionStatement", - "src": "4926:53:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 551, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "5028:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 552, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 516, - "src": "5044:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 553, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "5063: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": 548, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "5000:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 547, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "4993:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 549, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4993:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 550, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 2273, - "src": "4993: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": 554, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4993:77:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 555, - "nodeType": "ExpressionStatement", - "src": "4993:77:1" - } - ] - } - } - ] - }, - "documentation": null, - "id": 616, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "transfer_token", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 522, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 510, - "name": "token_type", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4595:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 509, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4595:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 512, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4612:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 511, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4612:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 514, - "name": "sender_address", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4635:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 513, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4635:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 516, - "name": "recipient_address", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4687:25:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 515, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4687:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 518, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4714:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 517, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4714:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 521, - "name": "erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4727:34:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 519, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4727:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 520, - "length": null, - "nodeType": "ArrayTypeName", - "src": "4727:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4594:168:1" - }, - "returnParameters": { - "id": 523, - "nodeType": "ParameterList", - "parameters": [], - "src": "4777:0:1" - }, - "scope": 1367, - "src": "4571:988:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 638, - "nodeType": "Block", - "src": "5674:92:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 629, - "name": "nonce_rand", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 620, - "src": "5723:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 630, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "5735:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5735:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 632, - "name": "seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 618, - "src": "5747:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 633, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "5753: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": 627, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3645, - "src": "5706:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5706:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 634, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5706:51:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 626, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "5696:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 635, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5696:62:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 625, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5691:4:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 636, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5691:68:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 624, - "id": 637, - "nodeType": "Return", - "src": "5684:75:1" - } - ] - }, - "documentation": null, - "id": 639, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "random", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 621, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 618, - "name": "seed", - "nodeType": "VariableDeclaration", - "scope": 639, - "src": "5609:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 617, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5609:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 620, - "name": "nonce_rand", - "nodeType": "VariableDeclaration", - "scope": 639, - "src": "5623:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 619, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5623:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5608:31:1" - }, - "returnParameters": { - "id": 624, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 623, - "name": "rand", - "nodeType": "VariableDeclaration", - "scope": 639, - "src": "5663:9:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 622, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5663:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5662:11:1" - }, - "scope": 1367, - "src": "5593:173:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 647, - "nodeType": "Block", - "src": "5968:278:1", - "statements": [ - { - "externalReferences": [ - { - "a": { - "declaration": 641, - "isOffset": false, - "isSlot": false, - "src": "6171:1:1", - "valueSize": 1 - } - }, - { - "b": { - "declaration": 644, - "isOffset": false, - "isSlot": false, - "src": "6224:1:1", - "valueSize": 1 - } - }, - { - "a": { - "declaration": 641, - "isOffset": false, - "isSlot": false, - "src": "6034:1:1", - "valueSize": 1 - } - }, - { - "a": { - "declaration": 641, - "isOffset": false, - "isSlot": false, - "src": "6043:1:1", - "valueSize": 1 - } - } - ], - "id": 646, - "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": "5978:262:1" - } - ] - }, - "documentation": null, - "id": 648, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "toBytes", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 642, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 641, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 648, - "src": "5920:9:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 640, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5920:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5919:11:1" - }, - "returnParameters": { - "id": 645, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 644, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 648, - "src": "5952:14:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 643, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "5952:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5951:16:1" - }, - "scope": 1367, - "src": "5903:343:1", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 702, - "nodeType": "Block", - "src": "6357:284:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 662, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 659, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 653, - "src": "6371:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 660, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6380:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 661, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6380:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6371:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 665, - "nodeType": "IfStatement", - "src": "6367:39:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 663, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6401:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "functionReturnParameters": 658, - "id": 664, - "nodeType": "Return", - "src": "6394:12:1" - } - }, - { - "body": { - "id": 689, - "nodeType": "Block", - "src": "6463:48:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 687, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 679, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6477:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 681, - "indexExpression": { - "argumentTypes": null, - "id": 680, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 667, - "src": "6483:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6477:8:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 682, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6488:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 686, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 683, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 667, - "src": "6494:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 684, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6498:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6494:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6488:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6477:23:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 688, - "nodeType": "ExpressionStatement", - "src": "6477:23:1" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 675, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 670, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 667, - "src": "6437:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 674, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 671, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6441:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 672, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6441:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 673, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6456:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6441:16:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6437:20:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 690, - "initializationExpression": { - "assignments": [ - 667 - ], - "declarations": [ - { - "constant": false, - "id": 667, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 690, - "src": "6421:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 666, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6421:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 669, - "initialValue": { - "argumentTypes": null, - "id": 668, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 653, - "src": "6430:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6421:14:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 677, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6459:3:1", - "subExpression": { - "argumentTypes": null, - "id": 676, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 667, - "src": "6459:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 678, - "nodeType": "ExpressionStatement", - "src": "6459:3:1" - }, - "nodeType": "ForStatement", - "src": "6416:95:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 698, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 691, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6520:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 696, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 695, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 692, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6526:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 693, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6526:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 694, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6541:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6526:16:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6520:23:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "307846464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646", - "id": 697, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6546:66:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", - "typeString": "int_const 1157...(70 digits omitted)...9935" - }, - "value": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - }, - "src": "6520:92:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 699, - "nodeType": "ExpressionStatement", - "src": "6520:92:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 700, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6629:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "functionReturnParameters": 658, - "id": 701, - "nodeType": "Return", - "src": "6622:12:1" - } - ] - }, - "documentation": null, - "id": 703, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getTokenIdWithIndex", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 654, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 651, - "name": "array", - "nodeType": "VariableDeclaration", - "scope": 703, - "src": "6281:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 649, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6281:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 650, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6281:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 653, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 703, - "src": "6305:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 652, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6305:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6280:36:1" - }, - "returnParameters": { - "id": 658, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 657, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 703, - "src": "6339:16:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 655, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6339:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 656, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6339:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6338:18:1" - }, - "scope": 1367, - "src": "6252:389:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 1122, - "nodeType": "Block", - "src": "6860:3782:1", - "statements": [ - { - "assignments": [ - 717 - ], - "declarations": [ - { - "constant": false, - "id": 717, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1122, - "src": "6871:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 716, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "6871:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 721, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 718, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "6894:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 720, - "indexExpression": { - "argumentTypes": null, - "id": 719, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 705, - "src": "6910:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6894:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6871:42:1" - }, - { - "assignments": [ - 723 - ], - "declarations": [ - { - "constant": false, - "id": 723, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 1122, - "src": "6923:25:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 722, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6923:15:1", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 729, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 726, - "name": "_recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 709, - "src": "6967:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6959:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint160_$", - "typeString": "type(uint160)" - }, - "typeName": "uint160" - }, - "id": 727, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6959:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } - ], - "id": 724, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6951:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 728, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6951:28:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6923:56:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 734, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 731, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7051:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 732, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "7051:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 733, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "7072:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7051:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303033", - "id": 735, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7077:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_e07a04e280e3297d905849ae173374e70a63466da0c147cb1dc3eddf1adc47fd", - "typeString": "literal_string \"003\"" - }, - "value": "003" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_e07a04e280e3297d905849ae173374e70a63466da0c147cb1dc3eddf1adc47fd", - "typeString": "literal_string \"003\"" - } - ], - "id": 730, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7042:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7042:41:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 737, - "nodeType": "ExpressionStatement", - "src": "7042:41:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 743, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 739, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7102:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 740, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "7102:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 741, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7122:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 742, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "7122:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "7102:35:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303034", - "id": 744, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7139:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_334057113ad66ac6ad2c739ea6af3f43062313ec754cf4ee576b916e9ef852be", - "typeString": "literal_string \"004\"" - }, - "value": "004" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_334057113ad66ac6ad2c739ea6af3f43062313ec754cf4ee576b916e9ef852be", - "typeString": "literal_string \"004\"" - } - ], - "id": 738, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7093:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 745, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7093:52:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 746, - "nodeType": "ExpressionStatement", - "src": "7093:52:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 753, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 748, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7164:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 749, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed", - "nodeType": "MemberAccess", - "referencedDeclaration": 93, - "src": "7164:10:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - } - }, - "id": 751, - "indexExpression": { - "argumentTypes": null, - "id": 750, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "7175:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7164:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 752, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7189:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "7164:30:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303035", - "id": 754, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7196:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_455d4b967493b29d0d995e675e1e17e44fa9a8488bfbfe9456da6496ca978090", - "typeString": "literal_string \"005\"" - }, - "value": "005" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_455d4b967493b29d0d995e675e1e17e44fa9a8488bfbfe9456da6496ca978090", - "typeString": "literal_string \"005\"" - } - ], - "id": 747, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7155:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 755, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7155:47:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 756, - "nodeType": "ExpressionStatement", - "src": "7155:47:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 760, - "name": "password", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 707, - "src": "7237:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - ], - "id": 759, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7231:5:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", - "typeString": "type(bytes storage pointer)" - }, - "typeName": "bytes" - }, - "id": 761, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7231:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 758, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "7221:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 762, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7221:26:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 763, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7251:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 764, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "hash", - "nodeType": "MemberAccess", - "referencedDeclaration": 65, - "src": "7251:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "7221:37:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303036", - "id": 766, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7260:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_1564f9bd55fc54819c3c6e158d9a00b635174ac7541b6517a7ba0553da91d60d", - "typeString": "literal_string \"006\"" - }, - "value": "006" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_1564f9bd55fc54819c3c6e158d9a00b635174ac7541b6517a7ba0553da91d60d", - "typeString": "literal_string \"006\"" - } - ], - "id": 757, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7212:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 767, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7212:54:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 768, - "nodeType": "ExpressionStatement", - "src": "7212:54:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 777, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 770, - "name": "validation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 711, - "src": "7285:10:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 773, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "7317:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 774, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7317:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 772, - "name": "toBytes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 648, - "src": "7309:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_bytes_memory_ptr_$", - "typeString": "function (address) pure returns (bytes memory)" - } - }, - "id": 775, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7309:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 771, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "7299:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 776, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7299:30:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "7285:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303037", - "id": 778, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7331:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_adafce779496806a67cd1ef67cfc3ac7e72c67c4eadb74565f826b325436f38b", - "typeString": "literal_string \"007\"" - }, - "value": "007" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_adafce779496806a67cd1ef67cfc3ac7e72c67c4eadb74565f826b325436f38b", - "typeString": "literal_string \"007\"" - } - ], - "id": 769, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7276:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 779, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7276:61:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 780, - "nodeType": "ExpressionStatement", - "src": "7276:61:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 786, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "7400: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": 781, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7378:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 784, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 86, - "src": "7378:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 785, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7378:21:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 787, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7378:32:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 788, - "nodeType": "ExpressionStatement", - "src": "7378:32:1" - }, - { - "assignments": [ - 790 - ], - "declarations": [ - { - "constant": false, - "id": 790, - "name": "claimed_tokens", - "nodeType": "VariableDeclaration", - "scope": 1122, - "src": "7420:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 789, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7420:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 791, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "7420:19:1" - }, - { - "assignments": [ - 795 - ], - "declarations": [ - { - "constant": false, - "id": 795, - "name": "token_ids", - "nodeType": "VariableDeclaration", - "scope": 1122, - "src": "7449:27:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 793, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7449:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 794, - "length": null, - "nodeType": "ArrayTypeName", - "src": "7449:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 801, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "31", - "id": 799, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7493:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 798, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "7479:13: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": 796, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7483:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 797, - "length": null, - "nodeType": "ArrayTypeName", - "src": "7483:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 800, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7479:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7449:46:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 805, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 802, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7578:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 803, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 67, - "src": "7578:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 804, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7593:4:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "7578:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 995, - "nodeType": "Block", - "src": "8700:798:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 921, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 918, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8718:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 919, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "8718:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 920, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8735:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "8718:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 993, - "nodeType": "Block", - "src": "9128:360:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 964, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 962, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 958, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9150:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 959, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "9150:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 960, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9168:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 961, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9168:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "9150:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 963, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9189:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "9150:40:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 985, - "nodeType": "Block", - "src": "9289:130:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 983, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 971, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "9311:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 974, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9341:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 975, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9341:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 980, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 976, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9363:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 977, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "9363:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 978, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9381:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 979, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9381:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "9363:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "id": 981, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "9362:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "expression": { - "argumentTypes": null, - "id": 972, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "9328:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 973, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "9328:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 982, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9328:72:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9311:89:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 984, - "nodeType": "ExpressionStatement", - "src": "9311:89:1" - } - ] - }, - "id": 986, - "nodeType": "IfStatement", - "src": "9146:273:1", - "trueBody": { - "id": 970, - "nodeType": "Block", - "src": "9191:77:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 968, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 965, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "9213:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 966, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9230:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 967, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9230:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9213:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 969, - "nodeType": "ExpressionStatement", - "src": "9213:36:1" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 991, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 987, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9436:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 989, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9436:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "id": 990, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "9459:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9436:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 992, - "nodeType": "ExpressionStatement", - "src": "9436:37:1" - } - ] - }, - "id": 994, - "nodeType": "IfStatement", - "src": "8714:774:1", - "trueBody": { - "id": 957, - "nodeType": "Block", - "src": "8738:360:1", - "statements": [ - { - "assignments": [ - 925 - ], - "declarations": [ - { - "constant": false, - "id": 925, - "name": "_array", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "8835:23:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 923, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8835:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 924, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8835:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 928, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 926, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8861:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 927, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "8861:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8835:45:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 936, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 929, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 795, - "src": "8898:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 931, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 930, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8908:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8898:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 932, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8913:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 933, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "8913:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 935, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 934, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8933: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": "8913:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8898:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 937, - "nodeType": "ExpressionStatement", - "src": "8898:37:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 945, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 938, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8953:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 940, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "8953:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 942, - "name": "_array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 925, - "src": "8995:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 943, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9003:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 941, - "name": "getTokenIdWithIndex", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 703, - "src": "8975:19:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", - "typeString": "function (uint256[] memory,uint256) view returns (uint256[] memory)" - } - }, - "id": 944, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8975:30:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "src": "8953:52:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 946, - "nodeType": "ExpressionStatement", - "src": "8953:52:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 949, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 947, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "9023:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 948, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9040:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "9023:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 950, - "nodeType": "ExpressionStatement", - "src": "9023:18:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 955, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 951, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9059:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 953, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9059:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 954, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9082:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "9059:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 956, - "nodeType": "ExpressionStatement", - "src": "9059:24:1" - } - ] - } - } - ] - }, - "id": 996, - "nodeType": "IfStatement", - "src": "7574:1924:1", - "trueBody": { - "id": 917, - "nodeType": "Block", - "src": "7599:1087:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 809, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 806, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7617:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 807, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "7617:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 808, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7634:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "7617:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 915, - "nodeType": "Block", - "src": "8042:634:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 861, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 859, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 855, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8064:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 856, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "8064:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 857, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8082:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 858, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "8082:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "8064:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 860, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8103:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8064:40:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 913, - "nodeType": "Block", - "src": "8203:459:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 876, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 868, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8225:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 875, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 870, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "8249:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 871, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "8255:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 869, - "name": "random", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "8242:6:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" - } - }, - "id": 872, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8242:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 873, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8264:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 874, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "MAX_AMOUNT", - "nodeType": "MemberAccess", - "referencedDeclaration": 71, - "src": "8264:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8242:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8225:52:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 877, - "nodeType": "ExpressionStatement", - "src": "8225:52:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 880, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 878, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8303:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 879, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8321:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "8303:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 889, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 886, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8421:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 887, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8439:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 888, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8439:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8421:37:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 905, - "nodeType": "IfStatement", - "src": "8417:172:1", - "trueBody": { - "id": 904, - "nodeType": "Block", - "src": "8460:129:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 902, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 890, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8486:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 901, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 891, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8503:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 892, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8503:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 899, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 897, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 893, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8526:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 894, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "8526:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 895, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8544:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 896, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "8544:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "8526:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 898, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8564:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8526:39:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "id": 900, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "8525:41:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "8503:63:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8486:80:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 903, - "nodeType": "ExpressionStatement", - "src": "8486:80:1" - } - ] - } - }, - "id": 906, - "nodeType": "IfStatement", - "src": "8299:290:1", - "trueBody": { - "id": 885, - "nodeType": "Block", - "src": "8324:67:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 883, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 881, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8350:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 882, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8367:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8350:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 884, - "nodeType": "ExpressionStatement", - "src": "8350:18:1" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 911, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 907, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8606:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 909, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8606:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "id": 910, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8629:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8606:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 912, - "nodeType": "ExpressionStatement", - "src": "8606:37:1" - } - ] - }, - "id": 914, - "nodeType": "IfStatement", - "src": "8060:602:1", - "trueBody": { - "id": 867, - "nodeType": "Block", - "src": "8105:77:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 865, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 862, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8127:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 863, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8144:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 864, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8144:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8127:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 866, - "nodeType": "ExpressionStatement", - "src": "8127:36:1" - } - ] - } - } - ] - }, - "id": 916, - "nodeType": "IfStatement", - "src": "7613:1063:1", - "trueBody": { - "id": 854, - "nodeType": "Block", - "src": "7637:375:1", - "statements": [ - { - "assignments": [ - 811 - ], - "declarations": [ - { - "constant": false, - "id": 811, - "name": "token_id_index", - "nodeType": "VariableDeclaration", - "scope": 854, - "src": "7655:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 810, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7655:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 819, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 818, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 813, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "7684:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 814, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "7690:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 812, - "name": "random", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "7677:6:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" - } - }, - "id": 815, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7677:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 816, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7699:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 817, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "7699:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7677:41:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7655:63:1" - }, - { - "assignments": [ - 823 - ], - "declarations": [ - { - "constant": false, - "id": 823, - "name": "_array", - "nodeType": "VariableDeclaration", - "scope": 854, - "src": "7736:23:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 821, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7736:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 822, - "length": null, - "nodeType": "ArrayTypeName", - "src": "7736:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 826, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 824, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7762:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 825, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "7762:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7736:45:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 833, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 827, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 795, - "src": "7799:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 829, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 828, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7809:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "7799:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 830, - "name": "_array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 823, - "src": "7814:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 832, - "indexExpression": { - "argumentTypes": null, - "id": 831, - "name": "token_id_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 811, - "src": "7821:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7814:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7799:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 834, - "nodeType": "ExpressionStatement", - "src": "7799:37:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 842, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 835, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7854:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 837, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "7854:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 839, - "name": "_array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 823, - "src": "7896:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - { - "argumentTypes": null, - "id": 840, - "name": "token_id_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 811, - "src": "7904:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 838, - "name": "getTokenIdWithIndex", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 703, - "src": "7876:19:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", - "typeString": "function (uint256[] memory,uint256) view returns (uint256[] memory)" - } - }, - "id": 841, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7876:43:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "src": "7854:65:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 843, - "nodeType": "ExpressionStatement", - "src": "7854:65:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 846, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 844, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "7937:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 845, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7954:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "7937:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 847, - "nodeType": "ExpressionStatement", - "src": "7937:18:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 848, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7973:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 850, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "7973:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7996:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "7973:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 853, - "nodeType": "ExpressionStatement", - "src": "7973:24:1" - } - ] - } - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 1003, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 997, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9508:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1000, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed", - "nodeType": "MemberAccess", - "referencedDeclaration": 93, - "src": "9508:10:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - } - }, - "id": 1001, - "indexExpression": { - "argumentTypes": null, - "id": 999, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "9519:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9508:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1002, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9532:4:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "9508:28:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1004, - "nodeType": "ExpressionStatement", - "src": "9508:28:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 1008, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "9547:20:1", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1005, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9547:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1007, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9547:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 1009, - "nodeType": "ExpressionStatement", - "src": "9547:20:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1013, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1010, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9581:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1011, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "9581:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1012, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9598:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "9581:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1048, - "nodeType": "Block", - "src": "9675:202:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 1026, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1022, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9693:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1023, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "9693:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1024, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9712:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1025, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9712:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "9693:36:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1047, - "nodeType": "IfStatement", - "src": "9689:177:1", - "trueBody": { - "id": 1046, - "nodeType": "Block", - "src": "9730:136:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1044, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1027, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9748:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1029, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "MAX_AMOUNT", - "nodeType": "MemberAccess", - "referencedDeclaration": 71, - "src": "9748:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1034, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9790:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1035, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9790:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 1040, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1036, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9811:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1037, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "9811:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1038, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9829:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1039, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9829:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "9811:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "expression": { - "argumentTypes": null, - "id": 1032, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "9777:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 1033, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "9777:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 1041, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9777:70:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "32", - "id": 1042, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9849:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - } - ], - "expression": { - "argumentTypes": null, - "id": 1030, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "9764:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 1031, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1675, - "src": "9764:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 1043, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9764:87:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9748:103:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1045, - "nodeType": "ExpressionStatement", - "src": "9748:103:1" - } - ] - } - } - ] - }, - "id": 1049, - "nodeType": "IfStatement", - "src": "9577:300:1", - "trueBody": { - "id": 1021, - "nodeType": "Block", - "src": "9601:60:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1019, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1014, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9615:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1016, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "MAX_AMOUNT", - "nodeType": "MemberAccess", - "referencedDeclaration": 71, - "src": "9615:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1017, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9631:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1018, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9631:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9615:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1020, - "nodeType": "ExpressionStatement", - "src": "9615:35:1" - } - ] - } - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1053, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1050, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9947:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1051, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "9947:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 1052, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9964:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "9947:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1064, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1061, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10044:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1062, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "10044:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 1063, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10061:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "10044:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1092, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1089, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10310:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1090, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "10310:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1091, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10327:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "10310:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1107, - "nodeType": "IfStatement", - "src": "10306:177:1", - "trueBody": { - "id": 1106, - "nodeType": "Block", - "src": "10330:153:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1094, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10359:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1095, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "10359:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1096, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10374:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1097, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "10374:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1099, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "10400:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 1098, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "10392:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 1100, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10392:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1101, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "10435:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 1102, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10446:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1103, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 795, - "src": "10462:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1093, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "10344:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 1104, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10344:128:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1105, - "nodeType": "ExpressionStatement", - "src": "10344:128:1" - } - ] - } - }, - "id": 1108, - "nodeType": "IfStatement", - "src": "10040:443:1", - "trueBody": { - "id": 1088, - "nodeType": "Block", - "src": "10064:228:1", - "statements": [ - { - "assignments": [ - 1068 - ], - "declarations": [ - { - "constant": false, - "id": 1068, - "name": "token_ids_holder", - "nodeType": "VariableDeclaration", - "scope": 1088, - "src": "10078:34:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1066, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10078:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1067, - "length": null, - "nodeType": "ArrayTypeName", - "src": "10078:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1074, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 1072, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10129:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 1071, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "10115:13: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": 1069, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10119:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1070, - "length": null, - "nodeType": "ArrayTypeName", - "src": "10119:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 1073, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10115:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10078:53:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1076, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10161:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1077, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "10161:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1078, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10176:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1079, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "10176:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1081, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "10202:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 1080, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "10194:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 1082, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10194:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1083, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "10237:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 1084, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10248:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1085, - "name": "token_ids_holder", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "10264:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1075, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "10146:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 1086, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10146:135:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1087, - "nodeType": "ExpressionStatement", - "src": "10146:135:1" - } - ] - } - }, - "id": 1109, - "nodeType": "IfStatement", - "src": "9943:540:1", - "trueBody": { - "id": 1060, - "nodeType": "Block", - "src": "9967:59:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1057, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10000:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1054, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "9981:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 1056, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9981:18:1", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 1058, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9981:34:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1059, - "nodeType": "ExpressionStatement", - "src": "9981:34:1" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1111, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10542:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1112, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "10542:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 1113, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "10549:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 1114, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10560:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1115, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10576:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1116, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "10576:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1117, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 795, - "src": "10594:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1110, - "name": "ClaimSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 129, - "src": "10529:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (bytes32,address,uint256,address,uint256[] memory)" - } - }, - "id": 1118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10529:75:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1119, - "nodeType": "EmitStatement", - "src": "10524:80:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 1120, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10621:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 715, - "id": 1121, - "nodeType": "Return", - "src": "10614:21:1" - } - ] - }, - "documentation": null, - "id": 1123, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "claim", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 712, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 705, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6749:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 704, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "6749:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 707, - "name": "password", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6761:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 706, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "6761:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 709, - "name": "_recipient", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6785:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 708, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6785:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 711, - "name": "validation", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6805:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 710, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "6805:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6748:76:1" - }, - "returnParameters": { - "id": 715, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 714, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6846:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 713, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6846:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6845:14:1" - }, - "scope": 1367, - "src": "6734:3908:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1165, - "nodeType": "Block", - "src": "10969:218:1", - "statements": [ - { - "assignments": [ - 1141 - ], - "declarations": [ - { - "constant": false, - "id": 1141, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1165, - "src": "10979:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 1140, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "10979:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1145, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1142, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "11002:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 1144, - "indexExpression": { - "argumentTypes": null, - "id": 1143, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1125, - "src": "11018:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11002:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10979:42:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1146, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11039:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1147, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "11039:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1148, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11057:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1149, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "11057:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1150, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11078:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1151, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "11078:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1152, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11112:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1153, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "11112:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1157, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 1154, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "11131:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1155, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11137:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1156, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "11137:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11131:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1158, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11157:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1159, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed", - "nodeType": "MemberAccess", - "referencedDeclaration": 93, - "src": "11157:10:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - } - }, - "id": 1162, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1160, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "11168:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11168:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11157:22:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "id": 1163, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "11038:142:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_address_$_t_uint256_$_t_uint8_$_t_uint8_$_t_bool_$_t_bool_$", - "typeString": "tuple(address,uint256,uint8,uint8,bool,bool)" - } - }, - "functionReturnParameters": 1139, - "id": 1164, - "nodeType": "Return", - "src": "11031:149:1" - } - ] - }, - "documentation": null, - "id": 1166, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_availability", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1126, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1125, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10774:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1124, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10774:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10773:12:1" - }, - "returnParameters": { - "id": 1139, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1128, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10807:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1127, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10807:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1130, - "name": "balance", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10830:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1129, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10830:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1132, - "name": "total", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10844:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1131, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10844:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1134, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10925:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1133, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10925:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1136, - "name": "expired", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10939:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1135, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10939:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1138, - "name": "ifclaimed", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10953:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1137, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10953:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10806:162:1" - }, - "scope": 1367, - "src": "10746:441:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1184, - "nodeType": "Block", - "src": "11341:94:1", - "statements": [ - { - "assignments": [ - 1175 - ], - "declarations": [ - { - "constant": false, - "id": 1175, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1184, - "src": "11351:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 1174, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "11351:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1179, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1176, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "11374:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 1178, - "indexExpression": { - "argumentTypes": null, - "id": 1177, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1168, - "src": "11390:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11374:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "11351:42:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1180, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1175, - "src": "11411:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1181, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 86, - "src": "11411:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - } - ], - "id": 1182, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "11410:18:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 1173, - "id": 1183, - "nodeType": "Return", - "src": "11403:25:1" - } - ] - }, - "documentation": null, - "id": 1185, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_claimed_list", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1169, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1168, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1185, - "src": "11276:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1167, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11276:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11275:12:1" - }, - "returnParameters": { - "id": 1173, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1172, - "name": "claimer_addrs", - "nodeType": "VariableDeclaration", - "scope": 1185, - "src": "11309:30:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 1170, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "11309:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 1171, - "length": null, - "nodeType": "ArrayTypeName", - "src": "11309:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11308:32:1" - }, - "scope": 1367, - "src": "11248:187:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1203, - "nodeType": "Block", - "src": "11584:97:1", - "statements": [ - { - "assignments": [ - 1194 - ], - "declarations": [ - { - "constant": false, - "id": 1194, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1203, - "src": "11594:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 1193, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "11594:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1198, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1195, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "11617:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 1197, - "indexExpression": { - "argumentTypes": null, - "id": 1196, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1187, - "src": "11633:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11617:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "11594:42:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1199, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1194, - "src": "11654:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1200, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "11654:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - } - ], - "id": 1201, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "11653:21:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "functionReturnParameters": 1192, - "id": 1202, - "nodeType": "Return", - "src": "11646:28:1" - } - ] - }, - "documentation": null, - "id": 1204, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_erc721_token_ids", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1188, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1187, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1204, - "src": "11516:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1186, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11516:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11515:12:1" - }, - "returnParameters": { - "id": 1192, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1191, - "name": "erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 1204, - "src": "11549:33:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1189, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "11549:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1190, - "length": null, - "nodeType": "ArrayTypeName", - "src": "11549:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11548:35:1" - }, - "scope": 1367, - "src": "11484:197:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1365, - "nodeType": "Block", - "src": "11722:1335:1", - "statements": [ - { - "assignments": [ - 1210 - ], - "declarations": [ - { - "constant": false, - "id": 1210, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1365, - "src": "11732:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 1209, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "11732:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1214, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1211, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "11755:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 1213, - "indexExpression": { - "argumentTypes": null, - "id": 1212, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1206, - "src": "11771:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11755:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "11732:42:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 1221, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1216, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "11792:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1217, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11792:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1218, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11806:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1219, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "11806:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 1220, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 98, - "src": "11806:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "11792:29:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303131", - "id": 1222, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11823:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", - "typeString": "literal_string \"011\"" - }, - "value": "011" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", - "typeString": "literal_string \"011\"" - } - ], - "id": 1215, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "11784:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1223, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11784:45:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1224, - "nodeType": "ExpressionStatement", - "src": "11784:45:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1229, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1226, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11847:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1227, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "11847:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 1228, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "11868:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11847:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303132", - "id": 1230, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11873:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", - "typeString": "literal_string \"012\"" - }, - "value": "012" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", - "typeString": "literal_string \"012\"" - } - ], - "id": 1225, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "11839:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11839:40:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1232, - "nodeType": "ExpressionStatement", - "src": "11839:40:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1236, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1233, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11894:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1234, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "11894:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 1235, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11911:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "11894:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1250, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1247, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11997:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1248, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "11997:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 1249, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12014:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "11997:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1291, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1288, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12347:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1289, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "12347:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1290, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12364:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "12347:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1347, - "nodeType": "IfStatement", - "src": "12343:600:1", - "trueBody": { - "id": 1346, - "nodeType": "Block", - "src": "12367:576:1", - "statements": [ - { - "assignments": [ - 1295 - ], - "declarations": [ - { - "constant": false, - "id": 1295, - "name": "token_ids", - "nodeType": "VariableDeclaration", - "scope": 1346, - "src": "12381:26:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1293, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "12381:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1294, - "length": null, - "nodeType": "ArrayTypeName", - "src": "12381:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1296, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "12381:26:1" - }, - { - "body": { - "id": 1329, - "nodeType": "Block", - "src": "12478:223:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1311, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12500:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1312, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "12500:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 1314, - "indexExpression": { - "argumentTypes": null, - "id": 1313, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1298, - "src": "12520:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "12500:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "307846464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646", - "id": 1315, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12526:66:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", - "typeString": "int_const 1157...(70 digits omitted)...9935" - }, - "value": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - }, - "src": "12500:92:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1328, - "nodeType": "IfStatement", - "src": "12496:191:1", - "trueBody": { - "id": 1327, - "nodeType": "Block", - "src": "12594:93:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1325, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1317, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1295, - "src": "12616:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 1320, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1318, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1295, - "src": "12626:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 1319, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12626:16:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "12616:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1321, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12646:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1322, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "12646:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 1324, - "indexExpression": { - "argumentTypes": null, - "id": 1323, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1298, - "src": "12666:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "12646:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "12616:52:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1326, - "nodeType": "ExpressionStatement", - "src": "12616:52:1" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 1301, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1298, - "src": "12438:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1306, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1302, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12442:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1303, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "12442:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 1304, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12442:26:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 1305, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12471:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "12442:30:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "12438:34:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1330, - "initializationExpression": { - "assignments": [ - 1298 - ], - "declarations": [ - { - "constant": false, - "id": 1298, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 1330, - "src": "12426:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1297, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "12426:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1300, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 1299, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12435:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "12426:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 1309, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "12474:3:1", - "subExpression": { - "argumentTypes": null, - "id": 1308, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1298, - "src": "12474:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1310, - "nodeType": "ExpressionStatement", - "src": "12474:3:1" - }, - "nodeType": "ForStatement", - "src": "12421:280:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1332, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12812:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1333, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "12812:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1334, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12827:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1335, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "12827:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1337, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "12853:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 1336, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "12845:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 1338, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12845:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1339, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "12888:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12888:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1341, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12900:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1342, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "12900:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1343, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1295, - "src": "12921:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1331, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "12797:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 1344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12797:134:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1345, - "nodeType": "ExpressionStatement", - "src": "12797:134:1" - } - ] - } - }, - "id": 1348, - "nodeType": "IfStatement", - "src": "11993:950:1", - "trueBody": { - "id": 1287, - "nodeType": "Block", - "src": "12017:312:1", - "statements": [ - { - "assignments": [ - 1254 - ], - "declarations": [ - { - "constant": false, - "id": 1254, - "name": "token_ids_holder", - "nodeType": "VariableDeclaration", - "scope": 1287, - "src": "12031:33:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1252, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "12031:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1253, - "length": null, - "nodeType": "ArrayTypeName", - "src": "12031:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1260, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 1258, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12081:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 1257, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "12067:13: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": 1255, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "12071:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1256, - "length": null, - "nodeType": "ArrayTypeName", - "src": "12071:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 1259, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12067:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "12031:52:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1266, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "12131:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1267, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12131:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1268, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12143:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1269, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "12143:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1262, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12105:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1263, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "12105:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 1261, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "12098:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 1264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12098:24:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 1265, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 2262, - "src": "12098:32:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 1270, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12098:65:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1271, - "nodeType": "ExpressionStatement", - "src": "12098:65:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1273, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12192:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1274, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "12192:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1275, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12207:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1276, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "12207:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1278, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "12233:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 1277, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "12225:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 1279, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12225:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1280, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "12268:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1281, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12268:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1282, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12280:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1283, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "12280:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1284, - "name": "token_ids_holder", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1254, - "src": "12301:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1272, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "12177:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 1285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12177:141:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1286, - "nodeType": "ExpressionStatement", - "src": "12177:141:1" - } - ] - } - }, - "id": 1349, - "nodeType": "IfStatement", - "src": "11890:1053:1", - "trueBody": { - "id": 1246, - "nodeType": "Block", - "src": "11914:65:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1242, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11948:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1243, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "11948:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1237, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "11928:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1240, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11928:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 1241, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11928:19:1", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 1244, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11928:40:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1245, - "nodeType": "ExpressionStatement", - "src": "11928:40:1" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1351, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12972:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1352, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "12972:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1353, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12979:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1354, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "12979:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1355, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12997:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1356, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "12997: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": 1350, - "name": "RefundSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 137, - "src": "12958:13:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256)" - } - }, - "id": 1357, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12958:59:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1358, - "nodeType": "EmitStatement", - "src": "12953:64:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 1363, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1359, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "13027:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1361, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "13027:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 1362, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "13049:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "13027:23:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1364, - "nodeType": "ExpressionStatement", - "src": "13027:23:1" - } - ] - }, - "documentation": null, - "id": 1366, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "refund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1207, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1206, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1366, - "src": "11703:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1205, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11703:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11702:12:1" - }, - "returnParameters": { - "id": 1208, - "nodeType": "ParameterList", - "parameters": [], - "src": "11722:0:1" - }, - "scope": 1367, - "src": "11687:1370:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 1368, - "src": "218:12962:1" - } - ], - "src": "0:13181:1" - }, - "legacyAST": { - "absolutePath": "/Users/yisiliu/Workspace/yisiliu/RedPacket/test/contracts/redpacket.sol", - "exportedSymbols": { - "HappyRedPacket": [ - 1367 - ] - }, - "id": 1368, - "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": 1368, - "sourceUnit": 2291, - "src": "25:64:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol", - "file": "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol", - "id": 60, - "nodeType": "ImportDirective", - "scope": 1368, - "sourceUnit": 3503, - "src": "90:66:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 61, - "nodeType": "ImportDirective", - "scope": 1368, - "sourceUnit": 1759, - "src": "157:59:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1367, - "linearizedBaseContracts": [ - 1367 - ], - "name": "HappyRedPacket", - "nodeType": "ContractDefinition", - "nodes": [ - { - "canonicalName": "HappyRedPacket.RedPacket", - "id": 94, - "members": [ - { - "constant": false, - "id": 63, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "276:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 62, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "276:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 65, - "name": "hash", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "296:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 64, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "296:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 67, - "name": "ifrandom", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "318:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 66, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "318:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 69, - "name": "token_type", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "341:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 68, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "341:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 71, - "name": "MAX_AMOUNT", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "366:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 70, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "366:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 73, - "name": "creator", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "391:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" - }, - "typeName": { - "contractScope": null, - "id": 72, - "name": "Creator", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 101, - "src": "391:7:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage_ptr", - "typeString": "struct HappyRedPacket.Creator" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 75, - "name": "total_number", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "416:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 74, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "416:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 77, - "name": "claimed_number", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "444:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 76, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "444:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 79, - "name": "expiration_time", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "474:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "474:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 81, - "name": "remaining_tokens", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "504:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 80, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "504:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 83, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "535:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 82, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "535:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 86, - "name": "claimer_addrs", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "566:23:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 84, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "566:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 85, - "length": null, - "nodeType": "ArrayTypeName", - "src": "566:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 89, - "name": "erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "599:26:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 87, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "599:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 88, - "length": null, - "nodeType": "ArrayTypeName", - "src": "599:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 93, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 94, - "src": "635:32:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - }, - "typeName": { - "id": 92, - "keyType": { - "id": 90, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "643:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "635:24:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - }, - "valueType": { - "id": 91, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "654:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "RedPacket", - "nodeType": "StructDefinition", - "scope": 1367, - "src": "249:425:1", - "visibility": "public" - }, - { - "canonicalName": "HappyRedPacket.Creator", - "id": 101, - "members": [ - { - "constant": false, - "id": 96, - "name": "name", - "nodeType": "VariableDeclaration", - "scope": 101, - "src": "705:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 95, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "705:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 98, - "name": "addr", - "nodeType": "VariableDeclaration", - "scope": 101, - "src": "726:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 97, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "726:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 100, - "name": "message", - "nodeType": "VariableDeclaration", - "scope": 101, - "src": "748:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 99, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "748:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Creator", - "nodeType": "StructDefinition", - "scope": 1367, - "src": "680:89:1", - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 116, - "name": "CreationSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 115, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 103, - "indexed": false, - "name": "total", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "806:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 102, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "806:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 105, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "826:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 104, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "826:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 107, - "indexed": false, - "name": "creator", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "846:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 106, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "846:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 109, - "indexed": false, - "name": "creation_time", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "871:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 108, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "871:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 111, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "899:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 110, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "899:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 114, - "indexed": false, - "name": "erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 116, - "src": "930:26:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 112, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "930:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 113, - "length": null, - "nodeType": "ArrayTypeName", - "src": "930:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "796:166:1" - }, - "src": "775:188:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 129, - "name": "ClaimSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 128, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 118, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "997:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 117, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "997:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 120, - "indexed": false, - "name": "claimer", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "1017:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 119, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1017:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 122, - "indexed": false, - "name": "claimed_value", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "1042:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 121, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1042:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "1070:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 123, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1070:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 127, - "indexed": false, - "name": "token_id", - "nodeType": "VariableDeclaration", - "scope": 129, - "src": "1101:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 125, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1101:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 126, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1101:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "987:138:1" - }, - "src": "969:157:1" - }, - { - "anonymous": false, - "documentation": null, - "id": 137, - "name": "RefundSuccess", - "nodeType": "EventDefinition", - "parameters": { - "id": 136, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 131, - "indexed": false, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "1161:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 130, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1161:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 133, - "indexed": false, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "1181:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 132, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1181:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 135, - "indexed": false, - "name": "remaining_balance", - "nodeType": "VariableDeclaration", - "scope": 137, - "src": "1212:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 134, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1212:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1151:89:1" - }, - "src": "1132:109:1" - }, - { - "constant": false, - "id": 139, - "name": "nonce", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1247:10:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 138, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1247:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 141, - "name": "contract_creator", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1263:31:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 140, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1263:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 145, - "name": "redpacket_by_id", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1300:45:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" - }, - "typeName": { - "id": 144, - "keyType": { - "id": 142, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1308:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Mapping", - "src": "1300:29:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket)" - }, - "valueType": { - "contractScope": null, - "id": 143, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "1319:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 148, - "name": "redpackets", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1351:21:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[]" - }, - "typeName": { - "baseType": { - "id": 146, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1351:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 147, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1351:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage_ptr", - "typeString": "bytes32[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": true, - "id": 151, - "name": "magic", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1378:66:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_memory", - "typeString": "string" - }, - "typeName": { - "id": 149, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1378:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "466f726d6572204e424120436f6d6d697373696f6e6572204461766964205374", - "id": 150, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1410:34:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_a58c4a8be3ed5c2bba4fce19b4e4fe34055a4a88c4449cf7cfcfe3110acfadba", - "typeString": "literal_string \"Former NBA Commissioner David St\"" - }, - "value": "Former NBA Commissioner David St" - }, - "visibility": "private" - }, - { - "constant": false, - "id": 153, - "name": "uuid", - "nodeType": "VariableDeclaration", - "scope": 1367, - "src": "1462:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 152, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1462:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "private" - }, - { - "body": { - "id": 172, - "nodeType": "Block", - "src": "1510:120:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 156, - "name": "contract_creator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "1520:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 157, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "1539:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 158, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1539:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "1520:29:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 160, - "nodeType": "ExpressionStatement", - "src": "1520:29:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 161, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "1559:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 165, - "name": "magic", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 151, - "src": "1593:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 166, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "1600:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 167, - "name": "contract_creator", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "1605: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": 163, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3645, - "src": "1576:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 164, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1576:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 168, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1576:46:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 162, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "1566:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 169, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1566:57:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "1559:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 171, - "nodeType": "ExpressionStatement", - "src": "1559:64:1" - } - ] - }, - "documentation": null, - "id": 173, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 154, - "nodeType": "ParameterList", - "parameters": [], - "src": "1500:2:1" - }, - "returnParameters": { - "id": 155, - "nodeType": "ParameterList", - "parameters": [], - "src": "1510:0:1" - }, - "scope": 1367, - "src": "1489:141:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 214, - "nodeType": "Block", - "src": "2013:181:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 197, - "name": "_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 175, - "src": "2041:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 198, - "name": "_number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 177, - "src": "2048:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - { - "argumentTypes": null, - "id": 199, - "name": "_ifrandom", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 179, - "src": "2057:9:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "id": 200, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 181, - "src": "2068:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 201, - "name": "_seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 183, - "src": "2079:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 202, - "name": "_message", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 185, - "src": "2086:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 203, - "name": "_name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 187, - "src": "2096:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "id": 204, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 189, - "src": "2129:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 205, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 191, - "src": "2142:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 206, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 193, - "src": "2155:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "31", - "id": 210, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2184:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 209, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "2170:13: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": 207, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2174:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 208, - "length": null, - "nodeType": "ArrayTypeName", - "src": "2174:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 211, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2170:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - ], - "id": 196, - "name": "create_red_packet", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 215, - 508 - ], - "referencedDeclaration": 508, - "src": "2023:17:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_uint8_$_t_bool_$_t_uint256_$_t_bytes32_$_t_string_memory_ptr_$_t_string_memory_ptr_$_t_uint256_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (bytes32,uint8,bool,uint256,bytes32,string memory,string memory,uint256,address,uint256,uint256[] memory)" - } - }, - "id": 212, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2023:164:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 213, - "nodeType": "ExpressionStatement", - "src": "2023:164:1" - } - ] - }, - "documentation": null, - "id": 215, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "create_red_packet", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 194, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 175, - "name": "_hash", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1748:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 174, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1748:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 177, - "name": "_number", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1763:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 176, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "1763:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 179, - "name": "_ifrandom", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1778:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 178, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1778:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 181, - "name": "_duration", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1794:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 180, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1794:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 183, - "name": "_seed", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1843:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 182, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "1843:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 185, - "name": "_message", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1858:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 184, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1858:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 187, - "name": "_name", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1882:19:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 186, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "1882:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 189, - "name": "_token_type", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1935:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 188, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1935:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 191, - "name": "_token_addr", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1953:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 190, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1953:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 193, - "name": "_total_tokens", - "nodeType": "VariableDeclaration", - "scope": 215, - "src": "1974:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 192, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1974:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1747:246:1" - }, - "returnParameters": { - "id": 195, - "nodeType": "ParameterList", - "parameters": [], - "src": "2013:0:1" - }, - "scope": 1367, - "src": "1720:474:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 507, - "nodeType": "Block", - "src": "2646:1875:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 242, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "2656:8:1", - "subExpression": { - "argumentTypes": null, - "id": 241, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "2656:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 243, - "nodeType": "ExpressionStatement", - "src": "2656:8:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 248, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 245, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "2682:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 246, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "2690:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 247, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2690:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2682:25:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303030", - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2709:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_35b5b8bece53958bb309db665734c38515f37439f69bfdbc64808f1af9a97c31", - "typeString": "literal_string \"000\"" - }, - "value": "000" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_35b5b8bece53958bb309db665734c38515f37439f69bfdbc64808f1af9a97c31", - "typeString": "literal_string \"000\"" - } - ], - "id": 244, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2674:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 250, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2674:41:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 251, - "nodeType": "ExpressionStatement", - "src": "2674:41:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 255, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 253, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "2733:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 254, - "name": "_number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 219, - "src": "2750:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "2733:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303031", - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2759:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_724f6bdc92705714b251fdfe205b952f71c1b25dac823eb448ff509b43ca2005", - "typeString": "literal_string \"001\"" - }, - "value": "001" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_724f6bdc92705714b251fdfe205b952f71c1b25dac823eb448ff509b43ca2005", - "typeString": "literal_string \"001\"" - } - ], - "id": 252, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2725:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 257, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2725:40:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 258, - "nodeType": "ExpressionStatement", - "src": "2725:40:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 262, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 260, - "name": "_number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 219, - "src": "2783:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 261, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2793:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2783:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303032", - "id": 263, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2796:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_06c34db6f65efc7a8a660fab3d9cc5dd13bff15dd1af935465134c67942a95e6", - "typeString": "literal_string \"002\"" - }, - "value": "002" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_06c34db6f65efc7a8a660fab3d9cc5dd13bff15dd1af935465134c67942a95e6", - "typeString": "literal_string \"002\"" - } - ], - "id": 259, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2775:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2775:27:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 265, - "nodeType": "ExpressionStatement", - "src": "2775:27:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 268, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 266, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "2817:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 267, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2832:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2817:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 280, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 278, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "2928:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2943:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2928:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 322, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 320, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "3260:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 321, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3275:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "3260:16:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 350, - "nodeType": "IfStatement", - "src": "3256:319:1", - "trueBody": { - "id": 349, - "nodeType": "Block", - "src": "3278:297:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 328, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3338:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 329, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3338:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 331, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "3358:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3350:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 332, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3350: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": 325, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "3308:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 324, - "name": "IERC721", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3502, - "src": "3300:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", - "typeString": "type(contract IERC721)" - } - }, - "id": 326, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3300:20:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC721_$3502", - "typeString": "contract IERC721" - } - }, - "id": 327, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "isApprovedForAll", - "nodeType": "MemberAccess", - "referencedDeclaration": 3490, - "src": "3300:37:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_bool_$", - "typeString": "function (address,address) view external returns (bool)" - } - }, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3300:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303131", - "id": 334, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3366:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", - "typeString": "literal_string \"011\"" - }, - "value": "011" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", - "typeString": "literal_string \"011\"" - } - ], - "id": 323, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "3292:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 335, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3292:80:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 336, - "nodeType": "ExpressionStatement", - "src": "3292:80:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 338, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "3401:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 339, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "3414:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 340, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3427:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 341, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3427:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 343, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "3447:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 342, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3439:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3439:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 345, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "3454:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 346, - "name": "_erc721_token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 238, - "src": "3469:17:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 337, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "3386:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 347, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3386:101:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 348, - "nodeType": "ExpressionStatement", - "src": "3386:101:1" - } - ] - } - }, - "id": 351, - "nodeType": "IfStatement", - "src": "2924:651:1", - "trueBody": { - "id": 319, - "nodeType": "Block", - "src": "2946:296:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 293, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 286, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "2998:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 287, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2998:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 289, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "3018:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 288, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3010:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 290, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3010: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": 283, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "2975:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 282, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "2968:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 284, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2968:19:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "allowance", - "nodeType": "MemberAccess", - "referencedDeclaration": 2253, - "src": "2968:29:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$_t_address_$returns$_t_uint256_$", - "typeString": "function (address,address) view external returns (uint256)" - } - }, - "id": 291, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2968:56:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 292, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "3028:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2968:73:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303039", - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3043:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_f1f53a772d6477eea2442888ded82401b11c74ea298b046a645e45bcb19dec14", - "typeString": "literal_string \"009\"" - }, - "value": "009" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_f1f53a772d6477eea2442888ded82401b11c74ea298b046a645e45bcb19dec14", - "typeString": "literal_string \"009\"" - } - ], - "id": 281, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2960:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 295, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2960:89:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 296, - "nodeType": "ExpressionStatement", - "src": "2960:89:1" - }, - { - "assignments": [ - 300 - ], - "declarations": [ - { - "constant": false, - "id": 300, - "name": "token_ids_holder", - "nodeType": "VariableDeclaration", - "scope": 319, - "src": "3063:34:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 298, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3063:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 299, - "length": null, - "nodeType": "ArrayTypeName", - "src": "3063:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 306, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 304, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3114:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "3100:13: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": 301, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3104:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 302, - "length": null, - "nodeType": "ArrayTypeName", - "src": "3104:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 305, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3100:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3063:53:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 308, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "3146:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 309, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "3159:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 310, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3172:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 311, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3172:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 313, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "3192:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 312, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3184:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 314, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3184:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 315, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "3199:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 316, - "name": "token_ids_holder", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 300, - "src": "3214:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 307, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "3131:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 317, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3131:100:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 318, - "nodeType": "ExpressionStatement", - "src": "3131:100:1" - } - ] - } - }, - "id": 352, - "nodeType": "IfStatement", - "src": "2813:762:1", - "trueBody": { - "id": 277, - "nodeType": "Block", - "src": "2835:67:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 273, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 270, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "2857:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 271, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2857:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 272, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "2870:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2857:26:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303038", - "id": 274, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2885:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_02548246e64702b5865ec88120494d1082d4d663fdcca59525f26e7037975219", - "typeString": "literal_string \"008\"" - }, - "value": "008" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_02548246e64702b5865ec88120494d1082d4d663fdcca59525f26e7037975219", - "typeString": "literal_string \"008\"" - } - ], - "id": 269, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "2849:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2849:42:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 276, - "nodeType": "ExpressionStatement", - "src": "2849:42:1" - } - ] - } - }, - { - "assignments": [ - 354 - ], - "declarations": [ - { - "constant": false, - "id": 354, - "name": "_id", - "nodeType": "VariableDeclaration", - "scope": 507, - "src": "3585:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 353, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "3585:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 366, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 358, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3626:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 359, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3626:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 360, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "3638:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 361, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "3643:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 362, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "3650:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 363, - "name": "_seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 225, - "src": "3656: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": 356, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3645, - "src": "3609:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 357, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3609:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 364, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3609:53:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 355, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "3599:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 365, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3599:64:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3585:78:1" - }, - { - "assignments": [ - 368 - ], - "declarations": [ - { - "constant": false, - "id": 368, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 507, - "src": "3673:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 367, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "3673:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 372, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 369, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "3696:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 371, - "indexExpression": { - "argumentTypes": null, - "id": 370, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "3712:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3696:20:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3673:43:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 377, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 373, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3726:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 375, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "3726:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 376, - "name": "_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 354, - "src": "3734:3:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "3726:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 378, - "nodeType": "ExpressionStatement", - "src": "3726:11:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 382, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3763:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 383, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "3763:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "expression": { - "argumentTypes": null, - "id": 379, - "name": "redpackets", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "3747:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bytes32_$dyn_storage", - "typeString": "bytes32[] storage ref" - } - }, - "id": 381, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3747:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_bytes32_$returns$_t_uint256_$", - "typeString": "function (bytes32) returns (uint256)" - } - }, - "id": 384, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3747:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 385, - "nodeType": "ExpressionStatement", - "src": "3747:22:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 386, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3780:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 388, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "3780:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 389, - "name": "_token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 231, - "src": "3796:11:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3780:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 391, - "nodeType": "ExpressionStatement", - "src": "3780:27:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 396, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 392, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3817:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 394, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "3817:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 395, - "name": "_token_addr", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 233, - "src": "3836:11:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "3817:30:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 397, - "nodeType": "ExpressionStatement", - "src": "3817:30:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 402, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 398, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3858:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 400, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "3858:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 401, - "name": "_number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 219, - "src": "3876:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "3858:25:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 403, - "nodeType": "ExpressionStatement", - "src": "3858:25:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 408, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 404, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3893:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 406, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "3893:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 407, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "3915:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3893:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 409, - "nodeType": "ExpressionStatement", - "src": "3893:35:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 417, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 410, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3939:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 413, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "3939:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 414, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 98, - "src": "3939:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 415, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "3957:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 416, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3957:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "3939:28:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 418, - "nodeType": "ExpressionStatement", - "src": "3939:28:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 425, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 419, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "3977:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 422, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "3977:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 423, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "name", - "nodeType": "MemberAccess", - "referencedDeclaration": 96, - "src": "3977:15:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 424, - "name": "_name", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 229, - "src": "3995:5:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "3977:23:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 426, - "nodeType": "ExpressionStatement", - "src": "3977:23:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 427, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4010:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 430, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "4010:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 431, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "message", - "nodeType": "MemberAccess", - "referencedDeclaration": 100, - "src": "4010:18:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 432, - "name": "_message", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 227, - "src": "4031:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "4010:29:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 434, - "nodeType": "ExpressionStatement", - "src": "4010:29:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 437, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 435, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 223, - "src": "4054:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4067:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4054:14:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 442, - "nodeType": "IfStatement", - "src": "4050:49:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 440, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 438, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 223, - "src": "4082:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "3836343030", - "id": 439, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4094:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_86400_by_1", - "typeString": "int_const 86400" - }, - "value": "86400" - }, - "src": "4082:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 441, - "nodeType": "ExpressionStatement", - "src": "4082:17:1" - } - }, - { - "expression": { - "argumentTypes": null, - "id": 451, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 443, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4120:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 445, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "4120:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 448, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "4154:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 449, - "name": "_duration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 223, - "src": "4159:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 446, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "4141:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 447, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1598, - "src": "4141:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 450, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4141:28:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4120:49:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 452, - "nodeType": "ExpressionStatement", - "src": "4120:49:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 457, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 453, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4180:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 455, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "4180:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 456, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4200:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4180:21:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 458, - "nodeType": "ExpressionStatement", - "src": "4180:21:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 463, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 459, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4211:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 461, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 67, - "src": "4211:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 462, - "name": "_ifrandom", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 221, - "src": "4225:9:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "4211:23:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 464, - "nodeType": "ExpressionStatement", - "src": "4211:23:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 469, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 465, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4244:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 467, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "hash", - "nodeType": "MemberAccess", - "referencedDeclaration": 65, - "src": "4244:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 468, - "name": "_hash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 217, - "src": "4254:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "4244:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 470, - "nodeType": "ExpressionStatement", - "src": "4244:15:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 484, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 471, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4269:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 473, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "MAX_AMOUNT", - "nodeType": "MemberAccess", - "referencedDeclaration": 71, - "src": "4269:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 478, - "name": "_total_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 235, - "src": "4311:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 479, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4326:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 480, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "4326:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "expression": { - "argumentTypes": null, - "id": 476, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "4298:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 477, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "4298:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 481, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4298:44:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "32", - "id": 482, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4344:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - } - ], - "expression": { - "argumentTypes": null, - "id": 474, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "4285:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 475, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1675, - "src": "4285:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 483, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4285:61:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4269:77:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 485, - "nodeType": "ExpressionStatement", - "src": "4269:77:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 490, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 486, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4356:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 488, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "4356:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 489, - "name": "_erc721_token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 238, - "src": "4378:17:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "src": "4356:39:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 491, - "nodeType": "ExpressionStatement", - "src": "4356:39:1" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 493, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4426:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 494, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "4426:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 495, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4447:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 496, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "4447:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 497, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4454:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 498, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "4454:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 98, - "src": "4454:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 500, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "4471:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 501, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4476:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 502, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "4476:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 503, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 368, - "src": "4494:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 504, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "4494:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - ], - "id": 492, - "name": "CreationSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "4410:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,bytes32,address,uint256,address,uint256[] memory)" - } - }, - "id": 505, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4410:104:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 506, - "nodeType": "EmitStatement", - "src": "4405:109:1" - } - ] - }, - "documentation": null, - "id": 508, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "create_red_packet", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 239, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 217, - "name": "_hash", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2312:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 216, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2312:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 219, - "name": "_number", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2327:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "typeName": { - "id": 218, - "name": "uint8", - "nodeType": "ElementaryTypeName", - "src": "2327:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 221, - "name": "_ifrandom", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2342:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 220, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "2342:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 223, - "name": "_duration", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2358:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 222, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2358:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 225, - "name": "_seed", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2407:13:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 224, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "2407:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 227, - "name": "_message", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2422:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 226, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2422:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 229, - "name": "_name", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2446:19:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 228, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "2446:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 231, - "name": "_token_type", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2499:16:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 230, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2499:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 233, - "name": "_token_addr", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2517:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 232, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2517:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 235, - "name": "_total_tokens", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2538:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 234, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2538:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 238, - "name": "_erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 508, - "src": "2590:34:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 236, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2590:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 237, - "length": null, - "nodeType": "ArrayTypeName", - "src": "2590:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "2311:314:1" - }, - "returnParameters": { - "id": 240, - "nodeType": "ParameterList", - "parameters": [], - "src": "2646:0:1" - }, - "scope": 1367, - "src": "2284:2237:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 615, - "nodeType": "Block", - "src": "4777:782:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 526, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 524, - "name": "token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 510, - "src": "4808:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 525, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4822:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "4808:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 559, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 557, - "name": "token_type", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 510, - "src": "5100:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 558, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5114:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "5100:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 613, - "nodeType": "IfStatement", - "src": "5096:456:1", - "trueBody": { - "id": 612, - "nodeType": "Block", - "src": "5117:435:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 568, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 565, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "5172:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 562, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "5147:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 561, - "name": "IERC721", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3502, - "src": "5139:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", - "typeString": "type(contract IERC721)" - } - }, - "id": 563, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5139:22:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC721_$3502", - "typeString": "contract IERC721" - } - }, - "id": 564, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 3435, - "src": "5139:32:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 566, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5139:48:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 567, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "5191:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5139:58:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303132", - "id": 569, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5199:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", - "typeString": "literal_string \"012\"" - }, - "value": "012" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", - "typeString": "literal_string \"012\"" - } - ], - "id": 560, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "5131:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 570, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5131:74:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 571, - "nodeType": "ExpressionStatement", - "src": "5131:74:1" - }, - { - "body": { - "id": 610, - "nodeType": "Block", - "src": "5251:291:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 586, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 582, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 516, - "src": "5273:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 584, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "5302:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 583, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5294:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5294:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "5273:34:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 598, - "nodeType": "IfStatement", - "src": "5269:150:1", - "trueBody": { - "id": 597, - "nodeType": "Block", - "src": "5308:111:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 591, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 516, - "src": "5361:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 592, - "name": "erc721_token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 521, - "src": "5380:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 594, - "indexExpression": { - "argumentTypes": null, - "id": 593, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 573, - "src": "5397:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5380:19: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": 588, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "5338:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 587, - "name": "IERC721", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3502, - "src": "5330:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", - "typeString": "type(contract IERC721)" - } - }, - "id": 589, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5330:22:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC721_$3502", - "typeString": "contract IERC721" - } - }, - "id": 590, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 3467, - "src": "5330:30:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256) external" - } - }, - "id": 595, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5330:70:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 596, - "nodeType": "ExpressionStatement", - "src": "5330:70:1" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 603, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "5472:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 604, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 516, - "src": "5488:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 605, - "name": "erc721_token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 521, - "src": "5507:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 607, - "indexExpression": { - "argumentTypes": null, - "id": 606, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 573, - "src": "5524:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5507:19: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": 600, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "5444:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 599, - "name": "IERC721", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3502, - "src": "5436:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC721_$3502_$", - "typeString": "type(contract IERC721)" - } - }, - "id": 601, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5436:22:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC721_$3502", - "typeString": "contract IERC721" - } - }, - "id": 602, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 3460, - "src": "5436:35:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,address,uint256) external" - } - }, - "id": 608, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5436:91:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 609, - "nodeType": "ExpressionStatement", - "src": "5436:91:1" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 578, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 576, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 573, - "src": "5234:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 577, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "5238:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5234:10:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 611, - "initializationExpression": { - "assignments": [ - 573 - ], - "declarations": [ - { - "constant": false, - "id": 573, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 611, - "src": "5224:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 572, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5224:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 575, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 574, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5231:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "5224:8:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 580, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "5246:3:1", - "subExpression": { - "argumentTypes": null, - "id": 579, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 573, - "src": "5246:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 581, - "nodeType": "ExpressionStatement", - "src": "5246:3:1" - }, - "nodeType": "ForStatement", - "src": "5219:323:1" - } - ] - } - }, - "id": 614, - "nodeType": "IfStatement", - "src": "4804:748:1", - "trueBody": { - "id": 556, - "nodeType": "Block", - "src": "4825:256:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 535, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 532, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "4879:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 529, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "4854:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 528, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "4847:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 530, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4847:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 531, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balanceOf", - "nodeType": "MemberAccess", - "referencedDeclaration": 2235, - "src": "4847:31:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) view external returns (uint256)" - } - }, - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4847:47:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 534, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "4898:6:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4847:57:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303130", - "id": 536, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4906:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_a775955c4ebf9a14a86ce326379f653bbb58908658ea96ba1b295aaa41291bcf", - "typeString": "literal_string \"010\"" - }, - "value": "010" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_a775955c4ebf9a14a86ce326379f653bbb58908658ea96ba1b295aaa41291bcf", - "typeString": "literal_string \"010\"" - } - ], - "id": 527, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "4839:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 537, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4839:73:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 538, - "nodeType": "ExpressionStatement", - "src": "4839:73:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 543, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "4956:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 544, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "4972: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": 540, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "4933:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 539, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "4926:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 541, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4926:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 542, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 2262, - "src": "4926:29:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 545, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4926:53:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 546, - "nodeType": "ExpressionStatement", - "src": "4926:53:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 551, - "name": "sender_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 514, - "src": "5028:14:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 552, - "name": "recipient_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 516, - "src": "5044:17:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 553, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 518, - "src": "5063: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": 548, - "name": "token_address", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 512, - "src": "5000:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 547, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "4993:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 549, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4993:21:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 550, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transferFrom", - "nodeType": "MemberAccess", - "referencedDeclaration": 2273, - "src": "4993: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": 554, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4993:77:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 555, - "nodeType": "ExpressionStatement", - "src": "4993:77:1" - } - ] - } - } - ] - }, - "documentation": null, - "id": 616, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "transfer_token", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 522, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 510, - "name": "token_type", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4595:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 509, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4595:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 512, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4612:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 511, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4612:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 514, - "name": "sender_address", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4635:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 513, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4635:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 516, - "name": "recipient_address", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4687:25:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 515, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "4687:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 518, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4714:11:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 517, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "4714:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 521, - "name": "erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 616, - "src": "4727:34:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 519, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4727:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 520, - "length": null, - "nodeType": "ArrayTypeName", - "src": "4727:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "4594:168:1" - }, - "returnParameters": { - "id": 523, - "nodeType": "ParameterList", - "parameters": [], - "src": "4777:0:1" - }, - "scope": 1367, - "src": "4571:988:1", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 638, - "nodeType": "Block", - "src": "5674:92:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 629, - "name": "nonce_rand", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 620, - "src": "5723:10:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 630, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "5735:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5735:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 632, - "name": "seed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 618, - "src": "5747:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 633, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "5753: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": 627, - "name": "abi", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3645, - "src": "5706:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_abi", - "typeString": "abi" - } - }, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "encodePacked", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5706:16:1", - "typeDescriptions": { - "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$", - "typeString": "function () pure returns (bytes memory)" - } - }, - "id": 634, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5706:51:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 626, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "5696:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 635, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5696:62:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - ], - "id": 625, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5691:4:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 636, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5691:68:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 624, - "id": 637, - "nodeType": "Return", - "src": "5684:75:1" - } - ] - }, - "documentation": null, - "id": 639, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "random", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 621, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 618, - "name": "seed", - "nodeType": "VariableDeclaration", - "scope": 639, - "src": "5609:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 617, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "5609:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 620, - "name": "nonce_rand", - "nodeType": "VariableDeclaration", - "scope": 639, - "src": "5623:15:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 619, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5623:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5608:31:1" - }, - "returnParameters": { - "id": 624, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 623, - "name": "rand", - "nodeType": "VariableDeclaration", - "scope": 639, - "src": "5663:9:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 622, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5663:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5662:11:1" - }, - "scope": 1367, - "src": "5593:173:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 647, - "nodeType": "Block", - "src": "5968:278:1", - "statements": [ - { - "externalReferences": [ - { - "a": { - "declaration": 641, - "isOffset": false, - "isSlot": false, - "src": "6171:1:1", - "valueSize": 1 - } - }, - { - "b": { - "declaration": 644, - "isOffset": false, - "isSlot": false, - "src": "6224:1:1", - "valueSize": 1 - } - }, - { - "a": { - "declaration": 641, - "isOffset": false, - "isSlot": false, - "src": "6034:1:1", - "valueSize": 1 - } - }, - { - "a": { - "declaration": 641, - "isOffset": false, - "isSlot": false, - "src": "6043:1:1", - "valueSize": 1 - } - } - ], - "id": 646, - "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": "5978:262:1" - } - ] - }, - "documentation": null, - "id": 648, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "toBytes", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 642, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 641, - "name": "a", - "nodeType": "VariableDeclaration", - "scope": 648, - "src": "5920:9:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 640, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "5920:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5919:11:1" - }, - "returnParameters": { - "id": 645, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 644, - "name": "b", - "nodeType": "VariableDeclaration", - "scope": 648, - "src": "5952:14:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes" - }, - "typeName": { - "id": 643, - "name": "bytes", - "nodeType": "ElementaryTypeName", - "src": "5952:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_storage_ptr", - "typeString": "bytes" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5951:16:1" - }, - "scope": 1367, - "src": "5903:343:1", - "stateMutability": "pure", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 702, - "nodeType": "Block", - "src": "6357:284:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 662, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 659, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 653, - "src": "6371:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 660, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6380:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 661, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6380:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6371:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 665, - "nodeType": "IfStatement", - "src": "6367:39:1", - "trueBody": { - "expression": { - "argumentTypes": null, - "id": 663, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6401:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "functionReturnParameters": 658, - "id": 664, - "nodeType": "Return", - "src": "6394:12:1" - } - }, - { - "body": { - "id": 689, - "nodeType": "Block", - "src": "6463:48:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 687, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 679, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6477:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 681, - "indexExpression": { - "argumentTypes": null, - "id": 680, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 667, - "src": "6483:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6477:8:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 682, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6488:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 686, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 683, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 667, - "src": "6494:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 684, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6498:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6494:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6488:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6477:23:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 688, - "nodeType": "ExpressionStatement", - "src": "6477:23:1" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 675, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 670, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 667, - "src": "6437:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 674, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 671, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6441:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 672, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6441:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 673, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6456:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6441:16:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6437:20:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 690, - "initializationExpression": { - "assignments": [ - 667 - ], - "declarations": [ - { - "constant": false, - "id": 667, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 690, - "src": "6421:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 666, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6421:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 669, - "initialValue": { - "argumentTypes": null, - "id": 668, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 653, - "src": "6430:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6421:14:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 677, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6459:3:1", - "subExpression": { - "argumentTypes": null, - "id": 676, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 667, - "src": "6459:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 678, - "nodeType": "ExpressionStatement", - "src": "6459:3:1" - }, - "nodeType": "ForStatement", - "src": "6416:95:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 698, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 691, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6520:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 696, - "indexExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 695, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 692, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6526:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 693, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6526:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 694, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6541:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6526:16:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6520:23:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "307846464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646", - "id": 697, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6546:66:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", - "typeString": "int_const 1157...(70 digits omitted)...9935" - }, - "value": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - }, - "src": "6520:92:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 699, - "nodeType": "ExpressionStatement", - "src": "6520:92:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 700, - "name": "array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 651, - "src": "6629:5:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "functionReturnParameters": 658, - "id": 701, - "nodeType": "Return", - "src": "6622:12:1" - } - ] - }, - "documentation": null, - "id": 703, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getTokenIdWithIndex", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 654, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 651, - "name": "array", - "nodeType": "VariableDeclaration", - "scope": 703, - "src": "6281:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 649, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6281:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 650, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6281:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 653, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 703, - "src": "6305:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 652, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6305:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6280:36:1" - }, - "returnParameters": { - "id": 658, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 657, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 703, - "src": "6339:16:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 655, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6339:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 656, - "length": null, - "nodeType": "ArrayTypeName", - "src": "6339:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6338:18:1" - }, - "scope": 1367, - "src": "6252:389:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "internal" - }, - { - "body": { - "id": 1122, - "nodeType": "Block", - "src": "6860:3782:1", - "statements": [ - { - "assignments": [ - 717 - ], - "declarations": [ - { - "constant": false, - "id": 717, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1122, - "src": "6871:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 716, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "6871:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 721, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 718, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "6894:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 720, - "indexExpression": { - "argumentTypes": null, - "id": 719, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 705, - "src": "6910:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6894:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6871:42:1" - }, - { - "assignments": [ - 723 - ], - "declarations": [ - { - "constant": false, - "id": 723, - "name": "recipient", - "nodeType": "VariableDeclaration", - "scope": 1122, - "src": "6923:25:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - "typeName": { - "id": 722, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6923:15:1", - "stateMutability": "payable", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 729, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 726, - "name": "_recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 709, - "src": "6967:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6959:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint160_$", - "typeString": "type(uint160)" - }, - "typeName": "uint160" - }, - "id": 727, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6959:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint160", - "typeString": "uint160" - } - ], - "id": 724, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "6951:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 728, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6951:28:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6923:56:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 734, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 731, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7051:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 732, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "7051:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 733, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "7072:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7051:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303033", - "id": 735, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7077:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_e07a04e280e3297d905849ae173374e70a63466da0c147cb1dc3eddf1adc47fd", - "typeString": "literal_string \"003\"" - }, - "value": "003" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_e07a04e280e3297d905849ae173374e70a63466da0c147cb1dc3eddf1adc47fd", - "typeString": "literal_string \"003\"" - } - ], - "id": 730, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7042:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7042:41:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 737, - "nodeType": "ExpressionStatement", - "src": "7042:41:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 743, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 739, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7102:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 740, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "7102:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 741, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7122:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 742, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "7122:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "7102:35:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303034", - "id": 744, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7139:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_334057113ad66ac6ad2c739ea6af3f43062313ec754cf4ee576b916e9ef852be", - "typeString": "literal_string \"004\"" - }, - "value": "004" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_334057113ad66ac6ad2c739ea6af3f43062313ec754cf4ee576b916e9ef852be", - "typeString": "literal_string \"004\"" - } - ], - "id": 738, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7093:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 745, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7093:52:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 746, - "nodeType": "ExpressionStatement", - "src": "7093:52:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 753, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 748, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7164:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 749, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed", - "nodeType": "MemberAccess", - "referencedDeclaration": 93, - "src": "7164:10:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - } - }, - "id": 751, - "indexExpression": { - "argumentTypes": null, - "id": 750, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "7175:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7164:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 752, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7189:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "7164:30:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303035", - "id": 754, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7196:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_455d4b967493b29d0d995e675e1e17e44fa9a8488bfbfe9456da6496ca978090", - "typeString": "literal_string \"005\"" - }, - "value": "005" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_455d4b967493b29d0d995e675e1e17e44fa9a8488bfbfe9456da6496ca978090", - "typeString": "literal_string \"005\"" - } - ], - "id": 747, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7155:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 755, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7155:47:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 756, - "nodeType": "ExpressionStatement", - "src": "7155:47:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 765, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 760, - "name": "password", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 707, - "src": "7237:8:1", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - ], - "id": 759, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "7231:5:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes_storage_ptr_$", - "typeString": "type(bytes storage pointer)" - }, - "typeName": "bytes" - }, - "id": 761, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7231:15:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 758, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "7221:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 762, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7221:26:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 763, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7251:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 764, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "hash", - "nodeType": "MemberAccess", - "referencedDeclaration": 65, - "src": "7251:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "7221:37:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303036", - "id": 766, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7260:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_1564f9bd55fc54819c3c6e158d9a00b635174ac7541b6517a7ba0553da91d60d", - "typeString": "literal_string \"006\"" - }, - "value": "006" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_1564f9bd55fc54819c3c6e158d9a00b635174ac7541b6517a7ba0553da91d60d", - "typeString": "literal_string \"006\"" - } - ], - "id": 757, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7212:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 767, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7212:54:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 768, - "nodeType": "ExpressionStatement", - "src": "7212:54:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "id": 777, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 770, - "name": "validation", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 711, - "src": "7285:10:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 773, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "7317:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 774, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7317:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - ], - "id": 772, - "name": "toBytes", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 648, - "src": "7309:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_address_$returns$_t_bytes_memory_ptr_$", - "typeString": "function (address) pure returns (bytes memory)" - } - }, - "id": 775, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7309:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes_memory_ptr", - "typeString": "bytes memory" - } - ], - "id": 771, - "name": "keccak256", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3652, - "src": "7299:9:1", - "typeDescriptions": { - "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", - "typeString": "function (bytes memory) pure returns (bytes32)" - } - }, - "id": 776, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7299:30:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "src": "7285:44:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303037", - "id": 778, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7331:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_adafce779496806a67cd1ef67cfc3ac7e72c67c4eadb74565f826b325436f38b", - "typeString": "literal_string \"007\"" - }, - "value": "007" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_adafce779496806a67cd1ef67cfc3ac7e72c67c4eadb74565f826b325436f38b", - "typeString": "literal_string \"007\"" - } - ], - "id": 769, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "7276:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 779, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7276:61:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 780, - "nodeType": "ExpressionStatement", - "src": "7276:61:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 786, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "7400: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": 781, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7378:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 784, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 86, - "src": "7378:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 785, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7378:21:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 787, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7378:32:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 788, - "nodeType": "ExpressionStatement", - "src": "7378:32:1" - }, - { - "assignments": [ - 790 - ], - "declarations": [ - { - "constant": false, - "id": 790, - "name": "claimed_tokens", - "nodeType": "VariableDeclaration", - "scope": 1122, - "src": "7420:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 789, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7420:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 791, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "7420:19:1" - }, - { - "assignments": [ - 795 - ], - "declarations": [ - { - "constant": false, - "id": 795, - "name": "token_ids", - "nodeType": "VariableDeclaration", - "scope": 1122, - "src": "7449:27:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 793, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7449:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 794, - "length": null, - "nodeType": "ArrayTypeName", - "src": "7449:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 801, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "31", - "id": 799, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7493:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - } - ], - "id": 798, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "7479:13: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": 796, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7483:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 797, - "length": null, - "nodeType": "ArrayTypeName", - "src": "7483:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 800, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7479:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7449:46:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 805, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 802, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7578:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 803, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "ifrandom", - "nodeType": "MemberAccess", - "referencedDeclaration": 67, - "src": "7578:11:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 804, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7593:4:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "7578:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 995, - "nodeType": "Block", - "src": "8700:798:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 921, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 918, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8718:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 919, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "8718:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 920, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8735:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "8718:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 993, - "nodeType": "Block", - "src": "9128:360:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 964, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 962, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 958, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9150:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 959, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "9150:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 960, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9168:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 961, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9168:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "9150:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 963, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9189:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "9150:40:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 985, - "nodeType": "Block", - "src": "9289:130:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 983, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 971, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "9311:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 974, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9341:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 975, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9341:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 980, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 976, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9363:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 977, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "9363:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 978, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9381:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 979, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9381:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "9363:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "id": 981, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "9362:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "expression": { - "argumentTypes": null, - "id": 972, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "9328:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 973, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "9328:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 982, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9328:72:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9311:89:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 984, - "nodeType": "ExpressionStatement", - "src": "9311:89:1" - } - ] - }, - "id": 986, - "nodeType": "IfStatement", - "src": "9146:273:1", - "trueBody": { - "id": 970, - "nodeType": "Block", - "src": "9191:77:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 968, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 965, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "9213:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 966, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9230:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 967, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9230:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9213:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 969, - "nodeType": "ExpressionStatement", - "src": "9213:36:1" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 991, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 987, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9436:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 989, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9436:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "id": 990, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "9459:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9436:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 992, - "nodeType": "ExpressionStatement", - "src": "9436:37:1" - } - ] - }, - "id": 994, - "nodeType": "IfStatement", - "src": "8714:774:1", - "trueBody": { - "id": 957, - "nodeType": "Block", - "src": "8738:360:1", - "statements": [ - { - "assignments": [ - 925 - ], - "declarations": [ - { - "constant": false, - "id": 925, - "name": "_array", - "nodeType": "VariableDeclaration", - "scope": 957, - "src": "8835:23:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 923, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "8835:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 924, - "length": null, - "nodeType": "ArrayTypeName", - "src": "8835:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 928, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 926, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8861:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 927, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "8861:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8835:45:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 936, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 929, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 795, - "src": "8898:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 931, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 930, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8908:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "8898:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 932, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8913:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 933, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "8913:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 935, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 934, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8933: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": "8913:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8898:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 937, - "nodeType": "ExpressionStatement", - "src": "8898:37:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 945, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 938, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8953:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 940, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "8953:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 942, - "name": "_array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 925, - "src": "8995:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 943, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9003:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - }, - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 941, - "name": "getTokenIdWithIndex", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 703, - "src": "8975:19:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", - "typeString": "function (uint256[] memory,uint256) view returns (uint256[] memory)" - } - }, - "id": 944, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8975:30:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "src": "8953:52:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 946, - "nodeType": "ExpressionStatement", - "src": "8953:52:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 949, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 947, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "9023:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 948, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9040:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "9023:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 950, - "nodeType": "ExpressionStatement", - "src": "9023:18:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 955, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 951, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9059:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 953, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9059:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 954, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9082:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "9059:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 956, - "nodeType": "ExpressionStatement", - "src": "9059:24:1" - } - ] - } - } - ] - }, - "id": 996, - "nodeType": "IfStatement", - "src": "7574:1924:1", - "trueBody": { - "id": 917, - "nodeType": "Block", - "src": "7599:1087:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 809, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 806, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7617:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 807, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "7617:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 808, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7634:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "7617:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 915, - "nodeType": "Block", - "src": "8042:634:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 861, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 859, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 855, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8064:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 856, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "8064:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 857, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8082:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 858, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "8082:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "8064:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 860, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8103:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8064:40:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 913, - "nodeType": "Block", - "src": "8203:459:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 876, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 868, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8225:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 875, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 870, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "8249:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 871, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "8255:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 869, - "name": "random", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "8242:6:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" - } - }, - "id": 872, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8242:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 873, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8264:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 874, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "MAX_AMOUNT", - "nodeType": "MemberAccess", - "referencedDeclaration": 71, - "src": "8264:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8242:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8225:52:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 877, - "nodeType": "ExpressionStatement", - "src": "8225:52:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 880, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 878, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8303:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 879, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8321:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "8303:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 889, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 886, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8421:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 887, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8439:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 888, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8439:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8421:37:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 905, - "nodeType": "IfStatement", - "src": "8417:172:1", - "trueBody": { - "id": 904, - "nodeType": "Block", - "src": "8460:129:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 902, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 890, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8486:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 901, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 891, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8503:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 892, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8503:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 899, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 897, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 893, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8526:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 894, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "8526:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 895, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8544:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 896, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "8544:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "8526:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 898, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8564:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8526:39:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "id": 900, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "8525:41:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "8503:63:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8486:80:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 903, - "nodeType": "ExpressionStatement", - "src": "8486:80:1" - } - ] - } - }, - "id": 906, - "nodeType": "IfStatement", - "src": "8299:290:1", - "trueBody": { - "id": 885, - "nodeType": "Block", - "src": "8324:67:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 883, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 881, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8350:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 882, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8367:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8350:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 884, - "nodeType": "ExpressionStatement", - "src": "8350:18:1" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 911, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 907, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8606:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 909, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8606:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "id": 910, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8629:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8606:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 912, - "nodeType": "ExpressionStatement", - "src": "8606:37:1" - } - ] - }, - "id": 914, - "nodeType": "IfStatement", - "src": "8060:602:1", - "trueBody": { - "id": 867, - "nodeType": "Block", - "src": "8105:77:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 865, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 862, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "8127:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 863, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "8144:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 864, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "8144:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "8127:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 866, - "nodeType": "ExpressionStatement", - "src": "8127:36:1" - } - ] - } - } - ] - }, - "id": 916, - "nodeType": "IfStatement", - "src": "7613:1063:1", - "trueBody": { - "id": 854, - "nodeType": "Block", - "src": "7637:375:1", - "statements": [ - { - "assignments": [ - 811 - ], - "declarations": [ - { - "constant": false, - "id": 811, - "name": "token_id_index", - "nodeType": "VariableDeclaration", - "scope": 854, - "src": "7655:19:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 810, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7655:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 819, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 818, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 813, - "name": "uuid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 153, - "src": "7684:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 814, - "name": "nonce", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 139, - "src": "7690:5:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 812, - "name": "random", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 639, - "src": "7677:6:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (bytes32,uint256) view returns (uint256)" - } - }, - "id": 815, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7677:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "%", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 816, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7699:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 817, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "7699:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7677:41:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7655:63:1" - }, - { - "assignments": [ - 823 - ], - "declarations": [ - { - "constant": false, - "id": 823, - "name": "_array", - "nodeType": "VariableDeclaration", - "scope": 854, - "src": "7736:23:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 821, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "7736:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 822, - "length": null, - "nodeType": "ArrayTypeName", - "src": "7736:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 826, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 824, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7762:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 825, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "7762:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7736:45:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 833, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 827, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 795, - "src": "7799:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 829, - "indexExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 828, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7809:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "7799:12:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 830, - "name": "_array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 823, - "src": "7814:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 832, - "indexExpression": { - "argumentTypes": null, - "id": 831, - "name": "token_id_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 811, - "src": "7821:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7814:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7799:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 834, - "nodeType": "ExpressionStatement", - "src": "7799:37:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 842, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 835, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7854:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 837, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "7854:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 839, - "name": "_array", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 823, - "src": "7896:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - { - "argumentTypes": null, - "id": 840, - "name": "token_id_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 811, - "src": "7904:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 838, - "name": "getTokenIdWithIndex", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 703, - "src": "7876:19:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$", - "typeString": "function (uint256[] memory,uint256) view returns (uint256[] memory)" - } - }, - "id": 841, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7876:43:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "src": "7854:65:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 843, - "nodeType": "ExpressionStatement", - "src": "7854:65:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 846, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 844, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "7937:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 845, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7954:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "7937:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 847, - "nodeType": "ExpressionStatement", - "src": "7937:18:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 848, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "7973:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 850, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "7973:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "-=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 851, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7996:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "7973:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 853, - "nodeType": "ExpressionStatement", - "src": "7973:24:1" - } - ] - } - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 1003, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 997, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9508:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1000, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed", - "nodeType": "MemberAccess", - "referencedDeclaration": 93, - "src": "9508:10:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - } - }, - "id": 1001, - "indexExpression": { - "argumentTypes": null, - "id": 999, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "9519:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "9508:21:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 1002, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9532:4:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "9508:28:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1004, - "nodeType": "ExpressionStatement", - "src": "9508:28:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 1008, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "9547:20:1", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1005, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9547:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1007, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9547:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "id": 1009, - "nodeType": "ExpressionStatement", - "src": "9547:20:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1013, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1010, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9581:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1011, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "9581:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1012, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9598:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "9581:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 1048, - "nodeType": "Block", - "src": "9675:202:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 1026, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1022, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9693:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1023, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "9693:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1024, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9712:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1025, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9712:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "9693:36:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1047, - "nodeType": "IfStatement", - "src": "9689:177:1", - "trueBody": { - "id": 1046, - "nodeType": "Block", - "src": "9730:136:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1044, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1027, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9748:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1029, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "MAX_AMOUNT", - "nodeType": "MemberAccess", - "referencedDeclaration": 71, - "src": "9748:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1034, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9790:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1035, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9790:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - }, - "id": 1040, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1036, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9811:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1037, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "9811:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1038, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9829:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1039, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "9829:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - "src": "9811:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "expression": { - "argumentTypes": null, - "id": 1032, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "9777:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 1033, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 1691, - "src": "9777:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 1041, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9777:70:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "32", - "id": 1042, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9849:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - } - ], - "expression": { - "argumentTypes": null, - "id": 1030, - "name": "SafeMath", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1758, - "src": "9764:8:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_SafeMath_$1758_$", - "typeString": "type(library SafeMath)" - } - }, - "id": 1031, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1675, - "src": "9764:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256,uint256) pure returns (uint256)" - } - }, - "id": 1043, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9764:87:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9748:103:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1045, - "nodeType": "ExpressionStatement", - "src": "9748:103:1" - } - ] - } - } - ] - }, - "id": 1049, - "nodeType": "IfStatement", - "src": "9577:300:1", - "trueBody": { - "id": 1021, - "nodeType": "Block", - "src": "9601:60:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1019, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1014, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9615:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1016, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "MAX_AMOUNT", - "nodeType": "MemberAccess", - "referencedDeclaration": 71, - "src": "9615:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1017, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9631:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1018, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "9631:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9615:35:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1020, - "nodeType": "ExpressionStatement", - "src": "9615:35:1" - } - ] - } - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1053, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1050, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "9947:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1051, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "9947:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 1052, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9964:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "9947:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1064, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1061, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10044:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1062, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "10044:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 1063, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10061:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "10044:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1092, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1089, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10310:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1090, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "10310:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1091, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10327:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "10310:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1107, - "nodeType": "IfStatement", - "src": "10306:177:1", - "trueBody": { - "id": 1106, - "nodeType": "Block", - "src": "10330:153:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1094, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10359:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1095, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "10359:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1096, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10374:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1097, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "10374:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1099, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "10400:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 1098, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "10392:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 1100, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10392:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1101, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "10435:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 1102, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10446:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1103, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 795, - "src": "10462:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1093, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "10344:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 1104, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10344:128:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1105, - "nodeType": "ExpressionStatement", - "src": "10344:128:1" - } - ] - } - }, - "id": 1108, - "nodeType": "IfStatement", - "src": "10040:443:1", - "trueBody": { - "id": 1088, - "nodeType": "Block", - "src": "10064:228:1", - "statements": [ - { - "assignments": [ - 1068 - ], - "declarations": [ - { - "constant": false, - "id": 1068, - "name": "token_ids_holder", - "nodeType": "VariableDeclaration", - "scope": 1088, - "src": "10078:34:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1066, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10078:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1067, - "length": null, - "nodeType": "ArrayTypeName", - "src": "10078:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1074, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 1072, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10129:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 1071, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "10115:13: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": 1069, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "10119:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1070, - "length": null, - "nodeType": "ArrayTypeName", - "src": "10119:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 1073, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10115:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10078:53:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1076, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10161:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1077, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "10161:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1078, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10176:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1079, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "10176:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1081, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "10202:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 1080, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "10194:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 1082, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10194:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1083, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "10237:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 1084, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10248:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1085, - "name": "token_ids_holder", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1068, - "src": "10264:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1075, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "10146:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 1086, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10146:135:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1087, - "nodeType": "ExpressionStatement", - "src": "10146:135:1" - } - ] - } - }, - "id": 1109, - "nodeType": "IfStatement", - "src": "9943:540:1", - "trueBody": { - "id": 1060, - "nodeType": "Block", - "src": "9967:59:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1057, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10000:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 1054, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "9981:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 1056, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9981:18:1", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 1058, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9981:34:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1059, - "nodeType": "ExpressionStatement", - "src": "9981:34:1" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1111, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10542:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1112, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "10542:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "id": 1113, - "name": "recipient", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 723, - "src": "10549:9:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "id": 1114, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10560:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1115, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 717, - "src": "10576:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1116, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "10576:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1117, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 795, - "src": "10594:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1110, - "name": "ClaimSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 129, - "src": "10529:12:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$_t_address_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (bytes32,address,uint256,address,uint256[] memory)" - } - }, - "id": 1118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10529:75:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1119, - "nodeType": "EmitStatement", - "src": "10524:80:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 1120, - "name": "claimed_tokens", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 790, - "src": "10621:14:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 715, - "id": 1121, - "nodeType": "Return", - "src": "10614:21:1" - } - ] - }, - "documentation": null, - "id": 1123, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "claim", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 712, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 705, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6749:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 704, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "6749:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 707, - "name": "password", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6761:22:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 706, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "6761:6:1", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 709, - "name": "_recipient", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6785:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 708, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "6785:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 711, - "name": "validation", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6805:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 710, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "6805:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6748:76:1" - }, - "returnParameters": { - "id": 715, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 714, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 1123, - "src": "6846:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 713, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6846:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6845:14:1" - }, - "scope": 1367, - "src": "6734:3908:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1165, - "nodeType": "Block", - "src": "10969:218:1", - "statements": [ - { - "assignments": [ - 1141 - ], - "declarations": [ - { - "constant": false, - "id": 1141, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1165, - "src": "10979:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 1140, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "10979:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1145, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1142, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "11002:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 1144, - "indexExpression": { - "argumentTypes": null, - "id": 1143, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1125, - "src": "11018:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11002:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10979:42:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1146, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11039:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1147, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "11039:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1148, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11057:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1149, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "11057:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1150, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11078:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1151, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "total_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 75, - "src": "11078:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1152, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11112:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1153, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed_number", - "nodeType": "MemberAccess", - "referencedDeclaration": 77, - "src": "11112:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - }, - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1157, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 1154, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "11131:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1155, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11137:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1156, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "11137:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11131:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1158, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1141, - "src": "11157:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1159, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimed", - "nodeType": "MemberAccess", - "referencedDeclaration": 93, - "src": "11157:10:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_bool_$", - "typeString": "mapping(address => bool)" - } - }, - "id": 1162, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1160, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "11168:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11168:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11157:22:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "id": 1163, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "11038:142:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_address_$_t_uint256_$_t_uint8_$_t_uint8_$_t_bool_$_t_bool_$", - "typeString": "tuple(address,uint256,uint8,uint8,bool,bool)" - } - }, - "functionReturnParameters": 1139, - "id": 1164, - "nodeType": "Return", - "src": "11031:149:1" - } - ] - }, - "documentation": null, - "id": 1166, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_availability", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1126, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1125, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10774:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1124, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "10774:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10773:12:1" - }, - "returnParameters": { - "id": 1139, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1128, - "name": "token_address", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10807:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1127, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10807:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1130, - "name": "balance", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10830:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1129, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10830:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1132, - "name": "total", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10844:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1131, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10844:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1134, - "name": "claimed", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10925:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1133, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10925:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1136, - "name": "expired", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10939:12:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1135, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10939:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1138, - "name": "ifclaimed", - "nodeType": "VariableDeclaration", - "scope": 1166, - "src": "10953:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1137, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10953:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10806:162:1" - }, - "scope": 1367, - "src": "10746:441:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1184, - "nodeType": "Block", - "src": "11341:94:1", - "statements": [ - { - "assignments": [ - 1175 - ], - "declarations": [ - { - "constant": false, - "id": 1175, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1184, - "src": "11351:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 1174, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "11351:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1179, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1176, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "11374:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 1178, - "indexExpression": { - "argumentTypes": null, - "id": 1177, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1168, - "src": "11390:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11374:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "11351:42:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1180, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1175, - "src": "11411:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1181, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "claimer_addrs", - "nodeType": "MemberAccess", - "referencedDeclaration": 86, - "src": "11411:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - } - ], - "id": 1182, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "11410:18:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "functionReturnParameters": 1173, - "id": 1183, - "nodeType": "Return", - "src": "11403:25:1" - } - ] - }, - "documentation": null, - "id": 1185, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_claimed_list", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1169, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1168, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1185, - "src": "11276:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1167, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11276:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11275:12:1" - }, - "returnParameters": { - "id": 1173, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1172, - "name": "claimer_addrs", - "nodeType": "VariableDeclaration", - "scope": 1185, - "src": "11309:30:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 1170, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "11309:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 1171, - "length": null, - "nodeType": "ArrayTypeName", - "src": "11309:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11308:32:1" - }, - "scope": 1367, - "src": "11248:187:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1203, - "nodeType": "Block", - "src": "11584:97:1", - "statements": [ - { - "assignments": [ - 1194 - ], - "declarations": [ - { - "constant": false, - "id": 1194, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1203, - "src": "11594:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 1193, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "11594:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1198, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1195, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "11617:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 1197, - "indexExpression": { - "argumentTypes": null, - "id": 1196, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1187, - "src": "11633:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11617:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "11594:42:1" - }, - { - "expression": { - "argumentTypes": null, - "components": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1199, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1194, - "src": "11654:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1200, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "11654:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - } - ], - "id": 1201, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "11653:21:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "functionReturnParameters": 1192, - "id": 1202, - "nodeType": "Return", - "src": "11646:28:1" - } - ] - }, - "documentation": null, - "id": 1204, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "check_erc721_token_ids", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1188, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1187, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1204, - "src": "11516:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1186, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11516:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11515:12:1" - }, - "returnParameters": { - "id": 1192, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1191, - "name": "erc721_token_ids", - "nodeType": "VariableDeclaration", - "scope": 1204, - "src": "11549:33:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1189, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "11549:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1190, - "length": null, - "nodeType": "ArrayTypeName", - "src": "11549:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11548:35:1" - }, - "scope": 1367, - "src": "11484:197:1", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1365, - "nodeType": "Block", - "src": "11722:1335:1", - "statements": [ - { - "assignments": [ - 1210 - ], - "declarations": [ - { - "constant": false, - "id": 1210, - "name": "rp", - "nodeType": "VariableDeclaration", - "scope": 1365, - "src": "11732:20:1", - "stateVariable": false, - "storageLocation": "storage", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - }, - "typeName": { - "contractScope": null, - "id": 1209, - "name": "RedPacket", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 94, - "src": "11732:9:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1214, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1211, - "name": "redpacket_by_id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "11755:15:1", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_bytes32_$_t_struct$_RedPacket_$94_storage_$", - "typeString": "mapping(bytes32 => struct HappyRedPacket.RedPacket storage ref)" - } - }, - "id": 1213, - "indexExpression": { - "argumentTypes": null, - "id": 1212, - "name": "id", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1206, - "src": "11771:2:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11755:19:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage", - "typeString": "struct HappyRedPacket.RedPacket storage ref" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "11732:42:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 1221, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1216, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "11792:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1217, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11792:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1218, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11806:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1219, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "creator", - "nodeType": "MemberAccess", - "referencedDeclaration": 73, - "src": "11806:10:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Creator_$101_storage", - "typeString": "struct HappyRedPacket.Creator storage ref" - } - }, - "id": 1220, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "addr", - "nodeType": "MemberAccess", - "referencedDeclaration": 98, - "src": "11806:15:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "11792:29:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303131", - "id": 1222, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11823:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", - "typeString": "literal_string \"011\"" - }, - "value": "011" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_359f0aca1c53c216ad47abe8e6c1356faf58ed042c9ad6c2da01d7e2a0618e1e", - "typeString": "literal_string \"011\"" - } - ], - "id": 1215, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "11784:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1223, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11784:45:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1224, - "nodeType": "ExpressionStatement", - "src": "11784:45:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1229, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1226, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11847:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1227, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "expiration_time", - "nodeType": "MemberAccess", - "referencedDeclaration": 79, - "src": "11847:18:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 1228, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3660, - "src": "11868:3:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11847:24:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "303132", - "id": 1230, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11873:5:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", - "typeString": "literal_string \"012\"" - }, - "value": "012" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_76ffb339ff0520d5996594fb80db6105eec1024fc2252bc83446be56db5757a5", - "typeString": "literal_string \"012\"" - } - ], - "id": 1225, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 3661, - 3662 - ], - "referencedDeclaration": 3662, - "src": "11839:7:1", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1231, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11839:40:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1232, - "nodeType": "ExpressionStatement", - "src": "11839:40:1" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1236, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1233, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11894:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1234, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "11894:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 1235, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11911:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "11894:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1250, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1247, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11997:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1248, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "11997:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 1249, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12014:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "11997:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1291, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1288, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12347:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1289, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "12347:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "32", - "id": 1290, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12364:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "12347:18:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1347, - "nodeType": "IfStatement", - "src": "12343:600:1", - "trueBody": { - "id": 1346, - "nodeType": "Block", - "src": "12367:576:1", - "statements": [ - { - "assignments": [ - 1295 - ], - "declarations": [ - { - "constant": false, - "id": 1295, - "name": "token_ids", - "nodeType": "VariableDeclaration", - "scope": 1346, - "src": "12381:26:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1293, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "12381:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1294, - "length": null, - "nodeType": "ArrayTypeName", - "src": "12381:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1296, - "initialValue": null, - "nodeType": "VariableDeclarationStatement", - "src": "12381:26:1" - }, - { - "body": { - "id": 1329, - "nodeType": "Block", - "src": "12478:223:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1311, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12500:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1312, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "12500:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 1314, - "indexExpression": { - "argumentTypes": null, - "id": 1313, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1298, - "src": "12520:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "12500:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "307846464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646", - "id": 1315, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12526:66:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", - "typeString": "int_const 1157...(70 digits omitted)...9935" - }, - "value": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - }, - "src": "12500:92:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 1328, - "nodeType": "IfStatement", - "src": "12496:191:1", - "trueBody": { - "id": 1327, - "nodeType": "Block", - "src": "12594:93:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 1325, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1317, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1295, - "src": "12616:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 1320, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1318, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1295, - "src": "12626:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 1319, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12626:16:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "12616:27:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1321, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12646:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1322, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "12646:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 1324, - "indexExpression": { - "argumentTypes": null, - "id": 1323, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1298, - "src": "12666:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "12646:22:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "12616:52:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1326, - "nodeType": "ExpressionStatement", - "src": "12616:52:1" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1307, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 1301, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1298, - "src": "12438:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1306, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1302, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12442:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1303, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "erc721_token_ids", - "nodeType": "MemberAccess", - "referencedDeclaration": 89, - "src": "12442:19:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage", - "typeString": "uint256[] storage ref" - } - }, - "id": 1304, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12442:26:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 1305, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12471:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "12442:30:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "12438:34:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1330, - "initializationExpression": { - "assignments": [ - 1298 - ], - "declarations": [ - { - "constant": false, - "id": 1298, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 1330, - "src": "12426:6:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1297, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "12426:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1300, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 1299, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12435:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "12426:10:1" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 1309, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "12474:3:1", - "subExpression": { - "argumentTypes": null, - "id": 1308, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1298, - "src": "12474:1:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1310, - "nodeType": "ExpressionStatement", - "src": "12474:3:1" - }, - "nodeType": "ForStatement", - "src": "12421:280:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1332, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12812:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1333, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "12812:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1334, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12827:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1335, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "12827:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1337, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "12853:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 1336, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "12845:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 1338, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12845:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1339, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "12888:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1340, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12888:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1341, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12900:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1342, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "12900:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1343, - "name": "token_ids", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1295, - "src": "12921:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1331, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "12797:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 1344, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12797:134:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1345, - "nodeType": "ExpressionStatement", - "src": "12797:134:1" - } - ] - } - }, - "id": 1348, - "nodeType": "IfStatement", - "src": "11993:950:1", - "trueBody": { - "id": 1287, - "nodeType": "Block", - "src": "12017:312:1", - "statements": [ - { - "assignments": [ - 1254 - ], - "declarations": [ - { - "constant": false, - "id": 1254, - "name": "token_ids_holder", - "nodeType": "VariableDeclaration", - "scope": 1287, - "src": "12031:33:1", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1252, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "12031:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1253, - "length": null, - "nodeType": "ArrayTypeName", - "src": "12031:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1260, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "30", - "id": 1258, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12081:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - } - ], - "id": 1257, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "12067:13: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": 1255, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "12071:7:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1256, - "length": null, - "nodeType": "ArrayTypeName", - "src": "12071:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - } - }, - "id": 1259, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12067:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory", - "typeString": "uint256[] memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "12031:52:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1266, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "12131:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1267, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12131:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1268, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12143:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1269, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "12143:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1262, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12105:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1263, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "12105:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 1261, - "name": "IERC20", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 2290, - "src": "12098:6:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_IERC20_$2290_$", - "typeString": "type(contract IERC20)" - } - }, - "id": 1264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12098:24:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_IERC20_$2290", - "typeString": "contract IERC20" - } - }, - "id": 1265, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "approve", - "nodeType": "MemberAccess", - "referencedDeclaration": 2262, - "src": "12098:32:1", - "typeDescriptions": { - "typeIdentifier": "t_function_external_nonpayable$_t_address_$_t_uint256_$returns$_t_bool_$", - "typeString": "function (address,uint256) external returns (bool)" - } - }, - "id": 1270, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12098:65:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 1271, - "nodeType": "ExpressionStatement", - "src": "12098:65:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1273, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12192:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1274, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_type", - "nodeType": "MemberAccess", - "referencedDeclaration": 69, - "src": "12192:13:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1275, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12207:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1276, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "12207:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1278, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3680, - "src": "12233:4:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_HappyRedPacket_$1367", - "typeString": "contract HappyRedPacket" - } - ], - "id": 1277, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "12225:7:1", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 1279, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12225:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1280, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "12268:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1281, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12268:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1282, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12280:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1283, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "12280:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1284, - "name": "token_ids_holder", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1254, - "src": "12301:16:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - } - ], - "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" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - ], - "id": 1272, - "name": "transfer_token", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 616, - "src": "12177:14:1", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_address_$_t_address_$_t_address_$_t_uint256_$_t_array$_t_uint256_$dyn_memory_ptr_$returns$__$", - "typeString": "function (uint256,address,address,address,uint256,uint256[] memory)" - } - }, - "id": 1285, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12177:141:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1286, - "nodeType": "ExpressionStatement", - "src": "12177:141:1" - } - ] - } - }, - "id": 1349, - "nodeType": "IfStatement", - "src": "11890:1053:1", - "trueBody": { - "id": 1246, - "nodeType": "Block", - "src": "11914:65:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1242, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "11948:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1243, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "11948:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1237, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3658, - "src": "11928:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1240, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11928:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "id": 1241, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11928:19:1", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 1244, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11928:40:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1245, - "nodeType": "ExpressionStatement", - "src": "11928:40:1" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1351, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12972:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1352, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "id", - "nodeType": "MemberAccess", - "referencedDeclaration": 63, - "src": "12972:5:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1353, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12979:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1354, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "token_address", - "nodeType": "MemberAccess", - "referencedDeclaration": 83, - "src": "12979:16:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1355, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "12997:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1356, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "12997: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": 1350, - "name": "RefundSuccess", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 137, - "src": "12958:13:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (bytes32,address,uint256)" - } - }, - "id": 1357, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12958:59:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1358, - "nodeType": "EmitStatement", - "src": "12953:64:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 1363, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1359, - "name": "rp", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1210, - "src": "13027:2:1", - "typeDescriptions": { - "typeIdentifier": "t_struct$_RedPacket_$94_storage_ptr", - "typeString": "struct HappyRedPacket.RedPacket storage pointer" - } - }, - "id": 1361, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "remaining_tokens", - "nodeType": "MemberAccess", - "referencedDeclaration": 81, - "src": "13027:19:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 1362, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "13049:1:1", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "13027:23:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1364, - "nodeType": "ExpressionStatement", - "src": "13027:23:1" - } - ] - }, - "documentation": null, - "id": 1366, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "refund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1207, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1206, - "name": "id", - "nodeType": "VariableDeclaration", - "scope": 1366, - "src": "11703:10:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - }, - "typeName": { - "id": 1205, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "11703:7:1", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11702:12:1" - }, - "returnParameters": { - "id": 1208, - "nodeType": "ParameterList", - "parameters": [], - "src": "11722:0:1" - }, - "scope": 1367, - "src": "11687:1370:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 1368, - "src": "218:12962:1" - } - ], - "src": "0:13181:1" - }, - "compiler": { - "name": "solc", - "version": "0.5.16+commit.9c3226ce.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" - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "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" - }, - "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" - }, - "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" - }, - "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" - } - }, - "links": {}, - "address": "0xEc9Fe35219934B182c2eA29e1E44eADA6B111248", - "transactionHash": "0xe53f8b43eb721c4ad0a3145444d3e340a32e88820658e7bc40d387e195911dbb" - } - }, - "schemaVersion": "3.2.5", - "updatedAt": "2020-09-17T07:15:42.104Z", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file From 17c630d85aa18bab63eb5e8dd2211a90a3f7860b Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Fri, 18 Sep 2020 16:36:31 +0800 Subject: [PATCH 7/7] Remove the unused creation function --- test/contracts/redpacket.sol | 14 ++------------ test/test/Testrp.js | 5 +++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index a85ce2a..c89a138 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -63,16 +63,6 @@ contract HappyRedPacket { uuid = keccak256(abi.encodePacked(magic, now, contract_creator)); } - // Inits a red packet instance - // _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) - public payable { - create_red_packet(_hash, _number, _ifrandom, _duration, _seed, _message, _name, - _token_type, _token_addr, _total_tokens, new uint256[](1)); - } - // Inits a red packet instance // _token_type: 0 - ETH 1 - ERC20 2 - ERC721 function create_red_packet (bytes32 _hash, uint8 _number, bool _ifrandom, uint _duration, @@ -90,8 +80,7 @@ contract HappyRedPacket { } else if (_token_type == 1) { require(IERC20(_token_addr).allowance(msg.sender, address(this)) >= _total_tokens, "009"); - uint256 [] memory token_ids_holder = new uint256[](0); - transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, token_ids_holder); + 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"); @@ -136,6 +125,7 @@ contract HappyRedPacket { 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++) { diff --git a/test/test/Testrp.js b/test/test/Testrp.js index 3de42fd..23362c0 100644 --- a/test/test/Testrp.js +++ b/test/test/Testrp.js @@ -33,6 +33,7 @@ contract("TestToken", accounts => { 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[])'; @@ -41,7 +42,7 @@ contract("TestToken", accounts => { 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); @@ -218,4 +219,4 @@ contract("Test721Token", accounts => { // assert.equal(Number(balance1) + Number(balance2) + Number(balance3), _total_tokens) }); -}); \ No newline at end of file +});