Description: Several functions in SoulboundProfileNFT
are marked as public
but are never called internally. The external
visibility modifier is more gas efficient for functions that are only called from outside the contract.
Found in SoulboundProfileNFT.sol
:
Impact:
Extra gas cost for function calls
For public
functions, Solidity copies array arguments to memory
external
functions can read array arguments directly from calldata
Proof of Concept:
The difference in gas cost occurs because:
public
functions copy arguments to memory
external
functions read directly from calldata
calldata is cheaper than memory
Recommended Mitigation: Change the visibility to external
:
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.