Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Introducing IPAccount Namespace Storage and IViewModule for Enhanced Metadata Display #100

Closed

Conversation

kingster-will
Copy link
Contributor

@kingster-will kingster-will commented Feb 16, 2024

This PR introduces significant enhancements to the StoryProtocol, focusing on the IPAccount Namespace Storage and the introduction of a new module type, IViewModule, aimed at offering flexibility in displaying metadata. Additionally, it incorporates a fully permissionless registration function for IPAssets. The key highlights and changes are as follows:

IPAccount Namespace Storage

The implementation of IPAccount Namespace Storage is realized through the IPAccountStorage contract, which adheres to the IIPAccountStorage interface. This development facilitates structured and conflict-free data storage for IPAccounts by employing a namespaced storage pattern. The default namespace is determined by the msg.sender, ensuring that only the owning Module can write data into its respective namespace, while read operations remain unrestricted across namespaces.

IViewModule Introduction

A new module type, IViewModule, has been introduced to enhance the flexibility in displaying metadata. This module type allows for a more dynamic and customizable presentation of IPAssets, catering to the diverse needs of different applications and user interfaces.

Test Coverage

The newly added code, including the IPAccount Namespace Storage and the register function, has achieved 100% test code coverage, ensuring reliability and robustness.

This PR represents a pivotal step forward in the StoryProtocol's development, introducing advanced features that enhance functionality, flexibility, and accessibility.

@kingster-will kingster-will requested a review from a team February 16, 2024 16:51
@kingster-will kingster-will self-assigned this Feb 16, 2024
@kingster-will kingster-will force-pushed the ipaccount-storage branch 4 times, most recently from 4ad67be to 0a98c13 Compare February 16, 2024 21:52
Copy link
Contributor

@Ramarti Ramarti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently no module integrates with this AFAIK. What is the purpose of this contract, for community created modules to store data in the IPAccount? What is the advantage of doing that vs keeping their own state?

/// This contract allows Modules to store and retrieve data in a structured and conflict-free manner
/// by utilizing namespaces, where the default namespace is determined by the
/// `msg.sender` (the caller Module's address).
contract IPAccountStorage is IIPAccountStorage {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one thing we discussed before is to just support string or base64 encoding, using KV pair, no need to support different type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or use just one function to set, one to get;

ex,

setData(namespace, type, value)
getData(namespace, type, value)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.
Simplified multiple setters/getters to unified set/getBytes()
Also, retain set/getbytes32() for the gas efficiency when storing simple types like bool

@kingster-will kingster-will changed the title Introducing IPAccount Namespace Storage and IViewModule for Enhanced Metadata Display with Permissionless IPAsset Registration Introducing IPAccount Namespace Storage and IViewModule for Enhanced Metadata Display Feb 21, 2024
@kingster-will
Copy link
Contributor Author

Currently no module integrates with this AFAIK. What is the purpose of this contract, for community created modules to store data in the IPAccount? What is the advantage of doing that vs keeping their own state?

The primary objective is to establish an Open Programmable IP platform by offering a standardized method for Open data access and sharing across modules. This approach is detailed in the following document: Open Data Access Architecture: Embracing Programmable IP. While current modules do not yet integrate with this change, plans are in place to refactor them to integrate with the IPAccount namespace storage.

@jdubpark jdubpark self-requested a review February 22, 2024 04:15
@LeoHChen LeoHChen closed this Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants