Skip to content

ian-shim/rental-exchange

Repository files navigation

RentalExchange

Smart contracts for NFT rental exchange.

WARNING: This code has not been comprehensively tested or audited. The author is not responsible for any loss of funds. Meanwhile, please open an issue or a PR if you find any bugs or vulnerabilities.

Contracts

  • RentalExchange.sol
    Exchange contracts that faciliates an order matching given a signed maker order and a fulfilling taker order.

  • CurrencyManager.sol
    Manages currencies that can be used to fulfill orders (ex. WETH).

  • ExecutionManager.sol
    Manages order matching strategies (ex. Fixed price sale, Dutch auction).

  • ReceiptToken.sol
    An ERC721 token that represents a receipt for a borrowed asset. Encodes the asset, borrower, and rental expiration. A lender uses this receipt to claim and retrieve the lent asset upon the expiry.

  • TransferSelectorNFT.sol
    Helper contract that returns appropriate TransferManager given a collection (NFT) contract.

  • TransferManagerERCxxx.sol
    Facilitates an actual NFT transfer.

Deployed Contract Addresses

RentalExchange

mainnet:
goerli: 0x1302727142cEfebDf3d781646bd29EDb4401Af25

CurrencyManager

mainnet:
goerli: 0x3398B3C2FbE099Bd27D6120d7602CA146e573d25

ExecutionManager

mainnet:
goerli: 0xead073B90d88e62400395AF2FaBd44846f58503a

ReceiptToken

mainnet:
goerli: 0xaB75D70b5Ad20bE5A71540519989B4b5290f5Fcd

TransferSelectorNFT

mainnet:
goerli: 0x235512d3C1Ad5f555CEaB7593969f35D26909Dbe

TransferManagerERC721

mainnet:
goerli: 0x12D8eC1962251B19Ebd19e87B5cc70ee1Dd5431F

TransferManagerERC1155

mainnet:
goerli: 0x9820dC28d69282e92f946a3bB2a26683BeD5Bd0a

Usage

Install Foundry

Download foundryup:

$ curl -L https://foundry.paradigm.xyz | bash

Then install Foundry:

$ foundryup

Clone the repo:

$ git clone https://github.com/ian-shim/rental-exchange.git

Running tests

Unit tests:

$ forge test [-vvvv]

Integration tests require forking mode:
(integration tests fork and use actual deployed contracts. Make sure the deployed addresses in the tests are correct)

$ forge test --fork-url <NODE_URL> --chain-id <CHAIN_ID> --etherscan-api-key <ETHERSCAN_KEY>

About

NFT Rental Exchange

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published