Vote 🗳️ ⮕ Fund 💸 ⮕ Deliver 🚀
Cofund is a framework that bridges the voting and funding processes for DAO grant programs. It is designed to improve the funding rate and completion of large and valuable projects by removing the main obstacles that make it difficult today.
In the first version of Cofund, we leverage NFTs, Superfluid streams, and Aragon client to implement a flexible voting-funding mechanism that (1) automatically triggers funding upon approval of a project proposal in Aragon and (2) executes a new funding scheme consisting of an immediate fixed transfer plus a Superfluid stream with an adjustable rate.
This repo contains the smart contracts for the prototype of the Cofund app that we built in the DAO Global Hackathon.
The light-paper in paper.md contains an extended explanation of the framework toghether with more details on practical relevance and future development goals. We also have mockups that show how our full product will look like, with management of multiple projects, milestone tracking, and a configuration panel that makes it easy to set and modify system parameters (voting strategies, voting-funding conversion rules, and checkpoint/milestone evaluation rules).
Links for the submission:
Clone this repository by typing the following command:
git clone https://github.com/m3-labs/cofund.git
Then, go to the App folder:
cd app
yarn install
Make sure you have installed Node, Yarn, and Git.
Main steps:
copy the .env.template
file and change the name to .env
. The format of the file is as follows:
ALCHEMY_URL= https://eth-rinkeby.alchemyapi.io/v2/xxx
PK= xxx
RECEIVER_PK= xxx
ETHERSCAN_API_KEY= xxx
- Go to the Alchemy.io and create create an App and copy the HTTP URL from the VIEW KEY. You will need it to paste it in the
.env
file. (In this prototype we used the Rinkeby testnet.) - PK is the private key of the metamask account.
- RECEIVER_PK is the private key of the reveiver of the fixed or streamed funds.
- ETHERSCAN_API_KEY: go to https://etherscan.io/apis and create a private key.
On the local machine, run:
yarn deploy:reset
Copy the generated smart contract, i.e. COFUND
, go to the Superfluid dashboard,
and send some stream to the smart contract.
First, go to Aragon and create an organization. Go to the Organization section, and copy the address of the agent.
Next, go to scripts/setOwner.js
file, and paste the agent address in this expression:
const txData = (await CoFund.methods.transferOwnership("0x5322E02231B6CB4713Ff93889Bbb6966f0b07863")).encodeABI()
To transfer the ownership run the following command on your console:
yarn transfer
Now the Aragon agent is the owner of the smart contract. It can interact with the contract such as changing the stream or modifying the fixed amount of fund. This will allow the Aragon app to trigger funding immediately when a proposal is approved as the result of a DAO Vote.
We can interact with the smart contract via the Aragon console and call any function, for example, setFixedFund
or issueNFT
.
First, we need to go to the console in the org address: https://client.aragon.org/#/cofund4/console
And execute any function based on this format:
act/agentAddress/targetAddress/methodName(type: arg)
The targetAddress
is the address of the smart contract.