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);
}