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.
-
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 appropriateTransferManager
given a collection (NFT) contract. -
TransferManagerERCxxx.sol
Facilitates an actual NFT transfer.
mainnet:
goerli: 0x1302727142cEfebDf3d781646bd29EDb4401Af25
mainnet:
goerli: 0x3398B3C2FbE099Bd27D6120d7602CA146e573d25
mainnet:
goerli: 0xead073B90d88e62400395AF2FaBd44846f58503a
mainnet:
goerli: 0xaB75D70b5Ad20bE5A71540519989B4b5290f5Fcd
mainnet:
goerli: 0x235512d3C1Ad5f555CEaB7593969f35D26909Dbe
mainnet:
goerli: 0x12D8eC1962251B19Ebd19e87B5cc70ee1Dd5431F
mainnet:
goerli: 0x9820dC28d69282e92f946a3bB2a26683BeD5Bd0a
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
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>