# Name registry

Energy Web has deployed [OpenEthereum's Name Registry contract.](https://github.com/openethereum/name-registry) This contract is identical to OpenEthereum's original contract, with the exception that it was made Ownable by Energy Web Foundation. Only Energy Web can reserve a name or drain funds from this contract.&#x20;

There are two reasons for making this contract Ownable:

1. OpenEthereum's name registry might be needed for other OpenEthereum related system contracts later: e.g. [service transaction checker](https://wiki.parity.io/Permissioning.html#gas-price), or [auto updater](https://wiki.parity.io/Automatic-Updating).
2. We will have the official [Ethereum Name Service](https://ens.domains/) system set up on the chain, so this contract is only needed for internal purposes and will not be used publicly.

The name registry is a placeholder for now. The contract can be found in our repo: <https://github.com/energywebfoundation/ewc-system-contracts/tree/master/contracts/registry>

## Interacting with the Name Registry Contract

### Contract Address and ABI

| Contract       | Address                                    | JSON ABI                                                         |
| -------------- | ------------------------------------------ | ---------------------------------------------------------------- |
| SimpleRegistry | 0x1204700000000000000000000000000000000006 | <https://gist.github.com/ngyam/255a461e2241085a6530d455f7c15529> |

### Callable Functions

| Function                   | Description                                                           |
| -------------------------- | --------------------------------------------------------------------- |
| entries(bytes32)           | Returns an entry based on the sha3 hash of the name registered.       |
| reverse(address)           | Reverse resolution of an address.                                     |
| fee()                      | Returns the fee for reserving a name (not really relevant to public). |
| getData(bytes32,string)    | Returns a string data value from an entry, given its key.             |
| getAddress(bytes32,string) | Returns an address data value from an entry, given its key.           |
| getUint(bytes32,string)    | Returns an unsigned integer data value from an entry, given its key.  |
| getOwner(bytes32)          | Returns the owner of an entry.                                        |
| hasReverse(bytes32)        | Returns true if entry has a reverse address registered.               |
| getReverse(bytes32)        | Returns reverse address of an entry.                                  |
| canReverse(address)        | Returns true if address can have a reverse.                           |
| reverse(address)           | Returns the reverse value of an address.                              |
| reserved(bytes32)          | Returns true if the name (its sha3 hash) is already reserved.         |


---

# 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-launchpad.energyweb.org/ewc-ecosystem/energy-web-chain/system-architecture/system-contracts/name-registry.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.
