Add ERC: Document Management for Security Tokens#1754
Open
rya-sge wants to merge 7 commits into
Open
Conversation
Collaborator
File
|
|
The commit 723eae2 (as a parent of b6e970b) contains errors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes from the original draft:
See 1643
Ethereum Magician: link
ERC-1643 — Change Summary (Original → Current)
This issue describes every meaningful difference between the original ERC-1643 proposal text (
erc-1643-original.md) and the current version (ERCS/erc-1643.md).1. Frontmatter
Changed fields
eipERC-1643(string with prefix)1643(integer only, per EIP-1 format)titleDocument Management Standard (part of the ERC-1400 Security Token Standards)Document Management for Security Tokensdiscussions-to#1411(GitHub issue reference)https://ethereum-magicians.org/t/erc-1643-document-management-standard-erc-1400/27437Added fields
description:Interface to attach, update, remove, and enumerate legal or operational documents for token contracts.author:Ryan Sauge (@rya-sge)Removed fields
require: None— replaced by the absence of the field (no hard dependencies).2. Removed sections
## Simple SummaryThe original opened with a Simple Summary section, which is not part of the current EIP-1 template.
Removed entirely. Its substance was folded into Abstract and Motivation.
## RequirementsThe original contained a dedicated Requirements section.
Removed. The single MUST requirement was moved into the Specification section. The ERC-1400 reference was removed because ERC-1400 only exists as an external GitHub issue and cannot be linked per eipw rules.
## ReferencesRemoved. External absolute URLs are not allowed in the ERC body per the
markdown-rel-linkseipw rule.## Interface(standalone section)The original exposed the Solidity interface in its own top-level section outside of Specification. This is a non-standard section not permitted by the repo's section-order lint.
Moved into
## Specificationas the### Interfacesubsection.3. Abstract
Original (2 short sentences):
Current: Rewritten to be more precise about what the ERC defines (a standard interface, not just a capability), what documents can represent, and the notification mechanism.
4. Motivation
Original (1 paragraph): Focused narrowly on security token issuance and the need for standardised document access for wallets and exchanges.
Current (5 paragraphs): Expanded with:
ERC-Nformat, which eipw cannot link).5. Specification
This section was the most substantially rewritten.
RFC 2119 boilerplate — added
Original: No boilerplate. Normative language appeared inline without a preamble.
Current: Standard sentence added at the top:
Document entry structure — added
Original: Document fields were described only in prose within each function description.
Current: The data model is defined upfront before the interface:
Interface — Solidity style updated
_name,_uri,_documentHash)name,uri,documentHash)returns (string, bytes32, uint256))returns (string memory uri, bytes32 documentHash, uint256 lastModified))string,bytes32[])string memory,bytes32[] memory,string calldata)@title,@notice,@dev,@returnon all itemsERC1643InvalidName()andERC1643MissingDocument()addedCustom errors — added
Original: No errors defined; revert behaviour was described only as "MUST throw".
Current: Two errors defined in the interface:
Naming rationale for
ERC1643InvalidNameThe name follows the
ERC<N>Invalid<Concept>convention established by ERC-6093 and adopted throughout OpenZeppelin v5 (ERC20InvalidSender,ERC721InvalidOwner, etc.). This makes the error immediately recognisable to developers already familiar with the ecosystem's error vocabulary.Two alternative names were considered and rejected:
ERC1643InvalidNameZero— too implementation-specific. "Zero" describes the Solidity representation (bytes32(0)) rather than the semantic meaning. A caller should not need to know the internal representation to understand why a transaction reverted.ERC1643EmptyName— semantically clearer about the condition, but deviates from theInvalid<Concept>convention without sufficient gain. Since this is the only name-related error in the interface (format validation was deliberately excluded), there is no ambiguity forERC1643InvalidNameto resolve.ERC1643InvalidNameis concise, follows established convention, and leaves room for implementations to override with more descriptive errors if their policy requires it (the spec permitsMAY use different error names/signatures).ERC-165 subsection — added
Original: No mention of interface detection.
Current: New
### Interface Detection (ERC-165)subsection:Function Requirements subsection — added
Original: Requirements were expressed as flat prose per function with minimal normative detail.
Current: A
### Function Requirementssubsection enumerates precise MUST / SHOULD / MAY rules per function, covering:getDocument: empty-return behaviour, no-revert guarantee.setDocument: create-vs-overwrite distinction, timestamp update, event emission,bytes32(0)rejection, empty URI/hash policy, error usage.removeDocument: removal, event with removed metadata, missing-document error usage.getAllDocuments: inclusion and exclusion invariants.6. Rationale
Original (1 paragraph): Only explained why a document hash is useful.
Current (3 paragraphs):
bytes32names (compact, deterministic, O(1) comparison vs.string).7. New sections (not present in original)
## Backwards Compatibility— addedStates that the ERC is additive and does not alter token transfer semantics.
## Test Cases— addedLists five minimum test scenarios covering the full document lifecycle, event emission, and enumeration consistency.
## Reference Implementation— addedLinks to the assets provided in
assets/erc-1643/:IERC1643.solERC1643.solERC20DocumentToken.solERC721DocumentToken.solDescribes the internal data structure (mapping, array, index for O(1) removal).
## Security Considerations— addedFour paragraphs covering:
setDocument/removeDocument.bytes32name truncation risk and the safer hash-based naming alternative.## Copyright— added8. Summary table
eip: ERC-1643,require:, missingdescription)