This proposal is a new implementation proposal of DIP5 (#5) for efficient handling of multiple Properties.
"Property Grouping" feature allows creators to combine multiple properties they have tokenized into one or more groups. This behavior is similar to the relationship between "folders" and "files" in a file system.
Directory Tokens
An ERC20 contract creating to group multiple Property Tokens (a.k.a. Creator Tokens). The total supply is fixed at 10,000,000. There are no restrictions on the transfer destination.
Directory Tokens holders can earn creator rewards for all grouped Property Tokens.
Once Directory Tokens are generated, no one can self-destruct them.
Technical requirements
I propose the main technical requirements and interfaces for Directory Tokens as follows.
Also, Directory Tokens should be implemented as an upgradeable contract. I think it is desirable to implement it as an external contract rather than incorporating it into the Dev Protocol core. However, Dev Kit and GraphQL should support Property Grouping.
Association
Creators can associate up to 9 Property Tokens with Directory Tokens (this limit works to keep low gas fees). The operation is required the Directory holder and the Property holder to be the same.
The association between Directory Tokens and Property Tokens is done by sending Property Tokens to Directory Tokens (Contract).
The interface is:
function associate(address _property, uint _amount) external;
Disassociation
Note: This feature should not be implemented initially. It should be implemented after sufficient security verification.
Transfer the Creator Tokens deposited in a Directory Token to another address. This operation requires agreement by all Directory Tokens holders. This is because disassociation means a reduction in rewards for Directory Tokens holders.
The interface is:
function disassociate(address _recipient, address _property, uint _amount) external;
Reward withdrawal
Withdraw rewards for associated Property Tokens. With the total reward amount of all associated Property Tokens as the maximum value, the reward is withdrawn according to the share ratio of Directory Tokens held by the account.
Calling Withdraw.withdraw
each grouped Properties means running ERC20.mint
and Lockup.update
each grouped Properties, which means higher gas fees. Should add the bulkWithdraw
function to the Withdraw contract.
The interface is:
function withdraw(address _directory) external;
Transfer Hook
A hook that updates the withdrawable rewards for the source and destination when transferring Directory Tokens. Withdraw.beforeBalanceChange
is the reference model.
The interface is:
function beforeBalanceChange(address _directory, address _from, address _to) external;