Skip to content

Commit

Permalink
Merge pull request #750 from PurrProof/fix/magic-num-text
Browse files Browse the repository at this point in the history
text(MagicNum): improve level description
  • Loading branch information
GianfrancoBazzani authored Aug 28, 2024
2 parents 39a1009 + 1faf7d7 commit 68ad817
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions client/src/gamedata/en/descriptions/levels/magicnum.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
To solve this level, you only need to provide the Ethernaut with a `Solver`, a contract that responds to `whatIsTheMeaningOfLife()` with the right number.
To solve this level, you only need to provide the Ethernaut with a `Solver`, a contract that responds to `whatIsTheMeaningOfLife()` with the right 32 byte number.

Easy right?
Well... there's a catch.

The solver's code needs to be really tiny. Really reaaaaaallly tiny. Like freakin' really really itty-bitty tiny: 10 opcodes at most.
The solver's code needs to be really tiny. Really reaaaaaallly tiny. Like freakin' really really itty-bitty tiny: 10 bytes at most.

Hint: Perhaps its time to leave the comfort of the Solidity compiler momentarily, and build this one by hand O_o.
Hint: Perhaps its time to leave the comfort of the Solidity compiler momentarily, and build this one by hand O_o.
That's right: Raw EVM bytecode.

Good luck!
Good luck!
4 changes: 2 additions & 2 deletions client/src/gamedata/es/descriptions/levels/magicnum.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Para resolver este nivel, solo necesitas proporcionar a Ethernaut un `Solver`, un contrato que responde a `whatIsTheMeaningOfLife()` con el número correcto.
Para resolver este nivel, solo necesitas proporcionar a Ethernaut un `Solver`, un contrato que responde a `whatIsTheMeaningOfLife()` con el número correcto de 32 bytes.

Fácil, ¿verdad?
Bueno ... Hay una trampa.

El código del `Solver` debe ser realmente pequeño. Realmeeeeeente diminuto. Jodidamente minúsculo: 10 opcodes como máximo.
El código del `Solver` debe ser realmente pequeño. Realmeeeeeente diminuto. Jodidamente minúsculo: 10 bytes como máximo.

Sugerencia: Quizás es hora de dejar la comodidad del compilador Solidity momentáneamente y construir este a mano O_o.
Así es: puro bytecode EVM.
Expand Down
6 changes: 3 additions & 3 deletions client/src/gamedata/fr/descriptions/levels/magicnum.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Pour résoudre ce niveau, il vous suffit de fournir à l'Ethernaut un `Solver`, un contrat qui répond à `whatIsTheMeaningOfLife()` (quel est le sens de la vie?) avec le bon numéro.
Pour résoudre ce niveau, il vous suffit de fournir à l'Ethernaut un `Solver`, un contrat qui répond à `whatIsTheMeaningOfLife()` (quel est le sens de la vie?) avec le bon numéro de 32 octets.

Facile, n'est ce pas?

Eh bien...pas vraiment.
Eh bien...pas vraiment.

Le code du `Solver` doit être vraiment petit. Vraiment tout petit. Comme vraiment vraiment minuscule : 10 opcodes au maximum.
Le code du `Solver` doit être vraiment petit. Vraiment tout petit. Comme vraiment vraiment minuscule : 10 octets au maximum.

Indice: Il est peut-être temps de quitter momentanément le confort du compilateur Solidity et de le construire à la main O_o.

Expand Down
4 changes: 2 additions & 2 deletions client/src/gamedata/pt_br/descriptions/levels/magicnum.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Para resolver este nível, você só precisa fornecer ao Ethernaut um `Solver`, um contrato que responde `whatIsTheMeaningOfLife()` com o número certo.
Para resolver este nível, você só precisa fornecer ao Ethernaut um `Solver`, um contrato que responde `whatIsTheMeaningOfLife()` com o número certo de 32 bytes.

Fácil né?
Então... Não é bem assim.

O código do solucionador precisa ser muito pequeno. Realmente muuuuuuuuuuito pequenininho. Tipo muito muito minúsculo de pequeno: 10 opcodes no máximo.
O código do solucionador precisa ser muito pequeno. Realmente muuuuuuuuuuito pequenininho. Tipo muito muito minúsculo de pequeno: 10 bytes no máximo.

Dica: talvez seja hora de deixar momentaneamente o conforto do compilador Solidity e fazer isso manualmente O_o.
Isso mesmo: bytecode EVM bruto.
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/levels/MagicNumFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract MagicNumFactory is Level {
bytes32 magic = solver.whatIsTheMeaningOfLife();
if (magic != 0x000000000000000000000000000000000000000000000000000000000000002a) return false;

// Require the solver to have at most 10 opcodes.
// Require the solver to have at most 10 bytes.
uint256 size;
assembly {
size := extcodesize(solver)
Expand Down

0 comments on commit 68ad817

Please sign in to comment.