Omniscia Olympus DAO Audit
ERC20 Manual Review Findings
ERC20 Manual Review Findings
ERC-01M: Non-Standard Mint Implementation
| Type | Severity | Location |
|---|---|---|
| Standard Conformity | Minor | ERC20.sol:L95-L101 |
Description:
The _mint function of the ERC20 implementation invokes the _beforeTokenTransfer hook and the Transfer event with the from argument being the address(this), an adaptation that will cause off-chain explorers to misbehave.
Example:
contracts/types/ERC20.sol
95function _mint(address account_, uint256 ammount_) internal virtual {96 require(account_ != address(0), "ERC20: mint to the zero address");97 _beforeTokenTransfer(address( this ), account_, ammount_);98 _totalSupply = _totalSupply.add(ammount_);99 _balances[account_] = _balances[account_].add(ammount_);100 emit Transfer(address( this ), account_, ammount_);101}Recommendation:
We advise both instances to be replaced by the canonical address(0) to enable proper interfacing of block explorers.
Alleviation:
The hook and event instances now properly use the zero address instead of the self address to indicate the origin of the "transfer" operation, thereby alleviating this exhibit.