Skip to content

Commit 63e37e5

Browse files
kariyclaude
andcommitted
Update Makefile contracts target to build VRF and AVNU contracts
Use `asdf exec scarb` for version management, build all three contract sets (main, VRF, AVNU) and copy artifacts to the shared build directory. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9842ce9 commit 63e37e5

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ CONTRACTS_CRATE := crates/contracts
2121
CONTRACTS_DIR := $(CONTRACTS_CRATE)/contracts
2222
CONTRACTS_BUILD_DIR := $(CONTRACTS_CRATE)/build
2323

24+
VRF_DIR := $(CONTRACTS_DIR)/vrf
25+
AVNU_DIR := $(CONTRACTS_DIR)/avnu/contracts
26+
27+
# The scarb version required by the AVNU contracts (no .tool-versions in that directory)
28+
AVNU_SCARB_VERSION := 2.11.4
29+
2430
# The `scarb` version that is required to compile the feature contracts in katana-contracts
2531
SCARB_VERSION := 2.8.4
2632

@@ -73,10 +79,16 @@ contracts: $(CONTRACTS_BUILD_DIR)
7379

7480
# Generate the list of sources dynamically to make sure Make can track all files in all nested subdirs
7581
$(CONTRACTS_BUILD_DIR): $(shell find $(CONTRACTS_DIR) -type f)
76-
@echo "Building contracts..."
77-
@cd $(CONTRACTS_DIR) && scarb build
78-
@mkdir -p build && \
79-
mv $(CONTRACTS_DIR)/target/dev/* $@ || { echo "Contracts build failed!"; exit 1; }
82+
@mkdir -p $@
83+
@echo "Building main contracts..."
84+
@cd $(CONTRACTS_DIR) && asdf exec scarb build || { echo "Main contracts build failed!"; exit 1; }
85+
@cp $(CONTRACTS_DIR)/target/dev/* $@
86+
@echo "Building VRF contracts..."
87+
@cd $(VRF_DIR) && asdf exec scarb build || { echo "VRF contracts build failed!"; exit 1; }
88+
@cp $(VRF_DIR)/target/dev/* $@
89+
@echo "Building AVNU contracts..."
90+
@cd $(AVNU_DIR) && ASDF_SCARB_VERSION=$(AVNU_SCARB_VERSION) asdf exec scarb build || { echo "AVNU contracts build failed!"; exit 1; }
91+
@cp $(AVNU_DIR)/target/dev/* $@
8092

8193
$(EXPLORER_UI_DIR):
8294
@echo "Initializing Explorer UI submodule..."

0 commit comments

Comments
 (0)