This is the final project for the ConsenSys Academy's Developer Program.
I decided to implement a Bounty dApp. In this app the user is able to:
- Create a bounty
- See the last bounties posted
- See the detail of a bounty, and know its status
- Propose a work for an existing bounty giving a description and uploading a file to IPFS network
- If the user is the creator of a bounty he can review the works and accept or reject a work
- Once a work has been accepted the bounty is set as closed and no work can be submitted anymore
- Access to his profile to see its balance and withdraw it
- Access to his profile to consult the list of bounties or works he posted
In order to test the project on your local machine, you'll have to have Ganache installed and running on https://127.0.0.1:8545
and Truffle too to deploy the smart contracts.
Then to deploy the smart contracts:
- Go in the project folder
- Make a
truffle compile
- Make a
truffle migrate
- To check that everything is ok you can run the tests with
truffle test
This is how to launch the local server:
- Go to the project folder
- Go in the client directory
cd client
- The first time make an
npm install
oryarn install
- Then to launch the server, make an
npm run start
- Go in your browser and go to
localhost:3000
In order to work, you must have Metamask installed in your browser, and have it connected to your Ganache local Ethereum blockchain.
The smart contract has been deployed on the Rinkeby test network.
All the infos about the contract address and the transaction hash of the deployment can be found in the file deployed_addresses.txt
.
I had some issue verifying the code on Etherscan.
The dapp is available at this url: https://bounty-dapp.now.sh Please use Metamask and the Rinkeby test network in order to access the app.
I used the SafeMath library from OpenZeppelin in order to avoid integers overflow or underflow. This can happen when an integer overflows the limit that is set for this number. For example for an unsigned integer which limit is 2 ^ 256 - 1, if an integer overflows the value will go back to 0.
The Counter library from OpenZeppelin provides an incrementing uint256 id that is useful for issuing ids for ERC-721 tokens. In this project, it is used to issue a new id for each new bounty or work.
I used the IPFS in order to allow users to associate a file to a work that they submit. The file is uploaded to IPFS, the hash is saved. Later anyone can access the file through the IPFS gateway (a direct link is provided on each work).
WARNING: In order for the IPFS file to be available through the gateway you may have to keep the dapp a bit open in order for the local daemon to transfer the file to other nodes.