# 5. Templates and Version Control

1. **Proxying and Cloning Technology**

**ComBoox** extensively adopts proxying and cloning technologies in its smart contract architecture. Specifically, it utilizes the data structures, functions, and algorithms defined in implementation template contracts to operate on the state variables of proxied or cloned contracts through the delegatecall mechanism. Proxying technology enables a proxy contract to upgrade its underlying logic without altering its address or stored state variables. In comparison with independently deployed contracts, cloning technology significantly reduces the bytecode size and gas consumption associated with contract deployment. The General Keeper and the Registers are deployed by proxying their respective implementation templates, whereas Shareholders’ Agreements and Investment Agreements are deployed using cloning techniques.

In addition, **contract templates** also adopts a lot of **delegate call mechanism**, i.e. leaving the definitions of data objects, methods and algorithms thereof in public libraries, which further reduced the size of the template contracts, as well as their deploying cost.

2. **Documents Mapping of Reg Center**

Another important function of **Reg Center** is to register and manage the template contracts and their clones, for which **Reg Center** adopts two mappings. Users can query a document’s type, version, author, creator and creation date by its contract address, or, query a document’s address by its sequence number.

3. **Types of Template Contracts**

Currently, there are totally 34 template contracts registered in **Reg Center**. When creating a new book-entry system for a company, or creating a new **Shareholders Agreement** or **Investment Agreement**, actually is deploying one or more proxy or clone contracts based on the templates.

<table><thead><tr><th width="68">No.</th><th>Name</th><th width="63.272705078125">No.</th><th>Name</th><th width="73.0909423828125">No.</th><th>Name</th></tr></thead><tbody><tr><td>1</td><td>ROC Keeper</td><td>13</td><td>Meeting Minutes</td><td>25</td><td>Alongs</td></tr><tr><td>2</td><td>ROD Keeper</td><td>14</td><td>Register of Members</td><td>26</td><td>Options</td></tr><tr><td>3</td><td>BMM Keeper</td><td>15</td><td>Register of Agreements</td><td>27</td><td>Register of Investors</td></tr><tr><td>4</td><td>ROM Keeper</td><td>16</td><td>Register of Options</td><td>28</td><td>Cashier</td></tr><tr><td>5</td><td>GMM Keeper</td><td>17</td><td>Register of Pledge</td><td>29</td><td>Register of Redemptions</td></tr><tr><td>6</td><td>ROA Keeper</td><td>18</td><td>Register of Shares</td><td>30</td><td>ROI Keeper</td></tr><tr><td>7</td><td>ROO Keeper</td><td>19</td><td>List of Orders</td><td>31</td><td>Accountant</td></tr><tr><td>8</td><td>ROP Keeper</td><td>20</td><td>General Keeper</td><td>32</td><td>Fund ROR Keeper</td></tr><tr><td>9</td><td>SHA Keeper</td><td>21</td><td>Investment Agreement</td><td>33</td><td>Fund ROC Keeper</td></tr><tr><td>10</td><td>LOO Keeper</td><td>22</td><td>Shareholders Agreement</td><td>34</td><td>Fund GMM Keeper</td></tr><tr><td>11</td><td>Register of Constitution</td><td>23</td><td>Anti-dilution</td><td> 35</td><td>Fund LOO Keeper </td></tr><tr><td>12</td><td>Register of Directors</td><td>24</td><td>Lock-up</td><td> 36</td><td>Fund ROI Keeper</td></tr><tr><td></td><td></td><td></td><td></td><td>37</td><td>Fund Accountant</td></tr></tbody></table>

In **ComBoox**, the design model for setting corporate governance rules is very flexible. Changing the definition of a specific “rule” and its parsing function, the attributes’ composition of the rule will be changed; changing an API’s algorithm of a **Bookkeeper**, the conditions, procedures and consequences of a legal behavior will be revised. And, all these changing methods on the corporate governing rules and terms, can be implemented by means of developing and incorporating new contract templates into the system.

Any developer can develop contract templates. These templates can be incorporated into the system upon approval and will become new foundations for proxying or cloning contracts. When users call to proxy or clone contracts, **Reg Center** will deduct a certain amount of CBP from the caller's account and pay to the template author's account as license fees. The rate of such license fee, together with its promotion policies, can be set and adjusted by the template’s author at full discretion.

For detailed arrangements concerning the copyright and license fee, as well as **CBP** tokens and the economic model of the system, please see the relevant sections of this paper.

## Source Code

### [**DocsRepo**](https://github.com/paul-lee-attorney/comboox/blob/master/contracts/lib/DocsRepo.sol)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://comboox.gitbook.io/whitepaper-en/system-overview/5.-templates-and-version-control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
