GithubHelp home page GithubHelp logo

lending-platform's Introduction

POC NFT Lending Platform

Introduction

This is a small POC of a lending platform where users can deposit NFTs and borrow stable coins against them.

Getting started

Project

This is a foundry project that contains the 3 contracts that are used in the lending platform.

This is a nextjs project that contains the frontend for the lending platform.

This is the docker-compose file that will start the foundry node and the nextjs app.

Installation

Install Web App Deps

cd apps/web
bun i

Clone foundry submodules

git submodule update --init --recursive

Usage

Start the app

docker compose up -d
docker compose logs anvil

Import the 6th private key into metamask. Or use the following mnemonic to import the account into metamask.

Open the webpage

open http://localhost:3000

Use the newly imported account to connect to the site.

Struggles

Minified Npm Packages

The compiled npm packages should not be minified as it makes quick debugging difficult. And makes ad-hock patching unfeasible.

Workaround: Coped the hook that needed the change into the project

Disconnecting wallet

There seems to be an issue when you disconnect using the metamask sdk the useAccount hook will update before the useSdk hook which causes an issue on when a sync between metamask sdk and wagmi sdk.

Workaround: Left this now the app will attempt to reconnect the wallet if it is disconnected.

Metamask caching issue 1.

No way to clear the cache of metamask, so if you have a wallet connected to the site Seems to be specific to the approval functions.

Workaround: Added randon nonce when deploying contract to force unique contract addresses.

Metamask caching issue 2.

Getting nft approval addresses seem to be cached until the page reloads

Workaround: Added randon nonce when deploying contract to force unique contract addresses.

lending-platform's People

Contributors

samcullin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.