Bid Beasts

First Flight #49
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Public Function Not Used Internally

Public Function Not Used Internally ,hence wasting a bit of gas

Description: Many function which are pointed out below uses public as visibility ,but are never used inside the contract .Therefore wasting some gas.

Impact: This will cost some extra gas while deploying and calling those functions.

Proof of Concept: The below proof shows the instances where public is used but not used in that contract.Hence should be converted to external instead .

  • 5 Found Instances

  • Found in src/BidBeastsNFTMarketPlace.sol

    @> function getListing(uint256 tokenId) public view returns (Listing memory) {
  • Found in src/BidBeastsNFTMarketPlace.sol

    @> function getHighestBid(uint256 tokenId) public view returns (Bid memory) {
  • Found in src/BidBeastsNFTMarketPlace.sol

    @> function getOwner() public view returns (address) {
  • Found in src/BidBeasts_NFT_ERC721.sol

    @> function mint(address to) public onlyOwner returns (uint256) {
  • Found in src/BidBeasts_NFT_ERC721.sol

    @> function burn(uint256 _tokenId) public {

Recommended Mitigation: If a function is marked public but is not used internally, consider marking it as external.

- function getListing(uint256 tokenId) public view returns (Listing memory) {
+ function getListing(uint256 tokenId) external view returns (Listing memory) {
- function getHighestBid(uint256 tokenId) public view returns (Bid memory) {
+ function getHighestBid(uint256 tokenId) external view returns (Bid memory) {
- function getOwner() public view returns (address) {
+ function getOwner() external view returns (address) {
- function mint(address to) public onlyOwner returns (uint256) {
+ function mint(address to) external onlyOwner returns (uint256) {
- function burn(uint256 _tokenId) public {
+ function burn(uint256 _tokenId) external {
Updates

Lead Judging Commences

cryptoghost Lead Judge 28 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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