Omniscia SaucerSwap Audit
NonfungiblePositionManager Code Style Findings
NonfungiblePositionManager Code Style Findings
NPM-01C: Generic Typographic Mistake
Type | Severity | Location |
---|---|---|
Code Style | NonfungiblePositionManager.sol:L69 |
Description:
The referenced line contains a typographical mistake (i.e. private
variable without an underscore prefix) or generic documentational error (i.e. copy-paste) that should be corrected.
Example:
69address public _nft; // token id address of the hedera NFT
Recommendation:
We advise this to be done so to enhance the legibility of the codebase.
Alleviation (d8d187efd1fa23b943c82694aaaccb5b9e427096):
The underscore has been omitted from the _nft
variable as advised.
NPM-02C: Redundant Statements
Type | Severity | Location |
---|---|---|
Gas Optimization | NonfungiblePositionManager.sol:L90-L91 |
Description:
The referenced statements are redundant as they do not affect the outcome of the contract's NonfungiblePositionManager::constructor
.
Example:
83supplyKeyType = supplyKeyType.setBit(4);84supplyKeyValue.contractId = address(this);85
86IHederaTokenService.TokenKey[] memory keys = new IHederaTokenService.TokenKey[](1);87keys[0] = IHederaTokenService.TokenKey (supplyKeyType, supplyKeyValue);88// Set this contract as supply89
90supplyKeyType = supplyKeyType.setBit(4);91supplyKeyValue.contractId = address(this);
Recommendation:
We advise them to be safely omitted, optimizing the contract's deployment gas cost.
Alleviation (d8d187efd1fa23b943c82694aaaccb5b9e427096):
The redundant statements have been safely omitted as advised.
NPM-03C: Suboptimal Struct Declaration Style
Type | Severity | Location |
---|---|---|
Code Style | NonfungiblePositionManager.sol:L87 |
Description:
The linked declaration style of a struct is using index-based argument initialization.
Example:
87keys[0] = IHederaTokenService.TokenKey (supplyKeyType, supplyKeyValue);
Recommendation:
We advise the key-value declaration format to be utilized instead, greatly increasing the legibility of the codebase.
Alleviation (d8d187efd1fa23b943c82694aaaccb5b9e427096):
The SaucerSwap team evaluated this exhibit and opted to acknowledge it.