8000 GitHub - tonred/FeedTheCat: πŸ’™πŸ’› Platform for creating safe funding to help Ukraine
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tonred/FeedTheCat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Feed The Cat

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

cats

Key features:

  • 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)

Technologies:

  • Polygon blockchain
  • Solidity ^0.8.9
  • Hardhat as dev env
  • IPFS for storing files
  • Aragon as a DAO

Workflow

Fundings

The main entity of the platform. Every funding is an independent contract with own vault. The workflow is next:

  1. Anyone can create proposal and put it in DAO for voting
  2. DAO consists of trusted persons that verify all documents, and accept proposal if funding is really needed
  3. 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

Donates and rewards

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:

  1. Donators can choose a favorite fundings from list and support them
  2. As a reward, donators will receive NFTs
  3. 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)

Sample of reward NFT

funding

DAO (Aragon)

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

voting

Technical description

Root

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:

  1. dao - address of Aragon DAO
  2. defaultToken - address of ERC20 token in which the fundings is made (usually USDT)
  3. nfts - list of global NFTs and requirements for them
  4. nftUri - 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;

Funding

Source code: Funding.sol

Every funding must have:

  1. Funding Info (see FundingInfo.sol
    • title - short name of funding
    • description - full description of funding
    • nftUri - uri for local nfts (see more in ERC1155)
    • target - target amount (balance) of funding
    • spender - account of person who is responsible for funding, this account can withdraw collected tokens and add reports
    • duration - duration of funding in seconds (from time when DAO accept it)
  2. Files that proofs reality of funding and reality of creator
  3. 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
Loading

Funding can have such states (see FundingState.sol):

  1. PENDING - funding is waiting for DAO accepting
  2. ACTIVE - anyone can donate to support it
  3. EXPIRED - time finished, but funding is not complete, all donators can refund their contribution
  4. FINISHED - funding successfully finished, creator can withdraw tokens and add reports

Timeline of states ftc-state

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;

Structures

  1. NFTInfo.sol - requirement for getting this NFT:
    • minAmount - min amount of donation in tokens
    • minCount - min count of donation repeats for local NFTs, and min unique fundings for global
    • onlyTop1, onlyTop2, onlyTop3 - only for local NFTs, means that it should be rewarded for specific place in top
    • special - only for global NFTs, means this logic of this reward described in root contract
  2. File.sol - description of IPFS file
  3. DonatorData.sol - data about each donator
  4. FundingState.sol and FundingInfo.sol - see above in Funding part

Tests

Main functionality is covered with tests, check report bellow tests

Slava Ukraini!

About

πŸ’™πŸ’› Platform for creating safe funding to help Ukraine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0