Skip to content

Commit

Permalink
fix: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Dec 3, 2024
1 parent 5cc6f91 commit 0e8f2d7
Show file tree
Hide file tree
Showing 14 changed files with 298 additions and 603 deletions.
Binary file added assets/images/ekoke-supply.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@

## Smart contracts

- [Deferred ERC721](./contracts/Deferred.md)
- [EKOKE ERC20](./contracts/Ekoke.md)
- [Marketplace](./contracts/Marketplace.md)
- [Reward Pool](./contracts/RewardPool.md)

## EKOKE rewards

- [Rewards](./reward.md)

## EKOKE DAO

- [DAO](./dao.md)
Expand Down
85 changes: 85 additions & 0 deletions docs/canisters/deferred-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Deferred Data

- [Deferred Data](#deferred-data)
- [Introduction](#introduction)
- [HTTP Endpoint](#http-endpoint)
- [Get contracts](#get-contracts)
- [Get contract by id](#get-contract-by-id)

## Introduction

Deferred **Data** canister takes care of storing sell contracts and provides the following functionalities:

- **Create contract**: the contract is inserted into the ledger by [deferred-minter](./deferred-minter.md).
- **Close contract**: the contract is closed by [deferred-minter](./deferred-minter.md).
- **Get contract data**: get the data for a contract. Closed contracts are not returned
- **Get all contracts**: get all existing contracts. Closed contracts are not returned
- **Get contract document**: get a contract document with its data and mime type
- **Upload contract document**: The agency can upload documents for a contract
- **Update contract property**: The agency can both update a contract property and restricted property. Mind that when we talk about **contract properties** we don't mean any property, but just those stored in the `properties` and `restricted_properties` fields.

## HTTP Endpoint

### Get contracts

This endpoints gets all the IDs of registered contracts

```txt
GET /contracts
```

Response:

```json
[
1,
2,
3
]
```

### Get contract by id

Get a contract by id

```txt
GET /contract/:id
```

Response:

```json
{
"id": 1,
"type": "Sell",
"sellers": [
{
"address": "0x...",
"quota": 100
}
],
"buyers": [
"0x000",
"0x001",
],
"installments": 4000,
"value": 400000,
"deposit": 50000,
"currency": "USD",
"properties": [],
"restrictedProperties": [],
"documents": {
"1": {
"accessList": ["agent"],
"mimeType": "application/pdf"
}
},
"agency": {
...
},
"expiration": "2050-01-1",
"closed": false
}
```

> Restricted properties are redacted based on your permissions
37 changes: 35 additions & 2 deletions docs/canisters/deferred-minter.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- [Close a sell contract](#close-a-sell-contract)
- [close contract requirements](#close-contract-requirements)
- [Close contract](#close-contract)
- [HTTP Endpoint](#http-endpoint)
- [Agents](#agents)

## Introduction

Expand All @@ -29,7 +31,7 @@ A party involved in the sell process (buyer/seller/agency) must send Ethereum to

#### Create contract

At this point the agency can send the `ContractRegistration` data and call the `create_contract` endpoint on the canister.
At this point the **agency** can send the `ContractRegistration` data and call the `create_contract` endpoint on the canister.

This endpoint will call `create_contract` on the **Deferred** Ethereum ERC721 which will mint the tokens and after that it will call `create_contract` on **deferred_data** to store the contract on the ledger.

Expand All @@ -46,10 +48,41 @@ A party involved in the sell process (buyer/seller/agency) must send Ethereum to

#### Close contract

At this point the agency can close the contract by calling `close_contract` on the canister.
The **agency** can close the contract by calling `close_contract` on the canister.

This will mark the contract as closed both on the ledger and on the ERC721.

Once the contract is closed tokens can't be traded anymore and the sell contract is completed.

> ❗ The agency must ensure before closing the contract that the buyer owns all the tokens
## HTTP Endpoint

### Agents

```txt
GET /agents
```

Returns all the agents registered.

The response has the following syntax:

```json
[
{
"address": "Via roma 12",
"city": "Milan",
"continent": "Europe",
"country": "Italy",
"email": "[email protected]",
"mobile": "3661677509",
"name": "MilanHouses",
"owner": "principal",
"region": "...",
"vat": "",
"website": "",
"zipCode": "33100"
}
]
```
Loading

0 comments on commit 0e8f2d7

Please sign in to comment.