From be76f716b10b59b149c8359079c86276de464c73 Mon Sep 17 00:00:00 2001 From: Moon Date: Mon, 30 Jan 2023 09:09:02 -0500 Subject: [PATCH] transferFrom so there's a transfer event --- contracts/CurioERC1155Wrapper.sol | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contracts/CurioERC1155Wrapper.sol b/contracts/CurioERC1155Wrapper.sol index 09baedc..5c35639 100644 --- a/contracts/CurioERC1155Wrapper.sol +++ b/contracts/CurioERC1155Wrapper.sol @@ -203,7 +203,9 @@ contract CurioERC1155Wrapper is ERC1155, ERC1155Metadata_URI, ERC1155Metadata, E require(balances[_id][msg.sender] >= _quantity, "insufficient balance"); balances[_id][msg.sender] -= _quantity; - curio.transfer(msg.sender, _quantity); + // do it this way to make sure there's a transfer event + curio.approve(address(this), _quantity); + curio.transferFrom(address(this), msg.sender, _quantity); // burn emit TransferSingle(msg.sender, msg.sender, address(0), _id, _quantity); @@ -228,7 +230,9 @@ contract CurioERC1155Wrapper is ERC1155, ERC1155Metadata_URI, ERC1155Metadata, E require(balances[_id][msg.sender] >= _quantity, "insufficient balance"); balances[_id][msg.sender] -= _quantity; - curio.transfer(msg.sender, _quantity); + // do it this way to make sure there's a transfer event + curio.approve(address(this), _quantity); + curio.transferFrom(address(this), msg.sender, _quantity); } // burn