{"id":20442284,"url":"https://github.com/gacwr/unlockd-protocol-immunefi","last_synced_at":"2026-03-06T08:03:55.127Z","repository":{"id":112329104,"uuid":"590203008","full_name":"GACWR/unlockd-protocol-immunefi","owner":"GACWR","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-11T22:39:11.000Z","size":12014,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-05T07:46:53.284Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"UnlockdFinance/unlockd-protocol-immunefi","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GACWR.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-17T21:49:23.000Z","updated_at":"2023-07-03T21:26:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0e833d4-9820-4312-8ac6-1ab4f6a5a537","html_url":"https://github.com/GACWR/unlockd-protocol-immunefi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GACWR/unlockd-protocol-immunefi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GACWR%2Funlockd-protocol-immunefi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GACWR%2Funlockd-protocol-immunefi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GACWR%2Funlockd-protocol-immunefi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GACWR%2Funlockd-protocol-immunefi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GACWR","download_url":"https://codeload.github.com/GACWR/unlockd-protocol-immunefi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GACWR%2Funlockd-protocol-immunefi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30166901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T09:39:01.407Z","updated_at":"2026-03-06T08:03:55.099Z","avatar_url":"https://github.com/GACWR.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" style=\"margin-bottom:32px\"\u003e\n  \u003ca href=\"https://unlockd.finance\"\u003e\n    \u003cimg alt=\"Unlockd logo\" src=\"https://miro.medium.com/max/660/1*YEp9mC_4sVUuFpBzatz3dQ.png\" width=\"auto\" height=\"92px\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://unlockd.finance\"\u003e\n    \u003cimg alt=\"Unlockd logo\" src=\"https://halborn.com/wp-content/uploads/2021/10/audited-by-halborn-green.png.webp\" width=\"auto\" height=\"92px\" /\u003e\n  \u003c/a\u003e\n  \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Figma-F24E1E?style=for-the-badge\u0026logo=figma\u0026logoColor=white\" alt=\"figma\"/\u003e\n    \u003cimg src=\"https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\" alt=\"typescript\"/\u003e   \n    \u003cimg src=\"https://img.shields.io/badge/Solidity-e6e6e6?style=for-the-badge\u0026logo=solidity\u0026logoColor=black\" alt=\"solidity\"/\u003e  \n    \u003cimg src=\"https://img.shields.io/badge/Google_Cloud-4285F4?style=for-the-badge\u0026logo=google-cloud\u0026logoColor=white\" alt=\"google-cloud\"/\u003e\n\n[![](https://dcbadge.vercel.app/api/server/unlockd)](https://discord.gg/unlockd)\n\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nUnlockd is a decentralized non-custodial NFT lending protocol where users can participate as depositors or borrowers. Depositors provide liquidity to the market to earn a passive income, while borrowers are able to borrow in an overcollateralized fashion, using NFTs as collaterl.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nThis repository contains the smart contracts source code and markets configuration for Unlockd Protocol. The repository uses Hardhat as development enviroment for compilation, testing and deployment tasks.\n\u003c/p\u003e\n\u003cbr/\u003e\n\n\u003e **🙇‍♂️ Thanks**\n\u003e Unlockd protocol refers to the architecture design and adopts some of the code of [AAVE](https://github.com/aave).\n\u003e We are very grateful to AAVE for providing us with an excellent DeFi platform.\n\nYou can join at the [Discord](https://discord.gg/unlockd) channel or at the [Governance](https://snapshot.org/#/unlockddao.eth) for asking questions about the protocol or talk about Unlockd with other peers.\n\n\n# 🗂️ Index\n\n- [Documentation](#-documentation)\n- [Setup](#-setup)\n- [Test](#-test)\n- [Tasks](#-tasks)\n- [Deployments](#-deployments)\n\n\n# 📝 Documentation\n\nThe documentation of Unlockd Protocol is in the following [Unlockd documentation](https://github.com/UnlockdFinance/unlockd-protocol-immunefi/tree/main/docs) link. At the documentation you can learn more about the protocol, see the contract interfaces, integration guides and audits.\n\nFor getting the latest contracts addresses, please check the [Deployed contracts](https://github.com/UnlockdFinance/unlockd-protocol-immunefi/blob/main/docs/deployed-contracts/lendingpool-protocol.md) page at the documentation to stay up to date.\n\n\n# 🎬 Setup\n\n- Install\n\nTo run Unlockd, install its dependencies using yarn. You will need [yarn](https://classic.yarnpkg.com/en/docs/install/#mac-stable) installed in your system.\n```bash\nyarn install\n```\n\n- Create an enviroment file named `.env` and fill the next enviroment variables\n\n```bash\n# Private key. Add it if you just want to interact with Hardhat with a single address.\nPRIVATE_KEY=\"\"\n\n# Mnemonic. Used by Hardhat if PRIVATE_KEY is not set. Also used in  `./unlockd-tasks`.\nMNEMONIC=\"\"\n\n# Used in `./unlockd-tasks` to simulate a user different than the owner.\nPRIVATE_KEY_USER=\"\"\n\n# Alchemy/Infura RPC endpoint URL.\nRPC_ENDPOINT=\"\"\n\n# Optional Etherscan key, for automatize the verification of the contracts at Etherscan\nETHERSCAN_KEY=\"\"\nETHERSCAN_NETWORK=\"\" # network in use\n\n# Optional, add it if you want to run tasks in a forked network environment\nFORK=\"\"\n\n# Optional, add it if you want to specify block number running tasks in a forked network\nFORK_BLOCK_NUMBER=\"\"\n\n```\n\n# 🧪 Test\n\nYou can run the full test suite with the following commands. All of them are explained in detail in the [tasks section](#tasks):\n\n```bash\nyarn test\n\nyarn test:localhost\n\nyarn test:file\n```\n\n## Markets configuration\n\nThe configurations related with the Unlockd Markets are located at `markets` directory. You can follow the `IUnlockdConfiguration` interface to create new Markets configuration or extend the current Unlockd configuration.\n\nEach market should have his own Market configuration file, and their own set of deployment tasks, using the Unlockd market config and tasks as a reference.\n\n# ✅ Tasks\n\n## General tasks\nYou can run the general tasks defined in the `package.json` file by using yarn and specifying the task you want to run. For example, we can run the `compile` task with the following command:\n``` bash\nyarn compile\n```\n\u003cdetails\u003e\n    \u003csummary\u003eShow general tasks\u003c/summary\u003e\n    \n| Task                              | Description |\n| -------------                     | ------------- |\n| run-env                          | Installs dependencies without verbose logging                                                                               |\n| hardhat                          | Executes hardhat command                                                                                                    |\n| hardhat:node                     | Starts a Hardhat Network node                                                                                               |\n| hardhat:localhost                | Executes hardhat command, setting network to `localhost`                                                                    |\n| hardhat:goerli                   | Executes hardhat command, setting network to `goerli`                                                                       |\n| hardhat:main                     | Executes hardhat command, setting network to `main`                                                                         |\n| size                             | Logs size of current contracts                                                                                              |\n| compile                          | Compiles the contracts                                                                                                      |\n| test                             | Runs all tests in `./test/`, setting network to `Hardhat` network                                                           |\n| test:localhost                   | Runs all tests in `./test/`, setting network to `localhost` network                                                         |\n| test:file                        | Allows to test for a specific file. The file can be specified in the command line setting it to be equal to `TEST_FILE` var |\n| dev:update-abis                  | Fetches abis from latest contracts data in `./artifacts` and sets them to `./abis` folder                                   |\n| prettier:abis                    | Standarizes the abis code style in `./abis` folder                                                                          |\n| prettier:check                   | Checks the code style in the project                                                                                        |\n| prettier:write                   | Standarizes the code style in the project                                                                                   |\n| ci:clean                         | Runs a hardhat clean and removes all temporal and autogenerated files and folders                                           |\n| unlockd:hardhat:dev:migration    | Deploys the Unlockd protocol development environment in the hardhat network                                                 |\n| unlockd:localhost:dev:migration  | Deploys the Unlockd protocol development environment in localhost                                                           |\n| unlockd:goerli:mock:migration    | Deploys mock environment in Goerli testnet                                                                                  |\n| unlockd:localhost:full:migration | Deploys the full Unlockd protocol in localhost                                                                              |\n| unlockd:goerli:full:migration    | Deploys the full Unlockd protocol in Goerli testnet                                                                         |\n| unlockd:fork:full:migration      | Deploys the full Unlockd protocol in the forked network of choice, set at the environment variables                         |\n| unlockd:main:full:migration      | Deploys the full Unlockd protocol in Ethereum mainnet                                                                       |\n| goerli:verify                    | Verifies in Etherscan all contracts deployed in Goerli                                                                      |\n| goerli:verify:reserves           | Verifies in Etherscan all reserves contracts deployed in Goerli testnet                                                     |\n| goerli:print-contracts           | Prints all current deployed contracts in Goerli testnet                                                                     |\n| goerli:print-config              | Prints all addresses and configuration set in Goerli deployed contracts                                                                                            |\n| main:verify                      | Verifies in Etherscan all reserves contracts deployed in Ethereum mainnet                                                   |\n| main:verify:reserves             | Verifies in Etherscan all reserves contracts deployed in Ethereum mainnet                                                                                                               |\n| main:print-contracts             | Prints all current deployed contracts in Ethereum mainnet                                                                                                      |\n| main:print-config                | Prints all addresses and configuration set in Ethereum mainnet deployed contracts                                                                \n\u003c/details\u003e\n\n## Unlockd tasks\nUnlockd tasks are a specific set of tasks that allow direct interaction with the currently deployed contracts. They require a set of params to be passed as flags in the command, which will be translated to be the params passed to the function to be executed. All params are explained in the definition of each task. These set of tasks can be run in terminal by using Hardhat commands. Network specification is fetched from the RPC_ENDPOINT environment variable. As an example, we'll try to run a 1 WETH deposit into the LendPool. The `deposit` task takes three params (`amount`, `reservename`, and `to`), and the task name is `lendpool:deposit`, so the command to run will be:\n\n```bash\nnpx hardhat lendpool:deposit --amount 100000000000000000 --reservename WETH --to 0x1a470e9916f3dFF8E268A69A39fa2E9F7B954927\n```\n\u003cdetails\u003e\n    \u003csummary\u003eShow Unlockd tasks\u003c/summary\u003e\n\n| Task | Description |\n| ------------- | ------------- |\n| lendpool:deposit | Deposits an amount in the LendPool  |\n| lendpool:withdraw  | Withdraws an amount from the LendPool  |\n| configurator:configureNftAsCollateral  | Sets the configuration parameters to the specified NFT  |\n| lendpool:borrow  | Borrows an amount of a specific reserve from unlockd, depositing an NFT as collateral  |\n| lendpool:getdebtdata  | Returns de debt data for a given loan  |\n| lendpool:getauctiondata  | Returns de auction data for a given loan that is in auction state  |\n| lendpool:repay  | Repays a specified amount from a previous borrow to the LendPool  |\n| lendpool:redeem | Redeems a specific amount from an auctioned NFT and pays a bid fine  |\n| lendpool:auction | Places a bid for an unhealthy position in the protocol  |\n| lendpool:liquidate | Liquidates an unhealthy position, transferring the NFT to the liquidator |\n| lendpool:liquidateNFTX | Liquidates an unhealthy position in NFTX market |\n\n\u003c/details\u003e\n\n# 🚀 Deployments\n\nFor deploying Unlockd Protocol, you can use the available scripts located at `package.json`. For a complete list, run `npm run` to see all the tasks.\n\n### Prepare\n\n```bash\n# install dependencies\nyarn install\n\n```\n\n### Localhost dev deployment\n\n```bash\n# In first terminal\nnpm run hardhat:node\n\n# In second terminal\nnpm run unlockd:localhost:dev:migration\n```\n\n### Localhost full deployment\n\n```bash\n# In first terminal\nnpm run hardhat:node\n\n# In second terminal\nnpx hardhat --network localhost \"dev:deploy-mock-reserves\"\n# then update pool config reserve address\n\nnpx hardhat --network localhost \"dev:deploy-mock-nfts\"\n# then update pool config nft address\n\nnpx hardhat --network localhost \"dev:deploy-mock-aggregators\" --pool Unlockd\n# then update pool config reserve aggregators address\n\nnpx hardhat --network localhost \"dev:deploy-mock-unft-registry\" --pool Unlockd\n# then update pool config unft registry address\n\nnpx hardhat --network localhost \"dev:deploy-mock-unft-tokens\" --pool Unlockd\n```\n\n### Goerli mock deployment (a full deployment may not run because of ERC20 and ERC721 Reserves)\n\n```bash\n# In one terminal\nnpm run unlockd:goerli:mock:migration\n```\n\n## Interact with Unlockd in Mainnet via console\n\nYou can interact with Unlockd at Mainnet network using the Hardhat console, in the scenario where the frontend is down or you want to interact directly. You can check the deployed addresses at [deployed-contracts](https://docs.unlockddao.xyz/developers/deployed-contracts).\n\nRun the Hardhat console pointing to the Mainnet network:\n\n```bash\nnpx hardhat --network main console\n```\n\nAt the Hardhat console, you can interact with the protocol:\n\n```javascript\n// Load the HRE into helpers to access signers\nrun(\"set-DRE\");\n\n// Import getters to instance any Unlockd contract\nconst contractGetters = require(\"./helpers/contracts-getters\");\n\n// Load the first signer\nconst signer = await contractGetters.getFirstSigner();\n\n// Lend pool instance\nconst lendPool = await contractGetters.getLendPool(\"\");\n\n// ERC20 token WETH Mainnet instance\nconst WETH = await contractGetters.getIErc20Detailed(\"\");\n\n// Approve 10 WETH to LendPool address\nawait WETH.connect(signer).approve(lendPool.address, ethers.utils.parseUnits(\"10\"));\n\n// Deposit 10 WETH\nawait lendPool.connect(signer).deposit(DAI.address, ethers.utils.parseUnits(\"10\"), await signer.getAddress(), \"0\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgacwr%2Funlockd-protocol-immunefi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgacwr%2Funlockd-protocol-immunefi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgacwr%2Funlockd-protocol-immunefi/lists"}