Skip to content

markcarey/dalleycats

Repository files navigation

Dalley Cats

Dalley Cats are NFTs generated by the DALL-E Artificial Intelligence (AI). Dalley Cats can jump between blockchains. Dalley Cats implement the oNFT standard from LayerZero. Images and metadata are stored on IPFS/Filecoin.

Dalley Cat

How it was Made

Artwork for Dalley Cats is generated at mint time by AI (DALL-E by OpenAI). Choose a color and an accessory and a Cat will be generated with a background color representing the "birth chain" of the Cat. Once the image has been generated, it is stored on IPFS (via the nft.storage service) and NFT metadata JSON is also saved to IPFS.

The Dalley Cats smart contracts adhere to the ERC721 and oNFT standards. The Universal oNFT standard enables minting NFTs from the collection ony any of the supported chains and the ability to send NFTs from one chain to another. Each chain has a defined range of IDs that can be minted on that chain -- but after minting, the NFTs can be sent to any of the other supported chains.

Dalley Cats made some adjustments and additions:

  • Mint with Metadata URI. To add support for decentralized storage of metadata on IPFS, the mint() function for Dalley Cats assigns the IPFS metadata hash to the newly minted token. Open Zeppelin's ERC721URIStorage extension was used towards this end.

  • MintAndSend() Function. Dalley Cats includes a second mint function that enables minting a new NFT and immediately sending it to another chain, in the same transaction. Suppose you want one of the cool Moonbeam Dalley Cats with the red background, but you want it in your Etheruem wallet. The mintAndSend() function enables this.

  • evmSend(), evmEstimateSendFee(), and evmEstimateMintAndSendFee(). These are convenience functions assume tranfers from one EVM chain to another, and enable the passing of less parameter and unpacked addresses. The fee estimation functions also needed to be adjust to account for the larger payload, since the tokenURI (IPFS metadata hash) needs to be send as part of the GMP through the LayerZero network.

  • Overriding Send and Receive Functions. A key challenge was ensuring the contract on the destination chain received the tokenURI (IPFS metadata hash), such that NFT marketplaces and explorers can access the Dalley Cat image and other metadata. The send() function was overidden in order to add the tokenURI to the payload. On the receiving end, the _nonblockingLzReceive() function was overidden to decode the tokenURI from the payload. And the related _creditTo() function was overidden to call the _setTokenURI() function to assign the metadata to the newly received NFT.

  • Contracts Deployed to the same address on each chain. Towards this end, Dalley Cats used the upgradeable version of the LayerZero contracts to avoid the need for a constructor(). The initialize() -- which is called in the same transaction as the deploy transaction -- also sets all of the required trusted remotes. This is possible because we know each of the contracts will deployed to the same address, so they can be added as remotes even before they are deployed.

Mint a Dalley Cat Today

Minted! Dalley Cats is currently deployed to four testnets. You can mint on any chain and jump your Cat to another, if desired:

The contract is deployed to the same address on each of the above chains: 0xFeDD8DEAC4Fb5E72E92d1Cef93e9C6986ad9B541.

The dapp can be found at https://dalleycats.club or ipfs://Qma7H8Fw8RvRhkzu7EfYjHcJPinkZpirVqPErfcBYbrRm1

Next Steps

  • find a co-founder to do Community Management
  • contract refinements
  • remote minting function? (send mint txn on Chain A, to mint on chain B, and send NFT back to chain A)
  • pricing of mainnet mint?
  • choose ~10 chains for mainnet launch
  • deploy to mainnets

Fun Fact

This is my second project using LayerZero. In April 2022, I created OmniGov, an omnichain governance tool that enables you to vote on one chain, and execute successful proposals on other chains. More at https://github.com/markcarey/omnigov

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors