vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.91k stars 803 forks source link

`exit` instruction in runtime code #4317

Closed charles-cooper closed 1 month ago

charles-cooper commented 1 month ago

the following code emits an exit instruction in the runtime code

totalShares: public(uint256)

# Set up the company.
@deploy
def __init__(_total_shares: uint256):
    pass

running vyper --experimental-codegen -f bb_runtime gives:

fallback:  IN=[__main_entry, 47_if_exit] OUT=[] => {}
    revert 0, 0
    exit

_Originally posted by @sandbubbles in https://github.com/vyperlang/vyper/pull/4314#discussion_r1806877996_

this isn't a big deal since the exit gets optimized out, but we should remove it as a matter of well-formedness.