20,000 USDC
View results
Submission Details
Severity: gas
Valid

Unnecessery function in the Beedle.sol contract

Summary

Beedle token contract implements 4 functions apart from inherited function from Ownable, ERC20, ERC20Permit, ERC20Votes. These function are _afterTokenTransfer, _mint, _burn and mint.
Only 'mint' function is needed and should be left in the contract.

Vulnerability Details

Functions _afterTokenTransfer and _burn are internal and can only be called internally within the contract or by the contracts inherited from the current one. They are not called inside of the contract and won't be reachable.

Function _mint is used in constructor, but as it simple calls the parent contract super._mint(to, amount) there is no particular reason to add it here.

Impact

Additional gas is used for contract deployment that might be saved.

Tools Used

Observation.

Recommendations

Delete unnecessary functions

Support

FAQs

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