Skip to content

Commit c935604

Browse files
authored
Merge pull request #40 from P4-Games/feature/contracts-docs
merge feature/contracts-docs into develop
2 parents b3a3e79 + cf4d71d commit c935604

8 files changed

+472
-6
lines changed

.doc/content.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Content
2+
3+
## Technical Overview
4+
5+
* [Contracts Overview](./overview/overview.md)
6+
* [Contracts Details](./overview/contracts-details.md)
7+
8+
## Development
9+
10+
* [Development Guidelines](./development/development-guidelines.md)
11+
12+
## Deployment
13+
14+
* [Deploy Guidelines](./deployment/deployment-guidelines.md)

.doc/deployment/deploy-guidelines.md

-3
This file was deleted.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Deployment Guidelines
2+
3+
(TBC)

.doc/technical-overview/contracts-details.md

+399
Large diffs are not rendered by default.

.doc/technical-overview/overview.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# ChatterPay Contracts Overview
2+
3+
## Summary
4+
5+
These smart contracts collectively create a robust ecosystem for wallet management, token price feeds, and NFT handling. They provide flexibility, upgradeability, and security by implementing key features like account abstraction, secure wallet deployment, NFT minting, and real-time price data management. The system allows for efficient wallet creation, management of user operations, and the minting of original and copy NFTs, all while ensuring that transaction fees and external data feeds are properly handled.
6+
7+
## Contracts List:
8+
9+
1. [**ChatterPay.sol**](../../src/L2/ChatterPay.sol)
10+
Core wallet contract for ChatterPay, handling user operations, token transfers, and transaction fee management.
11+
12+
2. [**ChatterPayPaymaster.sol**](../../src/L2/ChatterPayPaymaster.sol)
13+
Fee manager contract that ensures transaction fees are paid on behalf of users, supporting the account abstraction model of ChatterPay.
14+
15+
3. [**ChatterPayNFT.sol**](../../src/L2/ChatterPayNFT.sol)
16+
Manages the minting of original NFTs and their associated copies, with controls for copy limits and owner management.
17+
18+
4. [**ChatterPayVault.sol**](../../src/L2/ChatterPayNFT.sol)
19+
Handles secure storage and management of assets within the ChatterPay ecosystem, providing vault services for users.
20+
21+
5. [**ChatterPayWalletFactory.sol**](../../src/L2/ChatterPayWalletFactory.sol)
22+
A wallet factory contract that creates proxy wallets for users, tracks proxies, and allows for updates to wallet implementations.
23+
24+
6. [**ChatterPayWalletProxy.sol**](../../src/L2/ChatterPayWalletProxy.sol)
25+
A proxy contract for ChatterPay wallets, allowing for upgradeable wallet functionality using [ERC-1967 Proxy](https://docs.openzeppelin.com/contracts/4.x/api/proxy#ERC1967Proxy), and providing a method to retrieve the current wallet implementation.
26+
27+
7. [**SimpleSwap.sol**](../../src/L2/SimpleSwap.sol)
28+
Implements a simple token swapping mechanism, allowing users to swap between supported tokens within the ChatterPay ecosystem.
29+
30+
8. [**USDT.sol**](../../src/L2/USDT.sol)
31+
A contract representing the USDT (Tether) token on Layer 2, enabling stablecoin transactions within the ChatterPay platform.
32+
33+
9. [**WETH.sol**](../../src/L2/WETH.sol)
34+
A contract for wrapping and unwrapping ETH as WETH (Wrapped Ether), allowing users to interact with ETH as an ERC-20 token in the ChatterPay ecosystem.
35+
36+
10. [**PackedUserOperation.sol**](../../src/L2/utils/PackedUserOperation.sol)
37+
Defines the structure for user operations, including details like gas limits, fees, and operation signatures, enabling flexible interaction with the wallet system.
38+
39+
11. [**L1Keystore.sol**](../../src/Ethereum/L1Keystore.sol)
40+
Stores wallet data on Layer 1, managing user accounts, wallet registrations, and key-value storage, with access control for key updates.
41+
42+
12. [**TokensPriceFeeds.sol**](../../src/Ethereum/TokensPriceFeeds.sol)
43+
Reads and manages token price feeds (ETH/USD, BTC/USD) from external proxy contracts, ensuring the data is up-to-date and valid.
44+
45+
46+
Representation of Chatterpay's Smart Contracts Flow:
47+
48+
49+
![ChatterPay Smart Contracts Flow](./images/chatterpay-contracts-flow.png)
50+
51+
52+
[Here](./contracts-details.md) you can see a detailed breakdown of the provided smart contracts used for ChatterPay.

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ __Components__:
2929

3030
This repository contains the source code of the Smart Contracts.
3131

32-
![ChatterPay Smart Contracts Workflow](./.doc/architecture/images/chatterpay-scs-flow.png)
33-
34-
3532
__Build With__:
3633

3734
- Framework: [Foundry](https://github.com/foundry-rs/foundry)
@@ -41,6 +38,10 @@ __Build With__:
4138
- Account Abstraction L2 Keystore: [Scroll L1SLOAD](https://dev.to/turupawn/l1sload-el-nuevo-opcode-para-keystores-seguras-y-escalables-50of)
4239
- Web3 Data Feed: [api3](https://api3.org/)
4340

41+
If you would like to explore the details of the contracts in-depth, you can review them at this [link](.doc/overview/overview.md).
42+
43+
44+
4445
# Getting Started
4546

4647
__1. Install these Requirements__:

0 commit comments

Comments
 (0)