Metaverse Game development
● Smart Contracts: ○ Smart contracts are available in the drop-contracts repo. And it consists of 3 main contracts. ■ ERC20 contract that is the SILK token currency ■ ERC1155 contract that is our NFT contract ■ Webaverse contract, that is, a wrapper contract over SILK (ERC20) and NFT contract (ERC1155) and it charges SILK (ERC20) for minting.
Also, there is an accounts contract, that acts as a key-value store for storing user profile data. ○ All 3 main contracts are deployed on the sidechain as well as on the Polygon network.
An important point to note: The accounts contract is only deployed to the sidechain and will always be used through the sidechain. ● Blockchain Sync Server: ○ Blockchain sync server syncs data from our contracts deployed on the sidechain and it uses Moralis’ Web3 APIs to fetch synced data for the other NFTs available on Ethereum and Polygon. ○ It has a list of endpoints that can be called to fetch this data and use it.
Documentation of these endpoints is available here.
● App: The app communicates with smart contracts and the blockchain sync server. There are three main blockchain-related features that App should perform. ○ Listing NFTs: App will send a fetch request to the blockchain sync server with the user’s wallet address and connected chain. The sync server will respond with an array of NFTs that the user owns. This list will be shown to the user as their inventory. The item should be loaded when the user drags and drops the NFT from this list.
Important to note: From the JSON metadata attribute, we will first look for the asset attribute, if it exists on the NFT then load this file link through totum.
Otherwise, look for animation_url if even animation_url is not present then look for the image attribute and load it. ○ Minting NFTs: App will allow users to mint NFTs on Polygon or sidechain. If a user logs in through discord, the user will be able to mint on the sidechain. If a user logs in through metamask, check if the user is not connected to Polygon and show a prompt that we only allow minting on Polygon. ○ NFT Claims:● Discord Bot: ○ Discord bot present in this repo allows users to manage their profile and do all of the blockchain-related transactions on the Webaverse sidechain. When a user submits a command through a discord channel as a message, discord bot creates an account for this user in AWS dynamodb against its discord id Important point to note: Once a discord id is created then it will be further used for all future transactions (via discord bot).