DatingDapp

First Flight #33
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

The `LikeRegistry::FIXEDFEE` is of type immutable, but isn't being initialised through constructor which leads to unneccesary gas consumption

Description:

The LikeRegistry::FIXEDFEE is a variable of type immutable, but it is directly being initialised without the use of constructor. If it is not supposed to get initialised during contract deployment, then using type immutable is unneccesary, and can led to high gas consumption; instead it could be declared with type constant to save gas.

Impact:

Type immutable leds to gas consumption.

Recommended Mitigation:

Easy fix:

- uint256 immutable FIXEDFEE = 10;
+ uint256 constant FIXEDFEE=10;

If the variable was supposed to get initialised through constructor, then:

- uint256 immutable FIXEDFEE=10;
+ uint256 immmutable FIXEDFEE;
constructor(address _profileNFT,uint256 _fixedFee) Ownable(msg.sender) {
profileNFT = SoulboundProfileNFT(_profileNFT);
FIXEDFEE = _fixedFee;
}
Updates

Appeal created

n0kto Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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