Skip to content

Conversation

@DeVikingMark
Copy link

What I did

Added documentation comments to EVM opcode offset constants (PUSH_OFFSET, DUP_OFFSET, SWAP_OFFSET) in the assembler core module to improve code readability and developer understanding.

How I did it

Added explanatory comments above each constant definition explaining:

  • Their purpose as base values for EVM opcode calculation
  • The formula used: OFFSET + instruction_number
  • Specific examples showing how opcodes are derived (PUSH0 = 0x5F, DUP1 = 0x80, SWAP1 = 0x90)

How to verify it

  1. Check that the constants are still accessible: python3 -c "from vyper.evm.assembler.core import PUSH_OFFSET, DUP_OFFSET, SWAP_OFFSET; print(f'{PUSH_OFFSET}, {DUP_OFFSET}, {SWAP_OFFSET}')"
  2. Verify Python syntax: python3 -m py_compile vyper/evm/assembler/core.py
  3. Confirm the comments explain the EVM opcode encoding logic clearly

Commit message

docs: add documentation for EVM opcode offset constants

Description for the changelog

Added documentation comments to EVM assembler constants to clarify opcode encoding logic.

Cute Animal Picture

image

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.

1 participant