Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVM Puzzles Walkthrough #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

0xKitsune
Copy link

@0xKitsune 0xKitsune commented Mar 18, 2022

First off, thanks for making such an awesome set of challenges, they have been a ton of fun!

While I was going through each challenge, there were parts where I thought, "how does this opcode actually work under the hood" which was followed by a few nights of exploring the yellow paper, stack overflow posts and various other rabbit holes to find the answers. I thought that creating a walkthrough would help others that are newer to the EVM learn some of the EVM nuances related to these puzzles. I am still adding additions to the explanation on puzzle #8 but thought I would make a PR to see if you had any thoughts, edits or comments. I am open to all feedback and would love to have something like this integrated into the repo! I would be happy to make any additions that you think would be helpful or clarify anything that is currently in the walkthrough.

I am looking forward to hearing your thoughts.

@0xKitsune 0xKitsune changed the title Walkthrough for each puzzle EVM Puzzles Walkthrough Mar 18, 2022
@viraj124
Copy link

@0xKitsune in the last puzzle walkthrough how come CODESIZE becomes equal to 1b ?

@0xKitsune
Copy link
Author

You can know that CODESIZE equates to 1b (or 27 in decimal form) in puzzle #10 because the CODESIZE opcode returns the size of the current environment that the code is running. It's basically just counting the amount of bytes in the sequence.

For more info on how this works, you can check out the explanation for puzzle #2 as well as the explanation from evm.codes.

Here is an example of puzzle #10 running in an evm codes playground, where you can see it produces 1b. Lmk if you have any other questions feel free to dm me on twitter.

@larrettgee
Copy link

Getting back into EVM Opcodes & this walkthrough has been immensely helpful :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants