Release Notes

v0.4.0 (“Nagini”)

Date released: 2024-06-20

v0.4.0 represents a major overhaul to the Vyper language. Notably, it overhauls the import system and adds support for code reuse. It also adds a new, experimental backend to Vyper which lays the foundation for improved analysis, optimization and integration with third party tools.

Breaking Changes

  • feat[tool]!: make cancun the default evm version (#4029)

  • feat[lang]: remove named reentrancy locks (#3769)

  • feat[lang]!: change the signature of block.prevrandao (#3879)

  • feat[lang]!: change ABI type of decimal to int168 (#3696)

  • feat[lang]: rename _abi_encode and _abi_decode (#4097)

  • feat[lang]!: add feature flag for decimals (#3930)

  • feat[lang]!: make internal decorator optional (#4040)

  • feat[lang]: protect external calls with keyword (#2938)

  • introduce floordiv, ban regular div for integers (#2937)

  • feat[lang]: use keyword arguments for struct instantiation (#3777)

  • feat: require type annotations for loop variables (#3596)

  • feat: replace enum with flag keyword (#3697)

  • feat: remove builtin constants (#3350)

  • feat: drop istanbul and berlin support (#3843)

  • feat: allow range with two arguments and bound (#3679)

  • fix[codegen]: range bound check for signed integers (#3814)

  • feat: default code offset = 3 (#3454)

  • feat: rename vyper.interfaces to ethereum.ercs (#3741)

  • chore: add prefix to ERC interfaces (#3804)

  • chore[ux]: compute natspec as part of standard pipeline (#3946)

  • feat: deprecate vyper-serve (#3666)

Module system

  • refactor: internal handling of imports (#3655)

  • feat: implement “stateless” modules (#3663)

  • feat[lang]: export interfaces (#3919)

  • feat[lang]: singleton modules with ownership hierarchy (#3729)

  • feat[lang]: implement function exports (#3786)

  • feat[lang]: auto-export events in ABI (#3808)

  • fix: allow using interface defs from imported modules (#3725)

  • feat: add support for constants in imported modules (#3726)

  • fix[lang]: prevent modules as storage variables (#4088)

  • fix[ux]: improve initializer hint for unimported modules (#4145)

  • feat: add python sys.path to vyper path (#3763)

  • feat[ux]: improve error message for importing ERC20 (#3816)

  • fix[lang]: fix importing of flag types (#3871)

  • feat: search path resolution for cli (#3694)

  • fix[lang]: transitive exports (#3888)

  • fix[ux]: error messages relating to initializer issues (#3831)

  • fix[lang]: recursion in uses analysis for nonreentrant functions (#3971)

  • fix[ux]: fix uses error message (#3926)

  • fix[lang]: fix uses analysis for nonreentrant functions (#3927)

  • fix[lang]: fix a hint in global initializer check (#4089)

  • fix[lang]: builtin type comparisons (#3956)

  • fix[tool]: fix combined_json output for CLI (#3901)

  • fix[tool]: compile multiple files (#4053)

  • refactor: reimplement AST folding (#3669)

  • refactor: constant folding (#3719)

  • fix[lang]: typecheck hashmap indexes with folding (#4007)

  • fix[lang]: fix array index checks when the subscript is folded (#3924)

  • fix[lang]: pure access analysis (#3895)

Venom

  • feat: implement new IR for vyper (venom IR) (#3659)

  • feat[ir]: add make_ssa pass to venom pipeline (#3825)

  • feat[venom]: implement mem2var and sccp passes (#3941)

  • feat[venom]: add store elimination pass (#4021)

  • feat[venom]: add extract_literals pass (#4067)

  • feat[venom]: optimize branching (#4049)

  • feat[venom]: avoid last swap for commutative ops (#4048)

  • feat[venom]: “pickaxe” stack scheduler optimization (#3951)

  • feat[venom]: add algebraic optimization pass (#4054)

  • feat: Implement target constrained venom jump instruction (#3687)

  • feat: remove deploy instruction from venom (#3703)

  • fix[venom]: liveness analysis in some loops (#3732)

  • feat: add more venom instructions (#3733)

  • refactor[venom]: use venom pass instances (#3908)

  • refactor[venom]: refactor venom operand classes (#3915)

  • refactor[venom]: introduce IRContext and IRAnalysisCache (#3983)

  • feat: add utility functions to OrderedSet (#3833)

  • feat[venom]: optimize get_basic_block() (#4002)

  • fix[venom]: fix branch eliminator cases in sccp (#4003)

  • fix[codegen]: same symbol jumpdest merge (#3982)

  • fix[venom]: fix eval of exp in sccp (#4009)

  • refactor[venom]: remove unused method in make_ssa.py (#4012)

  • fix[venom]: fix return opcode handling in mem2var (#4011)

  • fix[venom]: fix cfg output format (#4010)

  • chore[venom]: fix output formatting of data segment in IRContext (#4016)

  • feat[venom]: optimize mem2var and store/variable elimination pass sequences (#4032)

  • fix[venom]: fix some sccp evaluations (#4028)

  • fix[venom]: add unique_symbols check to venom pipeline (#4149)

  • feat[venom]: remove redundant store elimination pass (#4036)

  • fix[venom]: remove some dead code in venom_to_assembly (#4042)

  • feat[venom]: improve unused variable removal pass (#4055)

  • fix[venom]: remove liveness requests (#4058)

  • fix[venom]: fix list of volatile instructions (#4065)

  • fix[venom]: remove dominator tree invalidation for store elimination pass (#4069)

  • fix[venom]: move loop invariant assertion to entry block (#4098)

  • fix[venom]: clear out_vars during calculation (#4129)

  • fix[venom]: alloca for default arguments (#4155)

  • Refactor ctx.add_instruction() and friends (#3685)

  • fix: type annotation of helper function (#3702)

  • feat[ir]: emit djump in dense selector table (#3849)

  • chore: move venom tests to tests/unit/compiler (#3684)

Other new features

  • feat[lang]: add blobhash() builtin (#3962)

  • feat[lang]: support block.blobbasefee (#3945)

  • feat[lang]: add revert_on_failure kwarg for create builtins (#3844)

  • feat[lang]: allow downcasting of bytestrings (#3832)

Docs

  • chore[docs]: add docs for v0.4.0 features (#3947)

  • chore[docs]: implements does not check event declarations (#4052)

  • docs: adopt a new theme: shibuya (#3754)

  • chore[docs]: add evaluation order warning for builtins (#4158)

  • Update FUNDING.yml (#3636)

  • docs: fix nit in v0.3.10 release notes (#3638)

  • docs: add note on pragma parsing (#3640)

  • docs: retire security@vyperlang.org (#3660)

  • feat[docs]: add more detail to modules docs (#4087)

  • docs: update resources section (#3656)

  • docs: add script to help working on the compiler (#3674)

  • docs: add warnings at the top of all example token contracts (#3676)

  • docs: typo in on_chain_market_maker.vy (#3677)

  • docs: clarify address.codehash for empty account (#3711)

  • docs: indexed arguments for events are limited (#3715)

  • docs: Fix typos (#3747)

  • docs: Upgrade dependencies and fixes (#3745)

  • docs: add missing cli flags (#3736)

  • chore: fix formatting and docs for new struct instantiation syntax (#3792)

  • docs: floordiv (#3797)

  • docs: add missing annotated_ast flag (#3813)

  • docs: update logo in readme, remove competition reference (#3837)

  • docs: add rationale for floordiv rounding behavior (#3845)

  • chore[docs]: amend revert_on_failure kwarg docs for create builtins (#3921)

  • fix[docs]: fix clipped endAuction method in example section (#3969)

  • refactor[docs]: refactor security policy (#3981)

  • fix: edit link to style guide (#3658)

  • Add Vyper online compiler tooling (#3680)

  • chore: fix typos (#3749)

Bugfixes

  • fix[codegen]: fix raw_log() when topics are non-literals (#3977)

  • fix[codegen]: fix transient codegen for slice and extract32 (#3874)

  • fix[codegen]: bounds check for signed index accesses (#3817)

  • fix: disallow value= passing for delegate and static raw_calls (#3755)

  • fix[codegen]: fix double evals in sqrt, slice, blueprint (#3976)

  • fix[codegen]: fix double eval in dynarray append/pop (#4030)

  • fix[codegen]: fix double eval of start in range expr (#4033)

  • fix[codegen]: overflow check in slice() (#3818)

  • fix: concat buffer bug (#3738)

  • fix[codegen]: fix make_setter overlap with internal calls (#4037)

  • fix[codegen]: fix make_setter overlap in dynarray_append (#4059)

  • fix[codegen]: make_setter overlap in the presence of staticcall (#4128)

  • fix[codegen]: fix _abi_decode buffer overflow (#3925)

  • fix[codegen]: zero-length dynarray abi_decode validation (#4060)

  • fix[codegen]: recursive dynarray oob check (#4091)

  • fix[codegen]: add back in returndatasize check (#4144)

  • fix: block memory allocation overflow (#3639)

  • fix[codegen]: panic on potential eval order issue for some builtins (#4157)

  • fix[codegen]: panic on potential subscript eval order issue (#4159)

  • add comptime check for uint2str input (#3671)

  • fix: dead code analysis inside for loops (#3731)

  • fix[ir]: fix a latent bug in sha3_64 codegen (#4063)

  • fix: opcodes and opcodes_runtime outputs (#3735)

  • fix: bad assertion in expr.py (#3758)

  • fix: iterator modification analysis (#3764)

  • feat: allow constant interfaces (#3718)

  • fix: assembly dead code eliminator (#3791)

  • fix: prevent range over decimal (#3798)

  • fix: mutability check for interface implements (#3805)

  • fix[codegen]: fix non-memory reason strings (#3877)

  • fix[ux]: fix compiler hang for large exponentiations (#3893)

  • fix[lang]: allow type expressions inside pure functions (#3906)

  • fix[ux]: raise VersionException with source info (#3920)

  • fix[lang]: fix pow folding when args are not literals (#3949)

  • fix[codegen]: fix some hardcoded references to STORAGE location (#4015)

Patched security advisories (GHSAs)

Tooling

  • feat[tool]: archive format (#3891)

  • feat[tool]: add source map for constructors (#4008)

  • feat: add short options -v and -O to the CLI (#3695)

  • feat: Add bb and bb_runtime output options (#3700)

  • fix: remove hex-ir from format cli options list (#3657)

  • fix: pickleability of CompilerData (#3803)

  • feat[tool]: validate AST nodes early in the pipeline (#3809)

  • feat[tool]: delay global constraint check (#3810)

  • feat[tool]: export variable read/write access (#3790)

  • feat[tool]: improvements to AST annotation (#3829)

  • feat[tool]: add node_id map to source map (#3811)

  • chore[tool]: add help text for hex-ir CLI flag (#3942)

  • refactor[tool]: refactor storage layout export (#3789)

  • fix[tool]: fix cross-compilation issues, add windows CI (#4014)

  • fix[tool]: star option in outputSelection (#4094)

Performance

  • perf: lazy eval of f-strings in IRnode ctor (#3602)

  • perf: levenshtein optimization (#3780)

  • feat: frontend optimizations (#3781)

  • feat: optimize VyperNode.deepcopy (#3784)

  • feat: more frontend optimizations (#3785)

  • perf: reimplement IRnode.__deepcopy__ (#3761)

Testing suite improvements

  • refactor[test]: bypass eth-tester and interface with evm backend directly (#3846)

  • feat: Refactor assert_tx_failed into a context (#3706)

  • feat[test]: implement abi_decode spec test (#4095)

  • feat[test]: add more coverage to abi_decode fuzzer tests (#4153)

  • feat[ci]: enable cancun testing (#3861)

  • fix: add missing test for memory allocation overflow (#3650)

  • chore: fix test for slice (#3633)

  • add abi_types unit tests (#3662)

  • refactor: test directory structure (#3664)

  • chore: test all output formats (#3683)

  • chore: deduplicate test files (#3773)

  • feat[test]: add more transient storage tests (#3883)

  • chore[ci]: fix apt-get failure in era pipeline (#3821)

  • chore[ci]: enable python3.12 tests (#3860)

  • chore[ci]: refactor jobs to use gh actions (#3863)

  • chore[ci]: use --dist worksteal from latest xdist (#3869)

  • chore: run mypy as part of lint rule in Makefile (#3771)

  • chore[test]: always specify the evm backend (#4006)

  • chore: update lint dependencies (#3704)

  • chore: add color to mypy output (#3793)

  • chore: remove tox rules for lint commands (#3826)

  • chore[ci]: roll back GH actions/artifacts version (#3838)

  • chore: Upgrade GitHub action dependencies (#3807)

  • chore[ci]: pin eth-abi for decode regression (#3834)

  • fix[ci]: release artifacts (#3839)

  • chore[ci]: merge mypy job into lint (#3840)

  • test: parametrize CI over EVM versions (#3842)

  • feat[ci]: add PR title validation (#3887)

  • fix[test]: fix failure in grammar fuzzing (#3892)

  • feat[test]: add xfail_strict, clean up setup.cfg (#3889)

  • fix[ci]: pin hexbytes to pre-1.0.0 (#3903)

  • chore[test]: update hexbytes version and tests (#3904)

  • fix[test]: fix a bad bound in decimal fuzzing (#3909)

  • fix[test]: fix a boundary case in decimal fuzzing (#3918)

  • feat[ci]: update pypi release pipeline to use OIDC (#3912)

  • chore[ci]: reconfigure single commit validation (#3937)

  • chore[ci]: downgrade codecov action to v3 (#3940)

  • feat[ci]: add codecov configuration (#4057)

  • feat[test]: remove memory mocker (#4005)

  • refactor[test]: change fixture scope in examples (#3995)

  • fix[test]: fix call graph stability fuzzer (#4064)

  • chore[test]: add macos to test matrix (#4025)

  • refactor[test]: change default expected exception type (#4004)

Misc / refactor

  • feat[ir]: add eval_once sanity fences to more builtins (#3835)

  • fix: reorder compilation of branches in stmt.py (#3603)

  • refactor[codegen]: make settings into a global object (#3929)

  • chore: improve exception handling in IR generation (#3705)

  • refactor: merge annotation.py and local.py (#3456)

  • chore[ux]: remove deprecated python AST classes (#3998)

  • refactor[ux]: remove deprecated VyperNode properties (#3999)

  • feat: remove Index AST node (#3757)

  • refactor: for loop target parsing (#3724)

  • chore: improve diagnostics for invalid for loop annotation (#3721)

  • refactor: builtin functions inherit from VyperType (#3559)

  • fix: remove .keyword from Call AST node (#3689)

  • improvement: assert descriptions in Crowdfund finalize() and participate() (#3064)

  • feat: improve panics in IR generation (#3708)

  • feat: improve warnings, refactor vyper_warn() (#3800)

  • fix[ir]: unique symbol name (#3848)

  • refactor: remove duplicate terminus checking code (#3541)

  • refactor: ExprVisitor type validation (#3739)

  • chore: improve exception for type validation (#3759)

  • fix: fuzz test not updated to use TypeMismatch (#3768)

  • chore: fix StringEnum._generate_next_value_ signature (#3770)

  • chore: improve some error messages (#3775)

  • refactor: get_search_paths() for vyper cli (#3778)

  • chore: replace occurrences of ‘enum’ by ‘flag’ (#3794)

  • chore: add another borrowship test (#3802)

  • chore[ux]: improve an exports error message (#3822)

  • chore: improve codegen test coverage report (#3824)

  • chore: improve syntax error messages (#3885)

  • chore[tool]: remove vyper-serve from setup.py (#3936)

  • fix[ux]: replace standard strings with f-strings (#3953)

  • chore[ir]: sanity check types in for range codegen (#3968)

v0.3.10 (“Black Adder”)

Date released: 2023-10-04

v0.3.10 is a performance focused release that additionally ships numerous bugfixes. It adds a codesize optimization mode (#3493), adds new vyper-specific #pragma directives (#3493), uses Cancun’s MCOPY opcode for some compiler generated code (#3483), and generates selector tables which now feature O(1) performance (#3496).

Breaking changes:

  • add runtime code layout to initcode (#3584)

  • drop evm versions through istanbul (#3470)

  • remove vyper signature from runtime (#3471)

  • only allow valid identifiers to be nonreentrant keys (#3605)

Non-breaking changes and improvements:

Notable fixes:

  • fix ecrecover() behavior when signature is invalid (GHSA-f5x6-7qgp-jhf3, #3586)

  • fix: order of evaluation for some builtins (#3583, #3587)

  • fix: memory allocation in certain builtins using msize (#3610)

  • fix: _abi_decode() input validation in certain complex expressions (#3626)

  • fix: pycryptodome for arm builds (#3485)

  • let params of internal functions be mutable (#3473)

  • typechecking of folded builtins in (#3490)

  • update tload/tstore opcodes per latest 1153 EIP spec (#3484)

  • fix: raw_call type when max_outsize=0 is set (#3572)

  • fix: implements check for indexed event arguments (#3570)

  • fix: type-checking for _abi_decode() arguments (#3626)

Other docs updates, chores and fixes:

  • relax restrictions on internal function signatures (#3573)

  • note on security advisory in release notes for versions 0.2.15, 0.2.16, and 0.3.0 (#3553)

  • fix: yanked version in release notes (#3545)

  • update release notes on yanked versions (#3547)

  • improve error message for conflicting methods IDs (#3491)

  • document epsilon builtin (#3552)

  • relax version pragma parsing (#3511)

  • fix: issue with finding installed packages in editable mode (#3510)

  • add note on security advisory for ecrecover in docs (#3539)

  • add asm option to cli help (#3585)

  • add message to error map for repeat range check (#3542)

  • fix: public constant arrays (#3536)

v0.3.9 (“Common Adder”)

Date released: 2023-05-29

This is a patch release fix for v0.3.8. @bout3fiddy discovered a codesize regression for blueprint contracts in v0.3.8 which is fixed in this release. @bout3fiddy also discovered a runtime performance (gas) regression for default functions in v0.3.8 which is fixed in this release.

Fixes:

  • initcode codesize blowup (#3450)

  • add back global calldatasize check for contracts with default fn (#3463)

v0.3.8

Date released: 2023-05-23

Non-breaking changes and improvements:

  • transient storage keyword (#3373)

  • ternary operators (#3398)

  • raw_revert() builtin (#3136)

  • shift operators (#3019)

  • make send() gas stipend configurable (#3158)

  • use new push0 opcode (#3361)

  • python 3.11 support (#3129)

  • drop support for python 3.8 and 3.9 (#3325)

  • build for aarch64 (#2687)

Note that with the addition of push0 opcode, shanghai is now the default compilation target for vyper. When deploying to a chain which does not support shanghai, it is recommended to set --evm-version to paris, otherwise it could result in hard-to-debug errors.

Major refactoring PRs:

  • refactor front-end type system (#2974)

  • merge front-end and codegen type systems (#3182)

  • simplify GlobalContext (#3209)

  • remove FunctionSignature (#3390)

Notable fixes:

Other docs updates, chores and fixes:

  • call graph stability (#3370)

  • fix vyper-serve output (#3338)

  • add custom: natspec tags (#3403)

  • add missing pc maps to vyper_json output (#3333)

  • fix constructor context for internal functions (#3388)

  • add deprecation warning for selfdestruct usage (#3372)

  • add bytecode metadata option to vyper-json (#3117)

  • fix compiler panic when a break is outside of a loop (#3177)

  • fix complex arguments to builtin functions (#3167)

  • add support for all types in ABI imports (#3154)

  • disable uadd operator (#3174)

  • block bitwise ops on decimals (#3219)

  • raise UNREACHABLE (#3194)

  • allow enum as mapping key (#3256)

  • block boolean not operator on numeric types (#3231)

  • enforce that loop’s iterators are valid names (#3242)

  • fix typechecker hotspot (#3318)

  • rewrite typechecker journal to handle nested commits (#3375)

  • fix missing pc map for empty functions (#3202)

  • guard against iterating over empty list in for loop (#3197)

  • skip enum members during constant folding (#3235)

  • bitwise not constant folding (#3222)

  • allow accessing members of constant address (#3261)

  • guard against decorators in interface (#3266)

  • fix bounds for decimals in some builtins (#3283)

  • length of literal empty bytestrings (#3276)

  • block empty() for HashMaps (#3303)

  • fix type inference for empty lists (#3377)

  • disallow logging from pure, view functions (#3424)

  • improve optimizer rules for comparison operators (#3412)

  • deploy to ghcr on push (#3435)

  • add note on return value bounds in interfaces (#3205)

  • index id param in URI event of ERC1155ownable (#3203)

  • add missing asset function to ERC4626 built-in interface (#3295)

  • clarify skip_contract_check=True can result in undefined behavior (#3386)

  • add custom NatSpec tag to docs (#3404)

  • fix uint256_addmod doc (#3300)

  • document optional kwargs for external calls (#3122)

  • remove slice() length documentation caveats (#3152)

  • fix docs of blockhash to reflect revert behaviour (#3168)

  • improvements to compiler error messages (#3121, #3134, #3312, #3304, #3240, #3264, #3343, #3307, #3313 and #3215)

These are really just the highlights, as many other bugfixes, docs updates and refactoring (over 150 pull requests!) made it into this release! For the full list, please see the changelog. Special thanks to contributions from @tserg, @trocher, @z80dev, @emc415 and @benber86 in this release!

New Contributors:

  • @omahs made their first contribution in (#3128)

  • @ObiajuluM made their first contribution in (#3124)

  • @trocher made their first contribution in (#3134)

  • @ozmium22 made their first contribution in (#3149)

  • @ToonVanHove made their first contribution in (#3168)

  • @emc415 made their first contribution in (#3158)

  • @lgtm-com made their first contribution in (#3147)

  • @tdurieux made their first contribution in (#3224)

  • @victor-ego made their first contribution in (#3263)

  • @miohtama made their first contribution in (#3257)

  • @kelvinfan001 made their first contribution in (#2687)

v0.3.7

Date released: 2022-09-26

Breaking changes:

  • chore: drop python 3.7 support (#3071)

  • fix: relax check for statically sized calldata (#3090)

Non-breaking changes and improvements:

  • fix: assert description in Crowdfund.finalize() (#3058)

  • fix: change mutability of example ERC721 interface (#3076)

  • chore: improve error message for non-checksummed address literal (#3065)

  • feat: isqrt() builtin (#3074) (#3069)

  • feat: add block.prevrandao as alias for block.difficulty (#3085)

  • feat: epsilon() builtin (#3057)

  • feat: extend ecrecover signature to accept additional parameter types (#3084)

  • feat: allow constant and immutable variables to be declared public (#3024)

  • feat: optionally disable metadata in bytecode (#3107)

Bugfixes:

  • fix: empty nested dynamic arrays (#3061)

  • fix: foldable builtin default args in imports (#3079) (#3077)

Additional changes and improvements:

  • doc: update broken links in SECURITY.md (#3095)

  • chore: update discord link in docs (#3031)

  • fix: broken links in various READMEs (#3072)

  • chore: fix compile warnings in examples (#3033)

  • feat: append lineno to the filename in error messages (#3092)

  • chore: migrate lark grammar (#3082)

  • chore: loosen and upgrade semantic version (#3106)

New Contributors

  • @emilianobonassi made their first contribution in #3107

  • @unparalleled-js made their first contribution in #3106

  • @pcaversaccio made their first contribution in #3085

  • @nfwsncked made their first contribution in #3058

  • @z80 made their first contribution in #3057

  • @Benny made their first contribution in #3024

  • @cairo made their first contribution in #3072

  • @fiddy made their first contribution in #3069

Special thanks to returning contributors @tserg, @pandadefi, and @delaaxe.

v0.3.6

Date released: 2022-08-07

Bugfixes:

  • Fix in expressions when list members are variables (#3035)

v0.3.5

THIS RELEASE HAS BEEN PULLED

Date released: 2022-08-05

Non-breaking changes and improvements:

  • Add blueprint deployer output format (#3001)

  • Allow arbitrary data to be passed to create_from_blueprint (#2996)

  • Add CBOR length to bytecode for decoders (#3010)

  • Fix compiler panic when accessing enum storage vars via self (#2998)

  • Fix: allow empty() in constant definitions and in default argument position (#3008)

  • Fix: disallow self address in pure functions (#3027)

v0.3.4

Date released: 2022-07-27

Non-breaking changes and improvements:

  • Add enum types (#2874, #2915, #2925, #2977)

  • Add _abi_decode builtin (#2882)

  • Add create_from_blueprint and create_copy_of builtins (#2895)

  • Add default_return_value kwarg for calls (#2839)

  • Add min_value and max_value builtins for numeric types (#2935)

  • Add uint2str builtin (#2879)

  • Add vyper signature to bytecode (#2860)

Other fixes and improvements:

  • Call internal functions from constructor (#2496)

  • Arithmetic for new int types (#2843)

  • Allow msg.data in raw_call without slice (#2902)

  • Per-method calldatasize checks (#2911)

  • Type inference and annotation of arguments for builtin functions (#2817)

  • Allow varargs for print (#2833)

  • Add error_map output format for tooling consumption (#2939)

  • Multiple evaluation of contract address in call (GHSA-4v9q-cgpw-cf38)

  • Improve ast output (#2824)

  • Allow @nonreentrant on view functions (#2921)

  • Add shift() support for signed integers (#2964)

  • Enable dynarrays of strings (#2922)

  • Fix off-by-one bounds check in certain safepow cases (#2983)

  • Optimizer improvements (#2647, #2868, #2914, #2843, #2944)

  • Reverse order in which exceptions are reported (#2838)

  • Fix compile-time blowup for large contracts (#2981)

  • Rename vyper-ir binary to fang (#2936)

Many other small bugfixes, optimizations and refactoring also made it into this release! Special thanks to @tserg and @pandadefi for contributing several important bugfixes, refactoring and features to this release!

v0.3.3

Date released: 2022-04-22

This is a bugfix release. It patches an off-by-one error in the storage allocation mechanism for dynamic arrays reported by @haltman-at in #2820

Other fixes and improvements:

  • Add a print built-in which allows printing debugging messages in hardhat. (#2818)

  • Fix various error messages (#2798, #2805)

v0.3.2

Date released: 2022-04-17

Breaking changes:

  • Increase the bounds of the decimal type (#2730)

  • Generalize and simplify the semantics of the convert builtin (#2694)

  • Restrict hex and bytes literals (#2736, #2872)

Non-breaking changes and improvements:

  • Implement dynamic arrays (#2556, #2606, #2615)

  • Support all ABIv2 integer and bytes types (#2705)

  • Add storage layout override mechanism (#2593)

  • Support <address>.code attribute (#2583)

  • Add tx.gasprice builtin (#2624)

  • Allow structs as constant variables (#2617)

  • Implement skip_contract_check kwarg (#2551)

  • Support EIP-2678 ethPM manifest files (#2628)

  • Add metadata output format (#2597)

  • Allow msg.* variables in internal functions (#2632)

  • Add unsafe_ arithmetic builtins (#2629)

  • Add subroutines to Vyper IR (#2598)

  • Add select opcode to Vyper IR (#2690)

  • Allow lists of any type as loop variables (#2616)

  • Improve suggestions in error messages (#2806)

Notable Fixes:

Lots of optimizations, refactoring and other fixes made it into this release! For the full list, please see the changelog.

Special thanks to @tserg for typechecker fixes and significant testing of new features! Additional contributors to this release include @abdullathedruid, @hi-ogawa, @skellet0r, @fubuloubu, @onlymaresia, @SwapOperator, @hitsuzen-eth, @Sud0u53r, @davidhq.

v0.3.1

Date released: 2021-12-01

Breaking changes:

  • Disallow changes to decimal precision when used as a library (#2479)

Non-breaking changes and improvements:

  • Add immutable variables (#2466)

  • Add uint8 type (#2477)

  • Add gaslimit and basefee env variables (#2495)

  • Enable checkable raw_call (#2482)

  • Propagate revert data when external call fails (#2531)

  • Improve LLL annotations (#2486)

  • Optimize short-circuiting boolean operations (#2467, #2493)

  • Optimize identity precompile usage (#2488)

  • Remove loaded limits for int128 and address (#2506)

  • Add machine readable ir_json format (#2510)

  • Optimize raw_call for the common case when the input is in memory (#2481)

  • Remove experimental OVM transpiler (#2532)

  • Add CLI flag to disable optimizer (#2522)

  • Add docs for LLL syntax and semantics (#2494)

Fixes:

  • Allow non-constant revert reason strings (#2509)

  • Allow slices of complex expressions (#2500)

  • Remove seq_unchecked from LLL codegen (#2485)

  • Fix external calls with default parameters (#2526)

  • Enable lists of structs as function arguments (#2515)

  • Fix .balance on constant addresses (#2533)

  • Allow variable indexing into constant/literal arrays (#2534)

  • Fix allocation of unused storage slots (#2439, #2514)

Special thanks to @skellet0r for some major features in this release!

v0.3.0

⚠️ A critical security vulnerability has been discovered in this version and we strongly recommend using version 0.3.1 or higher. For more information, please see the Security Advisory GHSA-5824-cm3x-3c38.

Date released: 2021-10-04

Breaking changes:

  • Change ABI encoding of single-struct return values to be compatible with Solidity (#2457)

  • Drop Python 3.6 support (#2462)

Non-breaking changes and improvements:

  • Rewrite internal calling convention (#2447)

  • Allow any ABI-encodable type as function arguments and return types (#2154, #2190)

  • Add support for deterministic deployment of minimal proxies using CREATE2 (#2460)

  • Optimize code for certain copies (#2468)

  • Add -o CLI flag to redirect output to a file (#2452)

  • Other docs updates (#2450)

Fixes:

  • _abi_encode builtin evaluates arguments multiple times (#2459)

  • ABI length is too short for nested tuples (#2458)

  • Returndata is not clamped for certain numeric types (#2454)

  • __default__ functions do not respect nonreentrancy keys (#2455)

  • Clamps for bytestrings in initcode are broken (#2456)

  • Missing clamps for decimal args in external functions (GHSA-c7pr-343r-5c46)

  • Memory corruption when returning a literal struct with a private function call inside of it (GHSA-xv8x-pr4h-73jv)

Special thanks to contributions from @skellet0r and @benjyz for this release!

v0.2.16

⚠️ A critical security vulnerability has been discovered in this version and we strongly recommend using version 0.3.1 or higher. For more information, please see the Security Advisory GHSA-5824-cm3x-3c38.

Date released: 2021-08-27

Non-breaking changes and improvements:

  • Expose _abi_encode as a user-facing builtin (#2401)

  • Export the storage layout as a compiler output option (#2433)

  • Add experimental OVM backend (#2416)

  • Allow any ABI-encodable type as event arguments (#2403)

  • Optimize int128 clamping (#2411)

  • Other docs updates (#2405, #2422, #2425)

Fixes:

  • Disallow nonreentrant decorator on constructors (#2426)

  • Fix bounds checks when handling msg.data (#2419)

  • Allow interfaces in lists, structs and maps (#2397)

  • Fix trailing newline parse bug (#2412)

Special thanks to contributions from @skellet0r, @sambacha and @milancermak for this release!

v0.2.15

⚠️ A critical security vulnerability has been discovered in this version and we strongly recommend using version 0.3.1 or higher. For more information, please see the Security Advisory GHSA-5824-cm3x-3c38.

Date released: 23-07-2021

Non-breaking changes and improvements - Optimization when returning nested tuples (#2392)

Fixes: - Annotated kwargs for builtins (#2389) - Storage slot allocation bug (#2391)

v0.2.14

THIS RELEASE HAS BEEN PULLED

Date released: 20-07-2021

Non-breaking changes and improvements: - Reduce bytecode by sharing code for clamps (#2387)

Fixes: - Storage corruption from re-entrancy locks (#2379)

v0.2.13

THIS RELEASE HAS BEEN PULLED

Date released: 06-07-2021

Non-breaking changes and improvements:

  • Add the abs builtin function (#2356)

  • Streamline the location of arrays within storage (#2361)

v0.2.12

Date released: 16-04-2021

This release fixes a memory corruption bug (#2345) that was introduced in the v0.2.x series and was not fixed in VVE-2020-0004. Read about it further in VVE-2021-0001.

Non-breaking changes and improvements:

  • Optimize calldataload (#2352)

  • Add the int256 signed integer type (#2351)

  • EIP2929 opcode repricing and Berlin support (#2350)

  • Add msg.data environment variable #2343 (#2343)

  • Full support for Python 3.9 (#2233)

v0.2.11

Date released: 27-02-2021

This is a quick patch release to fix a memory corruption bug that was introduced in v0.2.9 (#2321) with excessive memory deallocation when releasing internal variables

v0.2.10

THIS RELEASE HAS BEEN PULLED

Date released: 17-02-2021

This is a quick patch release to fix incorrect generated ABIs that was introduced in v0.2.9 (#2311) where storage variable getters were incorrectly marked as nonpayable instead of view

v0.2.9

THIS RELEASE HAS BEEN PULLED

Date released: 16-02-2021

Non-breaking changes and improvements: - Add license to wheel, Anaconda support (#2265) - Consider events during type-check with implements: (#2283) - Refactor ABI generation (#2284) - Remove redundant checks in parser/signatures (#2288) - Streamling ABI-encoding logic for tuple return types (#2302) - Optimize function ordering within bytecode (#2303) - Assembly-level optimizations (#2304) - Optimize nonpayable assertion (#2307) - Optimize re-entrancy locks (#2308)

Fixes: - Change forwarder proxy bytecode to ERC-1167 (#2281) - Reserved keywords check update (#2286) - Incorrect type-check error in literal lists (#2309)

Tons of Refactoring work courtesy of (@iamdefinitelyahuman)!

v0.2.8

Date released: 04-12-2020

Non-breaking changes and improvements:

  • AST updates to provide preliminary support for Python 3.9 (#2225)

  • Support for the not in comparator (#2232)

  • Lift restriction on calldata variables shadowing storage variables (#2226)

  • Optimize shift bytecode when 2nd arg is a literal (#2201)

  • Warn when EIP-170 size limit is exceeded (#2208)

Fixes:

  • Allow use of slice on a calldata bytes32 (#2227)

  • Explicitly disallow iteration of a list of structs (#2228)

  • Improved validation of address checksums (#2229)

  • Bytes are always represented as hex within the AST (#2231)

  • Allow empty as an argument within a function call (#2234)

  • Allow empty static-sized array as an argument within a log statement (#2235)

  • Compile-time issue with Bytes variables as a key in a mapping (#2239)

v0.2.7

Date released: 10-14-2020

This is a quick patch release to fix a runtime error introduced in v0.2.6 (#2188) that could allow for memory corruption under certain conditions.

Non-breaking changes and improvements:

  • Optimizations around assert and raise (#2198)

  • Simplified internal handling of memory variables (#2194)

Fixes:

  • Ensure internal variables are always placed sequentially within memory (#2196)

  • Bugfixes around memory de-allocation (#2197)

v0.2.6

THIS RELEASE HAS BEEN PULLED

Date released: 10-10-2020

Non-breaking changes and improvements:

  • Release and reuse memory slots within the same function (#2188)

  • Allow implicit use of uint256 as iterator type in range-based for loops (#2180)

  • Optimize clamping logic for int128 (#2179)

  • Calculate array index offsets at compile time where possible (#2187)

  • Improved exception for invalid use of dynamically sized struct (#2189)

  • Improved exception for incorrect arg count in function call (#2178)

  • Improved exception for invalid subscript (#2177)

Fixes:

  • Memory corruption issue when performing function calls inside a tuple or another function call (#2186)

  • Incorrect function output when using multidimensional arrays (#2184)

  • Reduced ambiguity between address and Bytes[20] (#2191)

v0.2.5

Date released: 30-09-2020

Non-breaking changes and improvements:

  • Improve exception on incorrect interface (#2131)

  • Standalone binary preparation (#2134)

  • Improve make freeze (#2135)

  • Remove Excessive Scoping Rules on Local Variables (#2166)

  • Optimize nonpayable check for contracts that do not accept ETH (#2172)

  • Optimize safemath on division-by-zero with a literal divisor (#2173)

  • Optimize multiple sequential memory-zeroings (#2174)

  • Optimize size-limit checks for address and bool types (#2175)

Fixes:

  • Constant folding on lhs of assignments (#2137)

  • ABI issue with bytes and string arrays inside tuples (#2140)

  • Returning struct from a external function gives error (#2143)

  • Error messages with struct display all members (#2160)

  • The returned struct value from the external call doesn’t get stored properly (#2164)

  • Improved exception on invalid function-scoped assignment (#2176)

v0.2.4

Date released: 03-08-2020

Non-breaking changes and improvements:

  • Improve EOF Exceptions (#2115)

  • Improve exception messaging for type mismatches (#2119)

  • Ignore trailing newline tokens (#2120)

Fixes:

  • Fix ABI translations for structs that are returned from functions (#2114)

  • Raise when items that are not types are called (#2118)

  • Ensure hex and decimal AST nodes are serializable (#2123)

v0.2.3

Date released: 16-07-2020

Non-breaking changes and improvements:

  • Show contract names in raised exceptions (#2103)

  • Adjust function offsets to not include decorators (#2102)

  • Raise certain exception types immediately during module-scoped type checking (#2101)

Fixes:

  • Pop for loop values from stack prior to returning (#2110)

  • Type checking non-literal array index values (#2108)

  • Meaningful output during for loop type checking (#2096)

v0.2.2

Date released: 04-07-2020

Fixes:

  • Do not fold exponentiation to a negative power (#2089)

  • Add repr for mappings (#2090)

  • Literals are only validated once (#2093)

v0.2.1

Date released: 03-07-2020

This is a major breaking release of the Vyper compiler and language. It is also the first release following our versioning scheme (#1887).

Breaking changes:

  • @public and @private function decorators have been renamed to @external and @internal (VIP #2065)

  • The @constant decorator has been renamed to @view (VIP #2040)

  • Type units have been removed (VIP #1881)

  • Event declaration syntax now resembles that of struct declarations (VIP #1864)

  • log is now a statement (VIP #1864)

  • Mapping declaration syntax changed to HashMap[key_type, value_type] (VIP #1969)

  • Interfaces are now declared via the interface keyword instead of contract (VIP #1825)

  • bytes and string types are now written as Bytes and String (#2080)

  • bytes and string literals must now be bytes or regular strings, respectively. They are no longer interchangeable. (VIP #1876)

  • assert_modifiable has been removed, you can now directly perform assertions on calls (#2050)

  • value is no longer an allowable variable name in a function input (VIP #1877)

  • The slice builtin function expects uint256 for the start and length args (VIP #1986)

  • len return type is now uint256 (VIP #1979)

  • value and gas kwargs for external function calls must be given as uint256 (VIP #1878)

  • The outsize kwarg in raw_call has been renamed to max_outsize (#1977)

  • The type kwarg in extract32 has been renamed to output_type (#2036)

  • Public array getters now use uint256 for their input argument(s) (VIP #1983)

  • Public struct getters now return all values of a struct (#2064)

  • RLPList has been removed (VIP #1866)

The following non-breaking VIPs and features were implemented:

  • Implement boolean condition short circuiting (VIP #1817)

  • Add the empty builtin function for zero-ing a value (#1676)

  • Refactor of the compiler process resulting in an almost 5x performance boost! (#1962)

  • Support ABI State Mutability Fields in Interface Definitions (VIP #2042)

  • Support @pure decorator (VIP #2041)

  • Overflow checks for exponentiation (#2072)

  • Validate return data length via RETURNDATASIZE (#2076)

  • Improved constant folding (#1949)

  • Allow raise without reason string (VIP #1902)

  • Make the type argument in method_id optional (VIP #1980)

  • Hash complex types when used as indexed values in an event (#2060)

  • Ease restrictions on calls to self (#2059)

  • Remove ordering restrictions in module-scope of contract (#2057)

  • raw_call can now be used to perform a STATICCALL (#1973)

  • Optimize precompiles to use STATICCALL (#1930)

Some of the bug and stability fixes:

  • Arg clamping issue when using multidimensional arrays (#2071)

  • Support calldata arrays with the in comparator (#2070)

  • Prevent modification of a storage array during iteration via for loop (#2028)

  • Fix memory length of revert string (#1982)

  • Memory offset issue when returning tuples from private functions (#1968)

  • Issue with arrays as default function arguments (#2077)

  • Private function calls no longer generate a call signature (#2058)

Significant codebase refactor, thanks to (@iamdefinitelyahuman)!

NOTE: v0.2.0 was not used due to a conflict in PyPI with a previous release. Both tags v0.2.0 and v0.2.1 are identical.

v0.1.0-beta.17

Date released: 24-03-2020

The following VIPs and features were implemented for Beta 17:

  • raw_call and slice argument updates (VIP #1879)

  • NatSpec support (#1898)

Some of the bug and stability fixes:

  • ABI interface fixes (#1842)

  • Modifications to how ABI data types are represented (#1846)

  • Generate method identifier for struct return type (#1843)

  • Return tuple with fixed array fails to compile (#1838)

  • Also lots of refactoring and doc updates!

This release will be the last to follow our current release process. All future releases will be governed by the versioning scheme (#1887). The next release will be v0.2.0, and contain many breaking changes.

v0.1.0-beta.16

Date released: 09-01-2020

Beta 16 was a quick patch release to fix one issue: (#1829)

v0.1.0-beta.15

Date released: 06-01-2020

NOTE: we changed our license to Apache 2.0 (#1772)

The following VIPs were implemented for Beta 15:

Some of the bug and stability fixes:

  • Removed all traces of Javascript from the codebase (#1770)

  • Ensured sufficient gas stipend for precompiled calls (#1771)

  • Allow importing an interface that contains an implements statement (#1774)

  • Fixed how certain values compared when using min and max (#1790)

  • Removed unnecessary overflow checks on addmod and mulmod (#1786)

  • Check for state modification when using tuples (#1785)

  • Fix Windows path issue when importing interfaces (#1781)

  • Added Vyper grammar, currently used for fuzzing (#1768)

  • Modify modulus calculations for literals to be consistent with the EVM (#1792)

  • Explicitly disallow the use of exponentiation on decimal values (#1792)

  • Add compile-time checks for divide by zero and modulo by zero (#1792)

  • Fixed some issues with negating constants (#1791)

  • Allow relative imports beyond one parent level (#1784)

  • Implement SHL/SHR for bitshifting, using Constantinople rules (#1796)

  • vyper-json compatibility with solc settings (#1795)

  • Simplify the type check when returning lists (#1797)

  • Add branch coverage reporting (#1743)

  • Fix struct assignment order (#1728)

  • Added more words to reserved keyword list (#1741)

  • Allow scientific notation for literals (#1721)

  • Avoid overflow on sqrt of Decimal upper bound (#1679)

  • Refactor ABI encoder (#1723)

  • Changed opcode costs per EIP-1884 (#1764)

Special thanks to (@iamdefinitelyahuman) for lots of updates this release!

v0.1.0-beta.14

Date released: 13-11-2019

Some of the bug and stability fixes:

  • Mucho Documentation and Example cleanup!

  • Python 3.8 support (#1678)

  • Disallow scientific notation in literals, which previously parsed incorrectly (#1681)

  • Add implicit rewrite rule for bytes[32] -> bytes32 (#1718)

  • Support bytes32 in raw_log (#1719)

  • Fixed EOF parsing bug (#1720)

  • Cleaned up arithmetic expressions (#1661)

  • Fixed off-by-one in check for homogeneous list element types (#1673)

  • Fixed stack valency issues in if and for statements (#1665)

  • Prevent overflow when using sqrt on certain datatypes (#1679)

  • Prevent shadowing of internal variables (#1601)

  • Reject unary subtraction on unsigned types (#1638)

  • Disallow orelse syntax in for loops (#1633)

  • Increased clarity and efficiency of zero-padding (#1605)

v0.1.0-beta.13

Date released: 27-09-2019

The following VIPs were implemented for Beta 13:

  • Add vyper-json compilation mode (VIP #1520)

  • Environment variables and constants can now be used as default parameters (VIP #1525)

  • Require uninitialized memory be set on creation (VIP #1493)

Some of the bug and stability fixes:

  • Type check for default params and arrays (#1596)

  • Fixed bug when using assertions inside for loops (#1619)

  • Fixed zero padding error for ABI encoder (#1611)

  • Check calldatasize before calldataload for function selector (#1606)

v0.1.0-beta.12

Date released: 27-08-2019

The following VIPs were implemented for Beta 12:

  • Support for relative imports (VIP #1367)

  • Restricted use of environment variables in private functions (VIP #1199)

Some of the bug and stability fixes:

  • @nonreentrant/@constant logical inconsistency (#1544)

  • Struct passthrough issue (#1551)

  • Private underflow issue (#1470)

  • Constancy check issue (#1480)

  • Prevent use of conflicting method IDs (#1530)

  • Missing arg check for private functions (#1579)

  • Zero padding issue (#1563)

  • vyper.cli rearchitecture of scripts (#1574)

  • AST end offsets and Solidity-compatible compressed sourcemap (#1580)

Special thanks to (@iamdefinitelyahuman) for lots of updates this release!

v0.1.0-beta.11

Date released: 23-07-2019

Beta 11 brings some performance and stability fixes.

  • Using calldata instead of memory parameters. (#1499)

  • Reducing of contract size, for large parameter functions. (#1486)

  • Improvements for Windows users (#1486) (#1488)

  • Array copy optimisation (#1487)

  • Fixing @nonreentrant decorator for return statements (#1532)

  • sha3 builtin function removed (#1328)

  • Disallow conflicting method IDs (#1530)

  • Additional convert() supported types (#1524) (#1500)

  • Equality operator for strings and bytes (#1507)

  • Change in compile_codes interface function (#1504)

Thanks to all the contributors!

v0.1.0-beta.10

Date released: 24-05-2019

  • Lots of linting and refactoring!

  • Bugfix with regards to using arrays as parameters to private functions (#1418). Please check your contracts, and upgrade to latest version, if you do use this.

  • Slight shrinking in init produced bytecode. (#1399)

  • Additional constancy protection in the for .. range expression. (#1397)

  • Improved bug report (#1394)

  • Fix returning of External Contract from functions (#1376)

  • Interface unit fix (#1303)

  • Not Equal (!=) optimisation (#1303) 1386

  • New assert <condition>, UNREACHABLE statement. (#711)

Special thanks to (Charles Cooper), for some excellent contributions this release.

v0.1.0-beta.9

Date released: 12-03-2019

  • Add support for list constants (#1211)

  • Add sha256 function (#1327)

  • Renamed create_with_code_of to create_forwarder_to (#1177)

  • @nonreentrant Decorator (#1204)

  • Add opcodes and opcodes_runtime flags to compiler (#1255)

  • Improved External contract call interfaces (#885)

Prior to v0.1.0-beta.9

Prior to this release, we managed our change log in a different fashion. Here is the old changelog:

  • 2019.04.05: Add stricter checking of unbalanced return statements. (#590)

  • 2019.03.04: create_with_code_of has been renamed to create_forwarder_to. (#1177)

  • 2019.02.14: Assigning a persistent contract address can only be done using the bar_contact = ERC20(<address>) syntax.

  • 2019.02.12: ERC20 interface has to be imported using from vyper.interfaces import ERC20 to use.

  • 2019.01.30: Byte array literals need to be annotated using b"", strings are represented as “”.

  • 2018.12.12: Disallow use of None, disallow use of del, implemented clear() built-in function.

  • 2018.11.19: Change mapping syntax to use map(). (VIP564)

  • 2018.10.02: Change the convert style to use types instead of string. (VIP1026)

  • 2018.09.24: Add support for custom constants.

  • 2018.08.09: Add support for default parameters.

  • 2018.06.08: Tagged first beta.

  • 2018.05.23: Changed wei_value to be uint256.

  • 2018.04.03: Changed bytes declaration from bytes <= n to bytes[n].

  • 2018.03.27: Renaming signed256 to int256.

  • 2018.03.22: Add modifiable and static keywords for external contract calls.

  • 2018.03.20: Renaming __log__ to event.

  • 2018.02.22: Renaming num to int128, and num256 to uint256.

  • 2018.02.13: Ban functions with payable and constant decorators.

  • 2018.02.12: Division by num returns decimal type.

  • 2018.02.09: Standardize type conversions.

  • 2018.02.01: Functions cannot have the same name as globals.

  • 2018.01.27: Change getter from get_var to var.

  • 2018.01.11: Change version from 0.0.2 to 0.0.3

  • 2018.01.04: Types need to be specified on assignment (VIP545).

  • 2017.01.02 Change as_wei_value to use quotes for units.

  • 2017.12.25: Change name from Viper to Vyper.

  • 2017.12.22: Add continue for loops

  • 2017.11.29: @internal renamed to @private.

  • 2017.11.15: Functions require either @internal or @public decorators.

  • 2017.07.25: The def foo() -> num(const): ... syntax no longer works; you now need to do def foo() -> num: ... with a @constant decorator on the previous line.

  • 2017.07.25: Functions without a @payable decorator now fail when called with nonzero wei.

  • 2017.07.25: A function can only call functions that are declared above it (that is, A can call B only if B appears earlier in the code than A does). This was introduced