From ec2c68ad5e5b3a731fce4e1c63cdcc95c0c4e6f7 Mon Sep 17 00:00:00 2001 From: Hging Date: Thu, 10 Sep 2020 23:53:10 +0800 Subject: [PATCH 01/28] 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 02/28] 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 03/28] 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 04/28] 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 05/28] 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 06/28] 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 07/28] 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 +}); From 27e452a14231b113c4a119eb33a581e880ee19fc Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Sun, 27 Sep 2020 16:22:58 +0800 Subject: [PATCH 08/28] Optimize at storage level --- test/contracts/Migrations.sol | 2 +- test/contracts/redpacket.sol | 62 ++++++++++------------------ test/contracts/test_erc721_token.sol | 8 ++-- test/contracts/test_token.sol | 5 +-- test/package-lock.json | 11 +++-- test/package.json | 6 ++- test/test/Testrp.js | 8 ++-- test/truffle-config.js | 2 +- 8 files changed, 45 insertions(+), 59 deletions(-) diff --git a/test/contracts/Migrations.sol b/test/contracts/Migrations.sol index c378ffb..7c542c4 100644 --- a/test/contracts/Migrations.sol +++ b/test/contracts/Migrations.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.4.21 <0.6.0; +pragma solidity >=0.4.21; contract Migrations { address public owner; diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index c89a138..34756d9 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -1,4 +1,4 @@ -pragma solidity >0.4.22; +pragma solidity ^0.6; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; @@ -9,28 +9,23 @@ contract HappyRedPacket { bytes32 id; bytes32 hash; bool ifrandom; - uint token_type; + uint8 token_type; uint MAX_AMOUNT; - Creator creator; + address creator; uint8 total_number; uint8 claimed_number; - uint expiration_time; + uint32 expiration_time; uint remaining_tokens; address token_address; - address[] claimer_addrs; uint256[] erc721_token_ids; mapping(address => bool) claimed; } - struct Creator { - string name; - address addr; - string message; - } - event CreationSuccess( uint total, bytes32 id, + string name, + string message, address creator, uint creation_time, address token_address, @@ -51,33 +46,31 @@ contract HappyRedPacket { uint remaining_balance ); - uint nonce; + uint32 nonce; address public contract_creator; mapping(bytes32 => RedPacket) redpacket_by_id; - bytes32 [] redpackets; string constant private magic = "Former NBA Commissioner David St"; // 32 bytes - bytes32 private uuid; + bytes32 private seed; constructor() public { contract_creator = msg.sender; - uuid = keccak256(abi.encodePacked(magic, now, contract_creator)); + seed = 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, + uint8 _token_type, address _token_addr, uint _total_tokens, uint256[] memory _erc721_token_ids) public payable { nonce ++; - require(nonce > redpackets.length, "000"); require(_total_tokens >= _number, "001"); require(_number > 0, "002"); if (_token_type == 0) { require(msg.value >= _total_tokens, "008"); - } + } 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, new uint256[](0)); @@ -88,10 +81,9 @@ contract HappyRedPacket { // IERC721(_token_addr).setApprovalForAll(address(this), false); } - bytes32 _id = keccak256(abi.encodePacked(msg.sender, now, nonce, uuid, _seed)); + bytes32 _id = keccak256(abi.encodePacked(msg.sender, now, nonce, seed, _seed)); RedPacket storage rp = redpacket_by_id[_id]; rp.id = _id; - redpackets.push(rp.id); rp.token_type = _token_type; rp.token_address = _token_addr; @@ -99,20 +91,18 @@ contract HappyRedPacket { rp.total_number = _number; rp.remaining_tokens = _total_tokens; - rp.creator.addr = msg.sender; - rp.creator.name = _name; - rp.creator.message = _message; + rp.creator = msg.sender; if (_duration == 0) _duration = 86400; // 24hours - rp.expiration_time = SafeMath.add(now, _duration); + rp.expiration_time = uint32(SafeMath.add(now, _duration)); rp.claimed_number = 0; rp.ifrandom = _ifrandom; rp.hash = _hash; rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(_total_tokens, rp.total_number), 2); 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); + emit CreationSuccess(rp.remaining_tokens, rp.id, _name, _message, rp.creator, now, rp.token_address, rp.erc721_token_ids); } // Check the balance of the given token @@ -139,8 +129,8 @@ contract HappyRedPacket { } // A boring wrapper - function random(bytes32 seed, uint nonce_rand) internal view returns (uint rand) { - return uint(keccak256(abi.encodePacked(nonce_rand, msg.sender, seed, now))); + function random(bytes32 _seed, uint32 nonce_rand) internal view returns (uint rand) { + return uint(keccak256(abi.encodePacked(nonce_rand, msg.sender, _seed, now))); } // https://ethereum.stackexchange.com/questions/884/how-to-convert-an-address-to-bytes-in-solidity @@ -155,7 +145,7 @@ contract HappyRedPacket { } } - function getTokenIdWithIndex(uint256[] memory array, uint index) internal view returns(uint256[] memory) { + function getTokenIdWithIndex(uint256[] memory array, uint index) internal pure returns(uint256[] memory) { if (index >= array.length) return array; for (uint i = index; i < array.length - 1; i++){ array[i] = array[i + 1]; @@ -178,14 +168,12 @@ contract HappyRedPacket { require (keccak256(bytes(password)) == rp.hash, "006"); require (validation == keccak256(toBytes(msg.sender)), "007"); - // Store claimer info - rp.claimer_addrs.push(recipient); uint claimed_tokens; uint256 [] memory token_ids = new uint256[](1); //TODO: Optimize this behavior. // Todo get erc721 token id; if (rp.ifrandom == true) { if (rp.token_type == 2) { - uint token_id_index = random(uuid, nonce) % rp.remaining_tokens; + uint token_id_index = random(seed, nonce) % rp.remaining_tokens; uint256[] memory _array = rp.erc721_token_ids; token_ids[0] = _array[token_id_index]; rp.erc721_token_ids = getTokenIdWithIndex(_array, token_id_index); @@ -198,7 +186,7 @@ contract HappyRedPacket { claimed_tokens = rp.remaining_tokens; } else{ - claimed_tokens = random(uuid, nonce) % rp.MAX_AMOUNT; + claimed_tokens = random(seed, nonce) % rp.MAX_AMOUNT; if (claimed_tokens == 0) { claimed_tokens = 1; } @@ -211,7 +199,7 @@ contract HappyRedPacket { } else { if (rp.token_type == 2) { - // token_id_index = random(uuid, nonce) % rp.remaining_tokens; + // token_id_index = random(seed, nonce) % rp.remaining_tokens; uint256[] memory _array = rp.erc721_token_ids; token_ids[0] = rp.erc721_token_ids[0]; rp.erc721_token_ids = getTokenIdWithIndex(_array, 0); @@ -270,12 +258,6 @@ contract HappyRedPacket { rp.claimed_number, now > rp.expiration_time, rp.claimed[msg.sender]); } - // Returns a list of claimed addresses accordingly - function check_claimed_list(bytes32 id) public view returns (address[] memory claimer_addrs) { - RedPacket storage rp = redpacket_by_id[id]; - return (rp.claimer_addrs); - } - // Returns a list of claiming token id function check_erc721_token_ids(bytes32 id) public view returns (uint256[] memory erc721_token_ids) { RedPacket storage rp = redpacket_by_id[id]; @@ -284,7 +266,7 @@ contract HappyRedPacket { function refund(bytes32 id) public { RedPacket storage rp = redpacket_by_id[id]; - require(msg.sender == rp.creator.addr, "011"); + require(msg.sender == rp.creator, "011"); require(rp.expiration_time < now, "012"); if (rp.token_type == 0) { diff --git a/test/contracts/test_erc721_token.sol b/test/contracts/test_erc721_token.sol index 4c5a5ef..4184830 100644 --- a/test/contracts/test_erc721_token.sol +++ b/test/contracts/test_erc721_token.sol @@ -1,11 +1,9 @@ -pragma solidity >0.4.22; +pragma solidity ^0.6; 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") { +contract Test721Token is ERC721 { + constructor (uint256 initialSupply) public ERC721("Test721Token", "TEST721") { for (uint i=0; i0.4.22; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; -import "openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol"; -contract TestToken is ERC20, ERC20Detailed{ - constructor(uint initialSupply) ERC20Detailed("TestToken", "TEST", 18) public{ +contract TestToken is ERC20 { + constructor(uint initialSupply) ERC20("TestToken", "TEST") public{ _mint(msg.sender, initialSupply); } } diff --git a/test/package-lock.json b/test/package-lock.json index 1466985..6413fc5 100644 --- a/test/package-lock.json +++ b/test/package-lock.json @@ -751,9 +751,9 @@ } }, "openzeppelin-solidity": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-2.4.0.tgz", - "integrity": "sha512-533gc5jkspxW5YT0qJo02Za5q1LHwXK9CJCc48jNj/22ncNM/3M/3JfWLqfpB90uqLwOKOovpl0JfaMQTR+gXQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-3.2.0.tgz", + "integrity": "sha512-ku9dZbpo63P1OOGvU1FflRlAxcxWauKhex+a7W0vbfjLzItaCQkZEiDedsH2TWJrg4xdo0B/BFS9taeVwKvAxw==", "dev": true }, "optionator": { @@ -1114,6 +1114,11 @@ "requires": { "mkdirp": "^0.5.1" } + }, + "zeppelin-solidity": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/zeppelin-solidity/-/zeppelin-solidity-1.12.0.tgz", + "integrity": "sha512-dgjPPnTmx14hAbTeOpTKemDeDCDdwglS0nquOAJG8h5o9zlb43FZafQSrMlIUUSp1EisDZfehrp5loGEYXHZBA==" } } } diff --git a/test/package.json b/test/package.json index af92c4b..7660c86 100644 --- a/test/package.json +++ b/test/package.json @@ -1,7 +1,9 @@ { - "dependencies": {}, + "dependencies": { + "zeppelin-solidity": "^1.12.0" + }, "devDependencies": { - "openzeppelin-solidity": "^2.4.0", + "openzeppelin-solidity": "^3.2.0", "solhint": "^2.3.0" } } diff --git a/test/test/Testrp.js b/test/test/Testrp.js index 23362c0..e72c5b4 100644 --- a/test/test/Testrp.js +++ b/test/test/Testrp.js @@ -36,8 +36,8 @@ contract("TestToken", accounts => { const token_ids = []; const total_tokens = _total_tokens; - const creation_success_encode = 'CreationSuccess(uint256,bytes32,address,uint256,address,uint256[])'; - const creation_success_types = ['uint256', 'bytes32', 'address', 'uint256', 'address', 'uint256[]']; + const creation_success_encode = 'CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256[])'; + const creation_success_types = ['uint256', 'bytes32', 'string', 'string','address', 'uint256', 'address', 'uint256[]']; await testtoken.approve.sendTransaction(redpacket.address, total_tokens); const creation_receipt = await redpacket.create_red_packet @@ -145,8 +145,8 @@ contract("Test721Token", accounts => { } const total_tokens = token_ids.length; - const creation_success_encode = 'CreationSuccess(uint256,bytes32,address,uint256,address,uint256[])'; - const creation_success_types = ['uint256', 'bytes32', 'address', 'uint256', 'address', 'uint256[]']; + const creation_success_encode = 'CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256[])'; + const creation_success_types = ['uint256', 'bytes32', 'string', 'string','address', 'uint256', 'address', 'uint256[]']; await test721token.setApprovalForAll.sendTransaction(redpacket.address, true); const creation_receipt = await redpacket.create_red_packet diff --git a/test/truffle-config.js b/test/truffle-config.js index bc4202e..009a87c 100644 --- a/test/truffle-config.js +++ b/test/truffle-config.js @@ -85,7 +85,7 @@ module.exports = { // Configure your compilers compilers: { solc: { - // version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version) + version: "0.6.2", // Fetch exact version from solc-bin (default: truffle's version) // docker: true, // Use "0.5.1" you've installed locally with docker (default: false) // settings: { // See the solidity docs for advice about optimization and evmVersion // optimizer: { From e785d508a8675830e81bbf2a4feeff21ff7e91b4 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Mon, 28 Sep 2020 16:06:05 +0800 Subject: [PATCH 09/28] Compress the variables into 32-byte blocks --- test/contracts/redpacket.sol | 135 +++++++++++++++-------------------- 1 file changed, 57 insertions(+), 78 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 34756d9..7ddb60a 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -6,17 +6,8 @@ import "openzeppelin-solidity/contracts/math/SafeMath.sol"; contract HappyRedPacket { struct RedPacket { - bytes32 id; - bytes32 hash; - bool ifrandom; - uint8 token_type; - uint MAX_AMOUNT; - address creator; - uint8 total_number; - uint8 claimed_number; - uint32 expiration_time; - uint remaining_tokens; - address token_address; + uint256 packed1; // exp(48) total_tokens(80) hash(64) id(64) BIG ENDIAN + uint256 packed2; // ifrandom(1) token_type(8) total_number(8) claimed(8) creator(64) token_addr(160) uint256[] erc721_token_ids; mapping(address => bool) claimed; } @@ -59,7 +50,7 @@ contract HappyRedPacket { // 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, + function create_red_packet (bytes32 _hash, uint _number, bool _ifrandom, uint _duration, bytes32 _seed, string memory _message, string memory _name, uint8 _token_type, address _token_addr, uint _total_tokens, uint256[] memory _erc721_token_ids) @@ -83,26 +74,21 @@ contract HappyRedPacket { bytes32 _id = keccak256(abi.encodePacked(msg.sender, now, nonce, seed, _seed)); RedPacket storage rp = redpacket_by_id[_id]; - rp.id = _id; + rp.packed2 = 0; + rp.packed2 |= uint160(_token_addr); // token_address = 160 bits + rp.packed2 |= (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192) << 64; // hash = sha3-256(addr)[:64] = 64 bits + //rp.packed2 |= 0 << 224; // claimed_number = 8 bits + rp.packed2 |= _number << 232; // total_ number = 8 bits + rp.packed2 |= _token_type << 240; // token_type = 8 bits + rp.packed2 |= _ifrandom ? 1 : 0 << 248; // ifrandom = 1 bit + + rp.packed1 = uint(_id) >> 192; // id = 64 bits + rp.packed1 |= (uint(_hash) >> 192) << 64; // hash = 64 bits (NEED TO CONFIRM THIS) + rp.packed1 |= uint80(_total_tokens) << 128; // total tokens = 80 bits = ~10^24.1 = ~10^6 18 decimals + rp.packed1 |= ((now+ _duration) & 0xffffffffffff) << 208; // expiration_time = 48 bits (to the end of the world) - rp.token_type = _token_type; - rp.token_address = _token_addr; - - rp.total_number = _number; - rp.remaining_tokens = _total_tokens; - - rp.creator = msg.sender; - - if (_duration == 0) - _duration = 86400; // 24hours - rp.expiration_time = uint32(SafeMath.add(now, _duration)); - - rp.claimed_number = 0; - rp.ifrandom = _ifrandom; - rp.hash = _hash; - rp.MAX_AMOUNT = SafeMath.mul(SafeMath.div(_total_tokens, rp.total_number), 2); rp.erc721_token_ids = _erc721_token_ids; - emit CreationSuccess(rp.remaining_tokens, rp.id, _name, _message, rp.creator, now, rp.token_address, rp.erc721_token_ids); + emit CreationSuccess(_total_tokens, _id, _name, _message, msg.sender, now, _token_addr, _erc721_token_ids); } // Check the balance of the given token @@ -130,7 +116,7 @@ contract HappyRedPacket { // A boring wrapper function random(bytes32 _seed, uint32 nonce_rand) internal view returns (uint rand) { - return uint(keccak256(abi.encodePacked(nonce_rand, msg.sender, _seed, now))); + return uint(keccak256(abi.encodePacked(nonce_rand, msg.sender, _seed, now))) + 1 ; } // https://ethereum.stackexchange.com/questions/884/how-to-convert-an-address-to-bytes-in-solidity @@ -158,95 +144,87 @@ contract HappyRedPacket { 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"); + //require (rp.packed1 >> 208 & 0xffffffffffff > now, "003"); + require (uint8(rp.packed2 >> 224) < uint8(rp.packed2 >> 232), "004"); + // Penalize greedy attackers by placing duplication check at the very last require (rp.claimed[recipient] == false, "005"); - require (keccak256(bytes(password)) == rp.hash, "006"); + require (uint256(keccak256(bytes(password))) >> 192 == (rp.packed1 >> 64 & 0xffffffffffffffff), "006"); require (validation == keccak256(toBytes(msg.sender)), "007"); uint claimed_tokens; uint256 [] memory token_ids = new uint256[](1); //TODO: Optimize this behavior. // Todo get erc721 token id; - if (rp.ifrandom == true) { - if (rp.token_type == 2) { - uint token_id_index = random(seed, nonce) % rp.remaining_tokens; + uint256 token_type = rp.packed2 >> 240 & 0xff; + if (rp.packed2 >> 248 & 0xff == 1) { + if (token_type == 2) { + uint token_id_index = random(seed, nonce) % (rp.packed1 >> 128 & 0xffffffffffffffffffff); uint256[] memory _array = rp.erc721_token_ids; token_ids[0] = _array[token_id_index]; rp.erc721_token_ids = getTokenIdWithIndex(_array, token_id_index); claimed_tokens = 1; - rp.remaining_tokens -= 1; + rp.packed1 |= (rp.packed1 >> 128 & 0xffffffffffffffffffff - 1) << 128; } else { - if (rp.total_number - rp.claimed_number == 1){ - claimed_tokens = rp.remaining_tokens; + if ((rp.packed2 >> 232 & 0xff) - (rp.packed2 >> 224 & 0xff) == 1){ + claimed_tokens = rp.packed1 >> 128 & 0xffffffffffffffffffff; } else{ - claimed_tokens = random(seed, 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; + //claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(rp.packed1 >> 128 & 0xffffffffffffffffffff, (rp.packed2 >> 232 & 0xff) - (rp.packed2 >> 224 & 0xff)), 2); //Max amount of tokens that can be claimed once is average * 2 + claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(rp.packed1 >> 128, (rp.packed2 >> 232) - (rp.packed2 >> 224)), 2); } + rp.packed1 |= ((rp.packed1 >> 128 & 0xffff) - claimed_tokens) << 128; } } else { - if (rp.token_type == 2) { + if (rp.packed2 >> 248 == 2) { // token_id_index = random(seed, nonce) % rp.remaining_tokens; uint256[] memory _array = rp.erc721_token_ids; token_ids[0] = rp.erc721_token_ids[0]; rp.erc721_token_ids = getTokenIdWithIndex(_array, 0); claimed_tokens = 1; - rp.remaining_tokens -= 1; + rp.packed1 |= ((rp.packed1 >> 128 & 0xffff) - 1) << 128; } else { - if (rp.total_number - rp.claimed_number == 1){ - claimed_tokens = rp.remaining_tokens; + if ((rp.packed2 >> 232 & 0xff) - (rp.packed2 >> 224 & 0xff) == 1){ + claimed_tokens = rp.packed1 >> 128 & 0xffffffffffffffffffff; } else{ - claimed_tokens = SafeMath.div(rp.remaining_tokens, (rp.total_number - rp.claimed_number)); + claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(rp.packed1 >> 128, (rp.packed2 >> 232) - (rp.packed2 >> 224)), 2); } - rp.remaining_tokens -= claimed_tokens; + rp.packed1 |= ((rp.packed1 >> 128) & 0xffff - claimed_tokens) << 128; } } - rp.claimed[recipient] = true; +// require(1 > 2); - rp.claimed_number ++; - 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); - } + // Change the state + rp.claimed[recipient] = true; + rp.packed2 |= ((rp.packed2 >> 224 & 0xff) + 1) << 224; - } // Transfer the red packet after state changing - if (rp.token_type == 0) { + if (rp.packed2 >> 248 == 0) { recipient.transfer(claimed_tokens); } - else if (rp.token_type == 1) { + else if (rp.packed2 >> 248 == 1) { uint256 [] memory token_ids_holder = new uint256[](0); - transfer_token(rp.token_type, rp.token_address, address(this), + transfer_token(rp.packed2 >> 240 & 0xff, address(uint160(rp.packed2 & 0xffffffffffffffffffff)), address(this), recipient, claimed_tokens, token_ids_holder); } - else if (rp.token_type == 2) { - transfer_token(rp.token_type, rp.token_address, address(this), + else if (rp.packed2 >> 248 == 2) { + transfer_token(rp.packed2 >> 240 & 0xff, address(uint160(rp.packed2 & 0xffffffffffffffffffff)), address(this), recipient, claimed_tokens, token_ids); } // Claim success event - emit ClaimSuccess(rp.id, recipient, claimed_tokens, rp.token_address, token_ids); + emit ClaimSuccess(bytes32(rp.packed1 & 0xffffffffffffffff), recipient, claimed_tokens, address(uint160(rp.packed2 & 0xffffffffffffffffffff)), token_ids); return claimed_tokens; } @@ -254,8 +232,7 @@ contract HappyRedPacket { function check_availability(bytes32 id) public view returns (address token_address, uint balance, uint total, uint claimed, bool expired, bool ifclaimed) { RedPacket storage rp = redpacket_by_id[id]; - return (rp.token_address, rp.remaining_tokens, rp.total_number, - rp.claimed_number, now > rp.expiration_time, rp.claimed[msg.sender]); + return (address(uint160(rp.packed2 & 0xffffffffffffffffffff)), rp.packed1 >> 128 & 0xffffffffffffffffffff, rp.packed2 >> 232 & 0xff, rp.packed2 >> 240 & 0xff, now > rp.packed1 >> 208 & 0xffffffffffff, rp.claimed[msg.sender]); } // Returns a list of claiming token id @@ -263,16 +240,17 @@ contract HappyRedPacket { 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, "011"); - require(rp.expiration_time < now, "012"); + require(uint256(keccak256(abi.encodePacked(msg.sender)) >> 192) == rp.packed2 >> 64 & 0xffffffffffffffff, "011"); + require(rp.packed >> 208 & 0xffffffffffff < now, "012"); - if (rp.token_type == 0) { - msg.sender.transfer(rp.remaining_tokens); + uint256 remainin_tokens = rp.packed1 >> 128 & 0xffffffffffffffffffff; + if (rp.packed2 >> 248 == 0) { + msg.sender.transfer(remaining_tokens); } - else if (rp.token_type == 1) { + else if (rp.packed2 >> 248 == 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), @@ -293,6 +271,7 @@ contract HappyRedPacket { emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens); rp.remaining_tokens = 0; } +*/ // One cannot send tokens to this contract after constructor anymore // function () external payable { From 09f2140bfb0de39171429a3641801f73305b4503 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Sun, 11 Oct 2020 00:04:33 +0800 Subject: [PATCH 10/28] Add box and unbox to make the code simpler --- test/contracts/redpacket.sol | 48 +++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 7ddb60a..b0566d1 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -52,7 +52,7 @@ contract HappyRedPacket { // _token_type: 0 - ETH 1 - ERC20 2 - ERC721 function create_red_packet (bytes32 _hash, uint _number, bool _ifrandom, uint _duration, bytes32 _seed, string memory _message, string memory _name, - uint8 _token_type, address _token_addr, uint _total_tokens, + uint _token_type, address _token_addr, uint _total_tokens, uint256[] memory _erc721_token_ids) public payable { nonce ++; @@ -73,24 +73,38 @@ contract HappyRedPacket { } bytes32 _id = keccak256(abi.encodePacked(msg.sender, now, nonce, seed, _seed)); - RedPacket storage rp = redpacket_by_id[_id]; - rp.packed2 = 0; - rp.packed2 |= uint160(_token_addr); // token_address = 160 bits - rp.packed2 |= (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192) << 64; // hash = sha3-256(addr)[:64] = 64 bits - //rp.packed2 |= 0 << 224; // claimed_number = 8 bits - rp.packed2 |= _number << 232; // total_ number = 8 bits - rp.packed2 |= _token_type << 240; // token_type = 8 bits - rp.packed2 |= _ifrandom ? 1 : 0 << 248; // ifrandom = 1 bit - - rp.packed1 = uint(_id) >> 192; // id = 64 bits - rp.packed1 |= (uint(_hash) >> 192) << 64; // hash = 64 bits (NEED TO CONFIRM THIS) - rp.packed1 |= uint80(_total_tokens) << 128; // total tokens = 80 bits = ~10^24.1 = ~10^6 18 decimals - rp.packed1 |= ((now+ _duration) & 0xffffffffffff) << 208; // expiration_time = 48 bits (to the end of the world) - - rp.erc721_token_ids = _erc721_token_ids; + RedPacket storage redp = redpacket_by_id[_id]; + wrap1(redp, _hash, _total_tokens, _duration); + wrap2(redp, _token_addr, msg.sender, _number, _token_type); + redp.erc721_token_ids = _erc721_token_ids; emit CreationSuccess(_total_tokens, _id, _name, _message, msg.sender, now, _token_addr, _erc721_token_ids); } + function wrap1 (RedPacket storage rp, bytes32 _hash, uint _total_tokens, uint _duration) internal { + rp.packed1 = 0; + box(rp.packed1, 0, 128, uint256(_hash) >> 128); // hash = 128 bits (NEED TO CONFIRM THIS) + box(rp.packed1, 128, 80, _total_tokens); // total tokens = 80 bits = ~10^24.1 = ~10^6 18 decimals + box(rp.packed1, 208, 48, (now + _duration)); // expiration_time = 48 bits (to the end of the world) + } + + function wrap2 (RedPacket storage rp, address _token_addr, address _creator, uint _number, uint _token_type) internal { + rp.packed2 = 0; + box(rp.packed2, 0, 160, uint256(_token_addr)); // token_address = 160 bits + box(rp.packed2, 160, 64, (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192)); // creator.hash = 64 bit + box(rp.packed2, 224, 8, 0); // claimed_number = 8 bits + box(rp.packed2, 232, 8, _number); // total_ number = 8 bits + box(rp.packed2, 240, 8, _token_type); // token_type = 8 bits + box(rp.packed2, 248, 8, 1); // ifrandom = 1 bit + } + + function box (uint256 base, uint8 position, uint8 size, uint256 data) internal pure { + base |= (data & (uint256(-1) >> (256 - size))) << position; + } + + function unbox (uint256 base, uint8 position, uint8 size) internal pure returns (uint256 unboxed) { + return (base >> position) & (uint256(-1) >> (256 - size)); + } + // Check the balance of the given token function transfer_token(uint token_type, address token_address, address sender_address, address recipient_address, uint amount, uint256 [] memory erc721_token_ids) public payable{ @@ -150,7 +164,7 @@ contract HappyRedPacket { // uint256 token_id; // Unsuccessful //require (rp.packed1 >> 208 & 0xffffffffffff > now, "003"); - require (uint8(rp.packed2 >> 224) < uint8(rp.packed2 >> 232), "004"); + //require (uint8(rp.packed2 >> 224) < uint8(rp.packed2 >> 232), "004"); // Penalize greedy attackers by placing duplication check at the very last require (rp.claimed[recipient] == false, "005"); require (uint256(keccak256(bytes(password))) >> 192 == (rp.packed1 >> 64 & 0xffffffffffffffff), "006"); From ff2013195874fde6cd99dbc83efee1ae0fb25cfb Mon Sep 17 00:00:00 2001 From: Hging Date: Sun, 11 Oct 2020 18:47:07 +0800 Subject: [PATCH 11/28] Change a lot of code for fix test error --- test/contracts/redpacket.sol | 110 ++++++++++++++++++++--------------- test/test/Testrp.js | 4 +- 2 files changed, 65 insertions(+), 49 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index b0566d1..df8c467 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -73,36 +73,48 @@ contract HappyRedPacket { } bytes32 _id = keccak256(abi.encodePacked(msg.sender, now, nonce, seed, _seed)); + uint _random_type = _ifrandom ? 1 : 0; RedPacket storage redp = redpacket_by_id[_id]; - wrap1(redp, _hash, _total_tokens, _duration); - wrap2(redp, _token_addr, msg.sender, _number, _token_type); + redp.packed1 = wrap1(_hash, _total_tokens, _duration); + redp.packed2 = wrap2(_token_addr, _number, _token_type, _random_type); redp.erc721_token_ids = _erc721_token_ids; emit CreationSuccess(_total_tokens, _id, _name, _message, msg.sender, now, _token_addr, _erc721_token_ids); } - function wrap1 (RedPacket storage rp, bytes32 _hash, uint _total_tokens, uint _duration) internal { - rp.packed1 = 0; - box(rp.packed1, 0, 128, uint256(_hash) >> 128); // hash = 128 bits (NEED TO CONFIRM THIS) - box(rp.packed1, 128, 80, _total_tokens); // total tokens = 80 bits = ~10^24.1 = ~10^6 18 decimals - box(rp.packed1, 208, 48, (now + _duration)); // expiration_time = 48 bits (to the end of the world) + function wrap1 (bytes32 _hash, uint _total_tokens, uint _duration) internal view returns (uint256 packed1) { + uint256 _packed1 = 0; + _packed1 |= box(0, 128, uint256(_hash) >> 128); // hash = 128 bits (NEED TO CONFIRM THIS) + _packed1 |= box(128, 80, _total_tokens); // total tokens = 80 bits = ~10^24.1 = ~10^6 18 decimals + _packed1 |= box(208, 48, (now + _duration)); // expiration_time = 48 bits (to the end of the world) + return _packed1; } - function wrap2 (RedPacket storage rp, address _token_addr, address _creator, uint _number, uint _token_type) internal { - rp.packed2 = 0; - box(rp.packed2, 0, 160, uint256(_token_addr)); // token_address = 160 bits - box(rp.packed2, 160, 64, (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192)); // creator.hash = 64 bit - box(rp.packed2, 224, 8, 0); // claimed_number = 8 bits - box(rp.packed2, 232, 8, _number); // total_ number = 8 bits - box(rp.packed2, 240, 8, _token_type); // token_type = 8 bits - box(rp.packed2, 248, 8, 1); // ifrandom = 1 bit + function wrap2 (address _token_addr, uint _number, uint _token_type, uint _ifrandom) internal view returns (uint256 packed2) { + uint256 _packed2 = 0; + _packed2 |= box(0, 160, uint256(_token_addr)); // token_address = 160 bits + _packed2 |= box(160, 64, (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192)); // creator.hash = 64 bit + _packed2 |= box(224, 8, 0); // claimed_number = 8 bits + _packed2 |= box(232, 8, _number); // total_ number = 8 bits + _packed2 |= box(240, 8, _token_type); // token_type = 8 bits + _packed2 |= box(248, 8, _ifrandom); // ifrandom = 1 bit + return _packed2; } - function box (uint256 base, uint8 position, uint8 size, uint256 data) internal pure { - base |= (data & (uint256(-1) >> (256 - size))) << position; + function box (uint16 position, uint16 size, uint256 data) internal pure returns (uint256 boxed) { + return data << (256 - size - position); } - function unbox (uint256 base, uint8 position, uint8 size) internal pure returns (uint256 unboxed) { - return (base >> position) & (uint256(-1) >> (256 - size)); + function unbox (uint256 base, uint16 position, uint16 size) internal pure returns (uint256 unboxed) { + return (base << position) >> (256 - size); + } + + function rewriteBox(uint256 _box, uint16 position, uint16 size, uint256 data) internal pure returns (uint256 boxed) { + + uint256 _boxData = box(position, size, data); + uint256 _mask = box(position, size, uint256(-1) >> (SafeMath.add(size, position))); + _box |= _boxData; + _box &= ~(~_boxData & _mask); + return _box; } // Check the balance of the given token @@ -163,82 +175,86 @@ contract HappyRedPacket { address payable recipient = address(uint160(_recipient)); // uint256 token_id; // Unsuccessful - //require (rp.packed1 >> 208 & 0xffffffffffff > now, "003"); - //require (uint8(rp.packed2 >> 224) < uint8(rp.packed2 >> 232), "004"); + require (unbox(rp.packed1, 208, 48) > now, "003"); + uint total_number = unbox(rp.packed2, 232, 8); + uint claimed_number = unbox(rp.packed2, 224, 8); + require (claimed_number < total_number, "004"); // Penalize greedy attackers by placing duplication check at the very last require (rp.claimed[recipient] == false, "005"); - require (uint256(keccak256(bytes(password))) >> 192 == (rp.packed1 >> 64 & 0xffffffffffffffff), "006"); + // require (1 > 2, 'test'); + require (uint256(keccak256(bytes(password))) >> 128 == unbox(rp.packed1, 0, 128), "006"); require (validation == keccak256(toBytes(msg.sender)), "007"); uint claimed_tokens; uint256 [] memory token_ids = new uint256[](1); //TODO: Optimize this behavior. + uint256 token_type = unbox(rp.packed2, 240, 8); + uint ifrandom = unbox(rp.packed2, 248, 8); + uint total_tokens = unbox(rp.packed1, 128, 80); // Todo get erc721 token id; - uint256 token_type = rp.packed2 >> 240 & 0xff; - if (rp.packed2 >> 248 & 0xff == 1) { + if (ifrandom == 1) { if (token_type == 2) { - uint token_id_index = random(seed, nonce) % (rp.packed1 >> 128 & 0xffffffffffffffffffff); + uint token_id_index = random(seed, nonce) % (total_tokens); uint256[] memory _array = rp.erc721_token_ids; token_ids[0] = _array[token_id_index]; rp.erc721_token_ids = getTokenIdWithIndex(_array, token_id_index); claimed_tokens = 1; - rp.packed1 |= (rp.packed1 >> 128 & 0xffffffffffffffffffff - 1) << 128; + rp.packed1 = rewriteBox(rp.packed1, 128, 80, total_tokens - 1); } else { - if ((rp.packed2 >> 232 & 0xff) - (rp.packed2 >> 224 & 0xff) == 1){ - claimed_tokens = rp.packed1 >> 128 & 0xffffffffffffffffffff; + if (total_number - claimed_number == 1){ + claimed_tokens = total_tokens; } else{ //claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(rp.packed1 >> 128 & 0xffffffffffffffffffff, (rp.packed2 >> 232 & 0xff) - (rp.packed2 >> 224 & 0xff)), 2); //Max amount of tokens that can be claimed once is average * 2 - claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(rp.packed1 >> 128, (rp.packed2 >> 232) - (rp.packed2 >> 224)), 2); + claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(total_tokens, total_number - claimed_number), 2); } - rp.packed1 |= ((rp.packed1 >> 128 & 0xffff) - claimed_tokens) << 128; + rp.packed1 = rewriteBox(rp.packed1, 128, 80, total_tokens - claimed_tokens); } } else { - if (rp.packed2 >> 248 == 2) { + if (token_type == 2) { // token_id_index = random(seed, nonce) % rp.remaining_tokens; uint256[] memory _array = rp.erc721_token_ids; token_ids[0] = rp.erc721_token_ids[0]; rp.erc721_token_ids = getTokenIdWithIndex(_array, 0); claimed_tokens = 1; - rp.packed1 |= ((rp.packed1 >> 128 & 0xffff) - 1) << 128; + rp.packed1 = rewriteBox(rp.packed1, 128, 80, total_tokens - 1); + // rp.packed1 |= ((rp.packed1 >> 128 & 0xffff) - 1) << 128; } else { - if ((rp.packed2 >> 232 & 0xff) - (rp.packed2 >> 224 & 0xff) == 1){ - claimed_tokens = rp.packed1 >> 128 & 0xffffffffffffffffffff; + if (total_number - claimed_number == 1){ + claimed_tokens = total_tokens; } else{ - claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(rp.packed1 >> 128, (rp.packed2 >> 232) - (rp.packed2 >> 224)), 2); + claimed_tokens = SafeMath.div(total_tokens, (total_number - claimed_number)); } - rp.packed1 |= ((rp.packed1 >> 128) & 0xffff - claimed_tokens) << 128; + + rp.packed1 = rewriteBox(rp.packed1, 128, 80, total_tokens - claimed_tokens); } } -// require(1 > 2); - - // Change the state rp.claimed[recipient] = true; - rp.packed2 |= ((rp.packed2 >> 224 & 0xff) + 1) << 224; + rp.packed2 = rewriteBox(rp.packed2, 224, 8, claimed_number + 1); // Transfer the red packet after state changing - if (rp.packed2 >> 248 == 0) { + if (token_type == 0) { recipient.transfer(claimed_tokens); } - else if (rp.packed2 >> 248 == 1) { + else if (token_type == 1) { uint256 [] memory token_ids_holder = new uint256[](0); - transfer_token(rp.packed2 >> 240 & 0xff, address(uint160(rp.packed2 & 0xffffffffffffffffffff)), address(this), + transfer_token(token_type, address(unbox(rp.packed2, 0, 160)), address(this), recipient, claimed_tokens, token_ids_holder); } - else if (rp.packed2 >> 248 == 2) { - transfer_token(rp.packed2 >> 240 & 0xff, address(uint160(rp.packed2 & 0xffffffffffffffffffff)), address(this), + else if (token_type == 2) { + transfer_token(token_type, address(unbox(rp.packed2, 0, 160)), address(this), recipient, claimed_tokens, token_ids); } // Claim success event - emit ClaimSuccess(bytes32(rp.packed1 & 0xffffffffffffffff), recipient, claimed_tokens, address(uint160(rp.packed2 & 0xffffffffffffffffffff)), token_ids); + emit ClaimSuccess(id, recipient, claimed_tokens, address(unbox(rp.packed2, 0, 160)), token_ids); return claimed_tokens; } @@ -246,7 +262,7 @@ contract HappyRedPacket { function check_availability(bytes32 id) public view returns (address token_address, uint balance, uint total, uint claimed, bool expired, bool ifclaimed) { RedPacket storage rp = redpacket_by_id[id]; - return (address(uint160(rp.packed2 & 0xffffffffffffffffffff)), rp.packed1 >> 128 & 0xffffffffffffffffffff, rp.packed2 >> 232 & 0xff, rp.packed2 >> 240 & 0xff, now > rp.packed1 >> 208 & 0xffffffffffff, rp.claimed[msg.sender]); + return (address(unbox(rp.packed2, 0, 160)), unbox(rp.packed1, 128, 80), unbox(rp.packed2, 232, 8), unbox(rp.packed2, 240, 8), now > unbox(rp.packed1, 208, 48), rp.claimed[msg.sender]); } // Returns a list of claiming token id diff --git a/test/test/Testrp.js b/test/test/Testrp.js index e72c5b4..550c823 100644 --- a/test/test/Testrp.js +++ b/test/test/Testrp.js @@ -165,8 +165,8 @@ contract("Test721Token", accounts => { 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']; + const claim_success_encode = "ClaimSuccess(%s,%s,%s,%s)"; + const claim_success_types = ['bytes32', 'address', 'uint256', 'address']; // Check Availability var returned = await redpacket.check_availability.call(rp_id); From e2798f0cb5e4607eac269586928f38bf3cd747a5 Mon Sep 17 00:00:00 2001 From: Hging Date: Mon, 12 Oct 2020 17:15:19 +0800 Subject: [PATCH 12/28] fix refund --- test/contracts/redpacket.sol | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index df8c467..0f1096f 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -270,38 +270,40 @@ contract HappyRedPacket { 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(uint256(keccak256(abi.encodePacked(msg.sender)) >> 192) == rp.packed2 >> 64 & 0xffffffffffffffff, "011"); - require(rp.packed >> 208 & 0xffffffffffff < now, "012"); + require(uint256(keccak256(abi.encodePacked(msg.sender)) >> 192) == unbox(rp.packed2, 160, 64), "011"); + require(unpack(rp.packed1, 208, 48) < now, "012"); - uint256 remainin_tokens = rp.packed1 >> 128 & 0xffffffffffffffffffff; - if (rp.packed2 >> 248 == 0) { + uint256 remaining_tokens = unpack(rp.redpack1, 128, 80); + uint256 token_type = unbox(rp.packed2, 240, 8); + + if (token_type == 0) { msg.sender.transfer(remaining_tokens); } - else if (rp.packed2 >> 248 == 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, token_ids_holder); + else if (token_type == 1) { + uint256[] memory token_ids_holder = new uint256[](0); + address token_address = unbox(rp.packed2, 0, 160) + IERC20(token_address).approve(msg.sender, remaining_tokens); + transfer_token(token_type, token_address, address(this), + msg.sender, remaining_tokens, token_ids_holder); } - else if (rp.token_type == 2) { + else if (token_type == 2) { uint256[] memory token_ids; for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){ if (rp.erc721_token_ids[i] != 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) { token_ids[token_ids.length] = rp.erc721_token_ids[i]; + rp.erc721_token_ids[i] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF } } - // 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); + // IERC721(token_address).approve(msg.sender, rp.remaining_tokens); + transfer_token(token_type, token_address, address(this), + msg.sender, remaining_tokens, token_ids); } - emit RefundSuccess(rp.id, rp.token_address, rp.remaining_tokens); - rp.remaining_tokens = 0; + emit RefundSuccess(id, token_address, remaining_tokens); + rp.packed1 = rewriteBox(rp.packed1, 128, 80, 0); } -*/ // One cannot send tokens to this contract after constructor anymore // function () external payable { From de0becae17e5046f23c48ddad64763db74c62ccd Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 13 Oct 2020 15:19:21 +0800 Subject: [PATCH 13/28] Fix refund(); Add gas_refund operations --- test/contracts/redpacket.sol | 45 ++++++++++++++++++++++-------- test/test/Testrp.js | 54 ++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 11 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 0f1096f..ecefcba 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -10,6 +10,7 @@ contract HappyRedPacket { uint256 packed2; // ifrandom(1) token_type(8) total_number(8) claimed(8) creator(64) token_addr(160) uint256[] erc721_token_ids; mapping(address => bool) claimed; + uint256[] claimed_list; } event CreationSuccess( @@ -78,6 +79,7 @@ contract HappyRedPacket { redp.packed1 = wrap1(_hash, _total_tokens, _duration); redp.packed2 = wrap2(_token_addr, _number, _token_type, _random_type); redp.erc721_token_ids = _erc721_token_ids; + redp.claimed_list = new uint256[]((_number-1)/4 + 1); emit CreationSuccess(_total_tokens, _id, _name, _message, msg.sender, now, _token_addr, _erc721_token_ids); } @@ -179,8 +181,6 @@ contract HappyRedPacket { uint total_number = unbox(rp.packed2, 232, 8); uint claimed_number = unbox(rp.packed2, 224, 8); require (claimed_number < total_number, "004"); - // Penalize greedy attackers by placing duplication check at the very last - require (rp.claimed[recipient] == false, "005"); // require (1 > 2, 'test'); require (uint256(keccak256(bytes(password))) >> 128 == unbox(rp.packed1, 0, 128), "006"); require (validation == keccak256(toBytes(msg.sender)), "007"); @@ -235,7 +235,17 @@ contract HappyRedPacket { } } - rp.claimed[recipient] = true; + // Penalize greedy attackers by placing duplication check at the very last + bool available = false; + for (uint i = 0; i < unbox(rp.packed2, 224, 8); i ++) { + if (unbox(rp.claimed_list[i / 4], uint16(64*(i%4)), 64) == (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192)) { + available = true; + break; + } + } + require (available == false, "005"); + + rp.claimed_list[claimed_number / 4] = rewriteBox(rp.claimed_list[claimed_number / 4], 64 * uint16(claimed_number % 4), 64, (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192)); rp.packed2 = rewriteBox(rp.packed2, 224, 8, claimed_number + 1); @@ -262,7 +272,16 @@ contract HappyRedPacket { function check_availability(bytes32 id) public view returns (address token_address, uint balance, uint total, uint claimed, bool expired, bool ifclaimed) { RedPacket storage rp = redpacket_by_id[id]; - return (address(unbox(rp.packed2, 0, 160)), unbox(rp.packed1, 128, 80), unbox(rp.packed2, 232, 8), unbox(rp.packed2, 240, 8), now > unbox(rp.packed1, 208, 48), rp.claimed[msg.sender]); + ifclaimed = false; + uint256 sender_hash = (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192); + uint256 number = unbox(rp.packed2, 224, 8); + for (uint i = 0; i < number; i ++) { + if (unbox(rp.claimed_list[i / 4], uint16(64*(i%4)), 64) == sender_hash) { + ifclaimed = true; + break; + } + } + return (address(unbox(rp.packed2, 0, 160)), unbox(rp.packed1, 128, 80), unbox(rp.packed2, 232, 8), unbox(rp.packed2, 240, 8), now > unbox(rp.packed1, 208, 48), ifclaimed); } // Returns a list of claiming token id @@ -270,20 +289,21 @@ contract HappyRedPacket { 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(uint256(keccak256(abi.encodePacked(msg.sender)) >> 192) == unbox(rp.packed2, 160, 64), "011"); - require(unpack(rp.packed1, 208, 48) < now, "012"); + require(unbox(rp.packed1, 208, 48) <= now, "012"); - uint256 remaining_tokens = unpack(rp.redpack1, 128, 80); + uint256 remaining_tokens = unbox(rp.packed1, 128, 80); uint256 token_type = unbox(rp.packed2, 240, 8); + address token_address = address(unbox(rp.packed2, 0, 160)); if (token_type == 0) { msg.sender.transfer(remaining_tokens); } else if (token_type == 1) { uint256[] memory token_ids_holder = new uint256[](0); - address token_address = unbox(rp.packed2, 0, 160) IERC20(token_address).approve(msg.sender, remaining_tokens); transfer_token(token_type, token_address, address(this), msg.sender, remaining_tokens, token_ids_holder); @@ -293,7 +313,7 @@ contract HappyRedPacket { 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]; - rp.erc721_token_ids[i] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + rp.erc721_token_ids[i] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; } } // IERC721(token_address).approve(msg.sender, rp.remaining_tokens); @@ -303,9 +323,12 @@ contract HappyRedPacket { emit RefundSuccess(id, token_address, remaining_tokens); rp.packed1 = rewriteBox(rp.packed1, 128, 80, 0); + for (uint i = 0; i < rp.claimed_list.length; i++){ + rp.claimed_list[i] = 0; + } } - // One cannot send tokens to this contract after constructor anymore - // function () external payable { - // } + // One cannot send tokens to this contract after constructor anymore + //function () external payable { + //} } diff --git a/test/test/Testrp.js b/test/test/Testrp.js index 550c823..3767f5b 100644 --- a/test/test/Testrp.js +++ b/test/test/Testrp.js @@ -112,6 +112,59 @@ contract("TestToken", accounts => { }); }); +contract("TestToken", accounts => { + beforeEach(async () =>{ + console.log("Before ALL\n"); + testtoken = await TestToken.deployed(); + redpacket = await HappyRedPacket.deployed(); + _total_tokens = 101; + }); + + 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 = 0; + 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,string,string,address,uint256,address,uint256[])'; + const creation_success_types = ['uint256', 'bytes32', 'string', 'string','address', 'uint256', 'address', 'uint256[]']; + + await testtoken.approve.sendTransaction(redpacket.address, total_tokens); + const creation_receipt = await redpacket.create_red_packet + .sendTransaction(hashes[0], number, true, duration, seed, msg, + name, token_type, token_address, total_tokens, token_ids); + const logs = await web3.eth.getPastLogs({address: redpacket.address, topics: [web3.utils.sha3(creation_success_encode)]}); + redpacket_id = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data)['1']; + assert.notEqual(redpacket_id, null); + }); + + it("Should refund the red packets.", async () => { + const redpacket = await HappyRedPacket.deployed(); + const rp_id = redpacket_id; + + const refund_success_encode = "RefundSuccess(%s,%s,%s)"; + const refund_success_types = ['bytes32', 'address', 'uint256']; + + const refund_receipt = await redpacket.refund.sendTransaction(rp_id, {'from': accounts[0]}); + const logs = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(refund_success_encode)]}); + console.log(web3.eth.abi.decodeParameters(refund_success_types, logs[0].data)); + }); +}); contract("Test721Token", accounts => { beforeEach(async () =>{ console.log("Before ALL\n"); @@ -219,4 +272,5 @@ contract("Test721Token", accounts => { // assert.equal(Number(balance1) + Number(balance2) + Number(balance3), _total_tokens) }); + }); From 96c150e306b93b1b8fc26f5e3ee72619228ee457 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 13 Oct 2020 17:23:02 +0800 Subject: [PATCH 14/28] Update the gas_refund --- test/contracts/redpacket.sol | 11 ++++++++--- test/test/Testrp.js | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index ecefcba..66d9914 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -9,7 +9,6 @@ contract HappyRedPacket { uint256 packed1; // exp(48) total_tokens(80) hash(64) id(64) BIG ENDIAN uint256 packed2; // ifrandom(1) token_type(8) total_number(8) claimed(8) creator(64) token_addr(160) uint256[] erc721_token_ids; - mapping(address => bool) claimed; uint256[] claimed_list; } @@ -85,7 +84,7 @@ contract HappyRedPacket { function wrap1 (bytes32 _hash, uint _total_tokens, uint _duration) internal view returns (uint256 packed1) { uint256 _packed1 = 0; - _packed1 |= box(0, 128, uint256(_hash) >> 128); // hash = 128 bits (NEED TO CONFIRM THIS) + _packed1 |= box(0, 128, uint256(_hash) >> 128); // hash = 128 bits (NEED TO CONFIRM THIS) _packed1 |= box(128, 80, _total_tokens); // total tokens = 80 bits = ~10^24.1 = ~10^6 18 decimals _packed1 |= box(208, 48, (now + _duration)); // expiration_time = 48 bits (to the end of the world) return _packed1; @@ -93,7 +92,7 @@ contract HappyRedPacket { function wrap2 (address _token_addr, uint _number, uint _token_type, uint _ifrandom) internal view returns (uint256 packed2) { uint256 _packed2 = 0; - _packed2 |= box(0, 160, uint256(_token_addr)); // token_address = 160 bits + _packed2 |= box(0, 160, uint256(_token_addr)); // token_address = 160 bits _packed2 |= box(160, 64, (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192)); // creator.hash = 64 bit _packed2 |= box(224, 8, 0); // claimed_number = 8 bits _packed2 |= box(232, 8, _number); // total_ number = 8 bits @@ -323,6 +322,12 @@ contract HappyRedPacket { emit RefundSuccess(id, token_address, remaining_tokens); rp.packed1 = rewriteBox(rp.packed1, 128, 80, 0); + // Gas Refund + rp.packed1 = 0; + rp.packed2 = 0; + for (uint i = 0; i < rp.erc721_token_ids.length; i++){ + rp.claimed_list[i] = 0; + } for (uint i = 0; i < rp.claimed_list.length; i++){ rp.claimed_list[i] = 0; } diff --git a/test/test/Testrp.js b/test/test/Testrp.js index 3767f5b..3bd6a82 100644 --- a/test/test/Testrp.js +++ b/test/test/Testrp.js @@ -272,5 +272,4 @@ contract("Test721Token", accounts => { // assert.equal(Number(balance1) + Number(balance2) + Number(balance3), _total_tokens) }); - }); From 81f8533ee18f97d312671986f016021707e8cdea Mon Sep 17 00:00:00 2001 From: Hging Date: Wed, 14 Oct 2020 14:28:55 +0800 Subject: [PATCH 15/28] fix erc721_token_ids gas_refund --- test/contracts/redpacket.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 66d9914..859d382 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -326,7 +326,7 @@ contract HappyRedPacket { rp.packed1 = 0; rp.packed2 = 0; for (uint i = 0; i < rp.erc721_token_ids.length; i++){ - rp.claimed_list[i] = 0; + rp.erc721_token_ids[i] = 0; } for (uint i = 0; i < rp.claimed_list.length; i++){ rp.claimed_list[i] = 0; From 229db2bffe9e2c38ea416164e3a1232347bca8b4 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Mon, 19 Oct 2020 10:42:08 +0800 Subject: [PATCH 16/28] Modify the code according to the preliminary report --- test/contracts/redpacket.sol | 40 ++++++++++++++++++++++++------------ test/test/Testrp.js | 8 ++++---- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 66d9914..ea9bbe6 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.6; +pragma solidity 0.6.2; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; import "openzeppelin-solidity/contracts/token/ERC721/IERC721.sol"; import "openzeppelin-solidity/contracts/math/SafeMath.sol"; @@ -42,6 +42,7 @@ contract HappyRedPacket { mapping(bytes32 => RedPacket) redpacket_by_id; string constant private magic = "Former NBA Commissioner David St"; // 32 bytes bytes32 private seed; + uint256 constant MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; constructor() public { contract_creator = msg.sender; @@ -58,6 +59,7 @@ contract HappyRedPacket { nonce ++; require(_total_tokens >= _number, "001"); require(_number > 0, "002"); + require(_number < 256, "002"); if (_token_type == 0) { require(msg.value >= _total_tokens, "008"); @@ -102,25 +104,34 @@ contract HappyRedPacket { } function box (uint16 position, uint16 size, uint256 data) internal pure returns (uint256 boxed) { + require(validRange(size, data), "Value out of range BOX"); return data << (256 - size - position); } function unbox (uint256 base, uint16 position, uint16 size) internal pure returns (uint256 unboxed) { + require(validRange(256, base), "Value out of range UNBOX"); return (base << position) >> (256 - size); } + function validRange(uint16 size, uint256 data) public pure returns(bool) { + if (data > 2 ** uint256(size) - 1) { + return false; + } else { + return true; + } + } + function rewriteBox(uint256 _box, uint16 position, uint16 size, uint256 data) internal pure returns (uint256 boxed) { uint256 _boxData = box(position, size, data); - uint256 _mask = box(position, size, uint256(-1) >> (SafeMath.add(size, position))); - _box |= _boxData; - _box &= ~(~_boxData & _mask); + uint256 _mask = box(position, size, uint256(-1) >> (256 - size)); + _box = (_box & ~_mask) | _boxData; return _box; } // Check the balance of the given token function transfer_token(uint token_type, address token_address, address sender_address, - address recipient_address, uint amount, uint256 [] memory erc721_token_ids) public payable{ + address recipient_address, uint amount, uint256 [] memory erc721_token_ids) internal{ // ERC20 if (token_type == 1) { require(IERC20(token_address).balanceOf(sender_address) >= amount, "010"); @@ -163,7 +174,7 @@ contract HappyRedPacket { for (uint i = index; i < array.length - 1; i++){ array[i] = array[i + 1]; } - array[array.length - 1] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + array[array.length - 1] = MASK; return array; } @@ -206,7 +217,10 @@ contract HappyRedPacket { } else{ //claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(rp.packed1 >> 128 & 0xffffffffffffffffffff, (rp.packed2 >> 232 & 0xff) - (rp.packed2 >> 224 & 0xff)), 2); //Max amount of tokens that can be claimed once is average * 2 - claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(total_tokens, total_number - claimed_number), 2); + claimed_tokens = random(seed, nonce) % SafeMath.div(SafeMath.mul(total_tokens, 2), total_number - claimed_number); + } + if (claimed_tokens == 0) { + claimed_tokens = 1; } rp.packed1 = rewriteBox(rp.packed1, 128, 80, total_tokens - claimed_tokens); } @@ -268,7 +282,7 @@ contract HappyRedPacket { } // Returns 1. remaining value 2. total number of red packets 3. claimed number of red packets - function check_availability(bytes32 id) public view returns (address token_address, uint balance, uint total, + function check_availability(bytes32 id) external view returns (address token_address, uint balance, uint total, uint claimed, bool expired, bool ifclaimed) { RedPacket storage rp = redpacket_by_id[id]; ifclaimed = false; @@ -280,11 +294,11 @@ contract HappyRedPacket { break; } } - return (address(unbox(rp.packed2, 0, 160)), unbox(rp.packed1, 128, 80), unbox(rp.packed2, 232, 8), unbox(rp.packed2, 240, 8), now > unbox(rp.packed1, 208, 48), ifclaimed); + return (address(unbox(rp.packed2, 0, 160)), unbox(rp.packed1, 128, 80), unbox(rp.packed2, 232, 8), unbox(rp.packed2, 224, 8), now > unbox(rp.packed1, 208, 48), ifclaimed); } // Returns a list of claiming token id - function check_erc721_token_ids(bytes32 id) public view returns (uint256[] memory erc721_token_ids) { + function check_erc721_token_ids(bytes32 id) external view returns (uint256[] memory erc721_token_ids) { RedPacket storage rp = redpacket_by_id[id]; return (rp.erc721_token_ids); } @@ -310,12 +324,12 @@ contract HappyRedPacket { else if (token_type == 2) { uint256[] memory token_ids; for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){ - if (rp.erc721_token_ids[i] != 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) { + if (rp.erc721_token_ids[i] != MASK) { token_ids[token_ids.length] = rp.erc721_token_ids[i]; - rp.erc721_token_ids[i] = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + rp.erc721_token_ids[i] = MASK; } } - // IERC721(token_address).approve(msg.sender, rp.remaining_tokens); + IERC721(token_address).approve(msg.sender, remaining_tokens); transfer_token(token_type, token_address, address(this), msg.sender, remaining_tokens, token_ids); } diff --git a/test/test/Testrp.js b/test/test/Testrp.js index 3bd6a82..f407b88 100644 --- a/test/test/Testrp.js +++ b/test/test/Testrp.js @@ -66,7 +66,7 @@ contract("TestToken", 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(web3.eth.abi.decodeParameters(claim_success_types, logs[0].data)); + //console.log(web3.eth.abi.decodeParameters(claim_success_types, logs[0].data)); // Check Availability returned = await redpacket.check_availability.call(rp_id, {'from': recipient1}); @@ -78,7 +78,7 @@ contract("TestToken", 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(web3.eth.abi.decodeParameters(claim_success_types, logs2[0].data)); + //console.log(web3.eth.abi.decodeParameters(claim_success_types, logs2[0].data)); // Check Availability returned = await redpacket.check_availability.call(rp_id, {'from': recipient2}); @@ -90,7 +90,7 @@ contract("TestToken", 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(web3.eth.abi.decodeParameters(claim_success_types, logs3[0].data)); + //console.log(web3.eth.abi.decodeParameters(claim_success_types, logs3[0].data)); // Check Availability returned = await redpacket.check_availability.call(rp_id, {'from': recipient3}); @@ -162,7 +162,7 @@ contract("TestToken", accounts => { const refund_receipt = await redpacket.refund.sendTransaction(rp_id, {'from': accounts[0]}); const logs = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(refund_success_encode)]}); - console.log(web3.eth.abi.decodeParameters(refund_success_types, logs[0].data)); + //console.log(web3.eth.abi.decodeParameters(refund_success_types, logs[0].data)); }); }); contract("Test721Token", accounts => { From 636418afd30e83a5e6309b9c75e7ca3a5ce51726 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Wed, 21 Oct 2020 11:34:22 +0800 Subject: [PATCH 17/28] Fix the loop --- test/contracts/redpacket.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 64f1c28..4db6c04 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -322,10 +322,11 @@ contract HappyRedPacket { msg.sender, remaining_tokens, token_ids_holder); } else if (token_type == 2) { - uint256[] memory token_ids; + uint256[] memory token_ids = new uint256[](remaining_tokens); + uint j = 0; for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){ if (rp.erc721_token_ids[i] != MASK) { - token_ids[token_ids.length] = rp.erc721_token_ids[i]; + token_ids[j++] = rp.erc721_token_ids[i]; rp.erc721_token_ids[i] = MASK; } } From a995e68efe65fbaaa7d0fd82a95624cc51b1d30d Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Wed, 21 Oct 2020 15:46:18 +0800 Subject: [PATCH 18/28] Fix a minor error --- test/contracts/redpacket.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 4db6c04..1808f05 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -324,7 +324,7 @@ contract HappyRedPacket { else if (token_type == 2) { uint256[] memory token_ids = new uint256[](remaining_tokens); uint j = 0; - for (uint i = 0; i < rp.erc721_token_ids.length - 1; i++){ + for (uint i = 0; i < rp.erc721_token_ids.length; i++){ if (rp.erc721_token_ids[i] != MASK) { token_ids[j++] = rp.erc721_token_ids[i]; rp.erc721_token_ids[i] = MASK; From 501f82d956b72bcfdb9e179d9bfc5321e130f4ca Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Mon, 30 Nov 2020 15:49:08 +0800 Subject: [PATCH 19/28] Remove unused appove during redpacket creation --- test/contracts/redpacket.sol | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 1808f05..22fe4fd 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -66,12 +66,11 @@ 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, new uint256[](0)); + IERC20(_token_addr).transferFrom(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, seed, _seed)); @@ -216,7 +215,6 @@ contract HappyRedPacket { claimed_tokens = total_tokens; } else{ - //claimed_tokens = random(seed, nonce) % SafeMath.mul(SafeMath.div(rp.packed1 >> 128 & 0xffffffffffffffffffff, (rp.packed2 >> 232 & 0xff) - (rp.packed2 >> 224 & 0xff)), 2); //Max amount of tokens that can be claimed once is average * 2 claimed_tokens = random(seed, nonce) % SafeMath.div(SafeMath.mul(total_tokens, 2), total_number - claimed_number); } if (claimed_tokens == 0) { @@ -349,6 +347,6 @@ contract HappyRedPacket { } // One cannot send tokens to this contract after constructor anymore - //function () external payable { - //} + function () external payable { + } } From 7fba9c0d09df100fa4ebf2241fa8588dff3c2568 Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Mon, 30 Nov 2020 15:58:30 +0800 Subject: [PATCH 20/28] Remove the fallback function --- test/contracts/redpacket.sol | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index 22fe4fd..a231802 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -345,8 +345,4 @@ contract HappyRedPacket { rp.claimed_list[i] = 0; } } - - // One cannot send tokens to this contract after constructor anymore - function () external payable { - } } From 6f5612341bcdaeb394bec4049d1cec6cbe61a05c Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 8 Dec 2020 14:54:43 +0800 Subject: [PATCH 21/28] Add check for 0 balance in refund --- test/contracts/redpacket.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index a231802..b0061d7 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -307,6 +307,8 @@ contract HappyRedPacket { require(unbox(rp.packed1, 208, 48) <= now, "012"); uint256 remaining_tokens = unbox(rp.packed1, 128, 80); + require(remaining_tokens != 0, "None left in the red packet.") + uint256 token_type = unbox(rp.packed2, 240, 8); address token_address = address(unbox(rp.packed2, 0, 160)); From 14e1ea6d879685d91bb5180bf12026ff922c19df Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 15 Dec 2020 13:44:00 +0800 Subject: [PATCH 22/28] Add the missing semicolon; --- test/contracts/redpacket.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index b0061d7..f3335eb 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -307,7 +307,7 @@ contract HappyRedPacket { require(unbox(rp.packed1, 208, 48) <= now, "012"); uint256 remaining_tokens = unbox(rp.packed1, 128, 80); - require(remaining_tokens != 0, "None left in the red packet.") + require(remaining_tokens != 0, "None left in the red packet."); uint256 token_type = unbox(rp.packed2, 240, 8); address token_address = address(unbox(rp.packed2, 0, 160)); From 091fa81a08c1165ead204c12752f7e8446e7fa7a Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Tue, 15 Dec 2020 14:23:19 +0800 Subject: [PATCH 23/28] Refine the error code --- test/contracts/redpacket.sol | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/contracts/redpacket.sol b/test/contracts/redpacket.sol index f3335eb..40b7ddf 100644 --- a/test/contracts/redpacket.sol +++ b/test/contracts/redpacket.sol @@ -57,19 +57,19 @@ contract HappyRedPacket { uint256[] memory _erc721_token_ids) public payable { nonce ++; - require(_total_tokens >= _number, "001"); - require(_number > 0, "002"); - require(_number < 256, "002"); + require(_total_tokens >= _number, "#tokens > #packets"); + require(_number > 0, "At least 1 recipient"); + require(_number < 256, "At most 255 recipients"); if (_token_type == 0) { - require(msg.value >= _total_tokens, "008"); + require(msg.value >= _total_tokens, "No enough tokens"); } else if (_token_type == 1) { - require(IERC20(_token_addr).allowance(msg.sender, address(this)) >= _total_tokens, "009"); + require(IERC20(_token_addr).allowance(msg.sender, address(this)) >= _total_tokens, "No enough allowance"); IERC20(_token_addr).transferFrom(msg.sender, address(this), _total_tokens); } else if (_token_type == 2) { - require(IERC721(_token_addr).isApprovedForAll(msg.sender, address(this)), "011"); + require(IERC721(_token_addr).isApprovedForAll(msg.sender, address(this)), "Not approved yet"); transfer_token(_token_type, _token_addr, msg.sender, address(this), _total_tokens, _erc721_token_ids); } @@ -133,14 +133,14 @@ contract HappyRedPacket { address recipient_address, uint amount, uint256 [] memory erc721_token_ids) internal{ // ERC20 if (token_type == 1) { - require(IERC20(token_address).balanceOf(sender_address) >= amount, "010"); + require(IERC20(token_address).balanceOf(sender_address) >= amount, "Balance too low"); IERC20(token_address).approve(sender_address, amount); IERC20(token_address).transferFrom(sender_address, recipient_address, amount); } // ERC721 else if (token_type == 2) { - require(IERC721(token_address).balanceOf(sender_address) >= amount, "012"); + require(IERC721(token_address).balanceOf(sender_address) >= amount, "721 balance too low"); for (uint i=0; i < amount; i++) { if (recipient_address == address(this)){ IERC721(token_address).approve(recipient_address, erc721_token_ids[i]); @@ -186,13 +186,13 @@ contract HappyRedPacket { address payable recipient = address(uint160(_recipient)); // uint256 token_id; // Unsuccessful - require (unbox(rp.packed1, 208, 48) > now, "003"); + require (unbox(rp.packed1, 208, 48) > now, "Expired"); uint total_number = unbox(rp.packed2, 232, 8); uint claimed_number = unbox(rp.packed2, 224, 8); - require (claimed_number < total_number, "004"); + require (claimed_number < total_number, "Out of stock"); // require (1 > 2, 'test'); - require (uint256(keccak256(bytes(password))) >> 128 == unbox(rp.packed1, 0, 128), "006"); - require (validation == keccak256(toBytes(msg.sender)), "007"); + require (uint256(keccak256(bytes(password))) >> 128 == unbox(rp.packed1, 0, 128), "Wrong password"); + require (validation == keccak256(toBytes(msg.sender)), "Validation failed"); uint claimed_tokens; uint256 [] memory token_ids = new uint256[](1); //TODO: Optimize this behavior. @@ -254,7 +254,7 @@ contract HappyRedPacket { break; } } - require (available == false, "005"); + require (available == false, "Already claimed"); rp.claimed_list[claimed_number / 4] = rewriteBox(rp.claimed_list[claimed_number / 4], 64 * uint16(claimed_number % 4), 64, (uint256(keccak256(abi.encodePacked(msg.sender))) >> 192)); rp.packed2 = rewriteBox(rp.packed2, 224, 8, claimed_number + 1); @@ -303,8 +303,8 @@ contract HappyRedPacket { function refund(bytes32 id) public { RedPacket storage rp = redpacket_by_id[id]; - require(uint256(keccak256(abi.encodePacked(msg.sender)) >> 192) == unbox(rp.packed2, 160, 64), "011"); - require(unbox(rp.packed1, 208, 48) <= now, "012"); + require(uint256(keccak256(abi.encodePacked(msg.sender)) >> 192) == unbox(rp.packed2, 160, 64), "Creator Only"); + require(unbox(rp.packed1, 208, 48) <= now, "Not expired yet"); uint256 remaining_tokens = unbox(rp.packed1, 128, 80); require(remaining_tokens != 0, "None left in the red packet."); From df41f0890331d6e297e23ab6a6ec9a31545af71c Mon Sep 17 00:00:00 2001 From: Yisi Liu Date: Mon, 18 Jan 2021 19:13:07 +0800 Subject: [PATCH 24/28] Rearrange the directory structure --- {test/contracts => contracts}/Migrations.sol | 0 {test/contracts => contracts}/redpacket.sol | 0 {test/contracts => contracts}/test_erc721_token.sol | 0 {test/contracts => contracts}/test_token.sol | 0 {test/migrations => migrations}/1_initial_migration.js | 0 {test/migrations => migrations}/2_test_token_migration.js | 0 {test/migrations => migrations}/3_redpacket_migration.js | 0 {test/migrations => migrations}/4_test_721_token_migration.js | 0 test/package-lock.json => package-lock.json | 0 test/package.json => package.json | 0 test/.solhint.json | 3 --- test/{test => }/Testrp.js | 0 test/truffle-config.js => truffle-config.js | 0 13 files changed, 3 deletions(-) rename {test/contracts => contracts}/Migrations.sol (100%) rename {test/contracts => contracts}/redpacket.sol (100%) rename {test/contracts => contracts}/test_erc721_token.sol (100%) rename {test/contracts => contracts}/test_token.sol (100%) rename {test/migrations => migrations}/1_initial_migration.js (100%) rename {test/migrations => migrations}/2_test_token_migration.js (100%) rename {test/migrations => migrations}/3_redpacket_migration.js (100%) rename {test/migrations => migrations}/4_test_721_token_migration.js (100%) rename test/package-lock.json => package-lock.json (100%) rename test/package.json => package.json (100%) delete mode 100644 test/.solhint.json rename test/{test => }/Testrp.js (100%) rename test/truffle-config.js => truffle-config.js (100%) diff --git a/test/contracts/Migrations.sol b/contracts/Migrations.sol similarity index 100% rename from test/contracts/Migrations.sol rename to contracts/Migrations.sol diff --git a/test/contracts/redpacket.sol b/contracts/redpacket.sol similarity index 100% rename from test/contracts/redpacket.sol rename to contracts/redpacket.sol diff --git a/test/contracts/test_erc721_token.sol b/contracts/test_erc721_token.sol similarity index 100% rename from test/contracts/test_erc721_token.sol rename to contracts/test_erc721_token.sol diff --git a/test/contracts/test_token.sol b/contracts/test_token.sol similarity index 100% rename from test/contracts/test_token.sol rename to contracts/test_token.sol diff --git a/test/migrations/1_initial_migration.js b/migrations/1_initial_migration.js similarity index 100% rename from test/migrations/1_initial_migration.js rename to migrations/1_initial_migration.js diff --git a/test/migrations/2_test_token_migration.js b/migrations/2_test_token_migration.js similarity index 100% rename from test/migrations/2_test_token_migration.js rename to migrations/2_test_token_migration.js diff --git a/test/migrations/3_redpacket_migration.js b/migrations/3_redpacket_migration.js similarity index 100% rename from test/migrations/3_redpacket_migration.js rename to migrations/3_redpacket_migration.js diff --git a/test/migrations/4_test_721_token_migration.js b/migrations/4_test_721_token_migration.js similarity index 100% rename from test/migrations/4_test_721_token_migration.js rename to migrations/4_test_721_token_migration.js diff --git a/test/package-lock.json b/package-lock.json similarity index 100% rename from test/package-lock.json rename to package-lock.json diff --git a/test/package.json b/package.json similarity index 100% rename from test/package.json rename to package.json diff --git a/test/.solhint.json b/test/.solhint.json deleted file mode 100644 index d7c3de9..0000000 --- a/test/.solhint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "solhint:default" -} diff --git a/test/test/Testrp.js b/test/Testrp.js similarity index 100% rename from test/test/Testrp.js rename to test/Testrp.js diff --git a/test/truffle-config.js b/truffle-config.js similarity index 100% rename from test/truffle-config.js rename to truffle-config.js From 54239eaca2bc4a53e66afd99888ab147086cd6a8 Mon Sep 17 00:00:00 2001 From: Hancheng Zhou Date: Wed, 20 Jan 2021 08:28:41 +0800 Subject: [PATCH 25/28] Add test coverage --- .gitignore | 4 + README.md | 28 +- package-lock.json | 14235 +++++++++++++++++++++++++++++++++++++++++--- package.json | 6 +- truffle-config.js | 3 +- 5 files changed, 13596 insertions(+), 680 deletions(-) diff --git a/.gitignore b/.gitignore index b38db2f..e4653ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ node_modules/ build/ +coverage/ +coverage.json +.coverage_artifacts +.coverage_contracts \ No newline at end of file diff --git a/README.md b/README.md index ad3a921..85f61f1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,29 @@ # RedPacket -test dir is a truffle project. +## Introduction + +## Overview + +## Getting Started + +This is a standard truffle project. +To install: +``` +npm i +``` +To build the project: +``` +truffle build +``` + +To test the project: +``` +npm install chai ganache-cli +truffle run coverage +``` + +To debug: +``` +truffle debug [TX_ID] +``` + diff --git a/package-lock.json b/package-lock.json index 6413fc5..f184ee6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,584 +1,12801 @@ { + "name": "RedPacket", + "lockfileVersion": 2, "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@babel/code-frame": { + "packages": { + "": { + "dependencies": { + "chai": "^4.2.0", + "zeppelin-solidity": "^1.12.0" + }, + "devDependencies": { + "bignumber.js": "2.0.0", + "chai-as-promised": "^7.1.1", + "openzeppelin-solidity": "^3.2.0", + "solhint": "^2.3.0", + "solidity-coverage": "^0.7.13" + } + }, + "node_modules/@babel/code-frame": { "version": "7.5.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "dev": true, - "requires": { + "dependencies": { "@babel/highlight": "^7.0.0" } }, - "@babel/highlight": { + "node_modules/@babel/highlight": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "dev": true, - "requires": { + "dependencies": { "chalk": "^2.0.0", "esutils": "^2.0.2", "js-tokens": "^4.0.0" } }, - "acorn": { + "node_modules/@ethersproject/abi": { + "version": "5.0.0-beta.153", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz", + "integrity": "sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg==", + "dev": true, + "dependencies": { + "@ethersproject/address": ">=5.0.0-beta.128", + "@ethersproject/bignumber": ">=5.0.0-beta.130", + "@ethersproject/bytes": ">=5.0.0-beta.129", + "@ethersproject/constants": ">=5.0.0-beta.128", + "@ethersproject/hash": ">=5.0.0-beta.128", + "@ethersproject/keccak256": ">=5.0.0-beta.127", + "@ethersproject/logger": ">=5.0.0-beta.129", + "@ethersproject/properties": ">=5.0.0-beta.131", + "@ethersproject/strings": ">=5.0.0-beta.130" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.0.8.tgz", + "integrity": "sha512-fqJXkewcGdi8LogKMgRyzc/Ls2js07yor7+g9KfPs09uPOcQLg7cc34JN+lk34HH9gg2HU0DIA5797ZR8znkfw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/networks": "^5.0.7", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/transactions": "^5.0.9", + "@ethersproject/web": "^5.0.12" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.0.11.tgz", + "integrity": "sha512-RKOgPSEYafknA62SrD3OCK42AllHE4YBfKYXyQeM+sBP7Nq3X5FpzeoY4uzC43P4wIhmNoTHCKQuwnX7fBqb6Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.0.8", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.9.tgz", + "integrity": "sha512-gKkmbZDMyGbVjr8nA5P0md1GgESqSGH7ILIrDidPdNXBl4adqbuA3OAuZx/O2oGpL6PtJ9BDa0kHheZ1ToHU3w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/rlp": "^5.0.7" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.0.7.tgz", + "integrity": "sha512-S5oh5DVfCo06xwJXT8fQC68mvJfgScTl2AXvbYMsHNfIBTDb084Wx4iA9MNlEReOv6HulkS+gyrUM/j3514rSw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.0.9" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.13.tgz", + "integrity": "sha512-b89bX5li6aK492yuPP5mPgRVgIxxBP7ksaBtKX5QQBsrZTpNOjf/MR4CjcUrAw8g+RQuD6kap9lPjFgY4U1/5A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "bn.js": "^4.4.0" + } + }, + "node_modules/@ethersproject/bytes": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.9.tgz", + "integrity": "sha512-k+17ZViDtAugC0s7HM6rdsTWEdIYII4RPCDkPEuxKc6i40Bs+m6tjRAtCECX06wKZnrEoR9pjOJRXHJ/VLoOcA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.0.8" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.8.tgz", + "integrity": "sha512-sCc73pFBsl59eDfoQR5OCEZCRv5b0iywadunti6MQIr5lt3XpwxK1Iuzd8XSFO02N9jUifvuZRrt0cY0+NBgTg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.0.13" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.0.10.tgz", + "integrity": "sha512-Tf0bvs6YFhw28LuHnhlDWyr0xfcDxSXdwM4TcskeBbmXVSKLv3bJQEEEBFUcRX0fJuslR3gCVySEaSh7vuMx5w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.0.10", + "@ethersproject/address": "^5.0.9", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/strings": "^5.0.8" + } + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.0.7.tgz", + "integrity": "sha512-zpUBmofWvx9PGfc7IICobgFQSgNmTOGTGLUxSYqZzY/T+b4y/2o5eqf/GGmD7qnTGzKQ42YlLNo+LeDP2qe55g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.0.9", + "js-sha3": "0.5.7" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.0.8.tgz", + "integrity": "sha512-SkJCTaVTnaZ3/ieLF5pVftxGEFX56pTH+f2Slrpv7cU0TNpUZNib84QQdukd++sWUp/S7j5t5NW+WegbXd4U/A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/networks": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.0.7.tgz", + "integrity": "sha512-dI14QATndIcUgcCBL1c5vUr/YsI5cCHLN81rF7PU+yS7Xgp2/Rzbr9+YqpC6NBXHFUASjh6GpKqsVMpufAL0BQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.0.8" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.0.7.tgz", + "integrity": "sha512-812H1Rus2vjw0zbasfDI1GLNPDsoyX1pYqiCgaR1BuyKxUTbwcH1B+214l6VGe1v+F6iEVb7WjIwMjKhb4EUsg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.0.8" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.0.7.tgz", + "integrity": "sha512-ulUTVEuV7PT4jJTPpfhRHK57tkLEDEY9XSYJtrSNHOqdwMvH0z7BM2AKIMq4LVDlnu4YZASdKrkFGEIO712V9w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.0.8.tgz", + "integrity": "sha512-YKxQM45eDa6WAD+s3QZPdm1uW1MutzVuyoepdRRVmMJ8qkk7iOiIhUkZwqKLNxKzEJijt/82ycuOREc9WBNAKg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "elliptic": "6.5.3" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.0.8.tgz", + "integrity": "sha512-5IsdXf8tMY8QuHl8vTLnk9ehXDDm6x9FB9S9Og5IA1GYhLe5ZewydXSjlJlsqU2t9HRbfv97OJZV/pX8DVA/Hw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/constants": "^5.0.8", + "@ethersproject/logger": "^5.0.8" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.0.9.tgz", + "integrity": "sha512-0Fu1yhdFBkrbMjenEr+39tmDxuHmaw0pe9Jb18XuKoItj7Z3p7+UzdHLr2S/okvHDHYPbZE5gtANDdQ3ZL1nBA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.0.9", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/constants": "^5.0.8", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/rlp": "^5.0.7", + "@ethersproject/signing-key": "^5.0.8" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.0.12.tgz", + "integrity": "sha512-gVxS5iW0bgidZ76kr7LsTxj4uzN5XpCLzvZrLp8TP+4YgxHfCeetFyQkRPgBEAJdNrexdSBayvyJvzGvOq0O8g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/base64": "^5.0.7", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/strings": "^5.0.8" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/@solidity-parser/parser": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.11.0.tgz", + "integrity": "sha512-IaC4IaW8uoOB8lmEkw6c19y1vJBK/+7SzAbGQ+LmBYRPXSLNB+UgpORvmcAJEXhB04kWKyz/Os1U8onqm6U/+w==", + "dev": true + }, + "node_modules/@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "dependencies": { + "defer-to-connect": "^1.0.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@truffle/error": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.11.tgz", + "integrity": "sha512-ju6TucjlJkfYMmdraYY/IBJaFb+Sa+huhYtOoyOJ+G29KcgytUVnDzKGwC7Kgk6IsxQMm62Mc1E0GZzFbGGipw==", + "dev": true + }, + "node_modules/@truffle/interface-adapter": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.18.tgz", + "integrity": "sha512-P9JVSYD/CX3V+NgTWu+Bf71sLh8pMwrCpbiYRB93pRw/1H3ZTvt5iDC2MVvVxCs8FkSiy4OZzQK/DJ8+hXAmYw==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.8", + "ethers": "^4.0.32", + "source-map-support": "^0.5.19", + "web3": "1.2.9" + } + }, + "node_modules/@truffle/provider": { + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.25.tgz", + "integrity": "sha512-BohKgT2357c2dYCH2IQwldQ4EJkfsWUClpb3j+kR8ng02vbsyAPe0HMH463I+h+tiDKvL757dBltXpe0DBJusg==", + "dev": true, + "dependencies": { + "@truffle/error": "^0.0.11", + "@truffle/interface-adapter": "^0.4.18", + "web3": "1.2.9" + } + }, + "node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "14.14.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.21.tgz", + "integrity": "sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==", + "dev": true + }, + "node_modules/@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", - "dev": true + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } }, - "acorn-jsx": { + "node_modules/acorn-jsx": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", "dev": true }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "node_modules/address": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz", + "integrity": "sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==", "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=", + "dev": true + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "ansi-escapes": { + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.4.2" + } + }, + "node_modules/ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "ansi-regex": { + "node_modules/ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, - "ansi-styles": { + "node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "requires": { + "dependencies": { "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "antlr4": { + "node_modules/antlr4": { "version": "4.7.1", "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.7.1.tgz", "integrity": "sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ==", "dev": true }, - "argparse": { + "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, - "requires": { + "dependencies": { "sprintf-js": "~1.0.2" } }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "engines": { + "node": ">=8" } }, - "caller-callsite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", - "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "node_modules/asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "dev": true, - "requires": { - "callsites": "^2.0.0" + "dependencies": { + "safer-buffer": "~2.1.0" } }, - "caller-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", - "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "node_modules/asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", "dev": true, - "requires": { - "caller-callsite": "^2.0.0" + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" } }, - "callsites": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", - "dev": true + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "engines": { + "node": ">=0.8" + } }, - "chalk": { + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "engines": { + "node": "*" + } + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/bignumber.js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-2.0.0.tgz", + "integrity": "sha1-n8pV5sc+G6XSlL2pmDGA6UfiEZw=", + "deprecated": "critical bug fixed in v2.0.4", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", + "dev": true + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "node_modules/bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + }, + "node_modules/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "dependencies": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-rsa/node_modules/bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, + "node_modules/browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "dependencies": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "node_modules/browserify-sign/node_modules/bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, + "node_modules/browserify-sign/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "dev": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "node_modules/buffer-to-arraybuffer": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", + "integrity": "sha1-YGSkD6dutDxyOrqe+PbhIW0QURo=", + "dev": true + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "node_modules/bufferutil": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", + "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.2.0" + } + }, + "node_modules/bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cacheable-request/node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "dependencies": { + "callsites": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "dependencies": { + "caller-callsite": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "node_modules/chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chai-as-promised": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz", + "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", + "dev": true, + "dependencies": { + "check-error": "^1.0.2" + }, + "peerDependencies": { + "chai": ">= 2.1.2 < 5" + } + }, + "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "requires": { + "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "chardet": { + "node_modules/chardet": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "cli-cursor": { + "node_modules/check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "engines": { + "node": "*" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "node_modules/cids": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", + "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "class-is": "^1.1.0", + "multibase": "~0.6.0", + "multicodec": "^1.0.0", + "multihashes": "~0.4.15" + }, + "engines": { + "node": ">=4.0.0", + "npm": ">=3.0.0" + } + }, + "node_modules/cids/node_modules/multicodec": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz", + "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==", + "dev": true, + "dependencies": { + "buffer": "^5.6.0", + "varint": "^5.0.0" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/class-is": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", + "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==", + "dev": true + }, + "node_modules/cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, - "requires": { + "dependencies": { "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "cli-width": { + "node_modules/cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, - "color-convert": { + "node_modules/clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + } + }, + "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "requires": { + "dependencies": { "color-name": "1.1.3" } }, - "color-name": { + "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "commander": { + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { "version": "2.18.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.18.0.tgz", "integrity": "sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ==", "dev": true }, - "concat-map": { + "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "node_modules/content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", "dev": true, - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" - } + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.6" + } }, - "cross-spawn": { + "node_modules/content-hash": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz", + "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==", + "dev": true, + "dependencies": { + "cids": "^0.7.1", + "multicodec": "^0.5.5", + "multihashes": "^0.4.15" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "node_modules/cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "dependencies": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, - "requires": { + "dependencies": { "nice-try": "^1.0.4", "path-key": "^2.0.1", "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" } }, - "debug": { + "node_modules/d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "dependencies": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/death": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", + "integrity": "sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg=", + "dev": true + }, + "node_modules/debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, - "requires": { + "dependencies": { "ms": "^2.1.1" } }, - "deep-is": { + "node_modules/decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "doctrine": { + "node_modules/defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "node_modules/detect-port": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.3.0.tgz", + "integrity": "sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ==", + "dev": true, + "dependencies": { + "address": "^1.0.1", + "debug": "^2.6.0" + }, + "bin": { + "detect": "bin/detect-port", + "detect-port": "bin/detect-port" + }, + "engines": { + "node": ">= 4.2.1" + } + }, + "node_modules/detect-port/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/detect-port/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, - "requires": { + "dependencies": { "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" } }, - "emoji-regex": { + "node_modules/dom-walk": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", + "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", + "dev": true + }, + "node_modules/duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "node_modules/elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "dependencies": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "node_modules/emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "dependencies": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "node_modules/es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "dependencies": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "node_modules/es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "dependencies": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "dependencies": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=0.12.0" + }, + "optionalDependencies": { + "source-map": "~0.2.0" + } + }, + "node_modules/escodegen/node_modules/esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + } + }, + "node_modules/eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint/node_modules/import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "dependencies": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "dependencies": { + "estraverse": "^4.0.0" + }, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "dependencies": { + "estraverse": "^4.1.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eth-ens-namehash": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", + "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", + "dev": true, + "dependencies": { + "idna-uts46-hx": "^2.3.1", + "js-sha3": "^0.5.7" + } + }, + "node_modules/eth-lib": { + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", + "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "nano-json-stream-parser": "^0.1.2", + "servify": "^0.1.12", + "ws": "^3.0.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/ethereum-bloom-filters": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.7.tgz", + "integrity": "sha512-cDcJJSJ9GMAcURiAWO3DxIEhTL/uWqlQnvgKpuYQzYPrt/izuGU+1ntQmHt0IRq6ADoSYHFnB+aCEFIldjhkMQ==", + "dev": true, + "dependencies": { + "js-sha3": "^0.8.0" + } + }, + "node_modules/ethereum-bloom-filters/node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + }, + "node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/ethereum-cryptography/node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/ethereum-cryptography/node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true + }, + "node_modules/ethereum-cryptography/node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "node_modules/ethereumjs-common": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", + "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==", + "dev": true + }, + "node_modules/ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "dev": true, + "dependencies": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "node_modules/ethers": { + "version": "4.0.48", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.48.tgz", + "integrity": "sha512-sZD5K8H28dOrcidzx9f8KYh8083n5BexIO3+SbE4jK83L85FxtpXZBCQdXb8gkg+7sBqomcLhhkU7UHL+F7I2g==", + "dev": true, + "dependencies": { + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.5.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.4", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "node_modules/ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "dev": true, + "dependencies": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/ethjs-unit/node_modules/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + }, + "node_modules/ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", + "dev": true + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "dependencies": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "dependencies": { + "type": "^2.0.0" + } + }, + "node_modules/ext/node_modules/type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", + "dev": true + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true, + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fastq": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", + "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "dependencies": { + "flat-cache": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "dependencies": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flatted": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "dev": true + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "dependencies": { + "minipass": "^2.6.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/ganache-cli": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ganache-cli/-/ganache-cli-6.12.2.tgz", + "integrity": "sha512-bnmwnJDBDsOWBUP8E/BExWf85TsdDEFelQSzihSJm9VChVO1SHp94YXLP5BlA4j/OTxp0wR4R1Tje9OHOuAJVw==", + "bundleDependencies": [ + "source-map-support", + "yargs", + "ethereumjs-util" + ], + "dev": true, + "dependencies": { + "ethereumjs-util": "6.2.1", + "source-map-support": "0.5.12", + "yargs": "13.2.4" + }, + "bin": { + "ganache-cli": "cli.js" + } + }, + "node_modules/ganache-cli/node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ganache-cli/node_modules/@types/node": { + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ganache-cli/node_modules/@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ganache-cli/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ganache-cli/node_modules/blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", + "dev": true, + "inBundle": true, + "license": "CC0-1.0" + }, + "node_modules/ganache-cli/node_modules/bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ganache-cli/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/ganache-cli/node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/ganache-cli/node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ganache-cli/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/ganache-cli/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/ganache-cli/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/ganache-cli/node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/ganache-cli/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/ganache-cli/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ganache-cli/node_modules/elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "node_modules/ganache-cli/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/ganache-cli/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/ganache-cli/node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "inBundle": true, + "license": "MPL-2.0", + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "node_modules/ganache-cli/node_modules/ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/ganache-cli/node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/ganache-cli/node_modules/execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/ganache-cli/node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/ganache-cli/node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/ganache-cli/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/ganache-cli/node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ganache-cli/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "dev": true, + "hasInstallScript": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/ganache-cli/node_modules/lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "invert-kv": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "p-defer": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/ganache-cli/node_modules/mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/ganache-cli/node_modules/npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "path-key": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/ganache-cli/node_modules/os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ganache-cli/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ganache-cli/node_modules/pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/ganache-cli/node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/ganache-cli/node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/ganache-cli/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ganache-cli/node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ganache-cli/node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/ganache-cli/node_modules/rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "dev": true, + "inBundle": true, + "license": "MPL-2.0", + "dependencies": { + "bn.js": "^4.11.1" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "node_modules/ganache-cli/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "dev": true, + "hasInstallScript": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/ganache-cli/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "inBundle": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/ganache-cli/node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "inBundle": true, + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/ganache-cli/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ganache-cli/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ganache-cli/node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "inBundle": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ganache-cli/node_modules/source-map-support": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/ganache-cli/node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/ganache-cli/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ganache-cli/node_modules/strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/ganache-cli/node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "inBundle": true, + "license": "MIT" + }, + "node_modules/ganache-cli/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/ganache-cli/node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/ganache-cli/node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true, + "inBundle": true, + "license": "ISC" + }, + "node_modules/ganache-cli/node_modules/yargs": { + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.0" + } + }, + "node_modules/ganache-cli/node_modules/yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "inBundle": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "node_modules/get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "engines": { + "node": "*" + } + }, + "node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/ghost-testrpc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", + "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", + "dev": true, + "dependencies": { + "chalk": "^2.4.2", + "node-emoji": "^1.10.0" + }, + "bin": { + "testrpc-sc": "index.js" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", + "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", + "dev": true, + "dependencies": { + "min-document": "^2.19.0", + "process": "^0.11.10" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "node_modules/handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/handlebars/node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/handlebars/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dev": true, + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "dependencies": { + "has-symbol-support-x": "^1.4.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash-base/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "node_modules/http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-errors/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "node_modules/http-https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", + "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=", + "dev": true + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/idna-uts46-hx": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", + "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", + "dev": true, + "dependencies": { + "punycode": "2.1.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/idna-uts46-hx/node_modules/punycode": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", + "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "dependencies": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-function": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", + "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", + "dev": true + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", + "dev": true, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", + "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "node_modules/is-retry-allowed": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "node_modules/isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "dependencies": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "node_modules/json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.6" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonschema": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.0.tgz", + "integrity": "sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "node_modules/keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.0" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "node_modules/lodash.toarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", + "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", + "dev": true + }, + "node_modules/lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lru-cache/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "dev": true, + "dependencies": { + "mime-db": "1.45.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "dev": true, + "dependencies": { + "dom-walk": "^0.1.0" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "node_modules/minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "node_modules/minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "dependencies": { + "minipass": "^2.9.0" + } + }, + "node_modules/mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "dependencies": { + "minimist": "0.0.8" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "deprecated": "This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.", + "dev": true, + "dependencies": { + "mkdirp": "*" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mock-fs": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.13.0.tgz", + "integrity": "sha512-DD0vOdofJdoaRNtnWcrXe6RQbpHkPPmtqGq14uRX0F8ZKJ5nv89CVTYl/BZdppDxBDaV0hl75htg3abpEWlPZA==", + "dev": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "dev": true, + "dependencies": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + }, + "node_modules/multicodec": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", + "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==", + "deprecated": "stable api reached", + "dev": true, + "dependencies": { + "varint": "^5.0.0" + } + }, + "node_modules/multihashes": { + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", + "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "multibase": "^0.7.0", + "varint": "^5.0.0" + } + }, + "node_modules/multihashes/node_modules/multibase": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", + "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", + "dev": true, + "dependencies": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + }, + "node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "node_modules/nano-json-stream-parser": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", + "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true + }, + "node_modules/node-emoji": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz", + "integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==", + "dev": true, + "dependencies": { + "lodash.toarray": "^4.4.0" + } + }, + "node_modules/node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "dev": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/number-to-bn": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", + "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", + "dev": true, + "dependencies": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/number-to-bn/node_modules/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/oboe": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.4.tgz", + "integrity": "sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY=", + "dev": true, + "dependencies": { + "http-https": "^1.0.0" + } + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/openzeppelin-solidity": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-3.2.0.tgz", + "integrity": "sha512-ku9dZbpo63P1OOGvU1FflRlAxcxWauKhex+a7W0vbfjLzItaCQkZEiDedsH2TWJrg4xdo0B/BFS9taeVwKvAxw==", + "dev": true + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "dependencies": { + "p-finally": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module/node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "dependencies": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/parse-headers": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", + "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==", + "dev": true + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "engines": { + "node": "*" + } + }, + "node_modules/pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true, + "optional": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "dev": true, + "dependencies": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "dependencies": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "dependencies": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/recursive-readdir": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "dev": true, + "dependencies": { + "minimatch": "3.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true, + "engines": { + "node": ">=6.5.0" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/request/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "dependencies": { + "lowercase-keys": "^1.0.0" + } + }, + "node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.1" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "node_modules/run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "dependencies": { + "is-promise": "^2.1.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/sc-istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.5.tgz", + "integrity": "sha512-7wR5EZFLsC4w0wSm9BUuCgW+OGKAU7PNlW5L0qwVPbh+Q1sfVn2fyzfMXYCm6rkNA5ipaCOt94nApcguQwF5Gg==", + "dev": true, + "dependencies": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "istanbul": "lib/cli.js" + } + }, + "node_modules/sc-istanbul/node_modules/esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sc-istanbul/node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/sc-istanbul/node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sc-istanbul/node_modules/supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "dependencies": { + "has-flag": "^1.0.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/scrypt-js": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", + "dev": true + }, + "node_modules/secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "node_modules/serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dev": true, + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/servify": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", + "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", + "dev": true, + "dependencies": { + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", + "dev": true + }, + "node_modules/setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "dev": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "dev": true, + "dependencies": { + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/solhint": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-2.3.0.tgz", + "integrity": "sha512-2yiELLp+MsDtuOTrjc14lgsYmlMchp++SicvqCBu01VXsi9Mk2uynhyN3nBfbGzYq1YfmOEBpUqJfFYXVAR/Ig==", + "dev": true, + "dependencies": { + "ajv": "^6.6.1", + "antlr4": "4.7.1", + "chalk": "^2.4.2", + "commander": "2.18.0", + "cosmiconfig": "^5.0.7", + "eslint": "^5.6.0", + "fast-diff": "^1.1.2", + "glob": "^7.1.3", + "ignore": "^4.0.6", + "js-yaml": "^3.12.0", + "lodash": "^4.17.11", + "prettier": "^1.14.3", + "semver": "^6.3.0" + }, + "bin": { + "solhint": "solhint.js" + }, + "optionalDependencies": { + "prettier": "^1.14.3" + } + }, + "node_modules/solidity-coverage": { + "version": "0.7.14", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.7.14.tgz", + "integrity": "sha512-2X9oNtu4yBbtDXtVe2tc9vYHtwON6QRqNvVylKdkhcJgAdCzP/OkJy9fWcWH/g3fnNCIOFssHoe0LPGZ2ppMZg==", + "dev": true, + "dependencies": { + "@solidity-parser/parser": "^0.11.0", + "@truffle/provider": "^0.2.24", + "chalk": "^2.4.2", + "death": "^1.1.0", + "detect-port": "^1.3.0", + "fs-extra": "^8.1.0", + "ganache-cli": "^6.11.0", + "ghost-testrpc": "^0.0.2", + "global-modules": "^2.0.0", + "globby": "^10.0.1", + "jsonschema": "^1.2.4", + "lodash": "^4.17.15", + "node-emoji": "^1.10.0", + "pify": "^4.0.1", + "recursive-readdir": "^2.2.2", + "sc-istanbul": "^0.4.5", + "semver": "^7.3.4", + "shelljs": "^0.8.3", + "web3-utils": "^1.3.0" + }, + "bin": { + "solidity-coverage": "plugins/bin.js" + } + }, + "node_modules/solidity-coverage/node_modules/semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "dev": true, + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/swarm-js": { + "version": "0.1.40", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.40.tgz", + "integrity": "sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA==", + "dev": true, + "dependencies": { + "bluebird": "^3.5.0", + "buffer": "^5.0.5", + "eth-lib": "^0.1.26", + "fs-extra": "^4.0.2", + "got": "^7.1.0", + "mime-types": "^2.1.16", + "mkdirp-promise": "^5.0.1", + "mock-fs": "^4.1.0", + "setimmediate": "^1.0.5", + "tar": "^4.0.2", + "xhr-request": "^1.0.1" + } + }, + "node_modules/swarm-js/node_modules/fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "node_modules/swarm-js/node_modules/get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/swarm-js/node_modules/got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "dependencies": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/swarm-js/node_modules/p-cancelable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/swarm-js/node_modules/prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/swarm-js/node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "node_modules/swarm-js/node_modules/url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "dependencies": { + "prepend-http": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/table/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "dev": true, + "dependencies": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + }, + "engines": { + "node": ">=4.5" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "node_modules/timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "dev": true + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "node_modules/type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "engines": { + "node": ">=4" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/uglify-js": { + "version": "3.12.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.4.tgz", + "integrity": "sha512-L5i5jg/SHkEqzN18gQMTWsZk3KelRsfD1wUVNqtq0kzqWQqcJjyL8yc1o8hJgRrWqrAl2mUFbhfznEIoi7zi2A==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "dev": true + }, + "node_modules/underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", + "dev": true + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "dependencies": { + "prepend-http": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/url-set-query": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", + "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=", + "dev": true + }, + "node_modules/url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz", + "integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-gyp-build": "^4.2.0" + } + }, + "node_modules/utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + }, + "node_modules/varint": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", + "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==", + "dev": true + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/web3": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.9.tgz", + "integrity": "sha512-Mo5aBRm0JrcNpN/g4VOrDzudymfOnHRC3s2VarhYxRA8aWgF5rnhQ0ziySaugpic1gksbXPe105pUWyRqw8HUA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "web3-bzz": "1.2.9", + "web3-core": "1.2.9", + "web3-eth": "1.2.9", + "web3-eth-personal": "1.2.9", + "web3-net": "1.2.9", + "web3-shh": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-bzz": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.9.tgz", + "integrity": "sha512-ogVQr9jHodu9HobARtvUSmWG22cv2EUQzlPeejGWZ7j5h20HX40EDuWyomGY5VclIj5DdLY76Tmq88RTf/6nxA==", + "dev": true, + "dependencies": { + "@types/node": "^10.12.18", + "got": "9.6.0", + "swarm-js": "^0.1.40", + "underscore": "1.9.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-bzz/node_modules/@types/node": { + "version": "10.17.51", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.51.tgz", + "integrity": "sha512-KANw+MkL626tq90l++hGelbl67irOJzGhUJk6a1Bt8QHOeh9tztJx+L0AqttraWKinmZn7Qi5lJZJzx45Gq0dg==", + "dev": true + }, + "node_modules/web3-core": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.9.tgz", + "integrity": "sha512-fSYv21IP658Ty2wAuU9iqmW7V+75DOYMVZsDH/c14jcF/1VXnedOcxzxSj3vArsCvXZNe6XC5/wAuGZyQwR9RA==", + "dev": true, + "dependencies": { + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "bignumber.js": "^9.0.0", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-core-requestmanager": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-core-helpers": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.9.tgz", + "integrity": "sha512-t0WAG3orLCE3lqi77ZoSRNFok3VQWZXTniZigDQjyOJYMAX7BU3F3js8HKbjVnAxlX3tiKoDxI0KBk9F3AxYuw==", + "dev": true, + "dependencies": { + "underscore": "1.9.1", + "web3-eth-iban": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-core-helpers/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-core-helpers/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-core-helpers/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-core-method": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.9.tgz", + "integrity": "sha512-bjsIoqP3gs7A/gP8+QeLUCyOKJ8bopteCSNbCX36Pxk6TYfYWNuC6hP+2GzUuqdP3xaZNe+XEElQFUNpR3oyAg==", + "dev": true, + "dependencies": { + "@ethersproject/transactions": "^5.0.0-beta.135", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9", + "web3-core-promievent": "1.2.9", + "web3-core-subscriptions": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-core-method/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-core-method/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-core-method/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-core-promievent": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.9.tgz", + "integrity": "sha512-0eAUA2zjgXTleSrnc1wdoKQPPIHU6KHf4fAscu4W9kKrR+mqP1KsjYrxY9wUyjNnXxfQ+5M29ipvbiaK8OqdOw==", + "dev": true, + "dependencies": { + "eventemitter3": "3.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-core-requestmanager": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.9.tgz", + "integrity": "sha512-1PwKV2m46ALUnIN5VPPgjOj8yMLJhhqZYvYJE34hTN5SErOkwhzx5zScvo5MN7v7KyQGFnpVCZKKGCiEnDmtFA==", + "dev": true, + "dependencies": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9", + "web3-providers-http": "1.2.9", + "web3-providers-ipc": "1.2.9", + "web3-providers-ws": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-core-subscriptions": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.9.tgz", + "integrity": "sha512-Y48TvXPSPxEM33OmXjGVDMzTd0j8X0t2+sDw66haeBS8eYnrEzasWuBZZXDq0zNUsqyxItgBGDn+cszkgEnFqg==", + "dev": true, + "dependencies": { + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-core/node_modules/@types/node": { + "version": "12.19.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.14.tgz", + "integrity": "sha512-2U9uLN46+7dv9PiS8VQJcHhuoOjiDPZOLAt0WuA1EanEknIMae+2QbMhayF7cgGqjvRVIfNpt+6jLPczJZFiRw==", + "dev": true + }, + "node_modules/web3-core/node_modules/bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/web3-core/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-core/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-core/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.9.tgz", + "integrity": "sha512-sIKO4iE9FEBa/CYUd6GdPd7GXt/wISqxUd8PlIld6+hvMJj02lgO7Z7p5T9mZIJcIZJGvZX81ogx8oJ9yif+Ag==", + "dev": true, + "dependencies": { + "underscore": "1.9.1", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-core-subscriptions": "1.2.9", + "web3-eth-abi": "1.2.9", + "web3-eth-accounts": "1.2.9", + "web3-eth-contract": "1.2.9", + "web3-eth-ens": "1.2.9", + "web3-eth-iban": "1.2.9", + "web3-eth-personal": "1.2.9", + "web3-net": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-abi": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.9.tgz", + "integrity": "sha512-3YwUYbh/DMfDbhMWEebAdjSd5bj3ZQieOjLzWFHU23CaLEqT34sUix1lba+hgUH/EN6A7bKAuKOhR3p0OvTn7Q==", + "dev": true, + "dependencies": { + "@ethersproject/abi": "5.0.0-beta.153", + "underscore": "1.9.1", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-abi/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-eth-abi/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-eth-abi/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-accounts": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.9.tgz", + "integrity": "sha512-jkbDCZoA1qv53mFcRHCinoCsgg8WH+M0YUO1awxmqWXRmCRws1wW0TsuSQ14UThih5Dxolgl+e+aGWxG58LMwg==", + "dev": true, + "dependencies": { + "crypto-browserify": "3.12.0", + "eth-lib": "^0.2.8", + "ethereumjs-common": "^1.3.2", + "ethereumjs-tx": "^2.1.1", + "scrypt-js": "^3.0.1", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-accounts/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-eth-accounts/node_modules/eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-eth-accounts/node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true + }, + "node_modules/web3-eth-accounts/node_modules/uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/web3-eth-accounts/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-accounts/node_modules/web3-utils/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-eth-contract": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.9.tgz", + "integrity": "sha512-PYMvJf7EG/HyssUZa+pXrc8IB06K/YFfWYyW4R7ed3sab+9wWUys1TlWxBCBuiBXOokSAyM6H6P6/cKEx8FT8Q==", + "dev": true, + "dependencies": { + "@types/bn.js": "^4.11.4", + "underscore": "1.9.1", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-core-promievent": "1.2.9", + "web3-core-subscriptions": "1.2.9", + "web3-eth-abi": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-contract/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-eth-contract/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-eth-contract/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-ens": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.9.tgz", + "integrity": "sha512-kG4+ZRgZ8I1WYyOBGI8QVRHfUSbbJjvJAGA1AF/NOW7JXQ+x7gBGeJw6taDWJhSshMoEKWcsgvsiuoG4870YxQ==", + "dev": true, + "dependencies": { + "content-hash": "^2.5.2", + "eth-ens-namehash": "2.0.8", + "underscore": "1.9.1", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-promievent": "1.2.9", + "web3-eth-abi": "1.2.9", + "web3-eth-contract": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-ens/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-eth-ens/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-eth-ens/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-iban": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.9.tgz", + "integrity": "sha512-RtdVvJE0pyg9dHLy0GzDiqgnLnssSzfz/JYguhC1wsj9+Gnq1M6Diy3NixACWUAp6ty/zafyOaZnNQ+JuH9TjQ==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-iban/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-eth-iban/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-eth-iban/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-personal": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.9.tgz", + "integrity": "sha512-cFiNrktxZ1C/rIdJFzQTvFn3/0zcsR3a+Jf8Y3KxeQDHszQtosjLWptP7bsUmDwEh4hzh0Cy3KpOxlYBWB8bJQ==", + "dev": true, + "dependencies": { + "@types/node": "^12.6.1", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-net": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth-personal/node_modules/@types/node": { + "version": "12.19.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.14.tgz", + "integrity": "sha512-2U9uLN46+7dv9PiS8VQJcHhuoOjiDPZOLAt0WuA1EanEknIMae+2QbMhayF7cgGqjvRVIfNpt+6jLPczJZFiRw==", + "dev": true + }, + "node_modules/web3-eth-personal/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-eth-personal/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-eth-personal/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-eth/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-eth/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-eth/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-net": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.9.tgz", + "integrity": "sha512-d2mTn8jPlg+SI2hTj2b32Qan6DmtU9ap/IUlJTeQbZQSkTLf0u9suW8Vjwyr4poJYXTurdSshE7OZsPNn30/ZA==", + "dev": true, + "dependencies": { + "web3-core": "1.2.9", + "web3-core-method": "1.2.9", + "web3-utils": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-net/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3-net/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3-net/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-providers-http": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.9.tgz", + "integrity": "sha512-F956tCIj60Ttr0UvEHWFIhx+be3He8msoPzyA44/kfzzYoMAsCFRn5cf0zQG6al0znE75g6HlWVSN6s3yAh51A==", + "dev": true, + "dependencies": { + "web3-core-helpers": "1.2.9", + "xhr2-cookies": "1.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-providers-ipc": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.9.tgz", + "integrity": "sha512-NQ8QnBleoHA2qTJlqoWu7EJAD/FR5uimf7Ielzk4Z2z+m+6UAuJdJMSuQNj+Umhz9L/Ys6vpS1vHx9NizFl+aQ==", + "dev": true, + "dependencies": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-providers-ws": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.9.tgz", + "integrity": "sha512-6+UpvINeI//dglZoAKStUXqxDOXJy6Iitv2z3dbgInG4zb8tkYl/VBDL80UjUg3ZvzWG0g7EKY2nRPEpON2TFA==", + "dev": true, + "dependencies": { + "eventemitter3": "^4.0.0", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9", + "websocket": "^1.0.31" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-providers-ws/node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, + "node_modules/web3-shh": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.9.tgz", + "integrity": "sha512-PWa8b/EaxaMinFaxy6cV0i0EOi2M7a/ST+9k9nhyhCjVa2vzXuNoBNo2IUOmeZ0WP2UQB8ByJ2+p4htlJaDOjA==", + "dev": true, + "dependencies": { + "web3-core": "1.2.9", + "web3-core-method": "1.2.9", + "web3-core-subscriptions": "1.2.9", + "web3-net": "1.2.9" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.3.1.tgz", + "integrity": "sha512-9gPwFm8SXtIJuzdrZ37PRlalu40fufXxo+H2PiCwaO6RpKGAvlUlWU0qQbyToFNXg7W2H8djEgoAVac8NLMCKQ==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "eth-lib": "0.2.8", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-utils/node_modules/eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3/node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/web3/node_modules/eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "dependencies": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "node_modules/web3/node_modules/web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "dependencies": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/websocket": { + "version": "1.0.33", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.33.tgz", + "integrity": "sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA==", + "dev": true, + "dependencies": { + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/websocket/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/websocket/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "dependencies": { + "mkdirp": "^0.5.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "dev": true, + "dependencies": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + } + }, + "node_modules/xhr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", + "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", + "dev": true, + "dependencies": { + "global": "~4.4.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/xhr-request": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", + "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", + "dev": true, + "dependencies": { + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" + } + }, + "node_modules/xhr-request-promise": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz", + "integrity": "sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==", + "dev": true, + "dependencies": { + "xhr-request": "^1.1.0" + } + }, + "node_modules/xhr2-cookies": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", + "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", + "dev": true, + "dependencies": { + "cookiejar": "^2.1.1" + } + }, + "node_modules/xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "dev": true, + "engines": { + "node": ">=0.10.32" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/zeppelin-solidity": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/zeppelin-solidity/-/zeppelin-solidity-1.12.0.tgz", + "integrity": "sha512-dgjPPnTmx14hAbTeOpTKemDeDCDdwglS0nquOAJG8h5o9zlb43FZafQSrMlIUUSp1EisDZfehrp5loGEYXHZBA==" + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@ethersproject/abi": { + "version": "5.0.0-beta.153", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz", + "integrity": "sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg==", + "dev": true, + "requires": { + "@ethersproject/address": ">=5.0.0-beta.128", + "@ethersproject/bignumber": ">=5.0.0-beta.130", + "@ethersproject/bytes": ">=5.0.0-beta.129", + "@ethersproject/constants": ">=5.0.0-beta.128", + "@ethersproject/hash": ">=5.0.0-beta.128", + "@ethersproject/keccak256": ">=5.0.0-beta.127", + "@ethersproject/logger": ">=5.0.0-beta.129", + "@ethersproject/properties": ">=5.0.0-beta.131", + "@ethersproject/strings": ">=5.0.0-beta.130" + } + }, + "@ethersproject/abstract-provider": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.0.8.tgz", + "integrity": "sha512-fqJXkewcGdi8LogKMgRyzc/Ls2js07yor7+g9KfPs09uPOcQLg7cc34JN+lk34HH9gg2HU0DIA5797ZR8znkfw==", + "dev": true, + "requires": { + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/networks": "^5.0.7", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/transactions": "^5.0.9", + "@ethersproject/web": "^5.0.12" + } + }, + "@ethersproject/abstract-signer": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.0.11.tgz", + "integrity": "sha512-RKOgPSEYafknA62SrD3OCK42AllHE4YBfKYXyQeM+sBP7Nq3X5FpzeoY4uzC43P4wIhmNoTHCKQuwnX7fBqb6Q==", + "dev": true, + "requires": { + "@ethersproject/abstract-provider": "^5.0.8", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7" + } + }, + "@ethersproject/address": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.0.9.tgz", + "integrity": "sha512-gKkmbZDMyGbVjr8nA5P0md1GgESqSGH7ILIrDidPdNXBl4adqbuA3OAuZx/O2oGpL6PtJ9BDa0kHheZ1ToHU3w==", + "dev": true, + "requires": { + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/rlp": "^5.0.7" + } + }, + "@ethersproject/base64": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.0.7.tgz", + "integrity": "sha512-S5oh5DVfCo06xwJXT8fQC68mvJfgScTl2AXvbYMsHNfIBTDb084Wx4iA9MNlEReOv6HulkS+gyrUM/j3514rSw==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.0.9" + } + }, + "@ethersproject/bignumber": { + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.0.13.tgz", + "integrity": "sha512-b89bX5li6aK492yuPP5mPgRVgIxxBP7ksaBtKX5QQBsrZTpNOjf/MR4CjcUrAw8g+RQuD6kap9lPjFgY4U1/5A==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "bn.js": "^4.4.0" + } + }, + "@ethersproject/bytes": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.0.9.tgz", + "integrity": "sha512-k+17ZViDtAugC0s7HM6rdsTWEdIYII4RPCDkPEuxKc6i40Bs+m6tjRAtCECX06wKZnrEoR9pjOJRXHJ/VLoOcA==", + "dev": true, + "requires": { + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/constants": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.0.8.tgz", + "integrity": "sha512-sCc73pFBsl59eDfoQR5OCEZCRv5b0iywadunti6MQIr5lt3XpwxK1Iuzd8XSFO02N9jUifvuZRrt0cY0+NBgTg==", + "dev": true, + "requires": { + "@ethersproject/bignumber": "^5.0.13" + } + }, + "@ethersproject/hash": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.0.10.tgz", + "integrity": "sha512-Tf0bvs6YFhw28LuHnhlDWyr0xfcDxSXdwM4TcskeBbmXVSKLv3bJQEEEBFUcRX0fJuslR3gCVySEaSh7vuMx5w==", + "dev": true, + "requires": { + "@ethersproject/abstract-signer": "^5.0.10", + "@ethersproject/address": "^5.0.9", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/strings": "^5.0.8" + } + }, + "@ethersproject/keccak256": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.0.7.tgz", + "integrity": "sha512-zpUBmofWvx9PGfc7IICobgFQSgNmTOGTGLUxSYqZzY/T+b4y/2o5eqf/GGmD7qnTGzKQ42YlLNo+LeDP2qe55g==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "js-sha3": "0.5.7" + } + }, + "@ethersproject/logger": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.0.8.tgz", + "integrity": "sha512-SkJCTaVTnaZ3/ieLF5pVftxGEFX56pTH+f2Slrpv7cU0TNpUZNib84QQdukd++sWUp/S7j5t5NW+WegbXd4U/A==", + "dev": true + }, + "@ethersproject/networks": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.0.7.tgz", + "integrity": "sha512-dI14QATndIcUgcCBL1c5vUr/YsI5cCHLN81rF7PU+yS7Xgp2/Rzbr9+YqpC6NBXHFUASjh6GpKqsVMpufAL0BQ==", + "dev": true, + "requires": { + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/properties": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.0.7.tgz", + "integrity": "sha512-812H1Rus2vjw0zbasfDI1GLNPDsoyX1pYqiCgaR1BuyKxUTbwcH1B+214l6VGe1v+F6iEVb7WjIwMjKhb4EUsg==", + "dev": true, + "requires": { + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/rlp": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.0.7.tgz", + "integrity": "sha512-ulUTVEuV7PT4jJTPpfhRHK57tkLEDEY9XSYJtrSNHOqdwMvH0z7BM2AKIMq4LVDlnu4YZASdKrkFGEIO712V9w==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/signing-key": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.0.8.tgz", + "integrity": "sha512-YKxQM45eDa6WAD+s3QZPdm1uW1MutzVuyoepdRRVmMJ8qkk7iOiIhUkZwqKLNxKzEJijt/82ycuOREc9WBNAKg==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "elliptic": "6.5.3" + } + }, + "@ethersproject/strings": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.0.8.tgz", + "integrity": "sha512-5IsdXf8tMY8QuHl8vTLnk9ehXDDm6x9FB9S9Og5IA1GYhLe5ZewydXSjlJlsqU2t9HRbfv97OJZV/pX8DVA/Hw==", + "dev": true, + "requires": { + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/constants": "^5.0.8", + "@ethersproject/logger": "^5.0.8" + } + }, + "@ethersproject/transactions": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.0.9.tgz", + "integrity": "sha512-0Fu1yhdFBkrbMjenEr+39tmDxuHmaw0pe9Jb18XuKoItj7Z3p7+UzdHLr2S/okvHDHYPbZE5gtANDdQ3ZL1nBA==", + "dev": true, + "requires": { + "@ethersproject/address": "^5.0.9", + "@ethersproject/bignumber": "^5.0.13", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/constants": "^5.0.8", + "@ethersproject/keccak256": "^5.0.7", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/rlp": "^5.0.7", + "@ethersproject/signing-key": "^5.0.8" + } + }, + "@ethersproject/web": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.0.12.tgz", + "integrity": "sha512-gVxS5iW0bgidZ76kr7LsTxj4uzN5XpCLzvZrLp8TP+4YgxHfCeetFyQkRPgBEAJdNrexdSBayvyJvzGvOq0O8g==", + "dev": true, + "requires": { + "@ethersproject/base64": "^5.0.7", + "@ethersproject/bytes": "^5.0.9", + "@ethersproject/logger": "^5.0.8", + "@ethersproject/properties": "^5.0.7", + "@ethersproject/strings": "^5.0.8" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", + "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.4", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", + "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", + "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.4", + "fastq": "^1.6.0" + } + }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@solidity-parser/parser": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.11.0.tgz", + "integrity": "sha512-IaC4IaW8uoOB8lmEkw6c19y1vJBK/+7SzAbGQ+LmBYRPXSLNB+UgpORvmcAJEXhB04kWKyz/Os1U8onqm6U/+w==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@truffle/error": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.11.tgz", + "integrity": "sha512-ju6TucjlJkfYMmdraYY/IBJaFb+Sa+huhYtOoyOJ+G29KcgytUVnDzKGwC7Kgk6IsxQMm62Mc1E0GZzFbGGipw==", + "dev": true + }, + "@truffle/interface-adapter": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.18.tgz", + "integrity": "sha512-P9JVSYD/CX3V+NgTWu+Bf71sLh8pMwrCpbiYRB93pRw/1H3ZTvt5iDC2MVvVxCs8FkSiy4OZzQK/DJ8+hXAmYw==", + "dev": true, + "requires": { + "bn.js": "^4.11.8", + "ethers": "^4.0.32", + "source-map-support": "^0.5.19", + "web3": "1.2.9" + } + }, + "@truffle/provider": { + "version": "0.2.25", + "resolved": "https://registry.npmjs.org/@truffle/provider/-/provider-0.2.25.tgz", + "integrity": "sha512-BohKgT2357c2dYCH2IQwldQ4EJkfsWUClpb3j+kR8ng02vbsyAPe0HMH463I+h+tiDKvL757dBltXpe0DBJusg==", + "dev": true, + "requires": { + "@truffle/error": "^0.0.11", + "@truffle/interface-adapter": "^0.4.18", + "web3": "1.2.9" + } + }, + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "14.14.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.21.tgz", + "integrity": "sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==", + "dev": true + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true + }, + "acorn-jsx": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", + "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==", + "dev": true + }, + "address": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz", + "integrity": "sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA==", + "dev": true + }, + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "optional": true + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "antlr4": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.7.1.tgz", + "integrity": "sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bignumber.js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-2.0.0.tgz", + "integrity": "sha1-n8pV5sc+G6XSlL2pmDGA6UfiEZw=", + "dev": true + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", + "dev": true + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "dev": true + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + } + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "dev": true, + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-to-arraybuffer": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz", + "integrity": "sha1-YGSkD6dutDxyOrqe+PbhIW0QURo=", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "bufferutil": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", + "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", + "dev": true, + "requires": { + "node-gyp-build": "^4.2.0" + } + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chai-as-promised": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.1.tgz", + "integrity": "sha512-azL6xMoi+uxu6z4rhWQ1jbdUhOMhis2PvscD/xjLqNMkv3BPPp2JyyuTHOrf9BOosGpNQ11v6BKv/g57RXbiaA==", + "dev": true, + "requires": { + "check-error": "^1.0.2" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "cids": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", + "integrity": "sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "class-is": "^1.1.0", + "multibase": "~0.6.0", + "multicodec": "^1.0.0", + "multihashes": "~0.4.15" + }, + "dependencies": { + "multicodec": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-1.0.4.tgz", + "integrity": "sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg==", + "dev": true, + "requires": { + "buffer": "^5.6.0", + "varint": "^5.0.0" + } + } + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-is": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/class-is/-/class-is-1.1.0.tgz", + "integrity": "sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.18.0.tgz", + "integrity": "sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-hash": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/content-hash/-/content-hash-2.5.2.tgz", + "integrity": "sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw==", + "dev": true, + "requires": { + "cids": "^0.7.1", + "multicodec": "^0.5.5", + "multihashes": "^0.4.15" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "dev": true, + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "death": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", + "integrity": "sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg=", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "requires": { + "type-detect": "^4.0.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "defer-to-connect": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-port": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-1.3.0.tgz", + "integrity": "sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ==", + "dev": true, + "requires": { + "address": "^1.0.1", + "debug": "^2.6.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dom-walk": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", + "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", + "dev": true + }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "dev": true, + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "dev": true, + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + } + } + }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "dependencies": { + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "eth-ens-namehash": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", + "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", + "dev": true, + "requires": { + "idna-uts46-hx": "^2.3.1", + "js-sha3": "^0.5.7" + } + }, + "eth-lib": { + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.1.29.tgz", + "integrity": "sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "nano-json-stream-parser": "^0.1.2", + "servify": "^0.1.12", + "ws": "^3.0.0", + "xhr-request-promise": "^0.1.2" + } + }, + "ethereum-bloom-filters": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.7.tgz", + "integrity": "sha512-cDcJJSJ9GMAcURiAWO3DxIEhTL/uWqlQnvgKpuYQzYPrt/izuGU+1ntQmHt0IRq6ADoSYHFnB+aCEFIldjhkMQ==", + "dev": true, + "requires": { + "js-sha3": "^0.8.0" + }, + "dependencies": { + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true + } + } + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + }, + "dependencies": { + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + } + } + }, + "ethereumjs-common": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", + "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==", + "dev": true + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "dev": true, + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "ethers": { + "version": "4.0.48", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.48.tgz", + "integrity": "sha512-sZD5K8H28dOrcidzx9f8KYh8083n5BexIO3+SbE4jK83L85FxtpXZBCQdXb8gkg+7sBqomcLhhkU7UHL+F7I2g==", + "dev": true, + "requires": { + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.5.3", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.4", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + }, + "ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "dev": true, + "requires": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "dev": true, + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.1.0.tgz", + "integrity": "sha512-G9absDWvhAWCV2gmF1zKud3OyC61nZDwWvBL2DApaVFogI07CprggiQAOOjvp2NRjYWFzPyu7vwtDrQFq8jeSA==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-glob": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", + "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastq": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.10.0.tgz", + "integrity": "sha512-NL2Qc5L3iQEsyYzweq7qfgy5OtXCmGzGvhElGEd/SoFWEMOEczNh5s5ocaF01HDetxz+p8ecjNPA6cZxxIHmzA==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "dev": true, + "requires": { + "minipass": "^2.6.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "ganache-cli": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ganache-cli/-/ganache-cli-6.12.2.tgz", + "integrity": "sha512-bnmwnJDBDsOWBUP8E/BExWf85TsdDEFelQSzihSJm9VChVO1SHp94YXLP5BlA4j/OTxp0wR4R1Tje9OHOuAJVw==", + "dev": true, + "requires": { + "ethereumjs-util": "6.2.1", + "source-map-support": "0.5.12", + "yargs": "13.2.4" + }, + "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "bundled": true, + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", + "bundled": true, + "dev": true + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "bundled": true, + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "bundled": true, + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "bundled": true, + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "bundled": true, + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", + "bundled": true, + "dev": true + }, + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", + "bundled": true, + "dev": true + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "bundled": true, + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "bundled": true, + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "bundled": true, + "dev": true, + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "bundled": true, + "dev": true, + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "bundled": true, + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "bundled": true, + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "bundled": true, + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "bundled": true, + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "bundled": true, + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "bundled": true, + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "bundled": true, + "dev": true + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "bundled": true, + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "bundled": true, + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "bundled": true, + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "bundled": true, + "dev": true + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "bundled": true, + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "bundled": true, + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "bundled": true, + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "bundled": true, + "dev": true, + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "bundled": true, + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "bundled": true, + "dev": true, + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "bundled": true, + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "bundled": true, + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "bundled": true, + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "bundled": true, + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "bundled": true, + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "bundled": true, + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "bundled": true, + "dev": true + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "bundled": true, + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "bundled": true, + "dev": true + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", + "bundled": true, + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "bundled": true, + "dev": true + }, + "keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "bundled": true, + "dev": true, + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "bundled": true, + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "bundled": true, + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "bundled": true, + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "bundled": true, + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "bundled": true, + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "bundled": true, + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "bundled": true, + "dev": true + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "bundled": true, + "dev": true + }, + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "bundled": true, + "dev": true + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "bundled": true, + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "bundled": true, + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "bundled": true, + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "bundled": true, + "dev": true + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "bundled": true, + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "bundled": true, + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "bundled": true, + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "bundled": true, + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "bundled": true, + "dev": true + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "bundled": true, + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "bundled": true, + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "bundled": true, + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "bundled": true, + "dev": true + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "bundled": true, + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "bundled": true, + "dev": true, + "requires": { + "bn.js": "^4.11.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "bundled": true, + "dev": true + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "bundled": true, + "dev": true + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "bundled": true, + "dev": true, + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "bundled": true, + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "bundled": true, + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "bundled": true, + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "bundled": true, + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "bundled": true, + "dev": true + }, + "source-map-support": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "bundled": true, + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "bundled": true, + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "bundled": true, + "dev": true + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "bundled": true, + "dev": true, + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "bundled": true, + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "bundled": true, + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "bundled": true, + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "bundled": true, + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "bundled": true, + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.0" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "ghost-testrpc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", + "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "node-emoji": "^1.10.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", + "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", + "dev": true, + "requires": { + "min-document": "^2.19.0", + "process": "^0.11.10" + } + }, + "global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "requires": { + "global-prefix": "^3.0.0" + } + }, + "global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "requires": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + } + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbol-support-x": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz", + "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==", + "dev": true + }, + "has-to-string-tag-x": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz", + "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==", + "dev": true, + "requires": { + "has-symbol-support-x": "^1.4.1" + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "http-https": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/http-https/-/http-https-1.0.0.tgz", + "integrity": "sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs=", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "idna-uts46-hx": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", + "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", + "dev": true, + "requires": { + "punycode": "2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", + "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=", + "dev": true + } + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-function": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", + "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", + "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-retry-allowed": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "isurl": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz", + "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==", + "dev": true, + "requires": { + "has-to-string-tag-x": "^1.2.0", + "is-object": "^1.0.1" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonschema": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.0.tgz", + "integrity": "sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw==", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "dev": true, + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "lodash": { + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "dev": true + }, + "lodash.toarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", + "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", + "dev": true + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", + "dev": true + }, + "mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "dev": true, + "requires": { + "mime-db": "1.45.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, + "min-document": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "dev": true, + "requires": { + "dom-walk": "^0.1.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "dev": true, + "requires": { + "minipass": "^2.9.0" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mkdirp-promise": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz", + "integrity": "sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE=", + "dev": true, + "requires": { + "mkdirp": "*" + } + }, + "mock-fs": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.13.0.tgz", + "integrity": "sha512-DD0vOdofJdoaRNtnWcrXe6RQbpHkPPmtqGq14uRX0F8ZKJ5nv89CVTYl/BZdppDxBDaV0hl75htg3abpEWlPZA==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "multibase": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.6.1.tgz", + "integrity": "sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw==", + "dev": true, + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + }, + "multicodec": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/multicodec/-/multicodec-0.5.7.tgz", + "integrity": "sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA==", + "dev": true, + "requires": { + "varint": "^5.0.0" + } + }, + "multihashes": { + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/multihashes/-/multihashes-0.4.21.tgz", + "integrity": "sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "multibase": "^0.7.0", + "varint": "^5.0.0" + }, + "dependencies": { + "multibase": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/multibase/-/multibase-0.7.0.tgz", + "integrity": "sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg==", + "dev": true, + "requires": { + "base-x": "^3.0.8", + "buffer": "^5.5.0" + } + } + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "nano-json-stream-parser": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz", + "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true + }, + "node-emoji": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.10.0.tgz", + "integrity": "sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==", + "dev": true, + "requires": { + "lodash.toarray": "^4.4.0" + } + }, + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, + "number-to-bn": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", + "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", + "dev": true, + "requires": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "oboe": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/oboe/-/oboe-2.1.4.tgz", + "integrity": "sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY=", + "dev": true, + "requires": { + "http-https": "^1.0.0" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "openzeppelin-solidity": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-3.2.0.tgz", + "integrity": "sha512-ku9dZbpo63P1OOGvU1FflRlAxcxWauKhex+a7W0vbfjLzItaCQkZEiDedsH2TWJrg4xdo0B/BFS9taeVwKvAxw==", + "dev": true + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-timeout": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz", + "integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=", + "dev": true, + "requires": { + "p-finally": "^1.0.0" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-headers": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", + "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true, + "optional": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "dev": true, + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + }, + "query-string": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz", + "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==", + "dev": true, + "requires": { + "decode-uri-component": "^0.2.0", + "object-assign": "^4.1.0", + "strict-uri-encode": "^1.0.0" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "^1.1.6" + } + }, + "recursive-readdir": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "dev": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "dev": true, + "requires": { + "bn.js": "^4.11.1" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "run-parallel": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", + "dev": true + }, + "rxjs": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", + "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sc-istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.5.tgz", + "integrity": "sha512-7wR5EZFLsC4w0wSm9BUuCgW+OGKAU7PNlW5L0qwVPbh+Q1sfVn2fyzfMXYCm6rkNA5ipaCOt94nApcguQwF5Gg==", + "dev": true, + "requires": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "scrypt-js": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", + "dev": true + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", "dev": true, "requires": { - "is-arrayish": "^0.2.1" + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" } }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, - "eslint": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", - "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.9.1", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^3.0.0", - "eslint-scope": "^4.0.3", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.1", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "inquirer": "^6.2.2", - "js-yaml": "^3.13.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.11", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.2.3", - "text-table": "^0.2.0" + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" }, "dependencies": { - "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true } } }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "dev": true, "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" } }, - "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "servify": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/servify/-/servify-0.1.12.tgz", + "integrity": "sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" + "body-parser": "^1.16.0", + "cors": "^2.8.1", + "express": "^4.14.0", + "request": "^2.79.0", + "xhr": "^2.3.3" } }, - "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", "dev": true }, - "espree": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", - "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", - "dev": true, - "requires": { - "acorn": "^6.0.7", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, - "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "estraverse": "^4.1.0" + "shebang-regex": "^1.0.0" } }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "shelljs": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", "dev": true, "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" } }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", "dev": true }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "dev": true, + "requires": { + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { - "escape-string-regexp": "^1.0.5" + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" } }, - "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "solhint": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-2.3.0.tgz", + "integrity": "sha512-2yiELLp+MsDtuOTrjc14lgsYmlMchp++SicvqCBu01VXsi9Mk2uynhyN3nBfbGzYq1YfmOEBpUqJfFYXVAR/Ig==", "dev": true, "requires": { - "flat-cache": "^2.0.1" + "ajv": "^6.6.1", + "antlr4": "4.7.1", + "chalk": "^2.4.2", + "commander": "2.18.0", + "cosmiconfig": "^5.0.7", + "eslint": "^5.6.0", + "fast-diff": "^1.1.2", + "glob": "^7.1.3", + "ignore": "^4.0.6", + "js-yaml": "^3.12.0", + "lodash": "^4.17.11", + "prettier": "^1.14.3", + "semver": "^6.3.0" } }, - "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "solidity-coverage": { + "version": "0.7.14", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.7.14.tgz", + "integrity": "sha512-2X9oNtu4yBbtDXtVe2tc9vYHtwON6QRqNvVylKdkhcJgAdCzP/OkJy9fWcWH/g3fnNCIOFssHoe0LPGZ2ppMZg==", "dev": true, "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" + "@solidity-parser/parser": "^0.11.0", + "@truffle/provider": "^0.2.24", + "chalk": "^2.4.2", + "death": "^1.1.0", + "detect-port": "^1.3.0", + "fs-extra": "^8.1.0", + "ganache-cli": "^6.11.0", + "ghost-testrpc": "^0.0.2", + "global-modules": "^2.0.0", + "globby": "^10.0.1", + "jsonschema": "^1.2.4", + "lodash": "^4.17.15", + "node-emoji": "^1.10.0", + "pify": "^4.0.1", + "recursive-readdir": "^2.2.2", + "sc-istanbul": "^0.4.5", + "semver": "^7.3.4", + "shelljs": "^0.8.3", + "web3-utils": "^1.3.0" + }, + "dependencies": { + "semver": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", + "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, - "flatted": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", - "dev": true + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" } }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } }, - "import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", "dev": true, "requires": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" + "is-hex-prefixed": "1.0.0" } }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" + "has-flag": "^3.0.0" } }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "swarm-js": { + "version": "0.1.40", + "resolved": "https://registry.npmjs.org/swarm-js/-/swarm-js-0.1.40.tgz", + "integrity": "sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA==", + "dev": true, + "requires": { + "bluebird": "^3.5.0", + "buffer": "^5.0.5", + "eth-lib": "^0.1.26", + "fs-extra": "^4.0.2", + "got": "^7.1.0", + "mime-types": "^2.1.16", + "mkdirp-promise": "^5.0.1", + "mock-fs": "^4.1.0", + "setimmediate": "^1.0.5", + "tar": "^4.0.2", + "xhr-request": "^1.0.1" + }, + "dependencies": { + "fs-extra": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", + "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "got": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/got/-/got-7.1.0.tgz", + "integrity": "sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw==", + "dev": true, + "requires": { + "decompress-response": "^3.2.0", + "duplexer3": "^0.1.4", + "get-stream": "^3.0.0", + "is-plain-obj": "^1.1.0", + "is-retry-allowed": "^1.0.0", + "is-stream": "^1.0.0", + "isurl": "^1.0.0-alpha5", + "lowercase-keys": "^1.0.0", + "p-cancelable": "^0.3.0", + "p-timeout": "^1.1.1", + "safe-buffer": "^5.0.1", + "timed-out": "^4.0.0", + "url-parse-lax": "^1.0.0", + "url-to-options": "^1.0.1" + } + }, + "p-cancelable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", + "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", + "dev": true, + "requires": { + "prepend-http": "^1.0.1" + } + } + } }, - "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" }, "dependencies": { "ansi-regex": { @@ -587,6 +12804,17 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -598,491 +12826,1058 @@ } } }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-directory": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" } }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=", "dev": true }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "os-tmpdir": "~1.0.2" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "minimist": "0.0.8" + "is-number": "^7.0.0" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "dev": true, "requires": { - "wrappy": "1" + "psl": "^1.1.28", + "punycode": "^2.1.1" } }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "dev": true, "requires": { - "mimic-fn": "^1.0.0" + "safe-buffer": "^5.0.1" } }, - "openzeppelin-solidity": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/openzeppelin-solidity/-/openzeppelin-solidity-3.2.0.tgz", - "integrity": "sha512-ku9dZbpo63P1OOGvU1FflRlAxcxWauKhex+a7W0vbfjLzItaCQkZEiDedsH2TWJrg4xdo0B/BFS9taeVwKvAxw==", + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "prelude-ls": "~1.1.2" } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, "requires": { - "callsites": "^3.0.0" - }, - "dependencies": { - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - } + "media-typer": "0.3.0", + "mime-types": "~2.1.24" } }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "is-typedarray": "^1.0.0" } }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "uglify-js": { + "version": "3.12.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.12.4.tgz", + "integrity": "sha512-L5i5jg/SHkEqzN18gQMTWsZk3KelRsfD1wUVNqtq0kzqWQqcJjyL8yc1o8hJgRrWqrAl2mUFbhfznEIoi7zi2A==", + "dev": true, + "optional": true + }, + "ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", "dev": true }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", "dev": true }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, - "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, - "optional": true + "requires": { + "punycode": "^2.1.0" + } }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" + } + }, + "url-set-query": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz", + "integrity": "sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk=", "dev": true }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "url-to-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz", + "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=", "dev": true }, - "regexpp": { + "utf-8-validate": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz", + "integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==", + "dev": true, + "requires": { + "node-gyp-build": "^4.2.0" + } + }, + "utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", "dev": true }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "varint": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", + "integrity": "sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow==", "dev": true }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "dev": true, "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" } }, - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "web3": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3/-/web3-1.2.9.tgz", + "integrity": "sha512-Mo5aBRm0JrcNpN/g4VOrDzudymfOnHRC3s2VarhYxRA8aWgF5rnhQ0ziySaugpic1gksbXPe105pUWyRqw8HUA==", "dev": true, "requires": { - "glob": "^7.1.3" + "web3-bzz": "1.2.9", + "web3-core": "1.2.9", + "web3-eth": "1.2.9", + "web3-eth-personal": "1.2.9", + "web3-net": "1.2.9", + "web3-shh": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "web3-bzz": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-bzz/-/web3-bzz-1.2.9.tgz", + "integrity": "sha512-ogVQr9jHodu9HobARtvUSmWG22cv2EUQzlPeejGWZ7j5h20HX40EDuWyomGY5VclIj5DdLY76Tmq88RTf/6nxA==", "dev": true, "requires": { - "is-promise": "^2.1.0" + "@types/node": "^10.12.18", + "got": "9.6.0", + "swarm-js": "^0.1.40", + "underscore": "1.9.1" + }, + "dependencies": { + "@types/node": { + "version": "10.17.51", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.51.tgz", + "integrity": "sha512-KANw+MkL626tq90l++hGelbl67irOJzGhUJk6a1Bt8QHOeh9tztJx+L0AqttraWKinmZn7Qi5lJZJzx45Gq0dg==", + "dev": true + } } }, - "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", + "web3-core": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core/-/web3-core-1.2.9.tgz", + "integrity": "sha512-fSYv21IP658Ty2wAuU9iqmW7V+75DOYMVZsDH/c14jcF/1VXnedOcxzxSj3vArsCvXZNe6XC5/wAuGZyQwR9RA==", "dev": true, "requires": { - "tslib": "^1.9.0" + "@types/bn.js": "^4.11.4", + "@types/node": "^12.6.1", + "bignumber.js": "^9.0.0", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-core-requestmanager": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "@types/node": { + "version": "12.19.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.14.tgz", + "integrity": "sha512-2U9uLN46+7dv9PiS8VQJcHhuoOjiDPZOLAt0WuA1EanEknIMae+2QbMhayF7cgGqjvRVIfNpt+6jLPczJZFiRw==", + "dev": true + }, + "bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "web3-core-helpers": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-helpers/-/web3-core-helpers-1.2.9.tgz", + "integrity": "sha512-t0WAG3orLCE3lqi77ZoSRNFok3VQWZXTniZigDQjyOJYMAX7BU3F3js8HKbjVnAxlX3tiKoDxI0KBk9F3AxYuw==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-eth-iban": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "web3-core-method": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-method/-/web3-core-method-1.2.9.tgz", + "integrity": "sha512-bjsIoqP3gs7A/gP8+QeLUCyOKJ8bopteCSNbCX36Pxk6TYfYWNuC6hP+2GzUuqdP3xaZNe+XEElQFUNpR3oyAg==", + "dev": true, + "requires": { + "@ethersproject/transactions": "^5.0.0-beta.135", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9", + "web3-core-promievent": "1.2.9", + "web3-core-subscriptions": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "web3-core-promievent": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-promievent/-/web3-core-promievent-1.2.9.tgz", + "integrity": "sha512-0eAUA2zjgXTleSrnc1wdoKQPPIHU6KHf4fAscu4W9kKrR+mqP1KsjYrxY9wUyjNnXxfQ+5M29ipvbiaK8OqdOw==", "dev": true, "requires": { - "shebang-regex": "^1.0.0" + "eventemitter3": "3.1.2" } }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true + "web3-core-requestmanager": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-requestmanager/-/web3-core-requestmanager-1.2.9.tgz", + "integrity": "sha512-1PwKV2m46ALUnIN5VPPgjOj8yMLJhhqZYvYJE34hTN5SErOkwhzx5zScvo5MN7v7KyQGFnpVCZKKGCiEnDmtFA==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9", + "web3-providers-http": "1.2.9", + "web3-providers-ipc": "1.2.9", + "web3-providers-ws": "1.2.9" + } }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "web3-core-subscriptions": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-core-subscriptions/-/web3-core-subscriptions-1.2.9.tgz", + "integrity": "sha512-Y48TvXPSPxEM33OmXjGVDMzTd0j8X0t2+sDw66haeBS8eYnrEzasWuBZZXDq0zNUsqyxItgBGDn+cszkgEnFqg==", + "dev": true, + "requires": { + "eventemitter3": "3.1.2", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9" + } + }, + "web3-eth": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth/-/web3-eth-1.2.9.tgz", + "integrity": "sha512-sIKO4iE9FEBa/CYUd6GdPd7GXt/wISqxUd8PlIld6+hvMJj02lgO7Z7p5T9mZIJcIZJGvZX81ogx8oJ9yif+Ag==", + "dev": true, + "requires": { + "underscore": "1.9.1", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-core-subscriptions": "1.2.9", + "web3-eth-abi": "1.2.9", + "web3-eth-accounts": "1.2.9", + "web3-eth-contract": "1.2.9", + "web3-eth-ens": "1.2.9", + "web3-eth-iban": "1.2.9", + "web3-eth-personal": "1.2.9", + "web3-net": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } }, - "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "web3-eth-abi": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.2.9.tgz", + "integrity": "sha512-3YwUYbh/DMfDbhMWEebAdjSd5bj3ZQieOjLzWFHU23CaLEqT34sUix1lba+hgUH/EN6A7bKAuKOhR3p0OvTn7Q==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "@ethersproject/abi": "5.0.0-beta.153", + "underscore": "1.9.1", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "solhint": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-2.3.0.tgz", - "integrity": "sha512-2yiELLp+MsDtuOTrjc14lgsYmlMchp++SicvqCBu01VXsi9Mk2uynhyN3nBfbGzYq1YfmOEBpUqJfFYXVAR/Ig==", + "web3-eth-accounts": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-accounts/-/web3-eth-accounts-1.2.9.tgz", + "integrity": "sha512-jkbDCZoA1qv53mFcRHCinoCsgg8WH+M0YUO1awxmqWXRmCRws1wW0TsuSQ14UThih5Dxolgl+e+aGWxG58LMwg==", "dev": true, "requires": { - "ajv": "^6.6.1", - "antlr4": "4.7.1", - "chalk": "^2.4.2", - "commander": "2.18.0", - "cosmiconfig": "^5.0.7", - "eslint": "^5.6.0", - "fast-diff": "^1.1.2", - "glob": "^7.1.3", - "ignore": "^4.0.6", - "js-yaml": "^3.12.0", - "lodash": "^4.17.11", - "prettier": "^1.14.3", - "semver": "^6.3.0" + "crypto-browserify": "3.12.0", + "eth-lib": "^0.2.8", + "ethereumjs-common": "^1.3.2", + "ethereumjs-tx": "^2.1.1", + "scrypt-js": "^3.0.1", + "underscore": "1.9.1", + "uuid": "3.3.2", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } + } + } } }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "web3-eth-contract": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-contract/-/web3-eth-contract-1.2.9.tgz", + "integrity": "sha512-PYMvJf7EG/HyssUZa+pXrc8IB06K/YFfWYyW4R7ed3sab+9wWUys1TlWxBCBuiBXOokSAyM6H6P6/cKEx8FT8Q==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "@types/bn.js": "^4.11.4", + "underscore": "1.9.1", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-core-promievent": "1.2.9", + "web3-core-subscriptions": "1.2.9", + "web3-eth-abi": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "web3-eth-ens": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-ens/-/web3-eth-ens-1.2.9.tgz", + "integrity": "sha512-kG4+ZRgZ8I1WYyOBGI8QVRHfUSbbJjvJAGA1AF/NOW7JXQ+x7gBGeJw6taDWJhSshMoEKWcsgvsiuoG4870YxQ==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "content-hash": "^2.5.2", + "eth-ens-namehash": "2.0.8", + "underscore": "1.9.1", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-promievent": "1.2.9", + "web3-eth-abi": "1.2.9", + "web3-eth-contract": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "web3-eth-iban": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-iban/-/web3-eth-iban-1.2.9.tgz", + "integrity": "sha512-RtdVvJE0pyg9dHLy0GzDiqgnLnssSzfz/JYguhC1wsj9+Gnq1M6Diy3NixACWUAp6ty/zafyOaZnNQ+JuH9TjQ==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "web3-utils": "1.2.9" + }, + "dependencies": { + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } + } }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "web3-eth-personal": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.2.9.tgz", + "integrity": "sha512-cFiNrktxZ1C/rIdJFzQTvFn3/0zcsR3a+Jf8Y3KxeQDHszQtosjLWptP7bsUmDwEh4hzh0Cy3KpOxlYBWB8bJQ==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "@types/node": "^12.6.1", + "web3-core": "1.2.9", + "web3-core-helpers": "1.2.9", + "web3-core-method": "1.2.9", + "web3-net": "1.2.9", + "web3-utils": "1.2.9" + }, + "dependencies": { + "@types/node": { + "version": "12.19.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.14.tgz", + "integrity": "sha512-2U9uLN46+7dv9PiS8VQJcHhuoOjiDPZOLAt0WuA1EanEknIMae+2QbMhayF7cgGqjvRVIfNpt+6jLPczJZFiRw==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + }, + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + } + } } }, - "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "web3-net": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-net/-/web3-net-1.2.9.tgz", + "integrity": "sha512-d2mTn8jPlg+SI2hTj2b32Qan6DmtU9ap/IUlJTeQbZQSkTLf0u9suW8Vjwyr4poJYXTurdSshE7OZsPNn30/ZA==", "dev": true, "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "web3-core": "1.2.9", + "web3-core-method": "1.2.9", + "web3-utils": "1.2.9" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "eth-lib": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", + "integrity": "sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco=", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" } }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "web3-utils": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.2.9.tgz", + "integrity": "sha512-9hcpuis3n/LxFzEVjwnVgvJzTirS2S9/MiNAa7l4WOEoywY+BSNwnRX4MuHnjkh9NY25B6QOjuNG6FNnSjTw1w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "bn.js": "4.11.8", + "eth-lib": "0.2.7", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" } } } }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true + "web3-providers-http": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-providers-http/-/web3-providers-http-1.2.9.tgz", + "integrity": "sha512-F956tCIj60Ttr0UvEHWFIhx+be3He8msoPzyA44/kfzzYoMAsCFRn5cf0zQG6al0znE75g6HlWVSN6s3yAh51A==", + "dev": true, + "requires": { + "web3-core-helpers": "1.2.9", + "xhr2-cookies": "1.1.0" + } }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true + "web3-providers-ipc": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-providers-ipc/-/web3-providers-ipc-1.2.9.tgz", + "integrity": "sha512-NQ8QnBleoHA2qTJlqoWu7EJAD/FR5uimf7Ielzk4Z2z+m+6UAuJdJMSuQNj+Umhz9L/Ys6vpS1vHx9NizFl+aQ==", + "dev": true, + "requires": { + "oboe": "2.1.4", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9" + } }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "web3-providers-ws": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-providers-ws/-/web3-providers-ws-1.2.9.tgz", + "integrity": "sha512-6+UpvINeI//dglZoAKStUXqxDOXJy6Iitv2z3dbgInG4zb8tkYl/VBDL80UjUg3ZvzWG0g7EKY2nRPEpON2TFA==", "dev": true, "requires": { - "os-tmpdir": "~1.0.2" + "eventemitter3": "^4.0.0", + "underscore": "1.9.1", + "web3-core-helpers": "1.2.9", + "websocket": "^1.0.31" + }, + "dependencies": { + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + } } }, - "tslib": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", - "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", - "dev": true + "web3-shh": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/web3-shh/-/web3-shh-1.2.9.tgz", + "integrity": "sha512-PWa8b/EaxaMinFaxy6cV0i0EOi2M7a/ST+9k9nhyhCjVa2vzXuNoBNo2IUOmeZ0WP2UQB8ByJ2+p4htlJaDOjA==", + "dev": true, + "requires": { + "web3-core": "1.2.9", + "web3-core-method": "1.2.9", + "web3-core-subscriptions": "1.2.9", + "web3-net": "1.2.9" + } }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "web3-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.3.1.tgz", + "integrity": "sha512-9gPwFm8SXtIJuzdrZ37PRlalu40fufXxo+H2PiCwaO6RpKGAvlUlWU0qQbyToFNXg7W2H8djEgoAVac8NLMCKQ==", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "bn.js": "^4.11.9", + "eth-lib": "0.2.8", + "ethereum-bloom-filters": "^1.0.6", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "underscore": "1.9.1", + "utf8": "3.0.0" + }, + "dependencies": { + "eth-lib": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", + "integrity": "sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw==", + "dev": true, + "requires": { + "bn.js": "^4.11.6", + "elliptic": "^6.4.0", + "xhr-request-promise": "^0.1.2" + } + } } }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "websocket": { + "version": "1.0.33", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.33.tgz", + "integrity": "sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA==", "dev": true, "requires": { - "punycode": "^2.1.0" + "bufferutil": "^4.0.1", + "debug": "^2.2.0", + "es5-ext": "^0.10.50", + "typedarray-to-buffer": "^3.1.5", + "utf-8-validate": "^5.0.2", + "yaeti": "^0.0.6" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, "which": { @@ -1100,6 +13895,12 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1115,6 +13916,86 @@ "mkdirp": "^0.5.1" } }, + "ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + } + }, + "xhr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", + "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", + "dev": true, + "requires": { + "global": "~4.4.0", + "is-function": "^1.0.1", + "parse-headers": "^2.0.0", + "xtend": "^4.0.0" + } + }, + "xhr-request": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz", + "integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==", + "dev": true, + "requires": { + "buffer-to-arraybuffer": "^0.0.5", + "object-assign": "^4.1.1", + "query-string": "^5.0.1", + "simple-get": "^2.7.0", + "timed-out": "^4.0.1", + "url-set-query": "^1.0.0", + "xhr": "^2.0.4" + } + }, + "xhr-request-promise": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz", + "integrity": "sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg==", + "dev": true, + "requires": { + "xhr-request": "^1.1.0" + } + }, + "xhr2-cookies": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz", + "integrity": "sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg=", + "dev": true, + "requires": { + "cookiejar": "^2.1.1" + } + }, + "xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "yaeti": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, "zeppelin-solidity": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/zeppelin-solidity/-/zeppelin-solidity-1.12.0.tgz", diff --git a/package.json b/package.json index 7660c86..6d6827e 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,13 @@ { "dependencies": { + "chai": "^4.2.0", "zeppelin-solidity": "^1.12.0" }, "devDependencies": { + "bignumber.js": "2.0.0", + "chai-as-promised": "^7.1.1", "openzeppelin-solidity": "^3.2.0", - "solhint": "^2.3.0" + "solhint": "^2.3.0", + "solidity-coverage": "^0.7.13" } } diff --git a/truffle-config.js b/truffle-config.js index 009a87c..4793fb9 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -95,5 +95,6 @@ module.exports = { // evmVersion: "byzantium" // } } - } + }, + plugins: ["solidity-coverage"] } From f00f2323406bf2c3b7405f9352fde65e17a03be9 Mon Sep 17 00:00:00 2001 From: Hancheng Zhou Date: Wed, 20 Jan 2021 08:51:56 +0800 Subject: [PATCH 26/28] Add prettier for test --- .prettierignore | 167 ++++++++++++ .prettierrc | 7 + package-lock.json | 5 +- package.json | 4 + test/Testrp.js | 672 +++++++++++++++++++++++++++------------------- 5 files changed, 577 insertions(+), 278 deletions(-) create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..a6ddfcf --- /dev/null +++ b/.prettierignore @@ -0,0 +1,167 @@ +.github/ +package.json +package-lock.json + +# VSCode personal settings +.vscode/launch.json +.vscode/tasks.json + +# JetBrain personal settings +.idea + +# testing +/reports +/junit.xml + +# Build out +dist/* +/build +/storybook-static +/Maskbook.*.zip + +# Environment files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Block-chain contract files +/contracts + +# E2E tests +/.env/e2e-test +/.env/e2e-development +/.env/e2e-production +/.pptr-alice +/.pptr-bob +/screenshots +/.env +/.pptr-* + +# Temp profiles +.firefox +.chrome + +# Following content is copied from https://github.com/github/gitignore/blob/master/Node.gitignore +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# Rush temporary files +common/deploy/ +common/temp/ +common/autoinstallers/*/.npmrc +**/.rush/temp/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..043fedf --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "trailingComma": "all", + "printWidth": 120, + "semi": false, + "singleQuote": true, + "jsxBracketSameLine": true +} diff --git a/package-lock.json b/package-lock.json index f184ee6..17552b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "bignumber.js": "2.0.0", "chai-as-promised": "^7.1.1", "openzeppelin-solidity": "^3.2.0", + "prettier": "^1.19.1", "solhint": "^2.3.0", "solidity-coverage": "^0.7.13" } @@ -5329,7 +5330,6 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", "dev": true, - "optional": true, "bin": { "prettier": "bin-prettier.js" }, @@ -11984,8 +11984,7 @@ "version": "1.19.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", - "dev": true, - "optional": true + "dev": true }, "process": { "version": "0.11.10", diff --git a/package.json b/package.json index 6d6827e..b2fb7f2 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,14 @@ "chai": "^4.2.0", "zeppelin-solidity": "^1.12.0" }, + "scripts": { + "format:test": "prettier --write ./test/**.js" + }, "devDependencies": { "bignumber.js": "2.0.0", "chai-as-promised": "^7.1.1", "openzeppelin-solidity": "^3.2.0", + "prettier": "^1.19.1", "solhint": "^2.3.0", "solidity-coverage": "^0.7.13" } diff --git a/test/Testrp.js b/test/Testrp.js index f407b88..713d271 100644 --- a/test/Testrp.js +++ b/test/Testrp.js @@ -1,275 +1,397 @@ -const TestToken = artifacts.require("TestToken"); -const Test721Token = artifacts.require("Test721Token"); -const HappyRedPacket = artifacts.require("HappyRedPacket"); -var testtoken; -var test721token; -var redpacket; -var redpacket_id; -var _total_tokens - -contract("TestToken", accounts => { - beforeEach(async () =>{ - console.log("Before ALL\n"); - testtoken = await TestToken.deployed(); - redpacket = await HappyRedPacket.deployed(); - _total_tokens = 101; - }); - - 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 = 1; - const token_address = testtoken.address; - const token_ids = []; - const total_tokens = _total_tokens; - - const creation_success_encode = 'CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256[])'; - const creation_success_types = ['uint256', 'bytes32', 'string', 'string','address', 'uint256', 'address', 'uint256[]']; - - await testtoken.approve.sendTransaction(redpacket.address, total_tokens); - const creation_receipt = await redpacket.create_red_packet - .sendTransaction(hashes[0], number, true, duration, seed, msg, - name, token_type, token_address, total_tokens, token_ids); - const logs = await web3.eth.getPastLogs({address: redpacket.address, topics: [web3.utils.sha3(creation_success_encode)]}); - redpacket_id = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data)['1']; - assert.notEqual(redpacket_id, null); - }); - - it("Should 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)"; - const claim_success_types = ['bytes32', 'address', 'uint256', 'address']; - - // 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(web3.eth.abi.decodeParameters(claim_success_types, logs[0].data)); - - // 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(web3.eth.abi.decodeParameters(claim_success_types, logs2[0].data)); - - // 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(web3.eth.abi.decodeParameters(claim_success_types, logs3[0].data)); - - // Check Availability - returned = await redpacket.check_availability.call(rp_id, {'from': recipient3}); - assert.equal(returned.ifclaimed, true); - - // Check balance - const balance1 = await testtoken.balanceOf.call(recipient1, {'from':recipient1}); - const balance2 = await testtoken.balanceOf.call(recipient2, {'from':recipient2}); - const balance3 = await testtoken.balanceOf.call(recipient3, {'from':recipient3}); - const balance4 = await testtoken.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) - - }); - -}); -contract("TestToken", accounts => { - beforeEach(async () =>{ - console.log("Before ALL\n"); - testtoken = await TestToken.deployed(); - redpacket = await HappyRedPacket.deployed(); - _total_tokens = 101; - }); - - 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 = 0; - 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,string,string,address,uint256,address,uint256[])'; - const creation_success_types = ['uint256', 'bytes32', 'string', 'string','address', 'uint256', 'address', 'uint256[]']; - - await testtoken.approve.sendTransaction(redpacket.address, total_tokens); - const creation_receipt = await redpacket.create_red_packet - .sendTransaction(hashes[0], number, true, duration, seed, msg, - name, token_type, token_address, total_tokens, token_ids); - const logs = await web3.eth.getPastLogs({address: redpacket.address, topics: [web3.utils.sha3(creation_success_encode)]}); - redpacket_id = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data)['1']; - assert.notEqual(redpacket_id, null); - }); - - it("Should refund the red packets.", async () => { - const redpacket = await HappyRedPacket.deployed(); - const rp_id = redpacket_id; - - const refund_success_encode = "RefundSuccess(%s,%s,%s)"; - const refund_success_types = ['bytes32', 'address', 'uint256']; - - const refund_receipt = await redpacket.refund.sendTransaction(rp_id, {'from': accounts[0]}); - const logs = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(refund_success_encode)]}); - //console.log(web3.eth.abi.decodeParameters(refund_success_types, logs[0].data)); - }); -}); -contract("Test721Token", accounts => { - beforeEach(async () =>{ - console.log("Before ALL\n"); - test721token = await Test721Token.deployed(); - redpacket = await HappyRedPacket.deployed(); - _total_tokens = 10; - }); - it("Should return the HappyRedPacket contract creator", async () => { - const contract_creator = await redpacket.contract_creator.call(); - assert.equal(contract_creator, accounts[0]); - }); - it("Should return a redpacket id", async () => { - - const passwords = ["1", "2"]; - const hashes = passwords.map(function (pass) { - return web3.utils.sha3(pass); - }); - const name = "cache"; - const msg = "hi"; - const number = 3; - const duration = 1200; - const seed = web3.utils.sha3("lajsdklfjaskldfhaikl"); - const token_type = 2; - const token_address = test721token.address; - // const token_total = await test721token.balanceOf.call(accounts[0]); - const token_total = 5; - const token_ids = []; - for (i=0; i < token_total; i++) { - token_id = await test721token.tokenOfOwnerByIndex.call(accounts[0], i); - token_ids.push(token_id); - } - const total_tokens = token_ids.length; - - const creation_success_encode = 'CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256[])'; - const creation_success_types = ['uint256', 'bytes32', 'string', 'string','address', 'uint256', 'address', 'uint256[]']; - - await test721token.setApprovalForAll.sendTransaction(redpacket.address, true); - const creation_receipt = await redpacket.create_red_packet - .sendTransaction(hashes[0], number, true, duration, seed, msg, - name, token_type, token_address, total_tokens, token_ids); - const logs = await web3.eth.getPastLogs({address: redpacket.address, topics: [web3.utils.sha3(creation_success_encode)]}); - log = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data); - redpacket_id = log['1'] - redpacket_token_ids = log['5']; - assert.notEqual(redpacket_id, null); - assert.notEqual(token_ids, null); - assert.equal(await test721token.balanceOf(redpacket.address), 5) - }); - it("Should allow two users to claim red packets.", async () => { - // const redpacket = await HappyRedPacket.deployed(); - const password = "1"; - const rp_id = redpacket_id; - - const claim_success_encode = "ClaimSuccess(%s,%s,%s,%s)"; - const claim_success_types = ['bytes32', 'address', 'uint256', 'address']; - - // Check Availability - var returned = await redpacket.check_availability.call(rp_id); - assert.equal(returned.ifclaimed, false); - - // 1st - const recipient1 = accounts[1]; - const validation1 = web3.utils.sha3(recipient1); - - const claim_receipt = await redpacket.claim.sendTransaction(rp_id, password, recipient1, validation1, {'from': recipient1}); - const logs = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(claim_success_encode)]}); - - - // Check Availability - returned = await redpacket.check_availability.call(rp_id, {'from': recipient1}); - assert.equal(returned.ifclaimed, true); - - // 2nd - const recipient2 = accounts[2]; - const validation2 = web3.utils.sha3(recipient2); - - const claim_receipt2 = await redpacket.claim.sendTransaction(rp_id, password, recipient2, validation2, {'from':recipient2}); - const logs2 = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(claim_success_encode)]}); - - // Check Availability - returned = await redpacket.check_availability.call(rp_id, {'from': recipient2}); - assert.equal(returned.ifclaimed, true); - - // 3rd - const recipient3 = accounts[3]; - const validation3 = web3.utils.sha3(recipient3); - - const claim_receipt3 = await redpacket.claim.sendTransaction(rp_id, password, recipient3, validation3, {'from':recipient3}); - const logs3 = await web3.eth.getPastLogs({address: redpacket.address, topic: [web3.utils.sha3(claim_success_encode)]}); - // Check Availability - returned = await redpacket.check_availability.call(rp_id, {'from': recipient3}); - assert.equal(returned.ifclaimed, true); - - // Check balance - const balance1 = await test721token.balanceOf.call(recipient1, {'from':recipient1}); - const balance2 = await test721token.balanceOf.call(recipient2, {'from':recipient2}); - const balance3 = await test721token.balanceOf.call(recipient3, {'from':recipient3}); - const balance4 = await test721token.balanceOf.call(accounts[4], {'from':accounts[4]}); - - // Assert - assert.isAbove(Number(balance1), 0); - assert.isAbove(Number(balance2), 0); - assert.isAbove(Number(balance3), 0); - assert.equal(Number(balance4), 0); - // assert.equal(Number(balance1) + Number(balance2) + Number(balance3), _total_tokens) - - }); -}); +const TestToken = artifacts.require('TestToken') +const Test721Token = artifacts.require('Test721Token') +const HappyRedPacket = artifacts.require('HappyRedPacket') +let testtoken +let test721token +let redpacket +let redpacket_id +let _total_tokens + +contract('TestToken', accounts => { + beforeEach(async () => { + console.log('Before ALL\n') + testtoken = await TestToken.deployed() + redpacket = await HappyRedPacket.deployed() + _total_tokens = 101 + }) + + 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 = 1 + const token_address = testtoken.address + const token_ids = [] + const total_tokens = _total_tokens + + const creation_success_encode = 'CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256[])' + const creation_success_types = [ + 'uint256', + 'bytes32', + 'string', + 'string', + 'address', + 'uint256', + 'address', + 'uint256[]', + ] + + await testtoken.approve.sendTransaction(redpacket.address, total_tokens) + const creation_receipt = await redpacket.create_red_packet.sendTransaction( + hashes[0], + number, + true, + duration, + seed, + msg, + name, + token_type, + token_address, + total_tokens, + token_ids, + ) + const logs = await web3.eth.getPastLogs({ + address: redpacket.address, + topics: [web3.utils.sha3(creation_success_encode)], + }) + redpacket_id = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data)['1'] + assert.notEqual(redpacket_id, null) + }) + + it('Should 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)' + const claim_success_types = ['bytes32', 'address', 'uint256', 'address'] + + // Check Availability + let 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(web3.eth.abi.decodeParameters(claim_success_types, logs[0].data)); + + // 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(web3.eth.abi.decodeParameters(claim_success_types, logs2[0].data)); + + // 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(web3.eth.abi.decodeParameters(claim_success_types, logs3[0].data)); + + // Check Availability + returned = await redpacket.check_availability.call(rp_id, { + from: recipient3, + }) + assert.equal(returned.ifclaimed, true) + + // Check balance + const balance1 = await testtoken.balanceOf.call(recipient1, { + from: recipient1, + }) + const balance2 = await testtoken.balanceOf.call(recipient2, { + from: recipient2, + }) + const balance3 = await testtoken.balanceOf.call(recipient3, { + from: recipient3, + }) + const balance4 = await testtoken.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) + }) +}) +contract('TestToken', accounts => { + beforeEach(async () => { + console.log('Before ALL\n') + testtoken = await TestToken.deployed() + redpacket = await HappyRedPacket.deployed() + _total_tokens = 101 + }) + + 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 = 0 + 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,string,string,address,uint256,address,uint256[])' + const creation_success_types = [ + 'uint256', + 'bytes32', + 'string', + 'string', + 'address', + 'uint256', + 'address', + 'uint256[]', + ] + + await testtoken.approve.sendTransaction(redpacket.address, total_tokens) + const creation_receipt = await redpacket.create_red_packet.sendTransaction( + hashes[0], + number, + true, + duration, + seed, + msg, + name, + token_type, + token_address, + total_tokens, + token_ids, + ) + const logs = await web3.eth.getPastLogs({ + address: redpacket.address, + topics: [web3.utils.sha3(creation_success_encode)], + }) + redpacket_id = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data)['1'] + assert.notEqual(redpacket_id, null) + }) + + it('Should refund the red packets.', async () => { + const redpacket = await HappyRedPacket.deployed() + const rp_id = redpacket_id + + const refund_success_encode = 'RefundSuccess(%s,%s,%s)' + const refund_success_types = ['bytes32', 'address', 'uint256'] + + const refund_receipt = await redpacket.refund.sendTransaction(rp_id, { + from: accounts[0], + }) + const logs = await web3.eth.getPastLogs({ + address: redpacket.address, + topic: [web3.utils.sha3(refund_success_encode)], + }) + //console.log(web3.eth.abi.decodeParameters(refund_success_types, logs[0].data)); + }) +}) +contract('Test721Token', accounts => { + beforeEach(async () => { + console.log('Before ALL\n') + test721token = await Test721Token.deployed() + redpacket = await HappyRedPacket.deployed() + _total_tokens = 10 + }) + it('Should return the HappyRedPacket contract creator', async () => { + const contract_creator = await redpacket.contract_creator.call() + assert.equal(contract_creator, accounts[0]) + }) + it('Should return a redpacket id', async () => { + const passwords = ['1', '2'] + const hashes = passwords.map(function(pass) { + return web3.utils.sha3(pass) + }) + const name = 'cache' + const msg = 'hi' + const number = 3 + const duration = 1200 + const seed = web3.utils.sha3('lajsdklfjaskldfhaikl') + const token_type = 2 + const token_address = test721token.address + // const token_total = await test721token.balanceOf.call(accounts[0]); + const token_total = 5 + const token_ids = [] + for (i = 0; i < token_total; i++) { + token_id = await test721token.tokenOfOwnerByIndex.call(accounts[0], i) + token_ids.push(token_id) + } + const total_tokens = token_ids.length + + const creation_success_encode = 'CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256[])' + const creation_success_types = [ + 'uint256', + 'bytes32', + 'string', + 'string', + 'address', + 'uint256', + 'address', + 'uint256[]', + ] + + await test721token.setApprovalForAll.sendTransaction(redpacket.address, true) + const creation_receipt = await redpacket.create_red_packet.sendTransaction( + hashes[0], + number, + true, + duration, + seed, + msg, + name, + token_type, + token_address, + total_tokens, + token_ids, + ) + const logs = await web3.eth.getPastLogs({ + address: redpacket.address, + topics: [web3.utils.sha3(creation_success_encode)], + }) + log = web3.eth.abi.decodeParameters(creation_success_types, logs[0].data) + redpacket_id = log['1'] + redpacket_token_ids = log['5'] + assert.notEqual(redpacket_id, null) + assert.notEqual(token_ids, null) + assert.equal(await test721token.balanceOf(redpacket.address), 5) + }) + it('Should allow two users to claim red packets.', async () => { + // const redpacket = await HappyRedPacket.deployed(); + const password = '1' + const rp_id = redpacket_id + + const claim_success_encode = 'ClaimSuccess(%s,%s,%s,%s)' + const claim_success_types = ['bytes32', 'address', 'uint256', 'address'] + + // Check Availability + let returned = await redpacket.check_availability.call(rp_id) + assert.equal(returned.ifclaimed, false) + + // 1st + const recipient1 = accounts[1] + const validation1 = web3.utils.sha3(recipient1) + + const claim_receipt = await redpacket.claim.sendTransaction(rp_id, password, recipient1, validation1, { + from: recipient1, + }) + const logs = await web3.eth.getPastLogs({ + address: redpacket.address, + topic: [web3.utils.sha3(claim_success_encode)], + }) + + // Check Availability + returned = await redpacket.check_availability.call(rp_id, { + from: recipient1, + }) + assert.equal(returned.ifclaimed, true) + + // 2nd + const recipient2 = accounts[2] + const validation2 = web3.utils.sha3(recipient2) + + const claim_receipt2 = await redpacket.claim.sendTransaction(rp_id, password, recipient2, validation2, { + from: recipient2, + }) + const logs2 = await web3.eth.getPastLogs({ + address: redpacket.address, + topic: [web3.utils.sha3(claim_success_encode)], + }) + + // Check Availability + returned = await redpacket.check_availability.call(rp_id, { + from: recipient2, + }) + assert.equal(returned.ifclaimed, true) + + // 3rd + const recipient3 = accounts[3] + const validation3 = web3.utils.sha3(recipient3) + + const claim_receipt3 = await redpacket.claim.sendTransaction(rp_id, password, recipient3, validation3, { + from: recipient3, + }) + const logs3 = await web3.eth.getPastLogs({ + address: redpacket.address, + topic: [web3.utils.sha3(claim_success_encode)], + }) + // Check Availability + returned = await redpacket.check_availability.call(rp_id, { + from: recipient3, + }) + assert.equal(returned.ifclaimed, true) + + // Check balance + const balance1 = await test721token.balanceOf.call(recipient1, { + from: recipient1, + }) + const balance2 = await test721token.balanceOf.call(recipient2, { + from: recipient2, + }) + const balance3 = await test721token.balanceOf.call(recipient3, { + from: recipient3, + }) + const balance4 = await test721token.balanceOf.call(accounts[4], { + from: accounts[4], + }) + + // Assert + assert.isAbove(Number(balance1), 0) + assert.isAbove(Number(balance2), 0) + assert.isAbove(Number(balance3), 0) + assert.equal(Number(balance4), 0) + // assert.equal(Number(balance1) + Number(balance2) + Number(balance3), _total_tokens) + }) +}) From 876108229b40899c8ec8c908c3c02d59e87e6249 Mon Sep 17 00:00:00 2001 From: Hancheng Zhou Date: Wed, 20 Jan 2021 09:54:39 +0800 Subject: [PATCH 27/28] Use chai expect --- test/Testrp.js | 58 ++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/test/Testrp.js b/test/Testrp.js index 713d271..cf3aea8 100644 --- a/test/Testrp.js +++ b/test/Testrp.js @@ -1,3 +1,7 @@ +const chai = require('chai') +const expect = chai.expect +chai.use(require('chai-as-promised')) + const TestToken = artifacts.require('TestToken') const Test721Token = artifacts.require('Test721Token') const HappyRedPacket = artifacts.require('HappyRedPacket') @@ -17,7 +21,7 @@ contract('TestToken', accounts => { it('Should return the HappyRedPacket contract creator', async () => { const contract_creator = await redpacket.contract_creator.call() - assert.equal(contract_creator, accounts[0]) + expect(contract_creator).to.be.eql(accounts[0]) }) it('Should return a redpacket id', async () => { @@ -66,7 +70,7 @@ contract('TestToken', accounts => { 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) + expect(redpacket_id).to.be.not.null }) it('Should allow two users to claim red packets.', async () => { @@ -98,7 +102,7 @@ contract('TestToken', accounts => { returned = await redpacket.check_availability.call(rp_id, { from: recipient1, }) - assert.equal(returned.ifclaimed, true) + expect(returned).to.have.property('ifclaimed').that.to.be.true // 2nd const recipient2 = accounts[2] @@ -117,7 +121,7 @@ contract('TestToken', accounts => { returned = await redpacket.check_availability.call(rp_id, { from: recipient2, }) - assert.equal(returned.ifclaimed, true) + expect(returned).to.have.property('ifclaimed').that.to.be.true // 3rd const recipient3 = accounts[3] @@ -136,7 +140,7 @@ contract('TestToken', accounts => { returned = await redpacket.check_availability.call(rp_id, { from: recipient3, }) - assert.equal(returned.ifclaimed, true) + expect(returned).to.have.property('ifclaimed').that.to.be.true // Check balance const balance1 = await testtoken.balanceOf.call(recipient1, { @@ -152,12 +156,11 @@ contract('TestToken', accounts => { 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) + expect(Number(balance1)).to.be.greaterThan(0) + expect(Number(balance2)).to.be.greaterThan(0) + expect(Number(balance3)).to.be.greaterThan(0) + expect(Number(balance4)).to.be.eql(0) + expect(Number(balance1) + Number(balance2) + Number(balance3)).to.be.eq(_total_tokens) }) }) contract('TestToken', accounts => { @@ -170,7 +173,7 @@ contract('TestToken', accounts => { it('Should return the HappyRedPacket contract creator', async () => { const contract_creator = await redpacket.contract_creator.call() - assert.equal(contract_creator, accounts[0]) + expect(contract_creator).to.be.eql(accounts[0]) }) it('Should return a redpacket id', async () => { @@ -219,7 +222,7 @@ contract('TestToken', accounts => { 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) + expect(redpacket_id).to.be.not.null }) it('Should refund the red packets.', async () => { @@ -248,7 +251,7 @@ contract('Test721Token', accounts => { }) it('Should return the HappyRedPacket contract creator', async () => { const contract_creator = await redpacket.contract_creator.call() - assert.equal(contract_creator, accounts[0]) + expect(contract_creator).to.be.eql(accounts[0]) }) it('Should return a redpacket id', async () => { const passwords = ['1', '2'] @@ -297,6 +300,7 @@ contract('Test721Token', accounts => { total_tokens, token_ids, ) + const balance = await test721token.balanceOf(redpacket.address) const logs = await web3.eth.getPastLogs({ address: redpacket.address, topics: [web3.utils.sha3(creation_success_encode)], @@ -304,12 +308,11 @@ contract('Test721Token', accounts => { 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) + expect(redpacket_id).to.be.not.null + expect(token_ids).to.be.not.null + expect(Number(balance)).to.be.eq(5) }) it('Should allow two users to claim red packets.', async () => { - // const redpacket = await HappyRedPacket.deployed(); const password = '1' const rp_id = redpacket_id @@ -318,7 +321,7 @@ contract('Test721Token', accounts => { // Check Availability let returned = await redpacket.check_availability.call(rp_id) - assert.equal(returned.ifclaimed, false) + expect(returned).to.have.property('ifclaimed').that.to.be.false // 1st const recipient1 = accounts[1] @@ -336,7 +339,7 @@ contract('Test721Token', accounts => { returned = await redpacket.check_availability.call(rp_id, { from: recipient1, }) - assert.equal(returned.ifclaimed, true) + expect(returned).to.have.property('ifclaimed').that.to.be.true // 2nd const recipient2 = accounts[2] @@ -354,7 +357,7 @@ contract('Test721Token', accounts => { returned = await redpacket.check_availability.call(rp_id, { from: recipient2, }) - assert.equal(returned.ifclaimed, true) + expect(returned).to.have.property('ifclaimed').that.to.be.true // 3rd const recipient3 = accounts[3] @@ -371,7 +374,7 @@ contract('Test721Token', accounts => { returned = await redpacket.check_availability.call(rp_id, { from: recipient3, }) - assert.equal(returned.ifclaimed, true) + expect(returned).to.have.property('ifclaimed').that.to.be.true // Check balance const balance1 = await test721token.balanceOf.call(recipient1, { @@ -387,11 +390,10 @@ contract('Test721Token', accounts => { 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) + expect(Number(balance1)).to.be.greaterThan(0) + expect(Number(balance2)).to.be.greaterThan(0) + expect(Number(balance3)).to.be.greaterThan(0) + expect(Number(balance4)).to.be.eql(0) + expect(Number(balance1) + Number(balance2) + Number(balance3)).to.be.eq(_total_tokens) }) }) From 856988bea6939fb77bcd2fb228fd926faf148512 Mon Sep 17 00:00:00 2001 From: Hancheng Zhou Date: Wed, 20 Jan 2021 21:48:32 +0800 Subject: [PATCH 28/28] Add test --- migrations/4_test_721_token_migration.js | 2 +- test/Testrp.js | 811 +++++++++++++---------- test/constants.js | 38 ++ test/helper.js | 89 +++ 4 files changed, 584 insertions(+), 356 deletions(-) create mode 100644 test/constants.js create mode 100644 test/helper.js diff --git a/migrations/4_test_721_token_migration.js b/migrations/4_test_721_token_migration.js index ca8b015..db406f7 100644 --- a/migrations/4_test_721_token_migration.js +++ b/migrations/4_test_721_token_migration.js @@ -1,5 +1,5 @@ let Test721Token = artifacts.require('Test721Token'); module.exports = function(deployer){ - deployer.deploy(Test721Token, 20); + deployer.deploy(Test721Token, 100); }; diff --git a/test/Testrp.js b/test/Testrp.js index cf3aea8..2a7933f 100644 --- a/test/Testrp.js +++ b/test/Testrp.js @@ -1,399 +1,500 @@ const chai = require('chai') const expect = chai.expect chai.use(require('chai-as-promised')) +const helper = require('./helper') +const { + creation_success_encode, + creation_success_types, + claim_success_encode, + claim_success_types, + refund_success_encode, + refund_success_types, + PASSWORD, + eth_address, +} = require('./constants') const TestToken = artifacts.require('TestToken') const Test721Token = artifacts.require('Test721Token') const HappyRedPacket = artifacts.require('HappyRedPacket') -let testtoken -let test721token -let redpacket -let redpacket_id -let _total_tokens -contract('TestToken', accounts => { +contract('HappyRedPacket', accounts => { + let snapShot + let snapshotId + let testtoken + let test721token + let redpacket + let creationParams + beforeEach(async () => { - console.log('Before ALL\n') + snapShot = await helper.takeSnapshot() + snapshotId = snapShot['result'] testtoken = await TestToken.deployed() + test721token = await Test721Token.deployed() redpacket = await HappyRedPacket.deployed() - _total_tokens = 101 + creationParams = { + hash: web3.utils.sha3(PASSWORD), + number: 3, + ifrandom: true, + duration: 1000, + seed: web3.utils.sha3('lajsdklfjaskldfhaikl'), + message: 'Hi', + name: 'cache', + token_type: 0, + token_addr: eth_address, + total_tokens: 10, + erc721_token_ids: [], + } + }) + + afterEach(async () => { + await helper.revertToSnapShot(snapshotId) }) it('Should return the HappyRedPacket contract creator', async () => { const contract_creator = await redpacket.contract_creator.call() - expect(contract_creator).to.be.eql(accounts[0]) + expect(contract_creator).to.be.eq(accounts[0]) }) - it('Should return a redpacket id', async () => { - const passwords = ['1', '2'] - const hashes = passwords.map(function(pass) { - return web3.utils.sha3(pass) + describe('create_red_packet()', async () => { + it('should throw error when total_tokens is less than number', async () => { + creationParams.number = 11 + await expect( + redpacket.create_red_packet.sendTransaction(...Object.values(creationParams), { + from: accounts[0], + value: creationParams.total_tokens, + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when number is less than 1', async () => { + creationParams.number = 0 + await expect( + redpacket.create_red_packet.sendTransaction(...Object.values(creationParams), { + from: accounts[0], + value: creationParams.total_tokens, + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when number is greater than 255', async () => { + creationParams.number = 256 + await expect( + redpacket.create_red_packet.sendTransaction(...Object.values(creationParams), { + from: accounts[0], + value: creationParams.total_tokens, + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when eth is not enough', async () => { + await expect( + redpacket.create_red_packet.sendTransaction(...Object.values(creationParams), { + from: accounts[0], + value: creationParams.total_tokens - 1, + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when erc20 token is not enough allowance', async () => { + creationParams.token_type = 1 + creationParams.token_addr = testtoken.address + await testtoken.approve.sendTransaction(redpacket.address, creationParams.total_tokens - 1) + await expect( + redpacket.create_red_packet.sendTransaction(...Object.values(creationParams), { + from: accounts[0], + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when erc721 token is not approved yet', async () => { + creationParams.token_type = 2 + creationParams.token_addr = test721token.address + await expect( + redpacket.create_red_packet.sendTransaction(...Object.values(creationParams), { + from: accounts[0], + }), + ).to.be.rejectedWith(Error) + }) + + it('should emit CreationSuccess when everything is ok', async () => { + await prepareERC721Token() + await redpacket.create_red_packet.sendTransaction(...Object.values(creationParams), { + from: accounts[0], + value: creationParams.total_tokens, + }) + + const result = await getRedPacketInfo() + expect(result) + .to.have.property('total') + .that.to.be.eq(creationParams.total_tokens.toString()) + expect(result).to.have.property('id').that.to.be.not.null + expect(result) + .to.have.property('name') + .that.to.be.eq(creationParams.name) + expect(result) + .to.have.property('message') + .that.to.be.eq(creationParams.message) + expect(result) + .to.have.property('creator') + .that.to.be.eq(accounts[0]) + expect(result) + .to.have.property('creation_time') + .that.to.length(10) + expect(result) + .to.have.property('token_address') + .that.to.be.eq(test721token.address) + expect(result) + .to.have.property('erc721_token_ids') + .that.to.be.eql(creationParams.erc721_token_ids.map(v => v.toString())) }) - const name = 'cache' - const msg = 'hi' - const number = 3 - const duration = 1200 - const seed = web3.utils.sha3('lajsdklfjaskldfhaikl') - const token_type = 1 - const token_address = testtoken.address - const token_ids = [] - const total_tokens = _total_tokens - - const creation_success_encode = 'CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256[])' - const creation_success_types = [ - 'uint256', - 'bytes32', - 'string', - 'string', - 'address', - 'uint256', - 'address', - 'uint256[]', - ] - - await testtoken.approve.sendTransaction(redpacket.address, total_tokens) - const creation_receipt = await redpacket.create_red_packet.sendTransaction( - hashes[0], - number, - true, - duration, - seed, - msg, - name, - token_type, - token_address, - total_tokens, - 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'] - expect(redpacket_id).to.be.not.null }) - 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)' - const claim_success_types = ['bytes32', 'address', 'uint256', 'address'] - - // Check Availability - let 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, + describe('check_availability()', async () => { + it('should throw error when red packet does not exist', async () => { + await expect(redpacket.check_availability.call('id not exist', { from: accounts[1] })).to.be.rejectedWith(Error) }) - const logs = await web3.eth.getPastLogs({ - address: redpacket.address, - topic: [web3.utils.sha3(claim_success_encode)], - }) - //console.log(web3.eth.abi.decodeParameters(claim_success_types, logs[0].data)); - - // Check Availability - returned = await redpacket.check_availability.call(rp_id, { - from: recipient1, - }) - expect(returned).to.have.property('ifclaimed').that.to.be.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, + it('should return availability status when everything is ok', async () => { + await createRedPacket() + const redPacketInfo = await getRedPacketInfo() + const result = await redpacket.check_availability.call(redPacketInfo.id, { from: accounts[1] }) + expect(result).to.be.an('object') }) - const logs2 = await web3.eth.getPastLogs({ - address: redpacket.address, - topic: [web3.utils.sha3(claim_success_encode)], - }) - //console.log(web3.eth.abi.decodeParameters(claim_success_types, logs2[0].data)); - - // Check Availability - returned = await redpacket.check_availability.call(rp_id, { - from: recipient2, - }) - expect(returned).to.have.property('ifclaimed').that.to.be.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(web3.eth.abi.decodeParameters(claim_success_types, logs3[0].data)); - - // Check Availability - returned = await redpacket.check_availability.call(rp_id, { - from: recipient3, - }) - expect(returned).to.have.property('ifclaimed').that.to.be.true - - // Check balance - const balance1 = await testtoken.balanceOf.call(recipient1, { - from: recipient1, - }) - const balance2 = await testtoken.balanceOf.call(recipient2, { - from: recipient2, - }) - const balance3 = await testtoken.balanceOf.call(recipient3, { - from: recipient3, - }) - const balance4 = await testtoken.balanceOf.call(accounts[4], { - from: accounts[4], - }) - - expect(Number(balance1)).to.be.greaterThan(0) - expect(Number(balance2)).to.be.greaterThan(0) - expect(Number(balance3)).to.be.greaterThan(0) - expect(Number(balance4)).to.be.eql(0) - expect(Number(balance1) + Number(balance2) + Number(balance3)).to.be.eq(_total_tokens) - }) -}) -contract('TestToken', accounts => { - beforeEach(async () => { - console.log('Before ALL\n') - testtoken = await TestToken.deployed() - redpacket = await HappyRedPacket.deployed() - _total_tokens = 101 }) - it('Should return the HappyRedPacket contract creator', async () => { - const contract_creator = await redpacket.contract_creator.call() - expect(contract_creator).to.be.eql(accounts[0]) - }) - - it('Should return a redpacket id', async () => { - const passwords = ['1', '2'] - const hashes = passwords.map(function(pass) { - return web3.utils.sha3(pass) + describe('claim()', async () => { + it('should throw error when redpacket id does not exist', async () => { + const claimParams = createClaimParams('not exist', accounts[1]) + await expect( + redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }), + ).to.be.rejectedWith(Error) + }) + + it('should emit ClaimSuccess when everything is ok', async () => { + const { claimParams } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + const claimResults = await getClaimRedPacketInfo(0) + expect(claimResults[0]).to.have.property('id').that.to.be.not.null + }) + + it('should throw error when expired', async () => { + creationParams.duration = 0 + const { claimParams } = await createThenGetClaimParams(accounts[1]) + await expect( + redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when out of stock', async () => { + creationParams.number = 1 + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + const availability = await redpacket.check_availability.call(redPacketInfo.id, { from: accounts[2] }) + expect(Number(availability.balance)).to.be.eq(0) + const anotherClaimParams = createClaimParams(redPacketInfo.id, accounts[2]) + await expect( + redpacket.claim.sendTransaction(...Object.values(anotherClaimParams), { + from: accounts[2], + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when password is wrong', async () => { + let { claimParams } = await createThenGetClaimParams(accounts[1]) + claimParams.password = 'wrong password' + await expect( + redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when validation failed', async () => { + let { claimParams } = await createThenGetClaimParams(accounts[1]) + claimParams.validation = 'wrong validation' + await expect( + redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error when already claimed', async () => { + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + + const availability = await redpacket.check_availability.call(redPacketInfo.id, { from: accounts[1] }) + + expect(availability).have.property('ifclaimed').that.to.be.true + await expect( + redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }), + ).to.be.rejectedWith(Error) + }) + + it('should claim average amount if not set random', async () => { + creationParams.ifrandom = false + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + const anotherClaimParams = createClaimParams(redPacketInfo.id, accounts[2]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + await redpacket.claim.sendTransaction(...Object.values(anotherClaimParams), { + from: accounts[2], + }) + + const results = await getClaimRedPacketInfo() + expect(Number(results[0].claimed_value)) + .to.be.eq(Number(results[1].claimed_value)) + .and.to.be.eq(3) + }) + + it('should claim random amount if set random', async () => { + creationParams.total_tokens = 1e5 + creationParams.number = 4 + creationParams.token_type = 1 + creationParams.token_addr = testtoken.address + await testtoken.approve.sendTransaction(redpacket.address, creationParams.total_tokens) + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + const claimParams2 = createClaimParams(redPacketInfo.id, accounts[2]) + const claimParams3 = createClaimParams(redPacketInfo.id, accounts[3]) + const claimParams4 = createClaimParams(redPacketInfo.id, accounts[4]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + await redpacket.claim.sendTransaction(...Object.values(claimParams2), { + from: accounts[2], + }) + await redpacket.claim.sendTransaction(...Object.values(claimParams3), { + from: accounts[3], + }) + await redpacket.claim.sendTransaction(...Object.values(claimParams4), { + from: accounts[4], + }) + + const results = await getClaimRedPacketInfo(3) + const v1 = Number(results[0].claimed_value) + const v2 = Number(results[1].claimed_value) + const v3 = Number(results[2].claimed_value) + const v4 = Number(results[3].claimed_value) + expect([v1, v2, v3].every(v => v === v4)).to.be.false + expect(v1 + v2 + v3 + v4).to.be.eq(1e5) + }) + + it('should claim the first erc721 token if not set random', async () => { + creationParams.ifrandom = false + await prepareERC721Token() + await test721token.setApprovalForAll.sendTransaction(redpacket.address, true) + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + const claimParams2 = createClaimParams(redPacketInfo.id, accounts[2]) + + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + await redpacket.claim.sendTransaction(...Object.values(claimParams2), { + from: accounts[2], + }) + + const results = await getClaimRedPacketInfo(1) + + expect(results[0].token_id).to.be.eql([creationParams.erc721_token_ids[0].toString()]) + expect(results[1].token_id).to.be.eql([creationParams.erc721_token_ids[1].toString()]) + }) + + it('should claim the first erc721 token if set random', async () => { + creationParams.total_tokens = 80 + await prepareERC721Token() + await test721token.setApprovalForAll.sendTransaction(redpacket.address, true) + const { claimParams } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + const results = await getClaimRedPacketInfo(0) + + // Note: this test has 1/80 possibility to fail: + // AssertionError: expected [ '0' ] to not deeply equal [ '0' ] + // see https://softwareengineering.stackexchange.com/a/147142 + expect(results[0].token_id).to.be.not.eql([creationParams.erc721_token_ids[0].toString()]) }) - const name = 'cache' - const msg = 'hi' - const number = 3 - const duration = 0 - 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,string,string,address,uint256,address,uint256[])' - const creation_success_types = [ - 'uint256', - 'bytes32', - 'string', - 'string', - 'address', - 'uint256', - 'address', - 'uint256[]', - ] - - await testtoken.approve.sendTransaction(redpacket.address, total_tokens) - const creation_receipt = await redpacket.create_red_packet.sendTransaction( - hashes[0], - number, - true, - duration, - seed, - msg, - name, - token_type, - token_address, - total_tokens, - 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'] - expect(redpacket_id).to.be.not.null }) - it('Should refund the red packets.', async () => { - const redpacket = await HappyRedPacket.deployed() - const rp_id = redpacket_id + describe('refund()', async () => { + it('should throw error when the refunder is not creator', async () => { + const { redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await expect( + redpacket.refund.sendTransaction(redPacketInfo.id, { + from: accounts[1], + }), + ).to.be.rejectedWith(Error) + }) + + it('should throw error before expiry', async () => { + const { redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await expect( + redpacket.refund.sendTransaction(redPacketInfo.id, { + from: accounts[0], + }), + ).to.be.rejectedWith(Error) + }) + + it("should throw error when there's no remaining", async () => { + creationParams.number = 1 + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + const availability = await redpacket.check_availability.call(redPacketInfo.id, { from: accounts[1] }) + expect(Number(availability.total)).to.be.eq(Number(availability.claimed)) + expect(Number(availability.balance)).to.be.eq(0) + await expect( + redpacket.refund.sendTransaction(redPacketInfo.id, { + from: accounts[0], + }), + ).to.be.rejectedWith(Error) + }) + + it('should refund eth successfully', async () => { + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + + await helper.advanceTimeAndBlock(2000) + + await redpacket.refund.sendTransaction(redPacketInfo.id, { + from: accounts[0], + }) + }) + + it('should refund eth successfully', async () => { + creationParams.ifrandom = false + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + + await helper.advanceTimeAndBlock(2000) + + await redpacket.refund.sendTransaction(redPacketInfo.id, { + from: accounts[0], + }) + const result = await getRefundRedPacketInfo() + expect(result).to.have.property('id').that.to.be.eq(redPacketInfo.id) + expect(result).to.have.property('token_address').that.to.be.eq(eth_address) + expect(Number(result.remaining_balance)).to.be.eq(7) + }) + + it('should refund erc20 successfully', async () => { + creationParams.ifrandom = false + creationParams.token_type = 1 + creationParams.token_addr = testtoken.address + await testtoken.approve.sendTransaction(redpacket.address, creationParams.total_tokens) + + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + + await helper.advanceTimeAndBlock(2000) + + await redpacket.refund.sendTransaction(redPacketInfo.id, { + from: accounts[0], + }) + const result = await getRefundRedPacketInfo() + expect(result).to.have.property('id').that.to.be.eq(redPacketInfo.id) + expect(result).to.have.property('token_address').that.to.be.eq(testtoken.address) + expect(Number(result.remaining_balance)).to.be.eq(7) + }) + + it('should refund erc721 successfully', async () => { + creationParams.ifrandom = false + await prepareERC721Token() + + const { claimParams, redPacketInfo } = await createThenGetClaimParams(accounts[1]) + await redpacket.claim.sendTransaction(...Object.values(claimParams), { + from: accounts[1], + }) + + await helper.advanceTimeAndBlock(2000) + + await redpacket.refund.sendTransaction(redPacketInfo.id, { + from: accounts[0], + }) + + const result = await getRefundRedPacketInfo() + expect(result).to.have.property('id').that.to.be.eq(redPacketInfo.id) + expect(result).to.have.property('token_address').that.to.be.eq(test721token.address) + expect(Number(result.remaining_balance)).to.be.eq(9) + }) + }) - const refund_success_encode = 'RefundSuccess(%s,%s,%s)' - const refund_success_types = ['bytes32', 'address', 'uint256'] + async function prepareERC721Token() { + creationParams.token_type = 2 + creationParams.token_addr = test721token.address + for (i = 0; i < creationParams.total_tokens; i++) { + const token_id = await test721token.tokenOfOwnerByIndex.call(accounts[0], i) + creationParams.erc721_token_ids.push(token_id) + } + await test721token.setApprovalForAll.sendTransaction(redpacket.address, true) + } + + async function createThenGetClaimParams(account) { + await createRedPacket() + const redPacketInfo = await getRedPacketInfo() + return { claimParams: createClaimParams(redPacketInfo.id, account), redPacketInfo } + } + + function createClaimParams(id, recipient) { + return { + id, + password: PASSWORD, + recipient, + validation: web3.utils.sha3(recipient), + } + } - const refund_receipt = await redpacket.refund.sendTransaction(rp_id, { + async function createRedPacket() { + await redpacket.create_red_packet.sendTransaction(...Object.values(creationParams), { from: accounts[0], + value: creationParams.total_tokens, }) - const logs = await web3.eth.getPastLogs({ - address: redpacket.address, - topic: [web3.utils.sha3(refund_success_encode)], - }) - //console.log(web3.eth.abi.decodeParameters(refund_success_types, logs[0].data)); - }) -}) -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() - expect(contract_creator).to.be.eql(accounts[0]) - }) - it('Should return a redpacket id', async () => { - const passwords = ['1', '2'] - const hashes = passwords.map(function(pass) { - return web3.utils.sha3(pass) - }) - const name = 'cache' - const msg = 'hi' - const number = 3 - const duration = 1200 - const seed = web3.utils.sha3('lajsdklfjaskldfhaikl') - const token_type = 2 - const token_address = test721token.address - // const token_total = await test721token.balanceOf.call(accounts[0]); - const token_total = 5 - const token_ids = [] - for (i = 0; i < token_total; i++) { - token_id = await test721token.tokenOfOwnerByIndex.call(accounts[0], i) - token_ids.push(token_id) - } - const total_tokens = token_ids.length - - const creation_success_encode = 'CreationSuccess(uint256,bytes32,string,string,address,uint256,address,uint256[])' - const creation_success_types = [ - 'uint256', - 'bytes32', - 'string', - 'string', - 'address', - 'uint256', - 'address', - 'uint256[]', - ] - - await test721token.setApprovalForAll.sendTransaction(redpacket.address, true) - const creation_receipt = await redpacket.create_red_packet.sendTransaction( - hashes[0], - number, - true, - duration, - seed, - msg, - name, - token_type, - token_address, - total_tokens, - token_ids, - ) - const balance = await test721token.balanceOf(redpacket.address) - 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'] - expect(redpacket_id).to.be.not.null - expect(token_ids).to.be.not.null - expect(Number(balance)).to.be.eq(5) - }) - it('Should allow two users to claim red packets.', async () => { - const password = '1' - const rp_id = redpacket_id - - const claim_success_encode = 'ClaimSuccess(%s,%s,%s,%s)' - const claim_success_types = ['bytes32', 'address', 'uint256', 'address'] + } - // Check Availability - let returned = await redpacket.check_availability.call(rp_id) - expect(returned).to.have.property('ifclaimed').that.to.be.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, - }) + async function getRedPacketInfo() { const logs = await web3.eth.getPastLogs({ address: redpacket.address, - topic: [web3.utils.sha3(claim_success_encode)], - }) - - // Check Availability - returned = await redpacket.check_availability.call(rp_id, { - from: recipient1, + topic: [web3.utils.sha3(creation_success_encode)], }) - expect(returned).to.have.property('ifclaimed').that.to.be.true + return web3.eth.abi.decodeParameters(creation_success_types, logs[0].data) + } - // 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({ + async function getClaimRedPacketInfo(fromBlock = 1) { + const latestBlock = await web3.eth.getBlockNumber() + const logs = await web3.eth.getPastLogs({ address: redpacket.address, topic: [web3.utils.sha3(claim_success_encode)], + fromBlock: latestBlock - fromBlock, + toBlock: latestBlock, }) + return logs.map(log => web3.eth.abi.decodeParameters(claim_success_types, log.data)) + } - // Check Availability - returned = await redpacket.check_availability.call(rp_id, { - from: recipient2, - }) - expect(returned).to.have.property('ifclaimed').that.to.be.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({ + async function getRefundRedPacketInfo() { + const logs = await web3.eth.getPastLogs({ address: redpacket.address, - topic: [web3.utils.sha3(claim_success_encode)], - }) - // Check Availability - returned = await redpacket.check_availability.call(rp_id, { - from: recipient3, - }) - expect(returned).to.have.property('ifclaimed').that.to.be.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], + topic: [web3.utils.sha3(refund_success_encode)], }) - - expect(Number(balance1)).to.be.greaterThan(0) - expect(Number(balance2)).to.be.greaterThan(0) - expect(Number(balance3)).to.be.greaterThan(0) - expect(Number(balance4)).to.be.eql(0) - expect(Number(balance1) + Number(balance2) + Number(balance3)).to.be.eq(_total_tokens) - }) + return web3.eth.abi.decodeParameters(refund_success_types, logs[0].data) + } }) diff --git a/test/constants.js b/test/constants.js new file mode 100644 index 0000000..613808d --- /dev/null +++ b/test/constants.js @@ -0,0 +1,38 @@ +const creation_success_encode = 'CreationSuccess(uint,bytes32,string,string,address,uint,address,uint256[])' +const creation_success_types = [ + { type: 'uint', name: 'total' }, + { type: 'bytes32', name: 'id' }, + { type: 'string', name: 'name' }, + { type: 'string', name: 'message' }, + { type: 'address', name: 'creator' }, + { type: 'uint', name: 'creation_time' }, + { type: 'address', name: 'token_address' }, + { type: 'uint256[]', name: 'erc721_token_ids' }, +] +const claim_success_encode = 'ClaimSuccess(bytes32,address,uint,address,uint256[])' +const claim_success_types = [ + { type: 'bytes32', name: 'id' }, + { type: 'address', name: 'claimer' }, + { type: 'uint', name: 'claimed_value' }, + { type: 'address', name: 'token_address' }, + { type: 'uint256[]', name: 'token_id' }, +] +const refund_success_encode = 'RefundSuccess(bytes32,address,uint)' +const refund_success_types = [ + { type: 'bytes32', name: 'id' }, + { type: 'address', name: 'token_address' }, + { type: 'uint', name: 'remaining_balance' }, +] +const PASSWORD = 'password' +const eth_address = "0x0000000000000000000000000000000000000000" + +module.exports = { + creation_success_encode, + creation_success_types, + claim_success_encode, + claim_success_types, + refund_success_encode, + refund_success_types, + PASSWORD, + eth_address, +} diff --git a/test/helper.js b/test/helper.js new file mode 100644 index 0000000..7c513cb --- /dev/null +++ b/test/helper.js @@ -0,0 +1,89 @@ +const advanceTime = time => { + return new Promise((resolve, reject) => { + web3.currentProvider.send( + { + jsonrpc: '2.0', + method: 'evm_increaseTime', + params: [time], + id: new Date().getTime(), + }, + (err, result) => { + if (err) { + return reject(err) + } + return resolve(result) + }, + ) + }) +} + +const advanceBlock = () => { + return new Promise((resolve, reject) => { + web3.currentProvider.send( + { + jsonrpc: '2.0', + method: 'evm_mine', + id: new Date().getTime(), + }, + (err, result) => { + if (err) { + return reject(err) + } + const newBlockHash = web3.eth.getBlock('latest').hash + + return resolve(newBlockHash) + }, + ) + }) +} + +const takeSnapshot = () => { + return new Promise((resolve, reject) => { + web3.currentProvider.send( + { + jsonrpc: '2.0', + method: 'evm_snapshot', + id: new Date().getTime(), + }, + (err, snapshotId) => { + if (err) { + return reject(err) + } + return resolve(snapshotId) + }, + ) + }) +} + +const revertToSnapShot = id => { + return new Promise((resolve, reject) => { + web3.currentProvider.send( + { + jsonrpc: '2.0', + method: 'evm_revert', + params: [id], + id: new Date().getTime(), + }, + (err, result) => { + if (err) { + return reject(err) + } + return resolve(result) + }, + ) + }) +} + +const advanceTimeAndBlock = async time => { + await advanceTime(time) + await advanceBlock() + return Promise.resolve(web3.eth.getBlock('latest')) +} + +module.exports = { + advanceTime, + advanceBlock, + advanceTimeAndBlock, + takeSnapshot, + revertToSnapShot, +}