fvictorio / evm-puzzles

A collection of EVM puzzles
806 stars 158 forks source link

Use INVALID (FE) instead of REVERT (FD) #6

Open luzianscherrer opened 2 years ago

luzianscherrer commented 2 years ago

Wouldn't it be cleaner to use INVALID (FD) instead of REVERT (FD) for the dead ends as REVERT requires two items on the stack and always results in a stack underflow otherwise?

Anyhow, thanks for those great little games! I did enjoy them a lot.

fvictorio commented 2 years ago

Oh damn, good call, I didn't realize that that was happening. I'll change it, thanks for the tip!

luzianscherrer commented 2 years ago

Also on a side note, I would suggest modifying puzzle 10 a little because as the modulo operation at position 0E is required to result in 0 one can just omit the calldata completely in order to pass which makes it a little too easy.

A slightly modified version keeping the spirit of the original would be: 38349011600857FD5B3661000390063460090157FDFDFDFD5B00

jeasonstudio commented 1 year ago

I find the most intriguing aspect to be the discussion on the utilization of create/extcodesize/call. These puzzles necessitate comprehension of the bytecode that is required to create a contract and return its contents, which proves beneficial for novices. The significance of the mod opcode in Puzzle 10 has become less important. @luzianscherrer