Skip to content
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

publish: Add warning if aragon app solidity code initializes any global variable #26

Closed
izqui opened this issue Jan 9, 2018 · 2 comments

Comments

@izqui
Copy link
Contributor

izqui commented Jan 9, 2018

Because of our use of Proxies, child contracts won't initialize global variables when created. In case an app being published does this, we should at least warn the developer.

contract MyFancyApp is App {
  uint initialState = 1;
}

In the above example, when used behind a proxy, initialState will be 0, even though the expectation reading the code is that it will be 1.

We should encourage the developer to make it something like:

contract MyFancyApp is App {
  uint initialState;

  function initialize() onlyInit { initialState = 1; }
}

Edit: this should apply to logic in constructors too

@izqui izqui added 🚀 new feature A change that adds new functionality to the API 🙏 good first issue An easy issue for a new contributor component: apm labels Jan 9, 2018
@izqui
Copy link
Contributor Author

izqui commented Jan 9, 2018

This should also make it in the documentation too

@onbjerg
Copy link
Contributor

onbjerg commented Jan 9, 2018

Should be fairly simple to do with solidity-parser. Obviously constants are excluded as they're not written to storage.

For the docs I think an illustration would be helpful. Storage is initialized, but just not for the proxy, which is the storage we care about.

@onbjerg onbjerg added this to the aragon-dev-cli 2.1.0 milestone Jan 9, 2018
@onbjerg onbjerg self-assigned this Apr 13, 2018
@izqui izqui removed this from the aragon-dev-cli 2.4.0 milestone Jun 6, 2018
@Quazia Quazia added the 📚 docs An addition or correction of the API documentation label Oct 5, 2018
@0xGabi 0xGabi removed the 📚 docs An addition or correction of the API documentation label Dec 15, 2018
@stale stale bot added the abandoned label Oct 14, 2019
@aragon aragon deleted a comment from stale bot Oct 15, 2019
@stale stale bot removed the abandoned label Oct 15, 2019
@0xGabi 0xGabi mentioned this issue Oct 21, 2019
31 tasks
@0xGabi 0xGabi added 👷 buidler plugin Dev oriented features and removed 🚀 new feature A change that adds new functionality to the API labels Jan 23, 2020
@0xGabi 0xGabi added 📚 docs An addition or correction of the API documentation and removed 🙏 good first issue An easy issue for a new contributor labels Jan 23, 2020
@0xGabi 0xGabi added this to the Sprint 2 milestone Jan 23, 2020
@eternauta1337 eternauta1337 removed this from the Sprint 2 milestone Jan 24, 2020
@0xGabi 0xGabi added 🛠️ toolkit Toolkit for accessing Aragon utilities programmatically. and removed 👷 buidler plugin Dev oriented features labels Jan 24, 2020
@0xGabi 0xGabi added the publish label Feb 14, 2020
@0xGabi 0xGabi added this to the Publish in toolkit @0xGabi milestone Feb 14, 2020
@0xGabi 0xGabi removed this from the Publish in toolkit @0xGabi milestone Feb 14, 2020
@0xGabi 0xGabi added 👷 buidler plugin Dev oriented features and removed 📚 docs An addition or correction of the API documentation 🛠️ toolkit Toolkit for accessing Aragon utilities programmatically. labels Mar 22, 2020
@stale stale bot added the abandoned label Sep 19, 2020
@stale stale bot closed this as completed Sep 26, 2020
@aragon aragon deleted a comment from stale bot Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants