crytic / building-secure-contracts

Guidelines and training material to write secure smart contracts
https://secure-contracts.com/
GNU Affero General Public License v3.0
2.22k stars 346 forks source link

docs: add naught coin exercise #211

Open ChmielewskiKamil opened 1 year ago

ChmielewskiKamil commented 1 year ago

This is a draft PR for #207

tldr; Where should this exercise be placed? Which number should I give to it?

It came up to be a little bit wordy compared to other exercises. I wanted to narrow the gap between the first four exercises, which are relatively easy, to the last 4 harder exercises.

Instead of hints, I decided to go with hidden-by-default steps that the user can follow if he gets stuck. It does not spoil the solution.

I am publishing this as a draft so you can review it early and tell me if this is the right way to go about it.

Thanks!

ChmielewskiKamil commented 1 year ago

As a side note @glarregay-tob. Where should this exercise be placed?

An idea that I had in my mind was to remove the numbers from the exercises altogether. This would prevent having broken links when adding new exercises.

glarregay-tob commented 1 year ago

I think @ggrieco-tob will have a more accurate answer, but here's my take. Having exercise numbers can make it easier to organize them and give people a feeling of progression when someone is following the tutorials/examples. But since the increasing numbers aren't associated with an increased difficulty or anything anymore, we might need to review this approach.

However, for this particular case, I'm a bit on the line if we should consider this a new exercise (because the explanation and the way it is presented is definitely a tutorial, it makes a lot of sense) or if we should open a new repo for Ethernaut solutions using Echidna.

ChmielewskiKamil commented 1 year ago

However, for this particular case, I'm a bit on the line if we should consider this a new exercise (because the explanation and the way it is presented is definitely a tutorial, it makes a lot of sense) or if we should open a new repo for Ethernaut solutions using Echidna.

Yes, it definitely came out to be more of a tutorial rather than an exercise. I think that splitting the content into tutorials, how-to guides, exercises, explanations and references would be a good long-term approach.

ChmielewskiKamil commented 1 year ago

@glarregay-tob, @ggrieco-tob, I've added the follow-up section with the external Setup.sol contract.

The only thing left is to change the name of this tutorial/exercise and place it in an appropriate place.

I can reorder other exercises and place this one as exercise 5. Another way to handle this would be to place it under the Tutorials section and call it something like Writing properties for ERC20

ggrieco-tob commented 1 year ago

@montyly what do you think about the name and reordering of these exercises?

ggrieco-tob commented 1 year ago

Can this one be converted to a PR to start the review?