-
Notifications
You must be signed in to change notification settings - Fork 211
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
Remove unnecessary constructors and data accounts from Solana contracts #1480
Comments
If this can be picked up as good-first-issue for a rust and blockchain beginner then I would like to pick this up! |
This task requires a significant amount of work. One needs to understand Solana's account model and how we modeled Solidity contracts around a program account to come up with a plan. After that, changes in sema and codegen are necessary, in addition to writing more tests and updating the current tests to work with the new changes. As this feature diverges from the current implementation of constructors, the documentation will need the respective updates. I wouldn't classify this issue as good for beginners, but if you are motivated to spend several weeks on it, please reach me on Discord so we can discuss it further. |
After that PR #1474 is merged, constructors are left in an awkward situation. If a contract has no storage variables, no function will require a data account, but the constructor will still need an account to be initialized.
Take this example:
Although
bar
does not require a data account, we still need to call Foo's construction and initialize its data account, which will never be used.The text was updated successfully, but these errors were encountered: