Add ERC: Store, Table-Based Introspectable Storage#711
Conversation
|
✅ All reviewers have approved. |
| @@ -0,0 +1,499 @@ | |||
| --- | |||
| eip: <to be assigned> | |||
| title: Store, Table-Based Introspectable Storage | |||
There was a problem hiding this comment.
| title: Store, Table-Based Introspectable Storage | |
| title: Table-Based Introspectable Storage |
Maybe simplify the title
There was a problem hiding this comment.
We would like to keep the name for now. Thanks for the feedback!
There was a problem hiding this comment.
For context - we feel it's important to keep the term "Store" in the title since it's the name of the pattern, ie all events are prefixed with Store
|
The commit d60529d (as a parent of 571b06e) contains errors. |
Co-authored-by: Andrew B Coathup <28278242+abcoathup@users.noreply.github.com>
Co-authored-by: Andrew B Coathup <28278242+abcoathup@users.noreply.github.com>
Co-authored-by: Andrew B Coathup <28278242+abcoathup@users.noreply.github.com>
|
@abcoathup please let us know if there are any other requested changes before we can get this merged as draft! |
|
|
||
| ## Abstract | ||
|
|
||
| This standard introduces a flexible on-chain storage pattern that organizes data into structured tables with schemas, similar to a traditional database. This approach allows new tables to be added at runtime without impacting existing contracts, thereby simplifying upgrades and extensions. By providing a unified interface for data access, the standard enables any contract or off-chain service to read stored data without the need for custom getter functions. Additionally, by standardizing event emissions for state changes it enables automatic, schema-aware indexing. |
There was a problem hiding this comment.
Your abstract is missing some technical meat. After reading this section, your audience should have a high level (but still technical) overview of how your proposal accomplishes its goals.
|
|
||
| A piece of data stored in a **Table**, addressed by one or more keys. | ||
|
|
||
| #### ResourceId |
There was a problem hiding this comment.
If these headings are literals from your code (and it looks like they might be), you should enclose them in backticks (`). That goes for any code snippets in the text as well.
| | tableId | ResourceId | The ID of the table where the record is deleted | | ||
| | keyTuple | bytes32[] | An array representing the composite key for the record | | ||
|
|
||
| #### Example |
There was a problem hiding this comment.
This should probably be moved to your Reference Implementation section. You can link to it from here though.
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
|
@SamWilsn we updated the PR with your feedback, could we get another look? |
|
@abcoathup @SamWilsn please let us know if there is anything else you'd like us to change before we can get this merged as draft! |
SamWilsn
left a comment
There was a problem hiding this comment.
Looks good, just some tiny formatting changes.
| | encodedLengths | EncodedLengths | The encoded lengths of the dynamic data of the record | | ||
| | dynamicData | bytes | The dynamic data of the record, using [custom packed encoding](#packed-data-encoding) | | ||
|
|
||
| #### Store_SpliceStaticData |
There was a problem hiding this comment.
| #### Store_SpliceStaticData | |
| #### `Store_SpliceStaticData` |
| | start | uint48 | The start position in bytes for the splice operation | | ||
| | data | bytes | Packed ABI encoding of a tuple with the value's static fields | | ||
|
|
||
| #### Store_SpliceDynamicData |
There was a problem hiding this comment.
| #### Store_SpliceDynamicData | |
| #### `Store_SpliceDynamicData` |
| | encodedLengths | EncodedLengths | The resulting encoded lengths of the dynamic data of the record | | ||
| | data | bytes | The data to insert into the dynamic data of the record at the start byte | | ||
|
|
||
| #### Store_DeleteRecord |
There was a problem hiding this comment.
| #### Store_DeleteRecord | |
| #### `Store_DeleteRecord` |
eip-review-bot
left a comment
There was a problem hiding this comment.
All Reviewers Have Approved; Performing Automatic Merge...
eip-review-bot
left a comment
There was a problem hiding this comment.
All Reviewers Have Approved; Performing Automatic Merge...
This standard introduces a flexible on-chain storage pattern that organizes data into structured tables with schemas, similar to a traditional database. This approach allows new tables to be added at runtime without impacting existing contracts, thereby simplifying upgrades and extensions. By providing a unified interface for data access, the standard enables any contract or off-chain service to read stored data without the need for custom getter functions. Additionally, by standardizing event emissions for state changes it enables automatic, schema-aware indexing.