Omniscia Brickken Protocol Audit
Brickken Static Analysis Findings
Brickken Static Analysis Findings
BRI-01S: Inexistent Usage of Overridden Function
Type | Severity | Location |
---|---|---|
Code Style | Brickken.sol:L53, L67-L72 |
Description:
The _mint
function that is overridden within the Brickken
contract is done so to silence a compiler warning about ambiguous behaviour, however, it remains unutilized by the mint
function that relies on it.
Example:
contracts/brickken/Brickken.sol
47/**48 * @dev Mint `amount` tokens to the `to` address.49 *50 * See {ERC20-_mint}.51 */52function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE){53 super._mint(to, amount);54}55
56/**57 * @dev Hook called after each token transfer. It moves votes delegation58 * calling the `ERC20Votes` function.59 */60function _afterTokenTransfer(address from, address to, uint256 amount)61 internal62 override(ERC20, ERC20Votes)63{64 ERC20Votes._afterTokenTransfer(from, to, amount);65}66
67function _mint(address to, uint256 amount)68 internal69 override(ERC20, ERC20Votes)70{71 super._mint(to, amount);72}
Recommendation:
We advise the mint
function to properly utilize the contract level's _mint
declaration rather than the parents by removing the super
keyword and dot accessor from the statement within the function.
Alleviation:
The Brickken team has acknowledged this issue, however, they have opted to not apply an alleviation for it as they desire to minimize changes to their code since their contract has already been deployed.