fractionaloan
所属分类:NFT
开发工具:TypeScript
文件大小:204KB
下载次数:0
上传日期:2021-10-24 14:23:08
上 传 者:
sh-1993
说明: 部分贷款是一种去中心化的协议,贷款人可以铸造其NFT的标记化部分所有权,这些NFT是...
(Fractionaloan is a decentralized protocol where lenders can mint tokenized fractional ownership of their NFTs that represent their credit.)
文件列表:
.nvmrc (8, 2021-10-24)
.prettierrc (210, 2021-10-24)
abis (0, 2021-10-24)
abis\ERC20.ts (3450, 2021-10-24)
abis\GoldfinchConfig.ts (10360, 2021-10-24)
abis\PoolTokens.ts (16119, 2021-10-24)
abis\TranchedPool.ts (18293, 2021-10-24)
app (0, 2021-10-24)
app\.eslintrc.json (40, 2021-10-24)
app\common (0, 2021-10-24)
app\common\constants.ts (239, 2021-10-24)
app\common\types.ts (71, 2021-10-24)
app\components (0, 2021-10-24)
app\components\Footer.tsx (595, 2021-10-24)
app\components\Fractionalizer.tsx (3440, 2021-10-24)
app\components\Head.tsx (290, 2021-10-24)
app\components\Header.tsx (530, 2021-10-24)
app\components\NFTSelector.tsx (915, 2021-10-24)
app\components\VaultSelector.tsx (790, 2021-10-24)
app\components\VaultViewer.tsx (5526, 2021-10-24)
app\components\WalletContext.tsx (1664, 2021-10-24)
app\next-env.d.ts (245, 2021-10-24)
app\next.config.js (87, 2021-10-24)
app\package-lock.json (91019, 2021-10-24)
app\package.json (437, 2021-10-24)
app\pages (0, 2021-10-24)
app\pages\_app.tsx (309, 2021-10-24)
app\pages\borrower.tsx (881, 2021-10-24)
app\pages\index.tsx (1343, 2021-10-24)
app\pages\lender.tsx (906, 2021-10-24)
app\public (0, 2021-10-24)
app\public\favicon.ico (4286, 2021-10-24)
app\public\fractionloan.png (32338, 2021-10-24)
app\public\vercel.svg (1101, 2021-10-24)
app\styles (0, 2021-10-24)
... ...
## Abstract
Fractionaloan is a decentralized protocol where lenders can mint tokenized fractional ownership of their NFTs that represent their credit.
## Develop Locally
1. Clone this repo and yarn install
```bash
git clone https://github.com/flactionaloan/flactionaloan-contracts
cd flactionaloan-contracts
yarn install
```
2. Create an [Alchemy](https://www.alchemy.com/) or [Infura](https://infura.io/) account and get their api key.
3. Declare environment variables
I encourage you to declare environment variables in your `.bash_profile`(or .zprofile and others) to avoid sharing your credentials accidentally. You can also make `.env` file in the root of this repository although I do not recommend it.
`.bash_profile`
```bash
export ALCHEMY_API_KEY =
export INFURA_API_KEY =
export DEPLOYMENT_ACCOUNT_PRIVATE_KEY =
export MNEMONIC_WORDS =
export WALLET_INITIAL_INDEX = "0"
export ETHERSCAN_API_KEY =
```
You can leave `DEPLOYMENT_ACCOUNT_PRIVATE_KEY` and `ETHERSCAN_API_KEY` empty until you deploy to the mainnet. I recommend obtaining your mnemonic words from MetaMask and storing in `MNEMONIC_WORDS`.
You are ready to write code!
## Npm Script
`npm run compile`: compiles your contracts, and generate artifacts & cache.
`npm run deploy:mainnet_forked`: deploys your contracts to the mirrored version of the mainnet in your local network.
`npm run node`: runs the default network configured in the `hardhat.config.ts`.
`cd app && yarn dev`: runs the web app
## Developing on the App
### Start Hardhat node
First, run `yarn node` to start your own hardhat test network. This will print out a few wallets with existing ETH.
Select one of these public/private key pairs to use as your own test wallet.
### Deploy contracts
In `scripts/deploy.ts` change `TEST_WALLET` and `TEST_PRIVATE_KEY` to be your own wallet, then run `yarn deploy`
You should see a printed out address that says `Deployed contract to {{address}}`
### Start App
Set `VAULT_ADDRESS` in `app/common/contants` to match the deployed address.
Then start the app with
```
cd app/
yarn install && yarn dev
```
近期下载者:
相关文件:
收藏者: