Questions tagged [conventions]

A generic tag covering any accepted method of doing things, which could include naming, spacing, coding, commenting, etc.

Filter by
Sorted by
Tagged with
3
votes
2answers
247 views

Should I give names to return values, when a function returns several of them?

I am currently working with solc v0.4.25, where it is not possible to return structures, so the only way to return multiple values is in a tuple. I've been advised to give names to each one of the ...
1
vote
0answers
223 views

Naming conventions for ERC-20 instancies [duplicate]

Given a contract that implements ERC-20. Is there a naming convention for new instancies such as its symbol? We are used to 3 chars but that range will run out at some time in future. I am asking ...
4
votes
0answers
690 views

Why are underscores used in front of parameters, instead of contract member variables? [duplicate]

In Solidity, for example, why: function Greeter(string _greeting) public { greeting = _greeting; } instead of: function Greeter(string greeting) public { _greeting = greeting; } The latter ...
16
votes
3answers
5k views

What is the purpose of underscores in front of parameters?

I see contracts that use underscores in front of parameter names, like so: function Greeter(string _greeting) public { greeting = _greeting; } What's the purpose of these underscores? Do they ...