In this challenge the user is provided with a contract called Elevator.sol
. The goal of this challenge is to set the variable top
to true.
- Create a contract
Top.sol
that has a function calledisLastFloor()
as it is what is expected by the Elevator contract. - The function is called twice, at first call to
isLastFloor()
it sets thefloor
variable to ourfloor
value. We returnfalse
here. - Based on the
floor
value we can on the second call toisLastFloor()
we returntrue
.
- Run Exploit!
forge test -vv -m test_challenge_11