ComBoox - White Paper
  • πŸ‘‹Welcome to ComBoox!
  • πŸ›οΈSystem Overview
    • ⌨️Overview
      • βš οΈβ€œPain Points” of Corporate Governance
      • πŸ’‘Blockchain Solution
      • πŸ’°Tokenization and Company Evaluation
      • ✨Features and Advantages
    • πŸ–₯️Computational Control Model
    • πŸ—οΈSystem Architecture
    • 🚷Identification and Access Control
    • πŸ“Templates and Version Control
    • πŸ’°CBP and Economic Model
    • πŸ’ΈFinancial Records
    • ☝️Key Legal Issues
    • πŸ₯‡Software License
  • πŸ•ΉοΈOperation Guide
    • πŸ›£οΈGet Start !
    • βœ’οΈDraft SHA
    • πŸ—³οΈPut Director On Board
    • πŸ—žοΈInvest And Trade Shares
  • πŸ“šTechnical Brochure
    • 🌻Key Objects
      • πŸ—žοΈShare and SharesRepo
      • πŸ‘¨β€πŸ‘¨β€πŸ‘§β€πŸ‘§Member and MembersRepo
      • πŸ’ΊPosition and OfficersRepo
      • πŸ—³οΈMotion and MotionsRepo
        • ✍️DelegateMap
        • πŸ—³οΈBallot and BallotsBox
      • πŸ›οΈDeal and DealsRepo
        • πŸ”„Swap and SwapsRepo
      • πŸ“ˆOrder and OrdersRepo
      • πŸ“‘Pledge and PledgesRepo
      • βš–οΈOption and OptionsRepo
      • πŸ“Rule and RulesParser
      • 🍡Anti-Dilution
      • πŸ”Lock Up
      • 🚜Drag / Tag Along
      • πŸ›ΈPut / Call Options
    • πŸ› οΈStructure and Components
      • ⏱️Checkpoints
      • 🏁TopChain
      • πŸ₯‡GoldChain
      • πŸ”€EnumerableSet
      • πŸ”„Condition and ConsRepo
      • πŸ”HashLock and LockersRepo
      • πŸ–‹οΈSignature and Sigpage
      • πŸ“‚File and FilesRepo
      • πŸ—„οΈDoc and DocsRepo
    • πŸ‘¨β€πŸš€Identity and Verification
      • 😜Role and RolesRepo
      • 🚷Access Control Contract
      • 🦸User and UsersRepo
    • πŸ„β€β™€οΈBehaviors and Process
      • 🀝Share Transaction
Powered by GitBook
On this page
  • Functions and Usage
  • Members and Attributes
  • Enumerable Set
  • Query API
  • Source Code
  1. Technical Brochure
  2. Structure and Components

EnumerableSet

PreviousGoldChainNextCondition and ConsRepo

Last updated 1 year ago

Functions and Usage

EnumerableSet is a public library defined by OpenZeplin project team in MIT License, which consists of an object set and a set of methods that can be used to store non-repetitive enumerable set in three data types, Bytes32, Address, and Uint. It can determine whether an element is contained in a set based on its value, and also quickly query the total number of elements in the set, a list of all the elements, and even can query the element value by its number.

Members and Attributes

The main members of the Enumerable Set include the Enumerable Set Object and the set objects of Byte 32 set, Address set, and Uint set derived from its kernel.

Enumerable Set

The object in Enumerable Set consists of a variable-length array with a 32-bit and an "element value -> index number" mapping. This structure not only allows you to quickly get the total number of elements in the set and the list of all elements, but also allows you to quickly query the corresponding array element number (index-1) from the mapping based on the element value, so you can determine whether the element has been contained in the set (index>0), and also allows you to quickly locate and delete specific array when deleting an element.

Attribute List of Set Object

Attribute
Commercial and Legal meaning

_values

a variable-length array with bytes 32

_indexes

"element value -> index number" mapping

Query API

The query API well describes the function and usage of the enumerable set repo in the whole system, as shown in the following list.

API
Commercial and Legal Meaning

contains

Query whether the element has been contained in the set

length

Get the total number of elements in the set.

at

Get the element values according to array number

values

Get the list of all elements.

Source Code

πŸ“š
πŸ› οΈ
πŸ”€
EnumerableSet
The Structure of Enumerable Set Repo