Smart Contracts
Last updated
Last updated
We utilize the Diamond-Pattern for our Smart-Contract Architecture
Our Deployed Contracts are here : [Github Repo]
The Game Architecture is stored on the Diamond, which is a Proxy to its Facets. This enables us to have modularized contracts with infinite contract size, with shared storage & upgradability. Saving Gas is just a very nice bonus.
Facets themselves are Feature-Specific Parts of the Game, such as Combat, Ship Crafting, Planets etc.
The Game's storage is using the AppStorage Pattern https://dev.to/mudgen/appstorage-pattern-for-state-variables-in-solidity-3lki
For The NFT's, we deploy ERC721/ERC1155/ERC20 Compliant Seperate Contracts which are coupled to the Diamond. In order to enable Patches, we are using the Upgradable Pattern from OpenZeppelin https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable