Use Calldata instead of Memory for Read Only Function Parameters
Using Elements Smaller than 32 bytes (256 bits) Might Use More Gas
Use Calldata instead of Memory for Read Only Function Parameters
Issue
It is cheaper gas to use calldata than memory if the function parameter is read only.
Calldata is a non-modifiable, non-persistent area where function arguments are stored,
and behaves mostly like memory. More details on following link.
link: https://docs.soliditylang.org/en/v0.8.15/types.html#data-location
PoC
./Creator/ZcToken.sol:31: constructor(uint8 _protocol, address _underlying, uint256 _maturity, address _cToken, address _redeemer, string memory _name, string memory _symbol, uint8 _decimals)
./Creator/Creator.sol:36: string memory n,
./Creator/Creator.sol:37: string memory s,
./Swivel/Swivel.sol:495: function setFee(uint16[] memory i, uint16[] memory d) external authorized(admin) returns (bool) {
./Marketplace/MarketPlace.sol:68: string memory n,
./Marketplace/MarketPlace.sol:69: string memory s
Mitigation
Change memory to calldata
Using Elements Smaller than 32 bytes (256 bits) Might Use More Gas
Table of Contents
Use Calldata instead of Memory for Read Only Function Parameters
Issue
It is cheaper gas to use calldata than memory if the function parameter is read only. Calldata is a non-modifiable, non-persistent area where function arguments are stored, and behaves mostly like memory. More details on following link. link: https://docs.soliditylang.org/en/v0.8.15/types.html#data-location
PoC
Mitigation
Change memory to calldata
Using Elements Smaller than 32 bytes (256 bits) Might Use More Gas
Issue
Since EVM operates on 32 bytes at a time, it acctually cost more gas to use elements smaller than 32 bytes. Reference: https://docs.soliditylang.org/en/v0.8.15/internals/layout_in_storage.html
PoC
Mitigation
I suggest using uint256 instead of anything smaller.