Skip to content

fix(makefile): use optimized wasm for typescript bindings and contract deployment (Fixes #866) - #891

Closed
kleitonbernardino-lab wants to merge 1 commit into
MergeFi:mainfrom
kleitonbernardino-lab:fix/bindings-optimized-wasm-866
Closed

kleitonbernardino-lab wants to merge 1 commit into
MergeFi:mainfrom
kleitonbernardino-lab:fix/bindings-optimized-wasm-866

Conversation

@kleitonbernardino-lab

Copy link
Copy Markdown

Summary

Fixes #866.

make build runs stellar contract optimize --wasm ..., which produces <contract>.optimized.wasm. However, make bindings was previously reading from the raw unoptimized *.wasm file, causing generated TypeScript bindings (and published release artifacts) to reflect an artifact different from what is actually deployed.

In addition, the example deploy recipes and integration flow script were referencing the unoptimized binary.

Changes

  1. Makefile (bindings): Point stellar contract bindings typescript --wasm at $(WASM_DIR)/$$(echo $$c | tr - _).optimized.wasm.
  2. Makefile (build): Assert that *.optimized.wasm exists following optimization to fail fast if optimization fails.
  3. Makefile (deploy targets): Update deploy-escrow, deploy-milestones, and deploy-maintenance-pool to deploy the optimized .optimized.wasm binary.
  4. scripts/examples/deposit-withdraw-flow.sh: Default WASM_PATH to target/wasm32v1-none/release/mergefi_maintenance_pool.optimized.wasm.

Verification

  • Audited Makefile syntax and tab indentation.
  • Verified path consistency with ci.yml wasm build and release steps.

…t deployment (Fixes MergeFi#866)

Update make bindings to generate TypeScript contract bindings from the optimized WASM artifacts (*.optimized.wasm) instead of the unoptimized raw binaries produced by cargo build. Also update deploy targets and example integration script to reference optimized binaries, and add an assertion in make build ensuring optimized WASM exists after optimization.

Fixes MergeFi#866

Signed-off-by: Kleiton Bernardino <kleiton.bernardino@gmail.com>
@vercel

vercel Bot commented Nov 12, 2026

Copy link
Copy Markdown

@kleitonbernardino-lab is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@chonilius chonilius closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make bindings generates TypeScript bindings from the unoptimized .wasm, not the *.optimized.wasm its own build step produces

2 participants