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
initialisation of stateless modules #3934
Comments
### 🕓 Changelog This PR refactors the `Math` contract to make it module-friendly and ready for the breaking `0.4.0` release. Furthermore, I remove the initialisation for stateless modules (see [here](vyperlang/vyper#3934) for the issue). It's important to note that if a contract is stateless in the sense that it does not access storage or `immutable`s but still uses `nonreentrant` decorators, it implicitly uses/accesses state via the `SLOAD` of the `$.nonreentrant_key` key at (default) slot `0`, and thus requires the `uses` or `initializes` syntax. --------- Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
seems like it should just emit a warning about it not really being neccessary to do |
i'd say if we're going to issue a warning, we might as well issue an error. initializing a stateless module seems like an error tbh. (i think in most languages it would be considered a linter issue, but in vyper we have always been a bit more aggressive about promoting "lint-level" issues into compiler errors). |
I think disallowing this behaviour makes most sense, i.e. throw a compiler error. |
Not sure whether this is a bug or feature, but the initialisation of stateless modules compiles:
The text was updated successfully, but these errors were encountered: