The DAO smart contracts provide a decentralized platform for managing datasets and distributing rewards to members using a quadratic funding mechanism. The contracts include a DAO contract that manages the overall platform and several supporting contracts for managing governance tokens, membership NFTs, dataset NFTs, and multi-signature wallets.
The DAO smart contracts are written in Solidity and use the OpenZeppelin Contracts library to implement common functionality such as ERC20 and ERC721 tokens.
The main DAO contract is an Ownable contract that inherits from the OpenZeppelin Ownable contract. This contract manages the overall platform and provides functions for joining the DAO, submitting proposals, voting on proposals, distributing rewards, and other actions.
The DAO contract uses several supporting contracts to manage governance tokens, membership NFTs, dataset NFTs, and multi-signature wallets. These contracts are GovernanceToken, MembershipNFT, DatasetNFT, and Wallet, respectively. The GovernanceToken, MembershipNFT, and DatasetNFT contracts are ERC20 or ERC721 token contracts that inherit from the corresponding OpenZeppelin token contract. The Wallet contract is an AccessControl contract that inherits from the OpenZeppelin AccessControl contract and provides a multi-signature wallet for managing funds.
The DAO contract has several state variables that store information about the platform and its members. These state variables include:
filecoin: The address of the Filecoin interface contract.governanceToken: The address of the GovernanceToken contract.membershipNFT: The address of the MembershipNFT contract.datasetNFT: The address of the DatasetNFT contract.proposalStake: The number of governance tokens required to stake when submitting a proposal.proposalSlash: The number of governance tokens to be slashed if a proposal does not pass.membershipRequirement: The number of datasets required to become a member.proposals: An array of Proposal structs representing proposals submitted by members.datasets: A mapping from member addresses to arrays of dataset CIDs representing the datasets owned by each member.delegates: A mapping from member addresses to delegate addresses representing the member's delegate for voting on proposals.stakes: A mapping from dataset CIDs to mappings from staker addresses to staked amounts representing the amount of Ether staked by each staker on each dataset.