Skip to content

Commit bafb60e

Browse files
author
Mauro Lacy
committed
Add README
1 parent 6fc888f commit bafb60e

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Op-finality-gadget
2+
3+
This repo contains the Wasm smart contract for Optimism staking integration.
4+
It will be deployed on Babylon, and will maintain finality signatures and block finalisation status of Optimism rollups.
5+
6+
## Development
7+
8+
### Prerequisites
9+
10+
Make sure you have `cargo-run-script` installed and docker running.
11+
12+
```bash
13+
cargo install cargo-run-script
14+
```
15+
16+
### Clean the build
17+
18+
```bash
19+
cargo clean
20+
```
21+
22+
### Build the contract
23+
24+
```bash
25+
cargo build
26+
```
27+
28+
### Formatting and Linting
29+
30+
Check whether the code is formatted correctly.
31+
32+
```bash
33+
cargo fmt --all -- --check
34+
cargo check
35+
cargo clippy --all-targets -- -D warnings
36+
```
37+
38+
Alternatively, you can run the following command to run all the checks at once.
39+
40+
```bash
41+
cargo run-script lint
42+
```
43+
44+
### Test the contract
45+
46+
Note: Requires the optimized contract to be built (`cargo optimize`)
47+
48+
Runs all the CI checks locally (in your actual toolchain).
49+
50+
```bash
51+
cargo test --lib
52+
```
53+
54+
### Integration tests the contract
55+
56+
Note: Requires the optimized contract to be built (`cargo optimize`)
57+
58+
```bash
59+
cargo test --test integration
60+
```
61+
62+
Alternatively, you can run the following command, that makes sure to build the optimized contract before running
63+
the integration tests.
64+
65+
```bash
66+
cargo run-script integration
67+
```
68+
69+
### Build the optimized contract
70+
71+
```bash
72+
cargo run-script optimize
73+
```

0 commit comments

Comments
 (0)