Omniscia Platypus Finance Audit

VeERC20Upgradeable Code Style Findings

VeERC20Upgradeable Code Style Findings

VER-01C: Non-Standard Aftercall Hook

TypeSeverityLocation
Gas OptimizationInformationalVeERC20Upgradeable.sol:L109, L137, L165

Description:

The linked after-call hook implementation should be adjusted to reflect a more standardized implementation.

Example:

contracts/VeERC20Upgradeable.sol
100function _mint(address account, uint256 amount) internal virtual {
101 require(account != address(0), 'ERC20: mint to the zero address');
102
103 _beforeTokenTransfer(address(0), account, amount);
104
105 _totalSupply += amount;
106 _balances[account] += amount;
107 emit Mint(account, amount);
108
109 _afterTokenOperation(account, _balances[account]);
110}

Recommendation:

We advise it to be aptly named as _afterTokenTransfer and its secondary argument to be inserted in an optimized fashion as it already exists in memory for a brief period during any _mint / _burn invocation.

Alleviation:

The Platypus team considered this exhibit but opted not to apply a remediation for it.