We copy pasted the code of erc1155 of Openzeppelin and didn't import it. Two reasons for this:
First, the import wouldn't work with some Starknet foundry tests.
More importantly: 1155's OZ interface isn't using transfer_from and mint anymore, but only safe_transfer_from and safe_mint. However, the use of these safe methods can't lead to issues:
If the receiver is not deployed: it fails
If the receiver is a contract that does not implement IERC_1155_RECEIVER, it fails (for example the Offsetter contract wouldn't be able to receive carbon credits). OZ had some arguments on why they did that, we shoud check it.
For the moment we forked the OZ's code and removed the safe logic to these functions (calldata isn't used anymore).
We should allow both safe and non-safe methods in the future.
Acceptance criteria
Clean usage of ERC1155 from OZ.
Possible to use safe and non-safe methods.
Prioritize interoperability for CEX, Marketplaces, Dex, etc.. What happens if they don't implement the necessary traits (like IERC_1155_RECEIVER)?
Description
We copy pasted the code of erc1155 of Openzeppelin and didn't import it. Two reasons for this: First, the import wouldn't work with some Starknet foundry tests.
More importantly: 1155's OZ interface isn't using
transfer_from
andmint
anymore, but onlysafe_transfer_from
andsafe_mint
. However, the use of these safe methods can't lead to issues:For the moment we forked the OZ's code and removed the
safe
logic to these functions (calldata isn't used anymore). We should allow both safe and non-safe methods in the future.Acceptance criteria
IERC_1155_RECEIVER
)?