Skip to content

Commit

Permalink
docs(contracts): keep high level description for contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmad committed Sep 12, 2024
1 parent 922ef7d commit 3b9b696
Showing 1 changed file with 0 additions and 102 deletions.
102 changes: 0 additions & 102 deletions packages/contracts/docs/platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,108 +2,6 @@

## Overview

This documentation provides details on the smart contracts used in the system, including their properties and methods. It also includes integration notes for connecting these contracts with other components like `maci-subgraph`.

## Contracts

### Contract: `EASRegistryManager`

The `EASRegistryManager` contract handles requests for registry management. Users send requests to this contract, and a coordinator approves or rejects these requests.

#### Properties

- **contractId**: `uint256` - Unique identifier for the contract.
- **owner**: `address` - The address of the contract owner.

#### Methods

- **getOwner()**: `address` - Returns the address of the owner.
- **setOwner(newOwner: address): void** - Sets a new owner for the contract.

### Contract: `EASRegistry`

The `EASRegistry` contract allows public access to information about projects. It is designed for reading project data, but if a subgraph is integrated, this contract may not be necessary for frontend use.

#### Properties

- **easId**: `uint256` - Unique identifier for the EAS.
- **projects**: `mapping(uint256 => Project)` - Mapping of project IDs to project details.

#### Methods

- **addEAS(eas: IEAS): void** - Adds a new EAS to the registry.
- **getEAS(): IEAS** - Retrieves an EAS from the registry.

### Contract: `Poll`

The `Poll` contract is used to manage polling information.

#### Properties

- **pollName**: `string` - Name of the poll.
- **pollDescription**: `string` - Description of the poll.

#### Methods

- **createPoll(name: string, description: string): void** - Creates a new poll with the given name and description.
- **getPoll(): (string, string)** - Retrieves the name and description of the poll.

### Contract: `MACI`

The `MACI` contract is used to process and manage MACI data.

#### Properties

- **maciData**: `string` - Data associated with MACI.

#### Methods

- **processMaciData(data: string): void** - Processes the provided MACI data.
- **getMaciData(): string** - Retrieves the MACI data.

### Contract: `IRegistryManager`

The `IRegistryManager` contract handles requests and maintains request-related data.

#### Properties

- **requestCount**: `uint256` - The number of requests.
- **requests**: `mapping(uint256 => Request)` - Mapping of request IDs to request details.

#### Methods

- **createRequest(request: Request): void** - Creates a new request.
- **getRequest(id: uint256): Request** - Retrieves a request by its ID.

### Contract: `Request`

The `Request` contract represents a request for registry management.

#### Properties

- **requestId**: `uint256` - Unique identifier for the request.
- **requestData**: `string` - Data associated with the request.

#### Methods

- **processRequest(): void** - Processes the request.
- **getRequestData(): string** - Retrieves the request data.

### Contract: `Recipient`

The `Recipient` contract represents a recipient entity in the registry.

#### Properties

- **recipientAddress**: `address` - Address of the recipient.
- **recipientName**: `string` - Name of the recipient.

#### Methods

- **getRecipientInfo(): (address, string)** - Retrieves the address and name of the recipient.

## Registry and RegistryManager

Below is the UML diagram representing the relationships and interactions between the contracts:

![UML Diagram](./diagram.svg)
Expand Down

0 comments on commit 3b9b696

Please sign in to comment.