sherlock-audit / 2023-04-unitasprotocol-judging

4 stars 3 forks source link

YakuzaKiawe - Minting inconsistencies on ERC20Token #119

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

YakuzaKiawe

medium

Minting inconsistencies on ERC20Token

YakuzaKiawe

medium

Minting inconsistencies on ERC20Token

Summary

The ERC20Token.sol contract when minting uses _mint() instead of _safeMint() which can cause to mint a contract who does not support nfts.

Vulnerability Detail

The SafeERC20 is used in many contracts like InsurancePool.sol, Unitas.sol, and PoolBalances.sol but not in ERC20Token.sol. This could cause inconsistency like minting of NFT(s)

Impact

ERC20Token.sol might mint a NFT to a contract that cannot handle nfts.

Code Snippet

https://github.com/sherlock-audit/2023-04-unitasprotocol/blob/d5328421bea80e3b0fd4595e4eb6b732a40e421e/Unitas-Protocol/src/ERC20Token.sol#L173

Tool used

Manual Review

Recommendation

Use _safeMint() in ERC20Token.sol.