BurnToClaimDropERC721

This contract allows users to burn tokens from another ERC721 contract to claim a new ERC721 token from this contract.

BurnToClaimDropERC721 Contract

This contract is a specialized ERC721 contract that allows users to claim new tokens by burning tokens from another ERC721 contract.

Features

  • Allows users to burn tokens from a specified ERC721 contract to claim a new ERC721 token from this contract.
  • Maintains a mapping of burned token IDs to claimed token IDs.
  • Provides functions to check if a token has been claimed and to retrieve the claimed token ID based on the burned token ID.

Usage

To use this contract, you need to deploy it and set the address of the ERC721 contract whose tokens will be burned. Users can then interact with the contract by calling the `claim` function, providing the token ID of the token they want to burn.

Implementation Details

The contract uses the `IERC721` interface to interact with the source ERC721 contract. It keeps track of the claimed tokens and the corresponding burned tokens using a mapping. The `claim` function verifies that the user owns the token to be burned and then burns the token before minting a new token and assigning it to the user.

Best Practices

  • Ensure the source ERC721 contract allows burning tokens.
  • Consider using a permissioned burn function if necessary to restrict the ability to burn tokens.
  • Securely store the address of the source ERC721 contract to prevent malicious modifications.
  • Implement proper error handling to gracefully handle potential issues during the claim process.