This is my project repository developed during SDSLabs Winter of Code 2023
This is a dApp for multiparty transactions, i.e transactions in which more than one party is involved (particularly organisations) and aims at implementing this for organisations. This was made using node.js, solidity (Hardhat development environemnt), bootstrap along with the use of MetaMask API.
- Simple and elegant UI and easy to interact and understand.
- Secure transactions on the blockchain.
- Processes multiparty transactions upon majority consensus after gaining user signatures.
This dApp is built to extend the functionality of MetaMask in order to exxpand it to serve to multiparty transactions, the transactions in which many parties are involved and all don't necessarily have the same 'weight' for their opinion.
- Clone the repository to your local machine using the command
git clone (SSH key)
in your terminal using the SSH key of the repository.
- Install all the required dependencies using
npm install
in the root of the repository.
-
Install MetaMask browser extension : Install MetaMask.
-
Create a
.env
file and create a variablePRIVATE_KEY
and assign it the value of private key of a MetaMask wallet (It is recommended to not use an actual wallet, instead make a new wallet). -
Deploy the contract on the Polygon Mumbai testnet by running the command
yarn hardhat run --network polygon_mumbai scripts/deploy.js
in the root of your directory. Now, copy the contract address in the terminal and paste that in theconstants.js
file. -
Use Polygon Faucet to get test MATIC cryptocurrrency by entering your wallet's address.
-
Change your directory by running
cd front-end-multiparty-payments
and run the node server by running the commandnode ./server/server.js
. Openlocalhost:5500/front-end-multiparty-payments/
. Now you can interact with the dApp.
You can add a new ShareHolder to the organisation by specifying their share, name and wallet address.
You can initiate a new transaction and notice that it will send signature requests to other ShareHolders which they can approve or disapprove, and if the total consensus is greater than 51%, the transaction will be successful (You need to have atleast two MetaMask wallet in diffefent browsers preferably!). Note that you can make multiple transactions after entering the relevant data of ShareHolders.
You can edit the relevant details like name of the organisation, required majority along with the data of CoFounders while deploying the contract in ./scripts/deploy.js
.
Licensed under the MIT License