A decentralized, smart contract based platform for p2p-lending of any existing ERC20 Token on the Ethereum Blockchain with ETH as colletral. The open ecosystem of the p2p-lending platform has the potential to offer cheaper lending contracts than traditional centralized institutions, while also enabling people all over the world to profit from a fair and transparent portfolio of products.
These are the requisites you need, in order to use the software and instructions, on how to install them.
curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
Download it form this link https://truffleframework.com/ganache
npm install --save-dev hardhat
git clone <Current_URL>
Ganache -> Settings -> Server -> Port Number -> 8545
npm install
hh compile
hh run scripts/deploy.ts
hh test
config.smartContractAddress.p2pToken
config.smartContractAddress.p2pPlatform
sudo npm install
sudo mkdir -p /var/log/defi/
sudo chmod 777 -R /var/log/defi
npm run start
Change below configuration in config/development.js
config.blockchain.url = {INFURA_URL} config.blockchain.chainId = {CHAIN_ID} (Ropsten - 3)
https://www.getpostman.com/collections/bab6a07226f6791e2eda
- UpgradToken.sol
- Governance.sol
- DeFiPlatform.sol
- Create Ask Request with collateral as ETH
- Get created requests from API -> get Requests
- Give Token approval from Lender to above address (same amount as asked)
- Call Lend Function from Lender
- Transfer some extra token to asker so that he can payback
- Payback from lender, Collateral will come back
- Collect Collateral if not paid before deadline
- Cancel Request before Lender pay
- Change is Valid from upVote from Governance Contract
HINT (Session 2) Deploy contract on ethereum ropsten network
- Set your Infura Key(https://infura.io/) and Mnemonic as below (Use your existing seed or create new and transfer some ether to it)
- Update "from" address in truffle-config.js which have funds
export INFURA_API_KEY="asdasd"
export MNEMONIC="asd asd ...."
To capture all blockchain transaction
cd backend
node script/blockCrawler.js
- Smart contract creation
- Smart contract deployment (Hardhat)
- Get the JSON artifacts (ABI files)
- Create your blockchain connection (web3)
- Create your smart contract object (contractObj -> ABI and Smart Contract Address)
- Interact with the contract
- Read : .call()
- Write : RawTransaction(APP work -> FE/BE) -> SignedTransaction(Wallet like metamask) -> Broadcast(Wallet like metamask)
sudo npm install github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb
OR
sudo npm i web3
sudo npm i ethereumjs-tx@1.3.7