Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following dependencies are required for the templates:

* `git`, `make`, `sed`, `bash`, `shasum` and others Unix utilities. Refer to the documentation for your operating systems for how to install them. Chances are your system might already have them.
* `Rust`: latest stable Rust installed via [rustup](https://rustup.rs/) should work. Make sure you have `riscv64` target installed via: `rustup target add riscv64imac-unknown-none-elf`
* `Clang`: make sure you have clang 18+ installed, sample installtion steps for selected platforms are:
* `Clang`: make sure you have clang 18+ installed, sample installation steps for selected platforms are:
+ Debian / Ubuntu: `wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh`
+ Fedora 39+: `sudo dnf -y install clang`
+ Archlinux: `sudo pacman --noconfirm -Syu clang`
Expand Down Expand Up @@ -144,10 +144,10 @@ $ make generate TEMPLATE=c-wrapper-crate DESTINATION=crates # generate a crat

Ready-to-use templates have been put together for different use cases:

* `contract`: default contract template you should use if no special requirements are neeeded.
* `contract`: default contract template you should use if no special requirements are needed.
* `stack-reorder-contract`: a contract template that adjusts memory layout so stack lives at lower address, and heap lives at higher address. This way a program would explicitly signal errors when stack space is fully use.
* `c-wrapper-crate`: a crate template that shows how to glue C code in a Rust crate for CKB's contract usage.
* `x64-simulator-crate`: a crate template that contains Rust-only code, but usees [ckb-x64-simulator](https://github.com/nervosnetwork/ckb-x64-simulator) for tests.
* `x64-simulator-crate`: a crate template that contains Rust-only code, but uses [ckb-x64-simulator](https://github.com/nervosnetwork/ckb-x64-simulator) for tests.

There are also deprecated templates kept for historical reasons.

Expand Down
4 changes: 2 additions & 2 deletions atomics-contract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
CARGO_ARGS :=
MODE := release
# Tweak this to change the clang version to use for building C code. By default
# we use a bash script with somes heuristics to find clang in current system.
# we use a bash script with some heuristics to find clang in current system.
CLANG := $(shell $(TOP)/scripts/find_clang)
AR := $(subst clang,llvm-ar,$(CLANG))
# When this is set to some value, the generated binaries will be copied over
Expand Down Expand Up @@ -61,7 +61,7 @@ fmt:
# Arbitrary cargo command is supported here. For example:
#
# make cargo CARGO_CMD=expand CARGO_ARGS="--ugly"
#
#
# Invokes:
# cargo expand --ugly
CARGO_CMD :=
Expand Down
4 changes: 2 additions & 2 deletions contract-without-simulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
CARGO_ARGS :=
MODE := release
# Tweak this to change the clang version to use for building C code. By default
# we use a bash script with somes heuristics to find clang in current system.
# we use a bash script with some heuristics to find clang in current system.
CLANG := $(shell $(TOP)/scripts/find_clang)
AR := $(subst clang,llvm-ar,$(CLANG))
OBJCOPY := $(subst clang,llvm-objcopy,$(CLANG))
Expand Down Expand Up @@ -64,7 +64,7 @@ fmt:
# Arbitrary cargo command is supported here. For example:
#
# make cargo CARGO_CMD=expand CARGO_ARGS="--ugly"
#
#
# Invokes:
# cargo expand --ugly
CARGO_CMD :=
Expand Down
4 changes: 2 additions & 2 deletions contract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
CARGO_ARGS :=
MODE := release
# Tweak this to change the clang version to use for building C code. By default
# we use a bash script with somes heuristics to find clang in current system.
# we use a bash script with some heuristics to find clang in current system.
CLANG := $(shell $(TOP)/scripts/find_clang)
AR := $(subst clang,llvm-ar,$(CLANG))
OBJCOPY := $(subst clang,llvm-objcopy,$(CLANG))
Expand Down Expand Up @@ -64,7 +64,7 @@ fmt:
# Arbitrary cargo command is supported here. For example:
#
# make cargo CARGO_CMD=expand CARGO_ARGS="--ugly"
#
#
# Invokes:
# cargo expand --ugly
CARGO_CMD :=
Expand Down
4 changes: 2 additions & 2 deletions stack-reorder-contract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS) \
CARGO_ARGS :=
MODE := release
# Tweak this to change the clang version to use for building C code. By default
# we use a bash script with somes heuristics to find clang in current system.
# we use a bash script with some heuristics to find clang in current system.
CLANG := $(shell $(TOP)/scripts/find_clang)
AR := $(subst clang,llvm-ar,$(CLANG))
# When this is set to some value, the generated binaries will be copied over
Expand Down Expand Up @@ -72,7 +72,7 @@ fmt:
# Arbitrary cargo command is supported here. For example:
#
# make cargo CARGO_CMD=expand CARGO_ARGS="--ugly"
#
#
# Invokes:
# cargo expand --ugly
CARGO_CMD :=
Expand Down
4 changes: 2 additions & 2 deletions standalone-contract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
CARGO_ARGS :=
MODE := release
# Tweak this to change the clang version to use for building C code. By default
# we use a bash script with somes heuristics to find clang in current system.
# we use a bash script with some heuristics to find clang in current system.
CLANG := $(shell $(TOP)/scripts/find_clang)
AR := $(subst clang,llvm-ar,$(CLANG))
# When this is set to some value, the generated binaries will be copied over
Expand Down Expand Up @@ -62,7 +62,7 @@ fmt:
# Arbitrary cargo command is supported here. For example:
#
# make cargo CARGO_CMD=expand CARGO_ARGS="--ugly"
#
#
# Invokes:
# cargo expand --ugly
CARGO_CMD :=
Expand Down
2 changes: 1 addition & 1 deletion workspace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CUSTOM_RUSTFLAGS := -C debug-assertions
CARGO_ARGS :=
MODE := release
# Tweak this to change the clang version to use for building C code. By default
# we use a bash script with somes heuristics to find clang in current system.
# we use a bash script with some heuristics to find clang in current system.
CLANG := $(shell $(TOP)/scripts/find_clang)
# When this is set, a single contract will be built instead of all contracts
CONTRACT :=
Expand Down
Loading