Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement(docs) - cap table deployment #16

Merged
merged 5 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/images/cap-table-issuer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/pages/development/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"install": "Install",
"setup": "Setup",
"factory-deployment": "Factory Deployment"
"factory-deploy": "Deploy Factory",
"cap-table-deploy": "Deploy Cap Table"
}
60 changes: 60 additions & 0 deletions src/pages/development/cap-table-deploy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { Steps } from 'nextra/components';

# Cap table smart contract

The cap table smart contract is responsible for minting the inital cap table onchain can be found in our repo under [CapTable.sol](https://github.com/transfer-agent-protocol/tap-cap-table/blob/main/chain/src/CapTable.sol).

## Deploy cap table smart contract
<Steps>

### Run the server

In the root folder, run the development server:

```bash
yarn dev
```

### Open Postman, and create a new POST request

Create a new request in Postman, and set the request type to `POST`. In the URL field, enter `http://localhost:{{PORT}}/issuer/create` - your port should be `8293` if you haven't changed it.

### Set the request body

In the request body, use this example JSON. You can change anything you like here. Every field is required and will first run through validation against the OCF schema using our [validateInputAgainstSchema](https://github.com/transfer-agent-protocol/tap-cap-table/blob/main/src/utils/validateInputAgainstSchema.js) script.

```json
{
"legal_name": "Transfer Agent Protocol",
"formation_date": "2022-08-23",
"country_of_formation": "US",
"country_subdivision_of_formation": "DE",
"initial_shares_authorized": "10000000",
"tax_ids": [
{
"tax_id": "88-3977591",
"country": "US"
}
],
"email": {
"email_address": "[email protected]",
"email_type": "BUSINESS"
},
"address": {
"address_type": "LEGAL",
"street_suite": "447 Broadway\n2nd Fl #713",
"city": "New York",
"country_subdivision": "NY",
"country": "US",
"postal_code": "10013"
},
"comments": []
}
```

### Send the request

Your request should look like this. Notice that in the response, you get the `capTableAddress` which is the address of the cap table smart contract. Congratulations, you've deployed your first cap table smart contract!
![Factories](../../../public/images/cap-table-issuer.png)
</Steps>

14 changes: 11 additions & 3 deletions src/pages/protocol/tap-cap-table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@ import { Card, Cards, Callout } from 'nextra/components'

Let's go over smart contract and what it does. We're going to start with the Cap Table Factory.

## Cap Table Factory
## Factory

The [CapTableFactory](https://github.com/transfer-agent-protocol/tap-cap-table/blob/main/chain/src/CapTableFactory.sol) smart contract uses OpenZeppelin's upgradeable beacon pattern to create and manage upgradeable instances of cap tables for tokenized assets, leveraging proxy contracts for modularity and upgradability.

It lets the contract owner to create new cap table instances with specific initial parameters (ID, name, and initial shares authorized) and update the underlying cap table implementation for all instances via the beacon.

The contract tracks each cap table proxy created, offering a function to count the total number of cap tables managed. The contract also provides a function to retrieve the address of a cap table proxy by its index.

## Cap Table

The [CapTable](https://github.com/transfer-agent-protocol/tap-cap-table/blob/main/chain/src/CapTable.sol) contract manages tokenized stock with role-based access for secure operations. It tracks stakeholders, stock classes, and transactions, supporting stock issuance, repurchase, and adjustments. It uses OpenZeppelin's upgradeable contracts for enhanced functionality and security.

<Cards>
<Card
title="Deploying Cap Table Factory"
href="/development/factory-deployment"
title="Deploy Cap Table Factory"
href="/development/factory-deploy"
/>
<Card
title="Deploy Cap Table"
href="/development/cap-table-deploy"
/>
</Cards>
Loading