code-423n4 / 2022-01-dev-test-repo-findings

2 stars 1 forks source link

`_safeMint()` should be used rather than `_mint()` wherever possible #374

Open code423n4 opened 7 months ago

code423n4 commented 7 months ago

Lines of code


139, 178, 204

Vulnerability details


_mint() is discouraged in favor of _safeMint() which ensures that the recipient is either an EOA or implements IERC721Receiver. Both OpenZeppelin and solmate have versions of this function. In the cases below, _mint() does not call ERC721TokenReceiver.onERC721Received() on the recipient.

File: contracts/YieldBox.sol

139:         _mint(to, assetId, share);

178:         _mint(to, assetId, 1);

204:         _mint(to, assetId, share);

Assessed type


other