You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Change transferFrom to transfer
Severity: GAS
'transferFrom(address(this), , **)' could be replaced by the following more gas efficient 'transfer(, **)'
This replacement is more gas efficient and improves the code quality.
Unused state variables are gas consuming at deployment (since they are located in storage) and are
a bad code practice. Removing those variables will decrease deployment gas cost and improve code quality.
This is a full list of all the unused storage variables we found in your code base.
Title: Unused declared local variables
Severity: GAS
Unused local variables are gas consuming, since the initial value assignment costs gas. And are
a bad code practice. Removing those variables will decrease the gas cost and improve code quality.
This is a full list of all the unused storage variables we found in your code base.
In the following files there are contract imports that aren't used
Import of unnecessary files costs deployment gas (and is a bad coding practice that is important to ignore)
NFTMarketBuyPrice.sol, line 11, import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
NFTMarketFees.sol, line 12, import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
NFTMarketBuyPrice.sol, line 5, import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
NFTMarketBuyPrice.sol, line 7, import "./Constants.sol";
NFTMarketReserveAuction.sol, line 14, import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
LockedBalance.sol, 113: change 'balance > 0' to 'balance != 0'
Title: Public functions to external
Severity: GAS
The following functions could be set external to save gas and improve code quality.
External call cost is less expensive than of public functions.
FoundationTreasuryNode.sol, getFoundationTreasury
Title: Use bytes32 instead of string to save gas whenever possible
Severity: GAS
Use bytes32 instead of string to save gas whenever possible.
String is a dynamic data structure and therefore is more gas consuming then bytes32.
FETH.sol (L120), string public constant name = "Foundation Wrapped Ether";
NFTMarketPrivateSale.sol (L38), string private constant NAME = "FNDNFTMarket";
FETH.sol (L125), string public constant symbol = "FETH";
Title: Internal functions to private
Severity: GAS
The following functions could be set private to save gas and improve code quality:
You can inline the following functions instead of writing a specific function to save gas.
(see https://github.com/code-423n4/2021-11-nested-findings/issues/167 for a similar issue.)
AccessControlUpgradeable.sol, getRoleAdmin, { return _roles[role].adminRole; }
AccessControlUpgradeable.sol, getRoleMemberCount, { return _roles[role].members.length(); }
AccessControlUpgradeable.sol, getRoleMember, { return _roles[role].members.at(index); }
AccessControlUpgradeable.sol, hasRole, { return _roles[role].members.contains(account); }
Title: Use calldata instead of memory
Severity: GAS
Use calldata instead of memory for function parameters
In some cases, having function arguments in calldata instead of
memory is more optimal.
Some of your contract inherent contracts but aren't use them at all.
We recommend not to inherent those contracts.
FNDNFTMarket.sol; the inherited contracts Constants, SendValueWithFallbackWithdraw, NFTMarketFees, NFTMarketReserveAuction, NFTMarketPrivateSale not used
WithdrawFromEscrow.sol; the inherited contracts AdminRole not used
FoundationTreasury.sol; the inherited contracts OperatorRole, CollateralManagement, WithdrawFromEscrow not used
NFTMarketReserveAuction.sol; the inherited contracts FoundationTreasuryNode not used
CollateralManagement.sol; the inherited contracts AdminRole not used
The text was updated successfully, but these errors were encountered:
Given that only 5 out of 15 findings were correct, and of those 5 only 3 belonged in the gas report, and the gas savings were minimal, I'm giving a score of zero. The time of the sponsor should be respected.
Title: Change transferFrom to transfer
Severity: GAS
'transferFrom(address(this), , **)' could be replaced by the following more gas efficient 'transfer(, **)'
This replacement is more gas efficient and improves the code quality.
Title: Unnecessary cast
Severity: Gas
Title: Unused state variables
Severity: GAS
Unused state variables are gas consuming at deployment (since they are located in storage) and are
a bad code practice. Removing those variables will decrease deployment gas cost and improve code quality.
This is a full list of all the unused storage variables we found in your code base.
Title: Unused declared local variables
Severity: GAS
Unused local variables are gas consuming, since the initial value assignment costs gas. And are
a bad code practice. Removing those variables will decrease the gas cost and improve code quality.
This is a full list of all the unused storage variables we found in your code base.
Title: Unused imports
Severity: GAS
In the following files there are contract imports that aren't used
Import of unnecessary files costs deployment gas (and is a bad coding practice that is important to ignore)
Title: Use != 0 instead of > 0
Severity: GAS
Using != 0 is slightly cheaper than > 0. (see code-423n4/2021-12-maple-findings#75 for similar issue)
Title: Public functions to external
Severity: GAS
The following functions could be set external to save gas and improve code quality.
External call cost is less expensive than of public functions.
Title: Use bytes32 instead of string to save gas whenever possible
Severity: GAS
Title: Internal functions to private
Severity: GAS
The following functions could be set private to save gas and improve code quality:
Severity: GAS
Title: Use calldata instead of memory
Severity: GAS
Use calldata instead of memory for function parameters
In some cases, having function arguments in calldata instead of
memory is more optimal.
Title: Unnecessary constructor
Severity: GAS
The following constructors are empty.
(A similar issue code-423n4/2021-11-fei-findings#12)
Title: Use unchecked to save gas for certain additive calculations that cannot overflow
Severity: GAS
You can use unchecked in the following calculations since there is no risk to overflow:
Title: Inline one time use functions
Severity: GAS
The following functions are used exactly once. Therefore you can inline them and save gas and improve code clearness.
Title: Unused inheritance
Severity: GAS
The text was updated successfully, but these errors were encountered: