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

Functions' visibility #15

Open
pauliax opened this issue Nov 18, 2017 · 2 comments
Open

Functions' visibility #15

pauliax opened this issue Nov 18, 2017 · 2 comments

Comments

@pauliax
Copy link

pauliax commented Nov 18, 2017

Consider marking functions with a specific access level, for example, functions that aren't called internally, please mark with a keyword "external". Calling external function consumes less gas than public function. Also, functions that are only used internally, should be marked "internal". If you want, I can specify which modifier every function should have.
As for best practices, you should use external if you expect that the function will only ever be called externally, and use public if you also need to call this function internally.

Now, in your code ~90% of the functions are public, despite some of them are only called from the outside world.

@dete
Copy link

dete commented Nov 18, 2017

Thanks @pauliax, this is very helpful.

For anyone interested in more details: https://ethereum.stackexchange.com/questions/19380/external-vs-public-best-practices

@kimcope
Copy link
Contributor

kimcope commented Nov 21, 2017

Thanks for your participation, @pauliax! Our team has reviewed your submission, and we are pleased to reward you for your report.

Impact: Low
Likelihood: Medium
Points: 125

Please see the final leaderboard here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants