Skip to content

A crowdfunding platform that allows users to send funds in the form of RVL, a customized ERC20 tokens and an RVL Faucet that allows users to receive RVL to be able to participate in crowdfunding projects

License

Notifications You must be signed in to change notification settings

nour-karoui/fund-me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HELLO This is RVL Faucet & RVL Crowdfunding

💰 What is RVL?

It is an ERC20 Token hosted on Goerli Testnet.
RVL Token on Goerli address is: 0x858bdC45260c796C22f6E43765e79B6DDbfF5a2D

✂️ How is this project divided?

The project is divided into 3 main sections:

  1. Truffle-Crowdfunding: The truffle project, containing all the smart contracts used for this project and their deployments configurations.
  2. Crowdfund: The Dapp that allows users to interact with our smart contracts, create and fund projects. Visit Crowd Fund Me
  3. RVL-Faucet: The faucet that allows users to receive some RVL. Visit RVL-Faucet

🙌 What is RVL Crowdfunding?

It is a decentralized crowdfunding app hosted on Goerli Testnet built with Truffle Framework, ReactJs and ethers.js library.

  1. Any user can create a funding project and specify a budget.
  2. Any user can fund the project with RVL Token as long as the budget is not reached yet.
  3. Any user can request refunds as long as the budget is not reached.
  4. A project admin (creator) can update the project budget.
  5. An event listener is listening to when the project budget is reached.

🎰 What is RVL Faucet?

In order to be able to fund projects, a user needs to pocess some RVL, that's why we created a faucet with ReactJs and ethers.js library, deployed on Goerli Testnet to fund any user with some RVL.

🎯 Running and Testing the project

In order to just run the DApp, you can skip this section since the smart contracts are already deployed. This section is for those who want to run, modify and test the smart contracts whether locally or in a testnet

After cloning this repo, we will start with running and testing the blockchain part.

📒 The blockchain part


In order to test the app locally, you need Ganache-cli.

To deploy and test smart contracts locally, open a terminal and run this command.

    ganache-cli

Deploying the contract on a Testnet takes more time than deploying it locally so be patient.

Make sure to create .env file following the .env.example file

Run this command to install dependencies:

    cd truffle-crowdfunding
    npm install truffle

These are the main commands that would help you interact with our smart contracts:

  1. Compiling the contracts (this will generate a JSON file for each contract found in build/contracts)
        truffle compile
  2. Deploying the contracts
        truffle migrate --network <NETWORK_NAME>
        truffle run verify <CONTRACT_NAME>
  3. Running unit tests
        truffle test --network <network-name>
  4. Interacting with the contracts
        truffle console --network <network-name>
    1. Instanciating the deployed contracts
      const rvlFacuet = await RVLFaucet.deployed()
      const rvlToken = await RVLToken.deployed()
      const projectsFactory = await ProjectsFactory.deployed()
      const accounts = await web3.eth.getAccounts()
    2. Funding the RVLFaucet
      # give access to rvlFaucet to transfer from accounts[0]
      await rvlToken.approve(rvlFaucet.address, web3.utils.toWei('10', 'ether'), {from: accounts[0]})
      await rvlFaucet.fundFaucet(web3.utils.toWei('10', 'ether'), {from: accounts[0]})
    3. Using the faucet to fund accounts[1]
      await rvlFaucet.fundFaucet(accounts[1], {from: accounts[1]})
      const balance = await rvlToken.balanceOf(accounts[1])
    4. Create a new project
      await projectsFactory.createNewProject('test project', web3.utils.toWei('10', 'ether'), rvlToken.address, {from: accounts[1]})
      const testProjectAddress = await projectsFactory.getProjectAddress('test project')
      const testProject = await ProjectFunding.at(testProjectAddress)
    5. Fund project
      await rvlToken.approve(testProject.address, web3.utils.toWei('1', 'ether'), {from: accounts[1]})
      await testProject.fundProject(web3.utils.toWei('1', 'ether'), {from: accounts[1]})
    6. Request refunds
      await testProject.refund(web3.utils.toWei('1', 'ether'))
    7. Update project budget
      # throws an error because sender is not the owner of the transaction
      await testProject.updateBudget(web3.utils.toWei('15', 'ether'), {from: accounts[0]})
      # updates project budget successfully
      await testProject.updateBudget(web3.utils.toWei('15', 'ether'), {from: accounts[1]})

🚀 Running The Crowdfunding & Faucet DApp


The run the Faucet and Crowdfund you need both a Metamask wallet attached to your Browser, also you need some Goerli Ether

You can get some Goerli ETH on This Faucet.

image

Running the DApps

To get some RVL Tokens.

    cd rvl-faucet
    PORT=3001 npm start

To interact with the crowdfunding app

    cd crowdfund
    npm start

🔨 Areas of Improvements

  • Frontend improvements: automatic updates of UI Components whithout the need to refresh the page.
  • Make the smart contracts upgradable.
  • Implement the possibility to add and update project settings (description, ...).
  • Automate smart contract deployment and integration with the front (ABI, address).
  • Create unit the RVL Faucet.
  • Provide multiple ERC20 token options to fund projects.
  • Add more events to be emitted from solidity (CreateNewProject Event, FundProject Event, UpdateProjectBudget Event, ...).

About

A crowdfunding platform that allows users to send funds in the form of RVL, a customized ERC20 tokens and an RVL Faucet that allows users to receive RVL to be able to participate in crowdfunding projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published