diff --git a/contracts/Makefile b/contracts/Makefile index 6f23b2df37..3ba77ac8d8 100644 --- a/contracts/Makefile +++ b/contracts/Makefile @@ -1,4 +1,4 @@ -SUBDIRS := alice bob transfer stake governance license +SUBDIRS := stake-types transfer-types alice bob transfer stake governance license all: $(SUBDIRS) ## Build all the contracts diff --git a/contracts/stake-types/Makefile b/contracts/stake-types/Makefile new file mode 100644 index 0000000000..ab50914d0b --- /dev/null +++ b/contracts/stake-types/Makefile @@ -0,0 +1,28 @@ +all: ## Build the transfer contract + @cargo build --release + +help: ## Display this help screen + @grep -h \ + -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ + awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +check: wasm ## Run the Rust check on the project features + @cargo check --target wasm32-unknown-unknown + @cargo check + +test: ## Perform the contract tests defined in the host module + @cargo test --release + +wasm: ## Build the WASM files + @RUSTFLAGS="$(RUSTFLAGS) --remap-path-prefix $(HOME)= -C link-args=-zstack-size=65536" \ + cargo +dusk build \ + --release \ + --color=always \ + -Z build-std=core,alloc \ + --target wasm64-unknown-unknown + +clippy: ## Run clippy + @cargo clippy --all-features --release -- -D warnings + @cargo clippy -Z build-std=core,alloc --release --target wasm32-unknown-unknown -- -D warnings + +.PHONY: all check test wasm help diff --git a/contracts/transfer-types/Cargo.toml b/contracts/transfer-types/Cargo.toml index 320d55f7ca..2226c79221 100644 --- a/contracts/transfer-types/Cargo.toml +++ b/contracts/transfer-types/Cargo.toml @@ -9,5 +9,5 @@ dusk-bls12_381 = { version = "0.12", default-features = false, features = ["rkyv dusk-jubjub = { version = "0.13", default-features = false, features = ["rkyv-impl"] } dusk-poseidon = { version = "0.31", default-features = false, features = ["rkyv-impl", "alloc"] } phoenix-core = { version = "0.21", default-features = false, features = ["rkyv-impl", "alloc"] } -rkyv = { version = "0.7", default-features = false } +rkyv = { version = "0.7", default-features = false, features = ["size_32"] } bytecheck = { version = "0.6", default-features = false } diff --git a/contracts/transfer-types/Makefile b/contracts/transfer-types/Makefile new file mode 100644 index 0000000000..ab50914d0b --- /dev/null +++ b/contracts/transfer-types/Makefile @@ -0,0 +1,28 @@ +all: ## Build the transfer contract + @cargo build --release + +help: ## Display this help screen + @grep -h \ + -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ + awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +check: wasm ## Run the Rust check on the project features + @cargo check --target wasm32-unknown-unknown + @cargo check + +test: ## Perform the contract tests defined in the host module + @cargo test --release + +wasm: ## Build the WASM files + @RUSTFLAGS="$(RUSTFLAGS) --remap-path-prefix $(HOME)= -C link-args=-zstack-size=65536" \ + cargo +dusk build \ + --release \ + --color=always \ + -Z build-std=core,alloc \ + --target wasm64-unknown-unknown + +clippy: ## Run clippy + @cargo clippy --all-features --release -- -D warnings + @cargo clippy -Z build-std=core,alloc --release --target wasm32-unknown-unknown -- -D warnings + +.PHONY: all check test wasm help