transferFrom so there's a transfer event

This commit is contained in:
Moon Man 2023-01-30 09:09:02 -05:00
parent 4d66247dd3
commit be76f716b1
1 changed files with 6 additions and 2 deletions

View File

@ -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