https://github.com/masaun/micro-finance
The Micro Finance platform by using smart contract
https://github.com/masaun/micro-finance
chainlink compound kyber
Last synced: about 1 year ago
JSON representation
The Micro Finance platform by using smart contract
- Host: GitHub
- URL: https://github.com/masaun/micro-finance
- Owner: masaun
- Created: 2019-09-21T08:43:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-27T20:32:00.000Z (over 6 years ago)
- Last Synced: 2025-02-02T10:43:12.233Z (over 1 year ago)
- Topics: chainlink, compound, kyber
- Language: JavaScript
- Homepage:
- Size: 25.2 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The Micro Finance platform by using smart contract
***
## 【Introduction of The Micro Finance platform by using smart contract】
- The Micro Finance platform that make come ture micro finance by type of group borrowing / lending by using smart contract.
(The Micro Finance platform that replace the Grameen Bank's model with smart contract)
- Lender can anytoken to lend and borrower can borrow with DAI which is converted by Kyber payment.
***
## 【Setup】
### Setup private network by using Ganache
1. Download Ganache from link below
https://www.trufflesuite.com/ganache
2. Execute Ganache
### Setup wallet by using Metamask
1. Add MetaMask to browser (Chrome or FireFox or Opera or Brave)
https://metamask.io/
2. Adjust appropriate newwork below
```
Ropsten Test Network
```
### Setup backend
1. Deploy contracts to ropsten network
```
(root directory)
$ npm run migrate:live
```
### Setup frontend
1. Execute command below in root directory.
```
$ npm run client
```
2. Access to browser by using link
```
http://127.0.0.1:3000
```
***
## 【Work flow】
***
## 【References】
- Documents
- #KyberDefi Hackathon / Resources
https://kyber.devpost.com/details/resources
- issue
https://gitcoin.co/issue/makerdao/community/314
https://challenges.adb.org/en/challenges/agri-fin/teams
# Chainlink Truffle Box
Implementation of a [Chainlink requesting contract](https://docs.chain.link/docs/create-a-chainlinked-project).
## Requirements
- NPM
## Installation
Package installation should have occurred for you during the Truffle Box setup. However, if you add dependencies, you'll need to add them to the project by running:
```bash
npm install
```
Or
```bash
yarn install
```
## Test
```bash
npm test
```
## Deploy
If needed, edit the `truffle-config.js` config file to set the desired network to a different port. It assumes any network is running the RPC port on 8545.
```bash
npm run migrate:dev
```
For deploying to live networks, Truffle will use `truffle-hdwallet-provider` for your mnemonic and an RPC URL. Set your environment variables `$RPC_URL` and `$MNEMONIC` before running:
```bash
npm run migrate:live
```
## Helper Scripts
There are 3 helper scripts provided with this box in the scripts directory:
- `fund-contract.js`
- `request-data.js`
- `read-contract.js`
They can be used by calling them from `npx truffle exec`, for example:
```bash
npx truffle exec scripts/fund-contract.js --network live
```
The CLI will output something similar to the following:
```
Using network 'live'.
Funding contract: 0x972DB80842Fdaf6015d80954949dBE0A1700705E
0xd81fcf7bfaf8660149041c823e843f0b2409137a1809a0319d26db9ceaeef650
Truffle v5.0.25 (core: 5.0.25)
Node v10.15.1
```
In the `request-data.js` script, example parameters are provided for you. You can change the oracle address, Job ID, and parameters based on the information available on [our documentation](https://docs.chain.link/docs/testnet-oracles).
```bash
npx truffle exec scripts/request-data.js --network live
```
This creates a request and will return the transaction ID, for example:
```
Using network 'live'.
Creating request on contract: 0x972DB80842Fdaf6015d80954949dBE0A1700705E
0x828f256109f22087b0804a4d1a5c25e8ce9e5ac4bbc777b5715f5f9e5b181a4b
Truffle v5.0.25 (core: 5.0.25)
Node v10.15.1
```
After creating a request on a live network, you will want to wait 3 blocks for the Chainlink node to respond. Then call the `read-contract.js` script to read the contract's state.
```bash
npx truffle exec scripts/read-contract.js --network live
```
Once the oracle has responded, you will receive a value similar to the one below:
```
Using network 'live'.
21568
Truffle v5.0.25 (core: 5.0.25)
Node v10.15.1
```