Skip to content

Commit

Permalink
fix: Update Documentation (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
Whytecrowe committed Jan 31, 2024
2 parents d5eb5a1 + 3380218 commit 8f67434
Show file tree
Hide file tree
Showing 11 changed files with 9,775 additions and 9,644 deletions.
64 changes: 62 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,68 @@

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/zer0-os/zNS/tree/development.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/zer0-os/zNS/tree/development)

# zNS
# zNS - Zer0 Name Service Protocol
________________________________________________________

## System Documentation

### [System Architecture](./docs/architecture.md)
### [Smart Contract Docs](./docs/contracts)
### [Flow Diagrams](./docs/flows.md)
### [Flow Diagrams](./docs/flows.md)
________________________________________________________

## About
Zer0 Name Service, or zNS, is a protocol that allows you to create domain and subdomain NFTs that focus on community building and creation of unique, on-chain identification.

Read more at [zero.tech](https://zero.tech/)

## Developers

### Install Dependencies
We are using `yarn` as our package manager.
```bash
yarn install
```
> **Docker Engine** is required to run tests locally. You can install it from [here](https://docs.docker.com/engine/install/).
### Setup Environment
Create `.env` file in the root directory and add the following variables:
```bash
ENV_LEVEL: "dev" # local dev environment
MONGO_DB_URI: "mongodb://localhost:27018" # local instance of MongoDB in the Docker
MONGO_DB_NAME: "zns-campaign" # name of the database
MOCK_MEOW_TOKEN: "true" # use mock MeowToken contract for local testing
SILENT_LOGGER: "true" # disable logging for tests
```

The full ENV setup with descriptions can be found in the [.env.sample](./.env.sample) file.

### Build
```bash
yarn build
```
This will compile all the contracts and add a git tag and a last commit for the current version of the contracts
that is **required** for the MongoDB where deployed contract data is stored.

This will also run a bash script that will pull **tag and commit** from git and write
it locally to `./artifacts/git-tag.txt` file. If you are using Windows, that script may fail. In that case you can
pull git data manually and write it to the file or use the TS based script here: `./src/utils/save-tag.ts` simply by running `yarn save-tag`
The resulting text in the `./artifacts/git-tag.txt` file should look like this:
```
v1.0.1:213334f3d4f47940779cb7e825aaf1fab77adb2e
```

### Run Tests
```bash
yarn test
```
This will launch `docker-compose` with MongoDB instance on it, required for some tests. Then launch all the tests in the `./test` directory.

> Note: If you do not have Docker installed this will fail.
### Submit Work
All new code is submitted through Pull Requests **ONLY**. Please make sure that you have all the tests passing in CircleCI and that
you have added new tests for your code before submitting for review. Codecov will fail the CI if the coverage drops. Pull Requests are not merged with a failing CI build.

All new code is merged into `development` branch and that will make a new prerelease tag.
`master` branch is used for production releases only. Code from `development` branch should be fully tested on the testnet before merging into `master`.
152 changes: 110 additions & 42 deletions docs/architecture.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/contracts/access/ZNSAccessController.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Uses a role-based access control scheme with levels:
- EXECUTOR: Can be here to future proof, if we need a new role (managed by Governor)
- REGISTRAR: This role is here specifically for the ZNSRootRegistrar.sol contract (managed by Admin)

> This contract is NOT proxied. When new implementation is needed, a new contract will be deployed
> This contract is not proxied. When new implementation is needed, a new contract will be deployed
and all modules will be updated to use the new address, since they all inherit from `AAccessControlled.sol`.

### constructor
Expand Down
11 changes: 7 additions & 4 deletions docs/flows.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# ZNS Flow Diagrams

## Domain Content Discovery
![pic](./img/discovery.jpg)
![Domain content discovery flow](./img/discovery.jpg)

## Domain Registration
![pic](./img/register.jpg)
![Domain registration flow](./img/distribution.jpg)

## Domain Transfer
![pic](./img/transfer.jpg)
![Domain transfer flow](./img/transfer.jpg)

## Domain Reclamation
![Domain reclaim flow](./img/reclamation.jpg)

## Domain Revocation
![pic](./img/revoke.jpg)
![Domain revoke flow](./img/revoke.jpg)
Binary file added docs/img/distribution.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/full-architecture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/img/full.jpg
Binary file not shown.
Binary file added docs/img/reclamation.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/revoke.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/DeployCampaign.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Defender } from "@openzeppelin/defender-sdk";
import { IZNSCampaignConfig, IZNSContracts } from "../src/deploy/campaign/types";


describe("DeployCampaign - Integration", () => {
describe("zNS + zDC Single Integration Test", () => {
// Minters
let deployAdmin : SignerWithAddress;
let zeroVault : SignerWithAddress;
Expand Down
Loading

0 comments on commit 8f67434

Please sign in to comment.