Level 15 - Naught Coin ⏺⏺⏺

Level Setup

NaughtCoin is an ERC20 token and you're already holding all of them. The catch is that you'll only be able to transfer them after a 10 year lockout period. Can you figure out how to get them out to another address so that you can transfer them freely? Complete this level by getting your token balance to 0.

Things that might help

Level Contract

Exploit

While the tokens can't be transferred directly by the owner, the owner can allow a different address to transfer the tokens for them.

  1. Deploy the Exploit contract.

  2. In the browser console, approve the newly deployed exploit contract address.

  1. Invoke the attack to transfer the tokens.

Submit instance... 🥳

Completion Message

When using code that's not your own, it's a good idea to familiarize yourself with it to get a good understanding of how everything fits together. This can be particularly important when there are multiple levels of imports (your imports have imports) or when you are implementing authorization controls, e.g. when you're allowing or disallowing people from doing things. In this example, a developer might scan through the code and think that transfer is the only way to move tokens around, low and behold there are other ways of performing the same operation with a different implementation.

Notes

Last updated