# Manufacturer

> *Address:* [*0x12B870fB7822ec80AF5E66e7CD19379347dE70DF*](https://polygonscan.com/address/0x12B870fB7822ec80AF5E66e7CD19379347dE70DF)

This contract represents the manufacturer of a vehicle or of an aftermarket device. A manufacturer is always a root node (no parent node), from which all other nodes derive directly or indirectly.

Because of the relevance of what a root represents, there are only two possible owner types: an admin of the system or a controller, which is also set by an admin. Although the system allows a controller to own only a single manufacturer node, in the early stages of the DIMO identity, all manufacturer nodes will be minted and owned by an admin. In the future, the ownership of those nodes will be transferred to the right controller.

Since many nodes will be created at once, an admin can invoke the following function to perform a batch mint:

```solidity
function mintManufacturerBatch(address _owner, string[] calldata names)
        external
        onlyRole(DEFAULT_ADMIN_ROLE)
```

### ManufacturerID (License)

The holder of the ManufacturerID license can create devices within the smart contract, update attributes of their devices, perform OTAs. See [License](/protocol/identity-protocol/nodes-and-nfts/license.md) for more.&#x20;

### Controllers

Unless an administrator, controllers can only own a single manufacturer node and, consequently, a single manufacturer ID.

To prevent a controller from possessing more than one node, we keep track of minted nodes by controller and restrict transfers in the `ManufacturerId` contract. When any transfer function is invoked in the NFT contract, an external call is made to the `Manufacturer` node through the function `setManufacturerMinted` to verify if the recipient is allowed to possess a manufacturer node and, then, to set the recipient as "already minted".

### Duplication

Besides the NFT ID, the `Manufacturer` nodes also have a mandatory `name` associated with them. In order to prevent duplicated nodes, two mappings are employed to verify existing data before minting:

```solidity
// Manufacturer name => Manufacturer Id
mapping(string => uint256) manufacturerNameToNodeId;

// Manufacturer Id => Manufacturer name
mapping(uint256 => string) nodeIdToManufacturerName;
```

Whenever a new `Manufacturer` node is about to be created, the new manufacturer `name` is verified against the existing ones to ensure the new `name` is not associated with an ID. It also facilitates external interfaces to query the `names` and IDs of the nodes.


---

# 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://docs.dimo.org/protocol/identity-protocol/nodes-and-nfts/manufacturer.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.
