Skip to content

Maintenance: Storage optimization, shared zero-address helper, and Docker v2 support - #722

Merged
JSE19 merged 4 commits into
JSE-ORG:mainfrom
Musab1258:maintenance/cleanup-and-optimizations-611-614
Jul 30, 2026
Merged

Maintenance: Storage optimization, shared zero-address helper, and Docker v2 support#722
JSE19 merged 4 commits into
JSE-ORG:mainfrom
Musab1258:maintenance/cleanup-and-optimizations-611-614

Conversation

@Musab1258

Copy link
Copy Markdown
Contributor

Summary

This PR addresses four distinct issues related to performance, code quality, and developer experience:

Related Issues:

Testing

  • All new code is covered by unit tests where applicable.
  • Existing tests pass locally (cargo test). Note: Verified that 2 pre-existing errors in admin.rs and instructions.rs are unrelated to these changes.
  • Updated integration tests to use the new shared zero_address helper.

Documentation

  • Updated docstrings/comments for new/modified functions.
  • Removed stale documentation regarding the "vault accumulation" fee model.

Code Quality

  • Follows the project's coding style and conventions.
  • Variables and functions are named descriptively.
  • Code is properly formatted (cargo fmt).
  • No new clippy warnings (cargo clippy).

Breaking Changes

  • If this PR introduces breaking changes, describe them and provide migration steps.
  • Updated version in Cargo.toml if appropriate (following semver).

Additional Notes

  • Reviewers should note that the Makefile update uses a dynamic check (shell command -v ...) to maintain backward compatibility for developers on older environments.
  • The zero_address helper uses the existing ZERO_ADDRESS_STR constant to ensure address consistency across the contract.

Add runtime detection for docker compose (v2) with fallback to docker-compose (v1). Introduce overridable DOCKER_COMPOSE variable used by both docker-up and docker-down targets.
Add pub(crate) zero_address helper to lib.rs to consolidate the construction of zero addresses. Replace five manual instances across admin.rs and internal.rs with crate::zero_address(). Update related test files to use the shared helper and remove redundant local definitions.
Replace the obsolete 'deduct_and_transfer' function name with 'transfer_with_protocol_fee' in the test_sep41 module documentation. This cleans up the final remaining reference to the old fee collection behavior.
Optimize persistent storage access by removing the redundant existence check. Replace the consecutive has() and get().unwrap() calls with a single get() match statement, preserving identical fallback behavior and TTL extension logic while reducing I/O operations.
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Musab1258 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@JSE19
JSE19 merged commit 075a2ec into JSE-ORG:main Jul 30, 2026
3 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants