✅Operation magic redemption
Last updated
Last updated
A prominent protocol, InsecStar, finds itself under attack. Their token, MagicETH (mETH), has been drained through an exploit in their borrow & loan protocol.
InsecStar has urgently summoned you to devise a method to recover the stolen tokens and redeem them for ETH before the situation worsens. This is a critical test of your capabilities. Can you rise to the occasion and secure the tokens, thereby reinforcing the strength and resilience of the Ethereum ecosystem?
📌 Recover 1000 mETH
from the exploiter wallet.
📌 Convert the mETH
to ETH
to avoid further losses.
The contracts that you will hack are:
The test script where you will have to write your solution is:
In burnFrom()
:
Always check if the parameters are provided in correct order. In this case, the function definition is allowance(address owner, address spender)
, and clearly msg.sender
shouldn't be the owner. The variable currentAllowance
is used here:
Developer assumed this line is going to reduce msg.sender
's allowance on account
. However, due to the bug in currentAllowance
, we can first call approve()
to grant max allowance for exploiter
and then call burnFrom(exploiter, 0)
to trigger:
After that a simple transferFrom()
call will take all mETH from the exploiter.