Capture the Ether hints, no spoilers

You can find complete writeups for this challenge elsewhere but come here if you need just a little nudge!

Warmup

I completed the challenges using hardhat and ethers.js library which has most of the stuff you’ll need.

Lotteries

Guess the number

Just call contract.guess(42), uh.

Guess the secret number

You can actually reverse a hash when the input value was a small number…

Guess the random number

Remember, all data on the chain is public. ethers.js provides a function to read that data too.

Guess the new number

Can just brute-force it. Or use the method from the next challenge.

Predict the future

If only you could execute some code on chain to check the guess number …

Predict the block hash

Like for any security work, make sure you are aware of the edge cases of APIs!

Math

Token sale

It should be quite obvious this will be about overflows.

Token whale

A business logic bug.

Look carefully if the right variables are in the right places.

Retirement fund

You’ll probably find the middle step you need to get to. To get there, need to be familiar with edge case behaviour of Solidity. It’s in the docs.

Mapping

Sometimes Solidity can be like C, lol

Don’t forget about the overflows either.

Donation

This one is not that obvious but it’s documented in SWC.

Fifty years

If you look closely, there’s something weird or funny in the code.

Where?

Well, similar problem to last challange but not the same.

BTW it doesn’t compile in newer versions of Solidity.

And then you can use that bug to get to the end.

Accounts

Fuzzy identity

There are probably two ways to solve this but both will involve some spinning fans.

Again, read the docs.

Public key

There is literally a function for this in ethers.js as well as in solidity / EVM!

Account takeover

Ok here is where you need to bring your cryptography knowledge about signatures, Sony etc.

Misc

Assume ownership

Yeah this bug doesn’t exist in new version of Solidity any more.

Was it Parity who got burned on that? Anyway …

Token bank

This classic bug should also be in the challenge!