diff --git a/packages/contracts/docs/platform.md b/packages/contracts/docs/platform.md index b11895fa..881c8bc0 100644 --- a/packages/contracts/docs/platform.md +++ b/packages/contracts/docs/platform.md @@ -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)