Skip to content

Commit 9e970eb

Browse files
authored
Guidelines for named return values (#5178)
1 parent 55fd53c commit 9e970eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

GUIDELINES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ In addition to the official Solidity Style Guide we have a number of other conve
131131
abstract contract AccessControl is ..., {
132132
```
133133

134+
* Return values are generally not named, unless they are not immediately clear or there are multiple return values.
135+
136+
```solidity
137+
function expiration() public view returns (uint256) { // Good
138+
function hasRole() public view returns (bool isMember, uint32 currentDelay) { // Good
139+
```
140+
134141
* Unchecked arithmetic blocks should contain comments explaining why overflow is guaranteed not to happen. If the reason is immediately apparent from the line above the unchecked block, the comment may be omitted.
135142

136143
* Custom errors should be declared following the [EIP-6093](https://eips.ethereum.org/EIPS/eip-6093) rationale whenever reasonable. Also, consider the following:

0 commit comments

Comments
 (0)