This is a simple project illustrating the fractionalization
of an ERC721
with ERC20
tokens.
On a high level, the process is as follows
- A
collector
owns anERC721
from a particularcollection
- The
collector
deploys theFractionalizer
contract which is a modifiedERC20
- The
collector
approves theFractionalize
contract to transfer theirERC721
- The
collector
then calls thefractionalize
method on the deployedFractionalizer
contract - The
collector
receives a specified number ofERC20
tokens denoting 100% ownership of theERC721
- The
ERC721
is transferred from thecollector
to theFractionalizer
contract - The
collector
can then sell theERC20
tokens on the market via AMM or similar - The
collector
can choose to list theERC721
for sale for a specified price in ETH
- The
holder
purchasesERC20
tokens on the market as a representative share of ownership - If the
ERC721
is sold to thebuyer
theholder
can redeem theirERC20
tokens foreth
based on their ownership ratio from theFractionalizer
contract.
- The
buyer
purchases the listedERC721
for the price in eth and transfers it to theFractionalizer
contract. - If the
buyer
somehow is able to acquire all the tokens on the market, they can justredeem
all of them for the nft itself. This is probably a low possibility, though. I just included it as it was in the specs.
# Install dependencies
npm i
# Setup .env
mv .env.example .env
# Run Tests
npx hardhat test
# Make sure you update the .env with your Goerli pk
# Deploy to Goerli
npx hardhat deploy --network goerli
# Verify contract
npx hardhat verify-contract --network goerli --address <deployed address>
- The
owner
of theFractionalizer
should be a third party - not thecollector
. I just did it this way for thecollector
to deploy their own fractionalization implementation. - The sale price should be a weighted average of a price indicated by
holders
based on their token holdings. ie. Ifholder a
holds half the supply, their price should weigh more thanholder b
with a quarter of the supply. I had thecollector
set the price for simplicity in the example.
- Implement a
factory
that uses theminimal proxy
pattern to reduce gas costs if we are deploying a single contract per fractionalized nft. - See weighted average price issue above
- Maybe use an auction style of sale?
- Research adding
withdraw
functions for nft/tokens to prevent unexpected locking within contract - If
Fractionalizer
is managed by a third party, add acurator
fee - Potentially add
permit
eip draft for gassless approvals