You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
contractFoo {
function bar(OtherContract c) publicreturns (string) {
return c.call();
}
}
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:
LucasSte
changed the title
Remove unnecessary constructors from Solana contracts
Remove unnecessary constructors and data accounts from Solana contracts
Aug 8, 2023
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: