Dollar Store Kids
This page highlights an example implementation of the CapsuleNFT Protocol with the popular NFT collection, Dollar Store Kids.
Last updated
This page highlights an example implementation of the CapsuleNFT Protocol with the popular NFT collection, Dollar Store Kids.
Last updated
Dollar Store Kids is the first NFT Collection of its kind in which every NFT in the collection can be redeemed for $1 USDC. Redeeming an NFT in the collection permanently burns the NFT, thereby reducing the total Dollar Store Kids NFTs in the collection by one.
The execution of this collection can be extrapolated to the . By adding varying amounts of project tokens in place of the $1 USDC, projects have the opportunity to distribute their tokens through NFTs in an unprecedented fashion.
At any time, the final version of the code can be viewed on and is free for public use. The code has been audited by Quantstamp, with results viewable .
Before hopping into the code, let's explore how this contract worked:
Upon deployment of the Dollar Store Kids contract, the constructor would deploy its own Capsule NFT Collection (it now owns that collection) with specific parameters (further information here).
The collection baseURI
(collection metadata) is set through the constructor, but can also be changed at any time through the updateBaseURI()
method.
The moment the toggleMint()
method is called, anyone can mint their own DSK from the contract by calling mint()
.
At any time, any user may redeem their DSK by calling the burn()
function.
The Dollar Store Kids were launched under the following conditions:
The Dollar Store Kids maximum total supply (MAX_DSK
) was set to X.
The Dollar Store Kids contract was funded with USDC. This was to X, to correspond to the maximum total supply.
In order to mint a Dollar Store Kid, the user would pay 0.001 ETH. This is the fee to mint an NFT using the Capsule NFT protocol.
Mint is limited to one Dollar Store Kid per account.
This section will go over some implementation requirements and decisions made in the Dollar Store Kids contract.
Adding the CapsuleNFT protocol to the contract is as simple as below:
This allows to you interact with all of the methods of the CapsuleNFT Protocol, alongside any ERC-721 NFT based methods (within ICapsule
).
Since this is an NFT Collection owner, the most important methods are for users to mint and burn their Dollar Store Kid.
function mint()
As mentioned above, the Dollar Store Kids collection was limited to one mint per account. Most of the logic in the mint method relates to such condition.
The remaining logic relates to the creation of a Dollar Store Kid Capsule NFT.
A more thorough explanation of the minting of a Capsule NFT can be found here. Note that this method could have included a different token, such as wETH, BAYC (with mintSingleERC721Capsule
), or multiple tokens (with mintMultiERC20Capsule
or mintMultiERC721Capsule
).
Since we supplied the USDC to the Dollar Store Kids contract, there was no need for the user to transfer any tokens to the contract first. This step should be considered when creating your own collection.
function burn()
Quite simply, this method accepts the user's Dollar Store Kid, and burns it for them. There is the ability to add more logic to this method.
The USDC is then transferred back to the user.
The Governor functions are admin functions used for varying purposes:
function sweep(address _token)
Used to withdraw any tokens sent to the Dollar Store Kids contract.
function toggleMint()
Used to either start the mint process for the collection, or pause it.
function transferCollectionOwnership(address newOwner_)
Used to transfer the ownership of the underlying Capsule NFT Collection.
function updateMetamaster(address metamaster_)
Used to transfer metamaster
ownership of the Capsule NFT Collection. For more information on metamaster
privileges, view Metamaster.
function updateBaseURI(string memory baseURI_)
Used to update the baseURI
of the collection.
function updateRoyaltyConfig(address royaltyReceiver_, uint256 royaltyRate_)
Used to update the royalty config for the base Capsule NFT contract.