Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

`public` functions not used internally could be marked `external`

Description:
To improve the security of the contract and to reduce gas costs, external function visibility should be preferred when declaring functions that will not be used internally.

Tools Used:
Aderyn

Recommended Mitigation:
It is recommended to change the visibility from public to external of the following functions.

TokenDivider.sol:

- function getBalanceOf(address user, address token) public view returns(uint256) {
return balances[user][token];
}
+ function getBalanceOf(address user, address token) external view returns(uint256) {
return balances[user][token];
}
- function getErc20TotalMintedAmount(address erc20) public view returns(uint256) {
return erc20ToMintedAmount[erc20];
}
+ function getErc20TotalMintedAmount(address erc20) external view returns(uint256) {
return erc20ToMintedAmount[erc20];
}
- function getErc20InfoFromNft(address nft) public view returns(ERC20Info memory) {
return nftToErc20Info[nft];
}
+ function getErc20InfoFromNft(address nft) external view returns(ERC20Info memory) {
return nftToErc20Info[nft];
}
- function getOrderPrice(address seller, uint256 index) public view returns(uint256 price) {
price = s_userToSellOrders[seller][index].price;
}
+ function getOrderPrice(address seller, uint256 index) external view returns(uint256 price) {
price = s_userToSellOrders[seller][index].price;
}

ERC20ToGenerateNftFraccion:

- function mint(address _to, uint256 _amount) public {
_mint(_to, _amount);
}
+ function mint(address _to, uint256 _amount) external {
_mint(_to, _amount);
}
Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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