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

Add opcodes and opcodes_runtime flags to compiler #1255

Merged
merged 4 commits into from
Feb 20, 2019
Merged

Add opcodes and opcodes_runtime flags to compiler #1255

merged 4 commits into from
Feb 20, 2019

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

  • added opcodes and opcodes_runtime flags to the compiler

How I did it

  • added PUSH, SWAP and DUP opcodes to vyper/opcodes.py
  • added new method get_opcodes to vyper/compiler.py
  • added opcodes and opcodes_runtime to output_formats_map in vyper/compiler.py
  • modified help string in bin/vyper

How to verify it

vyper -f opcodes examples/crowdfund.vy
vyper -f opcodes_runtime examples/crowdfund.vy

Description for the changelog

  • added opcodes and opcodes_runtime flags to the compiler

Cute Animal Picture

baby sloth like opcodes

Copy link
Member

@fubuloubu fubuloubu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a short test to show off how this works. (I'd love for it to be a doctest, and actually use them)

Copy link
Contributor

@jacqueswww jacqueswww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just fix the linting errors ;)

@jacqueswww
Copy link
Contributor

@fubuloubu doc tests are great for a quick test suite, but in general I think it just adds too much clutter on a code base - especially since we have a very extensive test suite already.

@fubuloubu
Copy link
Member

Doctests are nice because they keep the docs up to date

@iamdefinitelyahuman
Copy link
Contributor Author

LGTM, just fix the linting errors ;)

oops!

@jacqueswww jacqueswww merged commit 9bc84f0 into vyperlang:master Feb 20, 2019
@killersqueegie
Copy link

What's the difference between opcodes and opcodes_runtime?

@iamdefinitelyahuman
Copy link
Contributor Author

  • opcodes is generated from the bytecode used to deploy the contract
  • opcodes_runtime is from the final deployed bytecode that is stored on-chain

If you are familiar with solc:

  • opcodes is equivalent to evm.bytecode.opcodes
  • opcodes_runtime is equivalent to evm.deployedBytecode.opcodes

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.

None yet

4 participants