Skip to content

Commit 8652feb

Browse files
authored
Update README (#2531)
1 parent d559947 commit 8652feb

File tree

1 file changed

+174
-45
lines changed

1 file changed

+174
-45
lines changed

README.md

Lines changed: 174 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,173 @@
11
# CosmWasm
22

3-
[![CircleCI](https://circleci.com/gh/CosmWasm/cosmwasm/tree/main.svg?style=shield)](https://circleci.com/gh/CosmWasm/cosmwasm/tree/main)
3+
![component][component-badge]
4+
[![license][apache-badge]][apache-url]
5+
6+
[component-badge]: https://img.shields.io/badge/CosmWasm-6343ae.svg
7+
[apache-badge]: https://img.shields.io/badge/License-Apache%202.0-blue.svg
8+
[apache-url]: LICENSE
9+
[notice-url]: NOTICE
410

511
**WebAssembly Smart Contracts for the Cosmos SDK**
612

7-
## Packages
8-
9-
The following packages are maintained here:
10-
11-
| Crate | Usage | Download | Docs | Coverage |
12-
| --------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------ |
13-
| cosmwasm-crypto | Internal only | [![cosmwasm-crypto on crates.io](https://img.shields.io/crates/v/cosmwasm-crypto.svg)](https://crates.io/crates/cosmwasm-crypto) | [![Docs](https://docs.rs/cosmwasm-crypto/badge.svg)](https://docs.rs/cosmwasm-crypto) | [![Coverage][cov-badge-crypto]][cov-link-crypto] |
14-
| cosmwasm-derive | Internal only | [![cosmwasm-derive on crates.io](https://img.shields.io/crates/v/cosmwasm-derive.svg)](https://crates.io/crates/cosmwasm-derive) | [![Docs](https://docs.rs/cosmwasm-derive/badge.svg)](https://docs.rs/cosmwasm-derive) | [![Coverage][cov-badge-derive]][cov-link-derive] |
15-
| cosmwasm-schema | Contract development | [![cosmwasm-schema on crates.io](https://img.shields.io/crates/v/cosmwasm-schema.svg)](https://crates.io/crates/cosmwasm-schema) | [![Docs](https://docs.rs/cosmwasm-schema/badge.svg)](https://docs.rs/cosmwasm-schema) | [![Coverage][cov-badge-schema]][cov-link-schema] |
16-
| cosmwasm-core | Internal only | [![cosmwasm-core on crates.io](https://img.shields.io/crates/v/cosmwasm-core.svg)](https://crates.io/crates/cosmwasm-core) | [![Docs](https://docs.rs/cosmwasm-core/badge.svg)](https://docs.rs/cosmwasm-core) | [![Coverage][cov-badge-core]][cov-link-core] |
17-
| cosmwasm-std | Contract development | [![cosmwasm-std on crates.io](https://img.shields.io/crates/v/cosmwasm-std.svg)](https://crates.io/crates/cosmwasm-std) | [![Docs](https://docs.rs/cosmwasm-std/badge.svg)](https://docs.rs/cosmwasm-std) | [![Coverage][cov-badge-std]][cov-link-std] |
18-
| cosmwasm-vm | Host environments | [![cosmwasm-vm on crates.io](https://img.shields.io/crates/v/cosmwasm-vm.svg)](https://crates.io/crates/cosmwasm-vm) | [![Docs](https://docs.rs/cosmwasm-vm/badge.svg)](https://docs.rs/cosmwasm-vm) | [![Coverage][cov-badge-vm]][cov-link-vm] |
19-
| cosmwasm-check | Contract development | [![cosmwasm-check on crates.io](https://img.shields.io/crates/v/cosmwasm-check.svg)](https://crates.io/crates/cosmwasm-check) | `cosmwasm-check -h` | N/A |
20-
21-
[cosmwasm-storage](https://crates.io/crates/cosmwasm-storage) is no longer
22-
maintained and has been dropped in favor of
23-
[cw-storage-plus](https://github.com/CosmWasm/cw-storage-plus).
24-
25-
[cov-badge-crypto]:
26-
https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-crypto
27-
[cov-badge-derive]:
28-
https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-derive
29-
[cov-badge-schema]:
30-
https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-schema
31-
[cov-badge-core]:
32-
https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-core
33-
[cov-badge-std]:
34-
https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-std
35-
[cov-badge-vm]:
36-
https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-vm
37-
[cov-link-crypto]:
38-
https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/crypto
39-
[cov-link-derive]:
40-
https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/derive
41-
[cov-link-schema]:
42-
https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/schema
13+
## Rust crates
14+
15+
The following Rust crates are maintained in this repository:
16+
17+
| Crate | Usage | Download | Docs | Coverage |
18+
|------------------------------------|----------------------|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
19+
| cosmwasm‑check | Contract development | [![cosmwasm-check][crates-badge-cosmwasm-check]][crates-url-cosmwasm-check] | [![docs-cosmwasm-check][docs-badge-cosmwasm-check]][docs-url-cosmwasm-check] | ![cov-cosmwasm-check][cov-badge-cosmwasm-check] |
20+
| cosmwasm‑core | Internal use only | [![cosmwasm-core][crates-badge-cosmwasm-core]][crates-url-cosmwasm-core] | [![docs-cosmwasm-core][docs-badge-cosmwasm-core]][docs-url-cosmwasm-core] | ![cov-cosmwasm-core][cov-badge-cosmwasm-core] |
21+
| cosmwasm‑crypto | Internal use only | [![cosmwasm-crypto][crates-badge-cosmwasm-crypto]][crates-url-cosmwasm-crypto] | [![docs-cosmwasm-crypto][docs-badge-cosmwasm-crypto]][docs-url-cosmwasm-crypto] | ![cov-cosmwasm-crypto][cov-badge-cosmwasm-crypto] |
22+
| cosmwasm‑derive | Internal use only | [![cosmwasm-derive][crates-badge-cosmwasm-derive]][crates-url-cosmwasm-derive] | [![docs-cosmwasm-derive][docs-badge-cosmwasm-derive]][docs-url-cosmwasm-derive] | ![cov-cosmwasm-derive][cov-badge-cosmwasm-derive] |
23+
| cosmwasm‑schema | Contract development | [![cosmwasm-schema][crates-badge-cosmwasm-schema]][crates-url-cosmwasm-schema] | [![docs-cosmwasm-schema][docs-badge-cosmwasm-schema]][docs-url-cosmwasm-schema] | ![cov-cosmwasm-schema][cov-badge-cosmwasm-schema] |
24+
| cosmwasm‑schema‑derive | Internal use only | [![cosmwasm-schema-derive][crates-badge-cosmwasm-schema-derive]][crates-url-cosmwasm-schema-derive] | [![docs-cosmwasm-schema-derive][docs-badge-cosmwasm-schema-derive]][docs-url-cosmwasm-schema-derive] | ![cov-cosmwasm-schema-derive][cov-badge-cosmwasm-schema-derive] |
25+
| cosmwasm‑std | Contract development | [![cosmwasm-std][crates-badge-cosmwasm-std]][crates-url-cosmwasm-std] | [![docs-cosmwasm-std][docs-badge-cosmwasm-std]][docs-url-cosmwasm-std] | ![cov-cosmwasm-std][cov-badge-cosmwasm-std] |
26+
| cosmwasm‑vm | Host environments | [![cosmwasm-vm][crates-badge-cosmwasm-vm]][crates-url-cosmwasm-vm] | [![docs-cosmwasm-vm][docs-badge-cosmwasm-vm]][docs-url-cosmwasm-vm] | ![cov-cosmwasm-vm][cov-badge-cosmwasm-vm] |
27+
| cosmwasm‑vm‑derive | Internal use only | [![cosmwasm-vm-derive][crates-badge-cosmwasm-vm-derive]][crates-url-cosmwasm-vm-derive] | [![docs-cosmwasm-vm-derive][docs-badge-cosmwasm-vm-derive]][docs-url-cosmwasm-vm-derive] | ![cov-cosmwasm-vm-derive][cov-badge-cosmwasm-vm-derive] |
28+
| cw‑schema | Contract development | [![cw-schema][crates-badge-cw-schema]][crates-url-cw-schema] | [![docs-cw-schema][docs-badge-cw-schema]][docs-url-cw-schema] | ![cov-cw-schema][cov-badge-cw-schema] |
29+
| cw‑schema‑derive | Internal use only | [![cw-schema-derive][crates-badge-cw-schema-derive]][crates-url-cw-schema-derive] | [![docs-cw-schema-derive][docs-badge-cw-schema-derive]][docs-url-cw-schema-derive] | ![cov-cw-schema-derive][cov-badge-cw-schema-derive] |
30+
31+
[crates-badge-cosmwasm-check]: https://img.shields.io/crates/v/cosmwasm-check.svg
32+
[crates-url-cosmwasm-check]: https://crates.io/crates/cosmwasm-check
33+
[docs-badge-cosmwasm-check]: https://docs.rs/cosmwasm-check/badge.svg
34+
[docs-url-cosmwasm-check]: https://docs.rs/cosmwasm-check
35+
[cov-badge-cosmwasm-check]: https://img.shields.io/badge/coverage-98%25%20%E2%94%82%20100%25%20%E2%94%82%20100%25-21b577.svg
36+
37+
[crates-badge-cosmwasm-core]: https://img.shields.io/crates/v/cosmwasm-core.svg
38+
[crates-url-cosmwasm-core]: https://crates.io/crates/cosmwasm-core
39+
[docs-badge-cosmwasm-core]: https://docs.rs/cosmwasm-core/badge.svg
40+
[docs-url-cosmwasm-core]: https://docs.rs/cosmwasm-core
41+
[cov-badge-cosmwasm-core]: https://img.shields.io/badge/coverage-%E2%80%94%20%E2%94%82%20%E2%80%94%20%E2%94%82%20%E2%80%94-21b577.svg
42+
43+
[crates-badge-cosmwasm-crypto]: https://img.shields.io/crates/v/cosmwasm-crypto.svg
44+
[crates-url-cosmwasm-crypto]: https://crates.io/crates/cosmwasm-crypto
45+
[docs-badge-cosmwasm-crypto]: https://docs.rs/cosmwasm-crypto/badge.svg
46+
[docs-url-cosmwasm-crypto]: https://docs.rs/cosmwasm-crypto
47+
[cov-badge-cosmwasm-crypto]: https://img.shields.io/badge/coverage-81%25%20%E2%94%82%2084%25%20%E2%94%82%2092%25-21b577.svg
48+
49+
[crates-badge-cosmwasm-derive]: https://img.shields.io/crates/v/cosmwasm-derive.svg
50+
[crates-url-cosmwasm-derive]: https://crates.io/crates/cosmwasm-derive
51+
[docs-badge-cosmwasm-derive]: https://docs.rs/cosmwasm-derive/badge.svg
52+
[docs-url-cosmwasm-derive]: https://docs.rs/cosmwasm-derive
53+
[cov-badge-cosmwasm-derive]: https://img.shields.io/badge/coverage-84%25%20%E2%94%82%2085%25%20%E2%94%82%2094%25-21b577.svg
54+
55+
[crates-badge-cosmwasm-schema]: https://img.shields.io/crates/v/cosmwasm-schema.svg
56+
[crates-url-cosmwasm-schema]: https://crates.io/crates/cosmwasm-schema
57+
[docs-badge-cosmwasm-schema]: https://docs.rs/cosmwasm-schema/badge.svg
58+
[docs-url-cosmwasm-schema]: https://docs.rs/cosmwasm-schema
59+
[cov-badge-cosmwasm-schema]: https://img.shields.io/badge/coverage-61%25%20%E2%94%82%2047%25%20%E2%94%82%2065%25-f52020.svg
60+
61+
[crates-badge-cosmwasm-schema-derive]: https://img.shields.io/crates/v/cosmwasm-schema-derive.svg
62+
[crates-url-cosmwasm-schema-derive]: https://crates.io/crates/cosmwasm-schema-derive
63+
[docs-badge-cosmwasm-schema-derive]: https://docs.rs/cosmwasm-schema-derive/badge.svg
64+
[docs-url-cosmwasm-schema-derive]: https://docs.rs/cosmwasm-schema-derive
65+
[cov-badge-cosmwasm-schema-derive]: https://img.shields.io/badge/coverage-76%25%20%E2%94%82%2087%25%20%E2%94%82%2091%25-f4b01b.svg
66+
67+
[crates-badge-cosmwasm-std]: https://img.shields.io/crates/v/cosmwasm-std.svg
68+
[crates-url-cosmwasm-std]: https://crates.io/crates/cosmwasm-std
69+
[docs-badge-cosmwasm-std]: https://docs.rs/cosmwasm-std/badge.svg
70+
[docs-url-cosmwasm-std]: https://docs.rs/cosmwasm-std
71+
[cov-badge-cosmwasm-std]: https://img.shields.io/badge/coverage-92%25%20%E2%94%82%2091%25%20%E2%94%82%2094%25-21b577.svg
72+
73+
[crates-badge-cosmwasm-vm]: https://img.shields.io/crates/v/cosmwasm-vm.svg
74+
[crates-url-cosmwasm-vm]: https://crates.io/crates/cosmwasm-vm
75+
[docs-badge-cosmwasm-vm]: https://docs.rs/cosmwasm-vm/badge.svg
76+
[docs-url-cosmwasm-vm]: https://docs.rs/cosmwasm-vm
77+
[cov-badge-cosmwasm-vm]: https://img.shields.io/badge/coverage-79%25%20%E2%94%82%2083%25%20%E2%94%82%2090%25-f4b01b.svg
78+
79+
[crates-badge-cosmwasm-vm-derive]: https://img.shields.io/crates/v/cosmwasm-vm-derive.svg
80+
[crates-url-cosmwasm-vm-derive]: https://crates.io/crates/cosmwasm-vm-derive
81+
[docs-badge-cosmwasm-vm-derive]: https://docs.rs/cosmwasm-vm-derive/badge.svg
82+
[docs-url-cosmwasm-vm-derive]: https://docs.rs/cosmwasm-vm-derive
83+
[cov-badge-cosmwasm-vm-derive]: https://img.shields.io/badge/coverage-0%25%20%E2%94%82%200%25%20%E2%94%82%200%25-f52020.svg
84+
85+
[crates-badge-cw-schema]: https://img.shields.io/crates/v/cw-schema.svg
86+
[crates-url-cw-schema]: https://crates.io/crates/cw-schema
87+
[docs-badge-cw-schema]: https://docs.rs/cw-schema/badge.svg
88+
[docs-url-cw-schema]: https://docs.rs/cw-schema
89+
[cov-badge-cw-schema]: https://img.shields.io/badge/coverage-63%25%20%E2%94%82%2069%25%20%E2%94%82%2065%25-f4b01b.svg
90+
91+
[crates-badge-cw-schema-derive]: https://img.shields.io/crates/v/cw-schema-derive.svg
92+
[crates-url-cw-schema-derive]: https://crates.io/crates/cw-schema-derive
93+
[docs-badge-cw-schema-derive]: https://docs.rs/cw-schema-derive/badge.svg
94+
[docs-url-cw-schema-derive]: https://docs.rs/cw-schema-derive
95+
[cov-badge-cw-schema-derive]: https://img.shields.io/badge/coverage-0%25%20%E2%94%82%200%25%20%E2%94%82%200%25-f52020.svg
96+
97+
[cov-badge-crypto]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-crypto
98+
[cov-badge-derive]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-derive
99+
[cov-badge-schema]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-schema
100+
[cov-badge-core]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-core
101+
[cov-badge-std]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-std
102+
[cov-badge-vm]: https://codecov.io/gh/CosmWasm/cosmwasm/branch/main/graph/badge.svg?flag=cosmwasm-vm
103+
[cov-link-crypto]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/crypto
104+
[cov-link-derive]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/derive
105+
[cov-link-schema]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/schema
43106
[cov-link-core]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/core
44107
[cov-link-std]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/std
45108
[cov-link-vm]: https://codecov.io/gh/CosmWasm/cosmwasm/tree/main/packages/vm
46109

110+
## Dependencies
111+
112+
The following diagram shows the dependencies between the Rust crates in this repository:
113+
114+
```mermaid
115+
---
116+
config:
117+
theme: 'forest'
118+
---
119+
120+
graph BT
121+
A("`**cosmwasm-core**
122+
3.0.1`")
123+
124+
B("`**cosmwasm-std**
125+
3.0.1`")
126+
127+
C("`**cosmwasm-crypto**
128+
3.0.1`")
129+
130+
D("`**cosmwasm-vm**
131+
3.0.1`")
132+
133+
E("`**cosmwasm-vm-derive**
134+
3.0.1`")
135+
136+
F("`**cosmwasm-derive**
137+
3.0.1`")
138+
139+
G("`**cosmwasm-schema**
140+
3.0.1`")
141+
142+
H("`**cosmwasm-schema-derive**
143+
3.0.1`")
144+
145+
I("`**cosmwasm-check**
146+
3.0.1`")
147+
148+
J("`**cw-schema**
149+
3.0.1`")
150+
151+
K("`**cw-schema-derive**
152+
3.0.1`")
153+
154+
A --> B
155+
A --> C
156+
A --> D
157+
C --> B
158+
C --> D
159+
B --> D
160+
E --> D
161+
F --> B
162+
H --> G
163+
B --> I
164+
D --> I
165+
G --> B
166+
J --> B
167+
J --> G
168+
K --> J
169+
```
170+
47171
## Overview
48172

49173
To get that contract to interact with a system needs many moving parts. To get
@@ -74,7 +198,7 @@ This code is compiled into Wasm bytecode as part of the smart contract.
74198
Please submit your contract or interface via PR.
75199
- [rust-optimizer](https://github.com/cosmwasm/rust-optimizer) - A docker image
76200
and scripts to take your Rust code and produce the smallest possible Wasm
77-
output, deterministically. This is designed both for preparing contracts for
201+
output, deterministically. This is designed for preparing contracts for
78202
deployment as well as validating that a given deployed contract is based on
79203
some given source code, allowing a
80204
[similar contract verification algorithm](https://medium.com/coinmonks/how-to-verify-and-publish-on-etherscan-52cf25312945)
@@ -139,7 +263,7 @@ points, and no access to the outside world by default. To make them useful, we
139263
need to add a few elements.
140264

141265
If you haven't worked with WebAssembly before, please read an overview on
142-
[how to create imports and exports](docs/idl.md) in general.
266+
[how to create imports and exports](docs/IDL.md) in general.
143267

144268
### Exports
145269

@@ -294,7 +418,7 @@ pub struct Region {
294418
## Implementing the Smart Contract
295419

296420
If you followed the [instructions above](#Creating-a-smart-contract), you should
297-
have a runnable smart contract. You may notice that all of the Wasm exports are
421+
have a runnable smart contract. You may notice that all the Wasm exports are
298422
taken care of by `lib.rs`, which you shouldn't need to modify. What you need to
299423
do is simply look in `contract.rs` and implement `instantiate` and `execute`
300424
functions, defining your custom `InstantiateMsg` and `ExecuteMsg` structs for
@@ -392,7 +516,7 @@ in our sample contract.
392516
You may also want to ensure the compiled contract interacts with the environment
393517
properly. To do so, you will want to create a canonical release build of the
394518
`<contract>.wasm` file and then write tests with the same VM tooling we will use
395-
in production. This is a bit more complicated but we added some tools to help in
519+
in production. This is a bit more complicated, but we added some tools to help in
396520
[cosmwasm-vm](https://github.com/CosmWasm/cosmwasm/tree/main/packages/vm) which
397521
can be added as a `dev-dependency`.
398522

@@ -438,9 +562,6 @@ like hashing or signature verification.
438562

439563
## Developing
440564

441-
The ultimate auto-updating guide to building this project is the CI
442-
configuration in `.circleci/config.yml`.
443-
444565
For manually building this repo locally during development, here are a few
445566
commands. They assume you use a stable Rust version by default and have a
446567
nightly toolchain installed as well.
@@ -458,7 +579,15 @@ nightly toolchain installed as well.
458579
**Contracts**
459580

460581
| Step | Description | Command |
461-
| ---- | -------------------------------- | -------------------------------------- |
582+
|------|----------------------------------|----------------------------------------|
462583
| 1 | fast checks, rebuilds lock files | `./devtools/check_contracts_fast.sh` |
463584
| 2 | medium fast checks | `./devtools/check_contracts_medium.sh` |
464585
| 3 | slower checks | `./devtools/check_contracts_full.sh` |
586+
587+
## License
588+
589+
Licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
590+
(see [LICENSE][apache-url] and [NOTICE][notice-url]).
591+
592+
Any contribution intentionally submitted for inclusion in this crate by you,
593+
shall be licensed as above, without any additional terms or conditions.

0 commit comments

Comments
 (0)