You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
subtitle="Compose is a general purpose smart contract library. It helps you create smart contract systems."
16
17
variant="gradient"
17
18
height="medium"
18
19
/>
20
+
*/}
21
+
22
+
**Compose** is a general-purpose smart contract library that helps you build smart contract systems.
23
+
24
+
Traditional smart contract libraries give you source code that you must modify, extend, and deploy yourself to one or more blockchains.
19
25
20
-
Past smart contract libraries gave you source code and expected you to extend or modify it and then deploy it to one or more blockchains.
26
+
**Compose takes a different approach.**
21
27
22
-
Compose is different. We **don't**expect you to do that. We take a different approach.
28
+
Compose provides a set of **reusable on-chain contracts**that already exist on blockchains—you don't need to deploy or manage them yourself. The heavy lifting has been done.
23
29
24
-
Compose gives you a set of reusable smart contracts that already exist on blockchains. You don't have to deploy Compose source code. It's already been done. The smart contracts are already deployed for your use.
30
+
For your next project, instead of deploying new contracts, simply **use the existing on-chain contracts** provided by Compose.
25
31
26
-
For your new project, instead of deploying new contracts, use existing onchain smart contracts provided by Compose.
27
32
28
33
:::tip[Key Insight]
29
34
Compose is a general purpose **onchain** smart contract library.
30
35
:::
31
36
32
37
:::info[In Development]
33
-
We haven't actually deployed smart contracts yet because we are in early development. We are building. If this is exciting to you, come join us.
38
+
Compose is still in early development, and its smart contracts haven't been deployed yet.
39
+
We're actively building—and if this vision excites you, we'd love for you to join us.
34
40
:::
35
41
36
42
37
43
## Reusable Smart Contracts
38
44
39
-
You might wonder how to create a new project without deploying new smart contracts. How does Compose enable people to create new smart contract systems using existing onchain contracts?
45
+
You might be wondering: **How can I create a new project without deploying new smart contracts?**
40
46
41
-
This is where Compose's smart contract architecture comes in. Compose uses [diamond contracts](https://eips.ethereum.org/EIPS/eip-2535)
42
-
to organize smart contracts and make them reusable.
47
+
How does Compose make it possible to build new systems from existing onchain contracts?
43
48
44
-
A diamond contract is a simple, small contract that uses the code of other onchain contracts.
49
+
The answer lies in Compose’s smart contract architecture, which is based on [diamond contracts](https://eips.ethereum.org/EIPS/eip-2535).
45
50
46
-
A diamond contract creates and maintains its own storage data using code from other contracts. These "other contracts" are called facets. Here is a diagram of a diamond that shows it gets its code from facets.
51
+
A diamond contract is a simple, tiny contract that **uses the code of other onchain contracts** called **facets**. Each diamond uses the code of other contracts (facets) to create and maintain its storage data and state.
52
+
53
+
Below is a diagram showing a diamond connected to multiple facets that provide its functionality.
Using Compose you do actually deploy new contracts. Specifically you deploy a small diamond contract that uses existing onchain facets.
57
+
When you use Compose, you *do* deploy new contracts—but only the small diamond contract that ties together existing onchain facets.
58
+
59
+
Let's look at a simple example.
60
+
61
+
Suppose you want to create a new ERC-20 token that supports gasless approvals (permit) and cross-chain bridging.
51
62
52
-
Let's look at a simple example of how this works. Let's say that you want to create a new ERC20 token that uses the gasless "permit" function and can be bridged to other blockchains. **Use Compose to:**
63
+
With Compose, you can:
53
64
54
-
1.Find and choose onchain facets you need. In this case`ERC20Facet`, `ERC20PermitFacet` and `ERC20BridgableFacet`.
55
-
2.Setup initialization information such as the name of your ERC20 token, its total supply, etc.
56
-
3. Deploy a diamondwhich initializes your ERC20 token and uses the onchain facets in step 1.
65
+
1.**Select the facets you need** – for example,`ERC20Facet`, `ERC20PermitFacet`, and `ERC20BridgableFacet`.
66
+
2.**Provide initialization data** – such as the token name, symbol, and total supply.
67
+
3.**Deploy your diamond** – which initializes your ERC-20 token and connects it to the chosen facets.
57
68
58
69
:::tip[Key Insight]
59
-
Many diamond contracts are deployed that reuse the same onchain facets.
70
+
Many diamond contracts can be deployed that **reuse the same onchain facets**.
60
71
:::
61
72
62
73
## Composable Contracts
@@ -125,7 +136,7 @@ Isolated, small, simply written onchain components that are composed with your u
125
136
<FeatureGridcolumns={3}>
126
137
<FeatureGridItem
127
138
icon={<Iconname="package"size={32} />}
128
-
title="On-Chain Standard Library"
139
+
title="Onchain Standard Library"
129
140
description="Access verified, audited facets deployed once and reused across multiple diamonds on multiple blockchains."
0 commit comments