An open API service indexing awesome lists of open source software.

https://github.com/berzanorg/nft-pawn-shop

This repository contains the smart contract and the web interface of NFT Pawn Shop.
https://github.com/berzanorg/nft-pawn-shop

backdrop dapp defi lending nft solana

Last synced: 6 days ago
JSON representation

This repository contains the smart contract and the web interface of NFT Pawn Shop.

Awesome Lists containing this project

README

        

# 🏪 NFT Pawn Shop 🏪 [Visit it!](https://nftpawnshop.pages.dev/)
### What Is NFT Pawn Shop?
It is a decentralized application & a standard for the entire Solana ecosystem.

> The prototype is first developed for a local Solana hackathon as a team.
>

> But a production version is developed for [Backdrop](https://backdrop.so/)'s hackathon by me, [Berzan](https://x.com/BerzanXYZ).
>

> I'd like to thank my team members for their support.

### Why Does It Exist?
It allows NFT owners to borrow money using their NFTs as collateral.

It allows crypto holders to lend their crypto and earn interest.

Any dapp and NFT marketplace can integrate it to provide the same services.

![nft pawn shop logo](/.github/assets/logo.png)

### What Technologies Are Used?
⚓ We used [Anchor](https://www.anchor-lang.com/) framework to develop the smart contract.

⚛️ We used [React](https://react.dev/) with [Next.js](https://nextjs.org/) to develop the web interface.

🌬️ We used [TailwindCSS](https://tailwindcss.com/) to rapidly style the website without ever leaving HTML.

### Who Are The Team Members?
Emre: A blockchain & AI developer for a very long time.

Zeyn: The youngest in the team but the oldest in the meme game.

Berzan: A developer and a proud crypto ecosystem member.

Omer: A Rust developer working on various blockchains.

# 💻 Development 💻
>This repository consists of both the smart contract and the web interface.

This project is initialized using [`anchor init`](https://www.anchor-lang.com/docs/hello-world) command.

The web interface is located in [`app/`](/app/) folder.

### How To Setup The Environment?
[Node.js](https://nodejs.org/en/download), [Yarn](https://yarnpkg.com/), [Rust](https://www.rust-lang.org/), [Solana](https://docs.solana.com/cli/install-solana-cli-tools) and [Anchor](https://www.anchor-lang.com/docs/installation) are required.

You can locally install them all, however we recommend you to use [Dev Containers](https://containers.dev/).

It is the fastest way to setup a development environment.

If you already have [VS Code](https://code.visualstudio.com/) and [Docker](https://www.docker.com/) installed, [VS Code](https://code.visualstudio.com/) will warn you to open the project in a [Dev Container](https://containers.dev/).

We also added some extensions to improve your development experience in the [Dev Container](https://containers.dev/).

### How To Start Developing?

1 - First you have to clone the repository.
```sh
git clone https://github.com/solana-devs/nft-pawn-shop.git
```
2 - Secondly set the working directory.
```sh
cd nft-pawn-shop/
```

### How To Develop The Smart Contract? (A Program In Solana's Jargon)

You can build the program.
```sh
anchor build
```
You can also run the tests.
```sh
anchor test
```

### How To Deploy The Progam To Solana Devnet?
If you want to deploy the program, you have to replace the program ID.

Get the address from the keypair.
```sh
solana address -k target/deploy/nft_pawn_shop-keypair.json
```
After running this command copy the address it printed.

Then replace the address in [`Anchor.toml`](/Anchor.toml) and [`programs/nft-pawn-shop/src/lib.rs`](/programs/nft-pawn-shop/src/lib.rs) files.

Change configuration to use devnet as default.
```sh
solana config set --url devnet
```

Request some worthless (but worthy for devs) SOL to deploy.
```sh
solana airdrop 4
```

Finally you can deploy the program to Solana Devnet.
```sh
anchor deploy
```

### How To Develop The Web Interface?
The web interface resides in [`app/`](/app/) folder.

So you have to set the working directory as below.
```sh
cd app/
```

It is a classical [Next.js](https://nextjs.org/) project.

So you can be familiar with the commands.

Install dependencies.
```sh
npm install
```

Start the development server.
```sh
npm run dev
```

Make a production build.
```sh
npm run build
```


> ❤️ Made with love by **Omer**, **Berzan**, **Emre**, and **Zeyn**.