Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: default
Invalid

There are `private state variables`, `constants`, & `immutables` everywhere in the Protocol not following community recommended `GAS Efficient` naming convention. This may cause GAS Wastage.

Summary

  1. The private state variables, Soulmate::idToOwners, Soulmate::divorced, & Soulmate::nextID,

  2. The Constants, Airdrop::daysInSecond,

  3. The Immutables, Airdrop::loveToken, Airdrop::soulmateContract, Airdrop::airdropVault, LoveToken.sol::soulmateContract, LoveToken.sol::airdropVault, LoveToken.sol::stakingVault, Staking::loveToken, Staking::soulmateContract, Staking::stakingVault,

are not following prefixes to indicate whether variables are internal or scoped to contract or have accessibility out from the contract.

  1. Soulmate.sol::

//------------------------------------------------------
// --------------------------- ||
// ------------- \/
@> mapping(uint256 id => address[2] owners) private idToOwners;
mapping(uint256 id => uint256 timestamp) public idToCreationTimestamp;
mapping(address soulmate1 => address soulmate2) public soulmateOf;
mapping(address owner => uint256 id) public ownerToId;
//------------------------------------------------------
// --------------------------- ||
// ------------- \/
@> mapping(address owner => bool isDivorced) private divorced;
mapping(uint256 id => string) public sharedSpace;
//---------------------
// ---------- ||
// ----- \/
@> uint256 private nextID;
  1. Airdrop.sol:

//----------------------------------
// ----------------- ||
// -------- \/
@> uint256 public constant daysInSecond = 3600 * 24;
//----------------------------------
// ----------------- ||
// -------- \/
@> ILoveToken public immutable loveToken;
//----------------------------------
// ----------------- ||
// -------- \/
@> ISoulmate public immutable soulmateContract;
//----------------------------------
// ----------------- ||
// -------- \/
@> IVault public immutable airdropVault;

Impact

Could be confusing to the community developers who evolved with this convention but not mentioned by solidity docs. Absence of this, may also cause some more GAS.

Tools Used

Manual Review

Recommendations

Use Community recommended Naming conventions...

Modify or rename those three variables like this...

- mapping(uint256 id => address[2] owners) private idToOwners;
+ mapping(uint256 id => address[2] owners) private s_idToOwners;
mapping(uint256 id => uint256 timestamp) public idToCreationTimestamp;
mapping(address soulmate1 => address soulmate2) public soulmateOf;
mapping(address owner => uint256 id) public ownerToId;
- mapping(address owner => bool isDivorced) private divorced;
+ mapping(address owner => bool isDivorced) private s_divorced;
mapping(uint256 id => string) public sharedSpace;
- uint256 private nextID;
+ uint256 private s_nextID;
Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.