If an contract is used to create a position calling mintTokenizedPosition in its contructor, then the ERC1155 token may be lost.
This is because of use of below method in _mint
if (to.code.length != 0) {
if (
ERC1155Holder(to).onERC1155Received(msg.sender, address(0), id, amount, "") !=
ERC1155Holder.onERC1155Received.selector
) {
revert UnsafeRecipient();
}
}
Impact
loss of token minted from ERC1155
Recommended Mitigation Steps
Use assembly to check the to address is a contract or not
Lines of code
https://github.com/code-423n4/2023-11-panoptic/blob/aa86461c9d6e60ef75ed5a1fe36a748b952c8666/contracts/tokens/ERC1155Minimal.sol#L222-L229
Vulnerability details
If an contract is used to create a position calling mintTokenizedPosition in its contructor, then the ERC1155 token may be lost. This is because of use of below method in _mint
Impact
loss of token minted from ERC1155
Recommended Mitigation Steps
Use assembly to check the to address is a contract or not
Assessed type
Token-Transfer