Skip to content

fix: audit Makefile stale targets and remove gas_benchmark_hardhat.js - #1

Open
peterexcel494-oss wants to merge 1 commit into
mainfrom
fix/384-makefile-cleanup-remove-hardhat-benchmark
Open

fix: audit Makefile stale targets and remove gas_benchmark_hardhat.js#1
peterexcel494-oss wants to merge 1 commit into
mainfrom
fix/384-makefile-cleanup-remove-hardhat-benchmark

Conversation

@peterexcel494-oss

Copy link
Copy Markdown
Owner

Summary

Closes HubDApp#384

Audit of dongle-smartcontract/Makefile and scripts/gas_benchmark_hardhat.js as requested in issue HubDApp#384.


What was changed

dongle-smartcontract/Makefile

Issue Fix
soroban contract deploy (deprecated CLI) Replaced with stellar contract deploy in both deploy-testnet and deploy-local targets
Redundant cargo build in build target Removed — stellar contract build already compiles the crate to WASM; running both was wasteful and could produce confusing output
Hardcoded --source alice placeholder Replaced with $(DEPLOYER_IDENTITY) env-var; both deploy targets now guard against the variable being unset and print a descriptive error
Help text Updated to document the DEPLOYER_IDENTITY variable

All other Makefile targets (test, test-verbose, test-release, fmt, lint, check, clean, dev, ci) are valid and untouched.

scripts/gas_benchmark_hardhat.jsdeleted

The script is an EVM/Hardhat benchmark that:

  • Uses ethers.js / Hardhat (Node.js toolchain)
  • References 0x… Ethereum addresses
  • Measures gas units (an EVM concept, not applicable to Stellar fees)
  • Requires package.json, node_modules, and a hardhat.config.jsnone of which exist anywhere in this repository

The file was entirely non-functional in a pure-Rust Soroban repo and is removed.


Testing

  • No Rust source files were modified — existing cargo test suite is unaffected.
  • Makefile syntax verified manually; all targets resolve to valid cargo/stellar CLI commands.

…p#384)

- Replace deprecated `soroban contract deploy` with `stellar contract deploy`
  in deploy-testnet and deploy-local targets (soroban CLI was renamed)
- Remove redundant `cargo build` from the build target; `stellar contract build`
  already compiles the crate to WASM — running both was wasteful
- Replace hardcoded `--source alice` placeholder with `DEPLOYER_IDENTITY`
  env-var; targets now guard against an unset variable and print a clear error
- Update help text to document the DEPLOYER_IDENTITY variable
- Delete scripts/gas_benchmark_hardhat.js: the script targets an EVM/Hardhat
  toolchain (ethers.js, 0x Ethereum addresses, gas units) which has no relation
  to Soroban/Stellar. No package.json, node_modules, or hardhat config exists
  anywhere in the repository — the script was entirely non-functional.

Closes HubDApp#384
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.

Audit dongle-smartcontract/Makefile for stale targets referencing removed features

1 participant