-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
**Crowdfund.sol** | ||
- L144/423/471 - You can save gas if instead of doing uint256() > 0 you do != 0. | ||
|
||
- L180/242/300/348 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting. | ||
|
||
- L180/300 - When we are using a for and the length of the array is constantly consulted inside, it would be less expensive to create a variable in memory of the length of the array. | ||
|
||
- L180/242/300/348/358 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked. | ||
|
||
|
||
**BuyCrowdfund.sol** | ||
- L62 - When we are using a for and the length of the array is constantly consulted inside, it would be less expensive to create a variable in memory of the length of the array. | ||
|
||
- L62 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked. | ||
|
||
|
||
|
||
|
||
**ArbitraryCallsProposal** | ||
- L52/61/78 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting. | ||
|
||
- L52/61/78 - When we are using a for and the length of the array is constantly consulted inside, it would be less expensive to create a variable in memory of the length of the array. | ||
|
||
- L52/61/78 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked. | ||
|
||
- L137/139 - It is not necessary to create the hasPrecious variable, this generates an extra gas cost. Less gas could be wasted simply by returning the bool. | ||
|
||
|
||
|
||
|
||
**TokenDistributor** | ||
- L170/230 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked. | ||
|
||
- L230 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting. | ||
|
||
- L230 - When we are using a for and the length of the array is constantly consulted inside, it would be less expensive to create a variable in memory of the length of the array. | ||
|
||
- L381 - It is less expensive to make variable = variable - varA; which variable -= varA; | ||
|
||
|
||
**PartyGoverance.sol** | ||
- L306/432 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting. | ||
|
||
- L306 - When we are using a for and inside the length of the array is constantly consulted, it would be less expensive to create a variable in memory of the length of the array. | ||
|
||
- L306 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked. | ||
|
||
- L1062/1066 - It is not necessary to create a variable if it is only going to be used once, this saves gas expenses. | ||
|
||
|
||
**LibProposal.sol** | ||
- L14/32 - When we create a variable and we want it to have its base value, it is not necessary to set that value, since this would imply a double setting. | ||
|
||
- L14/32 - When we are using a for and inside the length of the array is constantly consulted, it would be less expensive to create a variable in memory of the length of the array. | ||
|
||
- L14/32 - When a uint256 value is impossible to overflow, such as in a for loop, it can become unchecked. | ||
|
||
|