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

Conversation

@iamdefinitelyahuman
Copy link
Contributor

iamdefinitelyahuman commented Feb 19, 2019

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 left a comment

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
Collaborator

jacqueswww left a comment

LGTM, just fix the linting errors ;)

@jacqueswww

This comment has been minimized.

Copy link
Collaborator

jacqueswww commented Feb 19, 2019

@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

This comment has been minimized.

Copy link
Member

fubuloubu commented Feb 19, 2019

Doctests are nice because they keep the docs up to date

@iamdefinitelyahuman

This comment has been minimized.

Copy link
Contributor Author

iamdefinitelyahuman commented Feb 19, 2019

LGTM, just fix the linting errors ;)

oops!

@jacqueswww jacqueswww merged commit 9bc84f0 into vyperlang:master Feb 20, 2019
1 of 2 checks passed
1 of 2 checks passed
ci/circleci: Build Error Your tests failed on CircleCI
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jacqueswww jacqueswww added the beta9 label Mar 11, 2019
@killersqueegie

This comment has been minimized.

Copy link

killersqueegie commented Aug 17, 2019

What's the difference between opcodes and opcodes_runtime?

@iamdefinitelyahuman

This comment has been minimized.

Copy link
Contributor Author

iamdefinitelyahuman commented Aug 18, 2019

  • 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
Projects
None yet
4 participants
You can’t perform that action at this time.