This contract, which has been designed to facilitate the exchange of tokens for non-fungible tokens (NFTs), enables token owners to have the opportunity to own unique assets from the organization's collection. Token owners initiate the redemption process by interacting with a smart contract, which verifies their tokens and triggers the issuance of NFTs. The organization maintains a collection of NFTs eligible for redemption, and upon successful verification, the smart contract transfers the NFTs from the organization to the token owner.
|Name of the Contract||Contract address|
|Name of the Contract||Contract address|
The architecture for redeambale typically involves the following components:
Here's a breakdown of the architecture into separate components:
- Creator/Admin Component:
- Responsible for managing redemption details.
- Interacts with the Redemption Contract to set up, update, or delete redemption details.
- Can view redeemed data and perform administrative functions.
- Claimant Component:
- Participants who can claim redemption and view redeemed details.
- Interacts with the Redemption Contract to initiate the redemption process.
- Can view redeemed data and the status of their redemption.
- Redemption Contract Component:
- Smart contract responsible for handling the redemption process.
- Stores redemption details, including collection addresses, token holding address, and other parameters.
- Validates redemption requests and verifies the eligibility of claimants.
- Transfers the specified NFT from the claimant's wallet to the Organization Wallet.
- Mints a new token representing the redeemed NFT and transfers it to the claimant's wallet from the Collection Contract.
- Stores transaction details and redeemed data.
- Organization Wallet Component:
- Wallet address associated with the organization.
- Receives the claimed NFTs transferred from the claimant's wallet.
- Claimant Wallet Component:
- Wallet address of the claimant.
- Receives the newly minted token representing the redeemed NFT from the Collection Contract.
- Collection Contract Component:
- Smart contract or external service managing the organization's collection of NFTs.
- Handles the minting and transfer of NFTs.
function createorUpdateRedeem( address redeemCollectionAddress, RedeemDetails memory list ) external
createorUpdateRedeem function is an external function defined in the
Redeemable smart contract. Its purpose is to create or update redemption-related details for a specific collection address. The function allows users with the admin role or specific collection-related roles to manage the redemption settings.
RedeemDetails struct contains various details related to the redemption process, such as the address of the new collection where redeemed tokens will be minted (
newCollectionAddress), the address holding the original NFT tokens to be redeemed (
tokenHoldingAddress), the maximum number of tokens that can be minted during redemption (
mintLimit), a boolean flag indicating whether to use an extended base URI for token metadata (
extensionBaseUri), and the name of the client or entity associated with the redemption (
function removeCollectionAddress(address redeemCollectionAddress) external
This function allows contract administrators, collection administrators, or collection owners to disable redemption functionality for a specific collection.
function setBaseURI( address redeemcollectionaddress, string memory baseURI_ ) external
The purpose of this is to update the base URI used for token metadata extension in the new collection specified by
function redeem( address redeemCollectionAddress, uint256 tokenId, address claimer, uint256 quantity, string memory tokenURI ) external returns (uint256 memory nftTokenId)
redeem function allows users to redeem NFT tokens from one collection to another. The user-owned token in
redeemCollectionAddress is transferred to the token holding address, and new tokens are minted in the new collection for user based on the provided redemption details.
function getRedeem( address walletAddress ) external view returns (nftIds memory list)
The purpose of
getRedeem function is to retrieve the redeemed NFT token IDs and their associated collection addresses for a specific
function getbaseURL( address collectionAddress, uint256 tokenId ) internal view returns (string memory uri)
getBaseURL function retrieves the base URI for token metadata associated with specific token IDs.
Updated 2 months ago