-
1. In _createComment function of LensHub.sol#L881, use argument ++_profileById[vars.profileId].pubCount in call to PublishingLogic.createComment and remove the Line LensHub.sol#L887 as _profileById[va…
-
Loading the array length here isn't needed as this is already the initial value, which in turn costs extra gas:
LensHub.sol::541 - for (uint256 i = 0; i < vars.datas.length; ++i) {
PublishingLogic.…
-
# GAS
1. The following structs could be optimized moving the position of certains values in order to save slot storages:
- move `sig` close to `followModule` in [DataTypes.sol#L125](https://github.co…
-
## Implement loops more efficiently
Caching the length saves gas. Moreover not assigning the default value 0 to i save gas;
Reference implementation
```
uint256 len = array.length;
for (uint256; …
-
### LensHubStorage.CREATE_PROFILE_WITH_SIG_TYPEHASH is unused
```solidity
bytes32 internal constant CREATE_PROFILE_WITH_SIG_TYPEHASH =
0x9ac3269d9abd6f8c5e850e07f21b199079e8a5cc4a55466d8c9…
-
# C4-001 : Use of _msgSender()
## Impact
The use of _msgSender() when there is no implementation of a meta transaction mechanism that uses it, such as EIP-2771, very slightly increases gas consumpti…
-
## 1. Title : multiple .length call on byteHandle
## Summary
It is cheaper to save the length value of the byteHandle
in a local variable than call the .length in every
if condition and loop
POC
…
-
# Use uint256 instead of bool
Use uint(1) instead of bool(true) to save gas by avoiding masking ops
https://github.com/code-423n4/2022-02-aave-lens/blob/c1d2de2b0609b7d2734ada2ce45c91a73cc54dd9/contra…
-
# 1. Loops can be more efficient
## Impact
The local variable used as for loop index need not be initialized to 0 because the default value is 0. Avoiding this anti-pattern can save a few opcodes a…
-
* function _validatePublishingEnabled() would be cheapier if it did not check all the other states, but just Unpaused:
```solidity
if (_state != DataTypes.ProtocolState.Unpaused) {
revert Errors…