-
Attribution: This dApp and its business plan were created by Marcos (Marcus) A. B. His GitHub username is codesport
-
NB: Version bump from 0.1.0-alpha to 0.1.5-alpha. See release notes.
-
Short Demo Video: https://youtu.be/pNOI2JKv-CA
- Overview
- Unit Testing Results: One-Stop DAO Launchpad and Governance Destination
- Background: A Novel Use Case for ERC-721 Tokens
- How It Works
- How It Is Made
- Frontend
This application demonstrates DAO and NFT tooling.
It allows:
- Creation of a fitness club (organized as a DAO) and
- Fee-based sign-up of new members to an existing club by means of an NFT minter.
- Read functions accessble to anyone. Write functions accesible to club administrators
Demo of contract read/write functions.
Demo) of DAO deployment and Membership Minting.
DAO Logo on IPFS: via Pinata
IPFS Pins for:
- Membership NFT URL: https://ipfo.io/ipfs/QmdXzqtFGaPQ5ePef6oNMwPujPb6aHhYp9c116A56i4Hrg
- Team Logo URL: https://ipfo.io//ipfs/QmXwGr3m845u7uLT1TFYav93PGZ6iiZr4HvkxacCcYbJGN
- Meta Data URL: https://ipfo.io/ipfs/QmW5nzum3UjJRMEVSJHtcbcygH9A8GNmddhLWsbdq8XG7T
Polygon Scan Addresses and Verifications:
- Minter: 0x76A9CF29A875242C5A6134438d851b227216E23e
- Timelock: 0xa0a49Eb06d13D2c10769f824FF8bA7aa7132F2E8
- Governor: 0x8D0507d79302366BD36d3dd24978b5b98f560371
- Minter Contract deployed TO: 0xfE1B8bBF112a9D926333D31FD4b6eC97dB013b5d
- TimeLock Contract deployed TO: 0x5Bb8ACE1bE38Aa97Bf81021F7E27a18dE0f9595E
- Governor Contract deployed TO: 0x4FBbf859E9870bc1e6C73C6064C6cc14078011dE
A comprehensive, 11.5 minute demo video is here.
In unit tests ERC721Minter.sol
and Box.sol
were transferred to TimeLock. This forced Goverance (i.e., voting) to mint new NFTs and interact with Box contract. For Box.sol
, Funds were deposited and withdrawn, and a public state variable was changed.
This project explores a use case of utility and programmable ERC-721 tokens. Such tokens offer post issuance and programmable utility such as:
- Authenticating users to portions of a website
- Providing membership certificates and credentials
- Distribution of ad hoc cash rewards or regular income
Fitness club memberships are conveyed by "hot-minting" an ERC-721 token (NFTs) from the fitness club. By "hot-minting" the NFTs are minted on-demand and are not pre-generated.
Through the form-based UI, club creators are able customize:
- Club Name
- Logo
- Symbol
- Member Cost (of issuing memberships as NFTs)
- Description
This project imports, uses, and customizes several OpenZeppelin templates to build a DAO based on audited code and accepted industry best practices.
Customizations were made to the minter contract order to:
- Set token sales price and enforce fees for minting:
receivePayThenMint()
,setSalesPrice()
,getSalesPrice()
- Implement getter and setters for
contractURI
: used by Opensea to auto-populate metadata for a collection - Customize maximum token supply:
setTotalSupply()
andgetTotalSupply()
- Block token minting when maximum token supply is reached:
require( _tokenIdCounter.current() < maxSupply, "Max supply of NFTs exhausted");
- Receive Donations and other funds:
receive()
andreceiveDonations()
- Expose next
tokenID
for printing on minted NFT:getTokenCurrentTokenID()
Additionally, several debugging and "exit" functions were included for testing purposes. These functions will be moved after through testing of the money transfer functionality using the Governance and Timelock contracts (e.g., voting to withdraw funds).
withdraw()
deleteContract()
: A self-destruct solely for the purpose of testing on testnets
This project is a web-based tool for deploying an NFT-based DAO. This tool deploys 3 contracts that permit issuance, governance, and treasury operations. Specifically it customizes and deploys:
- ERC721 Token Minter
- Timelock Controller
- Governor
On the backend, it relies upon node, Express.js, bash, and heavily upon Hardhat libraries which are called directly by Express. Javascript and RegEx are used to sanitize user inputs to conform with smart contract name conventions.
Express is used to call a custom bash script. The script serves as a workhorse which duplicates and customizes DAO contract templates. Specifically, based on information provided by the end user, the bash script customizes and modifies:
- Contract Name
- Total Memberships (token supply)
- Token Pricing
- Contract URI (contract metadata consisting of description and logo)
Hardhat is the the star of the show. It compiles and deploys the contracts to the block chain. Hardhat has a JS library that allows for native non command line use on node.
The UI is itentionally rudimentry. It was quickly protyped to show functionality required for an MVP.
The frontend uses React functional components. I began learning React in August 2020 using a strict Model-View-Controller (MVC)] design pattern with a Class Component a the Controller. With that pattern, I would send props downstream (prop-drilling) to my functional components. Facebook's React team now encourages devs to use Functional Components instead.
The CSS classes are semi-custom. The base CSS classes for the read and write buttons are from Chainlink's VRF2 Subscription Manager. The website design is from Illdy. Illdy is an older (2016 - 2018), open sourced WordPress theme based on Bootstrap 3.