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

doc says functions are by default internal - parity exploit #2617

Closed
SCBuergel opened this issue Jul 21, 2017 · 3 comments
Closed

doc says functions are by default internal - parity exploit #2617

SCBuergel opened this issue Jul 21, 2017 · 3 comments
Assignees

Comments

@SCBuergel
Copy link

I was just made aware that the docs currently say:

By default, function types are internal, so the internal keyword can be omitted.

To the best of my knowledge that is not true, otherwise the Parity multisig exploit would not have happened. This is important to get right. Or do you plan to change that and updated the docs already ahead of time?

SCBuergel referenced this issue in openethereum/parity-ethereum Jul 21, 2017
@5chdn
Copy link

5chdn commented Jul 21, 2017

Thanks, just raised that here: #2608 (comment)

But might be worth a separate ticket.

@axic
Copy link
Member

axic commented Jul 21, 2017

The documentation should be clearer, but function types refer to function type variables:

function f() {
  // This creates a function type (and it defaults to internal visibility):
  function (uint, uint) x;

  // It is possible to retrieve the type of a function (the function above defaults to public visibility):
  var y = f;

  // Assign the function f() to a local function type:
  function () external z = this.f;
}

The part of the documentation referring to functions says:

Functions can be specified as being external, public, internal or private, where the default is public.

@SCBuergel
Copy link
Author

Agree, this should be a lot clearer. Many people read the doc not like a book and pick up all definitions that you gave earlier. Lets make it clear again in the section on function types. I would call that entire section "Function parameter types" to avoid any confusion in the first place. But at least rephrase:

By default, function types are internal, so the internal keyword can be omitted

To something like

By default, function variable types are internal, so the internal keyword can be omitted. Note that function visibility is not external/public/internal/private and you need to set these yourself if needed.

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