Vyper: Make the default function visibility internal

Created on 18 Oct 2017  路  5Comments  路  Source: vyperlang/vyper

Currently, functions are public by default in Viper.
This has security implications, especially when refactoring code (see for example, the parity multisig wallet vulnerability)

My suggestion is to make the default internal, and require a @public annotation to make the function public.

Thoughts?

Most helpful comment

@fubuloubu I prefer having internal as the default function visibility for viper because it seems more in line with viper's core values. Clearly it might come as a surprise to some developers but I think it's well worth it for the added safety it will provide.

All 5 comments

Solidity defaults to public, I think this is an okay as is since we have @internal and @constant. Most functions you'd design will probably be publicly available.

@DavidKnott do you agree?

@fubuloubu I prefer having internal as the default function visibility for viper because it seems more in line with viper's core values. Clearly it might come as a surprise to some developers but I think it's well worth it for the added safety it will provide.

@DavidKnott I agree. Does that mean getting rid of @internal and introducing @public?

@vbuterin thoughts? I feel like having internal visibility by default could have prevented hacks like Rubixi or even Parity Wallet.

@maraoz We decided to not have defaults and require explicit visibility on all methods. Thanks a lot for creating this issue 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

travs picture travs  路  3Comments

ben-kaufman picture ben-kaufman  路  3Comments

haydenadams picture haydenadams  路  3Comments

ben-kaufman picture ben-kaufman  路  4Comments

lsaether picture lsaether  路  4Comments