NFTVault is a Solidity smart contract that allows users to deposit their ERC721 NFTs into a vault in exchange for ERC20 tokens. For each NFT they deposit they get one token. These tokens can later be used to reclaim the NFTs. The contract is built using the OpenZeppelin library for ERC20 and ERC721 standards.
It was inspired by the CryptoKitties WG0 token contract and I just wanted to create a modern version.
- Deposit Multiple NFTs: Users can deposit multiple ERC721 NFTs in a single transaction. Upon depositing NFTs, the contract mints an equivalent number of ERC20 tokens (1 token per NFT).
- Reclaim NFTs: Users can reclaim their NFTs by burning the corresponding number of ERC20 tokens.
- Events: The contract emits events when NFTs are deposited and reclaimed.
- Node.js: Ensure you have Node.js installed.
- Hardhat: A development environment for Ethereum.
Install the necessary dependencies:
npm install
npx hardhat test
This code has not been security audited and is provided for educational purposes only. It may contain bugs or vulnerabilities that could lead to the loss of assets. This contract is not intended for production use, especially in environments where financial assets are involved. Use at your own risk.
This project is licensed under the MIT License