Skip to content
/ ERC721M Public

This is an abstract contract intended to be inherited in NFT contracts in order to implement alignment with Remilia's vision for Network Spirituality

License

Notifications You must be signed in to change notification settings

Zodomo/ERC721M

Repository files navigation

Contributors Forks Stargazers Issues


Remilia Logo

ERC721M

An ERC721 extension that is designed with Network Spirituality in mind.

THIS PROJECT IS CURRENTLY UNDERGOING REFACTORING AND IS NOT CONSIDERED PRODUCTION-READY.

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

This is a NFT contract template intended to align NFT collections with Remilia's vision for Network Spirituality by deepening NFT collection liquidity using mint fees. It is designed such that the developer (or other recipient) can receive up to 95% of the mint fees, while the remainder is dedicated to deepening an NFT's NFTX liquidity. The developer can align between 5-100% of mint fees. All funds are directed towards deepening NFTX liquidity for a particular NFT collection and are locked forever. Yield generated by that liquidity can still be claimed. Liquidity rewards are split 50/50 between the contract owner and the liquidity pool.

(back to top)

Built With

  • Ethereum
  • Solidity

(back to top)

Getting Started

ERC721M was designed using Foundry, so I recommend familiarizing yourself with that if required.

Prerequisites

  • Foundry
    curl -L https://foundry.paradigm.xyz | bash
    foundryup

Installation

  1. Set up your NFT project using Foundry
    forge init ProjectName
  2. Install ERC721M
    forge install zodomo/ERC721M --no-commit
  3. Import ERC721M
    Add the following above the beginning of your project's primary contract
    import "ERC721M/ERC721M.sol";
  4. Inherit the module
    Add the following to the contract declaration
    contract ProjectName is ERC721M {}
  5. Utilize each function as required
    A deeper understanding of Solady is required to continue beyond this point

(back to top)

Usage

Once deployed, you must call initialize() and initializeMetadata() to fully prepare the contract. It is recommended that you call disableInitializers() afterwards.

changeFundsRecipient() is used to set fundsRecipient. This stored address is referenced to send mint funds to in the event the contract's ownership is renounced.

setPrice() sets the standard mint price.

openMint() enables purchasing NFTs of normal and discounted (if any) mint types.

updateBaseURI() allows the owner to update the metadata of all assets in the collection. lockURI() permanently locks this ability.

mint() processes normal mints for the given price. There are no limitations on normal mints.

mintDiscount() allows a minter to mint for an alternate price/free if they actively hold a predefined asset. The owner can even specify higher mint prices if they so choose. Each minter is allowed to mint a predefined amount under the discount per asset discount.

configureMintDiscount() allows the owner to specify special/free mints based on asset (IERC20 and IERC721) ownership. Each asset is given its own discount tier. Multiple assets cannot be grouped together. Discounts can be freely adjusted after mint is open, as long as the discount supply doesn't decrease beneath already claimed mints.

fixInventory() scans the contract's aligned NFT holdership to forward these NFTs to the AlignmentVault. This is only necessary if an NFT was sent with transferFrom rather than safeTransferFrom().

checkInventory() this scans the holdings of the AlignmentVault for aligned NFTs and adds them to inventory for processing. This is only necessary if an NFT was sent with transferFrom rather than safeTransferFrom().

alignLiquidity() triggers the AlignmentVault to assess the aligned NFT inventory, calculate how many NFTs it can afford to add to the liquidity pool, pairs them with their respective amount of ETH and adds them, and then sweeps all remaining funds into the liquidity pool, lastly staking all LP tokens.

claimYield() claims yield generated by the NFTX LP and splits it 50/50 with the owner, automatically restaking its portion.

rescueERC20() and rescueERC721() are responsible for withdrawing non-aligned assets. Aligned assets (such as ETH/WETH/NFTX fractionalized tokens/NFTX SLP) are forwarded into the AlignmentVault.

withdrawFunds() allows the contract owner to claim their portion of the mint funds.



An AlignmentVaultFactory has been deployed to Etherscan. Please use this in your contracts or manually to deploy AlignmentVaults, as it will be cheaper and will utilize the implementation already deployed on-chain. The factory is designed to return the current implementation address by calling the implementation() function.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the AGPL-3 License. See LICENSE.txt for more information.

(back to top)

Contact

Zodomo - @0xZodomo - zodomo@proton.me - Zodomo.eth

Project Link: https://github.com/Zodomo/ERC721M

(back to top)

Acknowledgments

(back to top)

About

This is an abstract contract intended to be inherited in NFT contracts in order to implement alignment with Remilia's vision for Network Spirituality

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published