ethereum / wiki

The Ethereum Wiki
https://www.ethereum.org
14.75k stars 2.56k forks source link

Typo in the key/value contract example in the wiki #703

Open siraben opened 4 years ago

siraben commented 4 years ago

The Ethereum Development Tutorial states:

NOT pops one value and pushes 1 if the value is zero, else 0

However, NOT is a bitwise operation on the top of stack as defined in the yellowpaper, instead ISZERO was probably meant.

Also, the bytecode should be changed from

PUSH1 0 CALLDATALOAD SLOAD NOT PUSH1 10 JUMPI STOP JUMPDEST PUSH1 32 CALLDATALOAD PUSH1 0 CALLDATALOAD SSTORE

to

PUSH1 0 CALLDATALOAD SLOAD ISZERO PUSH1 10 JUMPI STOP JUMPDEST PUSH1 32 CALLDATALOAD PUSH1 0 CALLDATALOAD SSTORE