Skip to content

Commit

Permalink
update docs theme, readme, basics
Browse files Browse the repository at this point in the history
  • Loading branch information
burnto committed Mar 26, 2024
1 parent 7d497fc commit cbb2445
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 13 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,28 @@ These docs are intended to help you get started with the PYUSD, PayPay's stablec

## Building / contributing

This project uses vitepress. To build the docs, you need to have node.js installed, then run:
### Docs

This project uses vitepress for documentation. To run a preview of docs, you need to have a recent version of node.js installed, then run:

```bash
npm install
npm run docs:dev
npm run docs:dev --workspace=docs
```

### Frontend project

To run the frontend project, run:

```bash
npm run dev --workspace=frontend
```

### Smart contract project

To test and deploy the smart contract, you need to install Foundry. See the [README in the `contracts` directory](./contracts/README.md) for more information.

```bash
cd contracts
forge test
```
17 changes: 13 additions & 4 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,28 @@ export default defineConfig({
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/" },
{ text: "Smart Contract", link: "/smart-contract/" },
{ text: "Getting started", link: "/getting-started/" },
{ text: "Smart contracts", link: "/smart-contract/" },
{ text: "Frontend", link: "/react-frontend/" },
],

sidebar: [
{
text: "PYUSD in smart contracts",
text: "Getting Started",
collapsed: true,
items: [
{ text: "Introduction", link: "/getting-started/" },
{ text: "PYUSD", link: "/getting-started/pyusd" },
],
},
{
text: "Smart contracts",
collapsed: true,
items: [
{ text: "Introduction", link: "/smart-contract/" },
{ text: "Getting set up", link: "/smart-contract/01-setup" },
{
text: "First Solidity",
text: "First solidity",
link: "/smart-contract/02-first-contract",
},
{
Expand All @@ -39,7 +48,7 @@ export default defineConfig({
link: "/smart-contract/05-accept-pyusd",
},
{
text: "Rendering Onchain",
text: "Onchain rendering",
link: "/smart-contract/06-onchain-rendering",
},
{
Expand Down
20 changes: 20 additions & 0 deletions docs/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
:root {
--vp-c-indigo-1: #0079c1;
--vp-c-indigo-2: #0079c1;
--vp-c-indigo-3: #00598d;
--vp-c-indigo-soft: #00457c;
}

.dark {
--vp-c-indigo-1: #81b8d9;
--vp-c-indigo-2: #0079c1;
--vp-c-indigo-3: #00457c;
--vp-c-indigo-soft: #00457c;
}

:root {
--vp-c-brand-1: var(--vp-c-indigo-1);
--vp-c-brand-2: var(--vp-c-indigo-2);
--vp-c-brand-3: var(--vp-c-indigo-3);
--vp-c-brand-soft: var(--vp-c-indigo-soft);
}
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import DefaultTheme from "vitepress/theme";
import "./custom.css";

export default DefaultTheme;
Empty file removed docs/basics/index.md
Empty file.
21 changes: 21 additions & 0 deletions docs/getting-started/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Welcome to _Build with PYUSD_

We're excited to have you here! We've built this site as a community resource for builders using [PYUSD](https://www.paypal.com/us/digital-wallet/manage-money/crypto/pyusd). Here you'll find guides, sample projects, and resources to help you get started building with PYUSD.

## 🍜 Soup to nuts

We've created some real world projects that use PYUSD, and these guides will walk you through building them yourself.

The projects we've featured here are examples of what you can build with PYUSD. We've provided working sample projects and deployments to get you started. Feel free to remix, reuse, or contribute back to the community.

- [Smart contract guide](/smart-contract/) + [solidity project](https://github.com/mono-koto/build-with-pyusd/tree/main/contracts)
- [Frontend guide](/react-frontend/) + [react project](https://github.com/mono-koto/build-with-pyusd/tree/main/frontend)
- [Source for these docs](https://github.com/mono-koto/build-with-pyusd/tree/main/docs)

## 🧰 For developers

These guides are intended for a mix of developers, builders, and hackers who are interested in building with PYUSD. We'll cover everything from setting up your development environment to deploying your first smart contract and frontend.

## 📚 Extensible

All content and projects are MIT licensed. Remix, reuse, or contribute back to the community. We're excited to see what you build!
54 changes: 54 additions & 0 deletions docs/getting-started/pyusd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# PYUSD

[PayPal's PYUSD](https://www.paypal.com/us/digital-wallet/manage-money/crypto/pyusd) is an ERC-20 token available on the Ethereum blockchain that is pegged to the value of the US dollar. PayPal users can buy, hold, and sell PYUSD via their PayPal accounts, and can transfer PYUSD to and from other Ethereum wallets.

## Addresses

| Network | Address |
| ------- | --------------------------------------------------------------------------------------------------------------------- |
| Mainnet | [0x6c3ea9036406852006290770bedfcaba0e23a0e8](https://etherscan.io/address/0x6c3ea9036406852006290770bedfcaba0e23a0e8) |
| Sepolia | [0xCaC524BcA292aaade2DF8A05cC58F0a65B1B3bB9](https://etherscan.io/address/0xCaC524BcA292aaade2DF8A05cC58F0a65B1B3bB9) |

## Testnet Faucet

PYUSD is available on the Sepolia testnet. You can get PYUSD from the [Paxos Sepolia faucet](https://faucet.paxos.com/).

## Design

PYUSD is an upgradeable ERC-20 token managed by [Paxos](https://www.paxos.com/). The token contract is written in an older version of Solidity (0.4.24), with a design that is very similar to [USDP](https://etherscan.io/token/0x8e870d67f660d95d5be530380d0ec0bd388289e1), which is also managed by Paxos.

## Audits

In 2023, Trail of Bits conducted an audit of the PYUSD contract.

- [Trail of Bits Audit Report](https://github.com/paxosglobal/pyusd-contract/blob/master/audit-reports/Trail_of_Bits_Audit_Report.pdf)

In addition, past audits covered the USDP and PAX contracts on which the PYUSD contract is based:

- [Trail of Bits Audit Report](https://github.com/paxosglobal/usdp-contracts/blob/master/audit-reports/ChainSecurity_Audit_Report.pdf)
- [Nomic Labs Audit Report](https://github.com/paxosglobal/usdp-contracts/blob/master/audit-reports/Nomic_Labs_Audit_Report.pdf)
- [ChainSecurity Audit Report](https://github.com/paxosglobal/usdp-contracts/blob/master/audit-reports/ChainSecurity_Audit_Report.pdf)

## Roles

PYUSD's administration is centralized. It's worth noting the following:

### Upgrades

The contract is behind a proxy and is upgradeable, which means that the contract's logic can be updated without changing the contract's address.

### Owner

The contract has an `owner` address that can reclaim any PYUSD balance held by the actual PYUSD contract. The owner can also `pause` and `unpause` the contract, which disables all transfers and approvals.

### Asset protection

The contract has "freeze" functions – `freeze`, `unfreeze`, `wipeFrozenAddress`, and `isFrozen` – available to a designated `assetProtectionRole` address. These functions allow the `assetProtectionRole` to freeze and unfreeze any address, and to wipe the balance of any frozen address. Currently the owner and asset protection roles are the same address.

### Supply control

The contract has `increaseSupply` and `decreaseSupply` functions available to a designated `supplyController` address. These functions allow the `supplyController` to mint and burn PYUSD to itself.

### Beta delegation

A `betaDelegateWhitelister` role is able to add and remove beta delegates, who can then transfer PYUSD on behalf of other addresses. This role is currently unassigned.
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ layout: home

hero:
name: "Build with PYUSD"
tagline: Guides, sample projects, and resources for builders using PYUSD
# image:
# src: /build-pyusd-logo.svg
# alt: VitePress
tagline: Community guides, sample projects, and resources for PYUSD builders
actions:
- theme: brand
text: Smart contract guide
Expand All @@ -16,10 +13,13 @@ hero:
text: Frontend guide
link: /react-frontend/
features:
- title: 🍜 Soup to nuts
- title: Soup to nuts
icon: 🍜
details: From setting up your env to deploying your first smart contract and frontend
- title: 🧰 Working projects
- title: Working projects
icon: 🧰
details: We provide working sample projects and deployments to get you started
- title: 📚 Extensible
- title: Extensible
icon: 📚
details: Content and projects are MIT licensed. Remix, reuse, or contribute back.
---

0 comments on commit cbb2445

Please sign in to comment.