Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kamalbuilds/debankonstacks
Demo Video -> https://youtu.be/_7GBtvhHg3c
https://github.com/kamalbuilds/debankonstacks
bitcoin-layer2 hiro stacks
Last synced: about 1 month ago
JSON representation
Demo Video -> https://youtu.be/_7GBtvhHg3c
- Host: GitHub
- URL: https://github.com/kamalbuilds/debankonstacks
- Owner: kamalbuilds
- Created: 2024-03-18T18:09:55.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-03-21T06:39:36.000Z (9 months ago)
- Last Synced: 2024-03-21T08:45:47.285Z (9 months ago)
- Topics: bitcoin-layer2, hiro, stacks
- Language: Clarity
- Homepage: https://debankonstacks.vercel.app
- Size: 110 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NFT Collateral Loan Contract on Stacks
This project introduces a novel smart contract for the Stacks blockchain, allowing Stacks Monkey NFT owners to use their non-fungible tokens (NFTs) from the "Stacks Monkeys" collection as collateral to secure loans. Lenders can provide loans to these NFT owners, and if the loan is not repaid by a specified due date, the NFT collateral is transferred to the lender. This mechanism provides liquidity to NFT owners while offering lenders an opportunity to earn interest or potentially acquire valuable NFTs.
Demo Video - https://youtu.be/_7GBtvhHg3c
## Features
- **Stake NFTs**: NFT owners can stake their "Stacks Monkeys" NFTs as collateral for loans.
- **Loan Provision**: Lenders can offer loans to NFT stakers, specifying loan amounts and due dates.
- **Loan Repayment**: Borrowers can repay loans before the due date to reclaim their NFTs.
- **Claim Collateral**: Lenders can claim the NFT collateral if the loan is not repaid on time.
- **Extend Loan**: Borrowers have the option to extend the loan period under certain conditions.
- **Loan and Staking Information**: Users can query the contract to get information about staked NFTs and loans.## Prerequisites
Before interacting with the contract, ensure you have:
- A Stacks Wallet with STX tokens for transaction fees.
- Ownership of "Stacks Monkeys" NFTs you wish to stake as collateral.## Contract Functions
### Stake NFT
```lisp
(stake-nft (token-id uint))
```
- **Description**: Stake a "Stacks Monkeys" NFT as collateral for a loan.
- **Parameters**:
- `token-id`: The ID of the NFT to stake.### Provide Loan
```lisp
(provide-loan (token-id uint) (loan-amount uint) (due-block uint))
```
- **Description**: Provide a loan to the staker of an NFT, specifying the loan amount and the repayment due date in block height.
- **Parameters**:
- `token-id`: The ID of the staked NFT.
- `loan-amount`: The amount of the loan.
- `due-block`: The block height by which the loan must be repaid.### Repay Loan
```lisp
(repay-loan (token-id uint))
```
- **Description**: Repay an outstanding loan and reclaim the staked NFT.
- **Parameters**:
- `token-id`: The ID of the NFT for which the loan is being repaid.### Claim Collateral
```lisp
(claim-collateral (token-id uint))
```
- **Description**: Claim the NFT collateral if the loan is not repaid by the due date.
- **Parameters**:
- `token-id`: The ID of the NFT to claim as collateral.### Extend Loan
```lisp
(extend-loan (token-id uint) (additional-blocks uint))
```
- **Description**: Extend the due date of an existing loan.
- **Parameters**:
- `token-id`: The ID of the NFT for which the loan is extended.
- `additional-blocks`: The number of blocks to extend the loan due date by.### Get Staked NFT Info
```lisp
(get-staked-nft-info (token-id uint))
```
- **Description**: Retrieve information about a staked NFT, including the loan amount and due date.
- **Parameters**:
- `token-id`: The ID of the staked NFT.## Security Considerations
Users should be aware of the security implications of staking NFTs and providing loans. Ensure you trust the contract's operations and understand the terms of any loan you participate in, whether as a borrower or a lender.
## Development and Testing
This contract was developed and tested on the Stacks blockchain. Developers are encouraged to review the code, deploy it to a testnet, and perform thorough testing before considering a mainnet deployment.