Project Github: https://github.com/tonred/FeedTheCat
Polygon Root: 0xd4FA89528eeE80a6F5c0AEDE34d26e324F23c0E5
Website: https://feedthecat.org
DAO (Aragon): https://client.aragon.org/#/feedthecat/ at 0x9Ea69F795c34308491945E816Afb1C8f06044446
Platform for creating safe funding to help Ukraine. Donators will receive NFTs as a reward for donation and have ability to help with validation of fundings
- Approve funding via DAO
- Multiple fundings support
- Global and local NFT rewards for donation
- Staking NFTs to allow active donators to validate fundings (in progress)
- Polygon blockchain
- Solidity
^0.8.9
- Hardhat as dev env
- IPFS for storing files
- Aragon as a DAO
The main entity of the platform. Every funding is an independent contract with own vault. The workflow is next:
- Anyone can create proposal and put it in DAO for voting
- DAO consists of trusted persons that verify all documents, and accept proposal if funding is really needed
- Funding appears in list of active fundings
-
- If funding collected target amount, the creator can withdraw tokens and add reports (as IPFS files)
- If funding expired and target amount is not reached, donators can refund their tokens
In order to motivate people to donate, they will receive NFTs while they make a progress in donations. There global rewards that shared between all fundings, and local rewards for every funding. The workflow is next:
- Donators can choose a favorite fundings from list and support them
- As a reward, donators will receive NFTs
- Reward NFTs can be staked in order to receive limited amount of DAO tokens. Using these tokens, top donators can help DAO members to validate fundings (in progress)
DAO consists of trusted persons that verify all documents, and accept proposal if funding is really needed. These persons have 90% of DAO tokens. Other 10% will distribute among top donators
Besides this, DAO members can emergency stop any funding in any moments. Also, they can add new NFT global rewards
Source code: Root.sol
Main contract which contains fundings list, donators statistics and global NFTs. Also used to proxy DAO decisions to fundings
Root constructor must include:
dao
- address of Aragon DAOdefaultToken
- address of ERC20 token in which the fundings is made (usually USDT)nfts
- list of global NFTs and requirements for themnftUri
- uri for global nfts (see more in ERC1155)
Click here to see main function for Root
function createFunding(FundingInfo calldata info, File[] calldata files, NFTInfo[] calldata nfts) external;
function acceptFunding(uint32 fundingID) external;
function processDonation(uint32 fundingID, address donator, uint256 amount) external;
function emergencyFinish(uint32 fundingID) external;
Source code: Funding.sol
Every funding must have:
- Funding Info (see FundingInfo.sol
title
- short name of fundingdescription
- full description of fundingnftUri
- uri for local nfts (see more in ERC1155)target
- target amount (balance) of fundingspender
- account of person who is responsible for funding, this account can withdraw collected tokens and add reportsduration
- duration of funding in seconds (from time when DAO accept it)
- Files that proofs reality of funding and reality of creator
- List of NFTs that will be created only for this funding, and requirements for getting them. NFT is ERC1155 compatible token
Creating of funding:
sequenceDiagram
autonumber
User -) Root: createFunding
Root ->> Funding: constructor
Root ->> DAO: newVoting
DAO members -) DAO: <verify and accept>
DAO ->> Root: acceptFunding
Root ->> Funding: accept
Funding can have such states (see FundingState.sol):
PENDING
- funding is waiting for DAO acceptingACTIVE
- anyone can donate to support itEXPIRED
- time finished, but funding is not complete, all donators can refund their contributionFINISHED
- funding successfully finished, creator can withdraw tokens and add reports
Click here to see main function for Funding
function state() external view returns (FundingState);
function accept() external;
function donateDefault(uint256 amount) external;
function refund() external;
function withdraw(address to, uint256 amount) external;
function addReports(File[] calldata reports) external;
function emergencyFinish() external;
- NFTInfo.sol - requirement for getting this NFT:
minAmount
- min amount of donation in tokensminCount
- min count of donation repeats for local NFTs, and min unique fundings for globalonlyTop1
,onlyTop2
,onlyTop3
- only for local NFTs, means that it should be rewarded for specific place in topspecial
- only for global NFTs, means this logic of this reward described in root contract
- File.sol - description of IPFS file
- DonatorData.sol - data about each donator
- FundingState.sol and FundingInfo.sol - see above in Funding part
Main functionality is covered with tests, check report bellow