Skip to content

Commit

Permalink
Merge All Current Cargo Stylus Subcommands Into Main Package (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
rauljordan authored Aug 28, 2024
1 parent 9237e85 commit 9d18b19
Show file tree
Hide file tree
Showing 41 changed files with 662 additions and 5,613 deletions.
62 changes: 7 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[workspace]
members = ["cgen", "check", "example", "main", "replay", "util"]
members = ["example", "main"]
resolver = "2"

[workspace.package]
authors = ["Offchain Labs"]
version = "0.4.2"
version = "0.5.0"
edition = "2021"
homepage = "https://arbitrum.io"
license = "MIT OR Apache-2.0"
Expand All @@ -31,7 +31,4 @@ lazy_static = "1.4.0"
libc = "0.2.148"
libloading = "0.8.0"
parking_lot = "0.12.1"
sneks = "0.1.2"

# members
cargo-stylus-util = { path = "util", version = "0.4.2" }
sneks = "0.1.2"
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM --platform=linux/amd64 rust:1.80 as builder
RUN apt-get update && apt-get install -y git
RUN rustup target add x86_64-unknown-linux-gnu
RUN git clone https://github.com/offchainlabs/cargo-stylus.git
WORKDIR /cargo-stylus
RUN git checkout v0.5.0
RUN cargo build --release --manifest-path main/Cargo.toml
FROM --platform=linux/amd64 rust:1.80
COPY --from=builder /cargo-stylus/target/release/cargo-stylus /usr/local/bin/cargo-stylus
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ You should now have it available as a Cargo subcommand:
cargo stylus --help
Cargo command for developing Arbitrum Stylus projects
Usage:
cargo stylus new
cargo stylus export-abi
cargo stylus check
cargo stylus deploy
```

### Building the Project Locally
Expand Down Expand Up @@ -106,7 +100,7 @@ Location:
prover/src/binary.rs:493:9, data: None)
```

To read more about what counts as valid vs. invalid user WASM contracts, see [VALID_WASM](./check/VALID_WASM.md).
To read more about what counts as valid vs. invalid user WASM contracts, see [VALID_WASM](./main/VALID_WASM.md).

If your contract succeeds, you'll see the following message:

Expand All @@ -124,7 +118,7 @@ First, we can estimate the gas required to perform our deployment and activation
```
cargo stylus deploy \
--private-key-path=<PRIVKEY_FILE_PATH> \
--estimate-gas-only
--estimate-gas
```

and see:
Expand Down Expand Up @@ -222,7 +216,7 @@ Brotli-compressed, Stylus contract WASM binaries must fit within the **24Kb** [c
We recommend optimizing your Stylus contract's sizes to smaller sizes, but keep in mind the safety tradeoffs of using some of the more advanced optimizations. However, some small contracts when compiled to much smaller sizes can suffer performance penalties.
For a deep-dive into the different options for optimizing binary sizes using cargo stylus, see [OPTIMIZING_BINARIES.md](./check/OPTIMIZING_BINARIES.md).
For a deep-dive into the different options for optimizing binary sizes using cargo stylus, see [OPTIMIZING_BINARIES.md](./main/OPTIMIZING_BINARIES.md).
## License
Expand Down
18 changes: 0 additions & 18 deletions cgen/Cargo.toml

This file was deleted.

34 changes: 0 additions & 34 deletions cgen/src/main.rs

This file was deleted.

Loading

0 comments on commit 9d18b19

Please sign in to comment.