Allows you to create and manage campaigns in Rinkeby network using ethereum smart contracts.
- Truffle - ( development framework for dapps based on the Ethereum blockchain: https://truffleframework.com/),
- Ganache - ( A personal blockchain for Ethereum development that can be used to deploy contracts, develop applications, and run tests: https://truffleframework.com/ganache),
- Solidity - (contract-oriented programming language for writing smart contracts: https://solidity.readthedocs.io/en/v0.4.24/),
- Web3.js - (Ethereum JavaScript API: https://github.com/ethereum/web3.js/)
- Truffle Contract -(Better Ethereum contract abstraction, for Node and the browser):https://www.npmjs.com/package/@truffle/contract
- MetaMask - (A browser plugin which allows users to make transactions to Ethereum or other networks through browsers, eliminating the need for dedicated user interfaces for Ethereum or other networks: https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en)
- OpenZeppelin Contracts - OpenZeppelin Contracts is a library for secure smart contract development: https://github.com/OpenZeppelin/openzeppelin-contracts
- NodeJS - (An open source and cross-platform runtime environment for executing JavaScript code outside of a browser: https://nodejs.org/en/),
- Semantic UI - User Interface
- Next JS - Server Rendered Apps
You need to install metamask browser extension and create an account.
Once your account is ready, you need to add some ether balance using Rinkeby Authenticated Faucet.
In the absence of metamask, the project will fallback to using Infura node to access Rinkeby network.
- Run the command
npm install -g truffle
- Git clone the E-cert-Dapp repo
- Cd into the directory and run
yarn install
- Run
yarn run compile
to compile the smart contract - Run
yarn run migrate
to migrate the contract.truffle deploy
is an alias fortruffle migrate
. They both do the same thing. - Run
yarn run console
to interact with the smart contract on the ganache ethereum blockchain
- Go to https://truffleframework.com/ganache and download a version dedicated to your operating system.
- Install by a double click, then run.
- Ganache runs with default values which should be the same or similar to these on-screen. The crucial part is a section defining RPC Server.
- Leave it running.
- To download Nodejs, navigate to navigate to https://nodejs.org/en/download/ and click the version that suits your machine
- After downloading it, click the installer to get it installed on your machine
- Verify installation by running the command on your CLI
node -v
- You can use npm or yarn for package management
- Open a terminal and run:
truffle test or yarn run test
- Open a terminal and run:
truffle run coverage or yarn run coverage
- Open a terminal and run:
truffle run migrate or yarn run migrate
- Open a terminal and run:
truffle run ropsten or yarn run ropsten
- Open a terminal and run:
truffle run ropsten or yarn run ropsten
- Use Solidity Visual Developer to generate the graph for the contract
- Use Solidity Visual Developer to generate the graph for the contract
- Use Solidity Visual Developer to generate the UML with PlantUML embedded
- Use Solidity Visual Developer to generate the UML with PlantUML embedded
Campaign contract is deployed at address 0x2280cB3780CACe8da81dF119f9af16F3aF73c02A
and is available inside the contracts folder.
Our app will interact with the deployed contract to create campaigns.
npm run dev
Go to browser at address https://localhost:3000 to access the web page.
Next JS performs server side rendering of the pages and hot reloading as you make any changes to the code.
You can create a campaign by specifying a minimum contribution required.
Once the campaign is created, you become the manager of the campaign and will be able to create requests which needs to be approved by the contributors.
Any user who contributes below the requirement for the campaign will have their transaction rejected.
Shows details of the campaign such as address of the account which created the campaign, minimum contribution required, campaign balance, number of people who have donated for the campaign and number of requests created by the manager.
Allows you to contribute to the campaign.
List the requests created by the manager for the campaign.
Contributors can approve the requests.
Once the approval criteria is met, the manager can finalize the request for payment to the recipient.
Manager of a campaign can create a request which will be fulfilled by the recipient.
Once more than 50% of the campaign contributors approve the request, the manager can finalize the payment to the vendor.
- Credit: Stephen Grider course on Udemy