Skip to content

Fix/issues 298 299#356

Merged
Abidoyesimze merged 2 commits into
Neurowealth:mainfrom
Mrwicks00:fix/issues-298-299
Jun 29, 2026
Merged

Fix/issues 298 299#356
Abidoyesimze merged 2 commits into
Neurowealth:mainfrom
Mrwicks00:fix/issues-298-299

Conversation

@Mrwicks00

Copy link
Copy Markdown
Contributor

Summary

Addresses two open issues in a single focused PR.


Issue #298scripts/verify-deployment.sh for post-deploy smoke checks

verify-deployment.sh already exists and satisfies all acceptance criteria
(reads devnet-contracts.env, checks get_version/init state, get_agent,
get_usdc_token, is_paused, exits non-zero on failure).

Gap fixed: deploy-devnet.sh was writing DEPLOYER_ADDRESS to the env
file but not OWNER_ADDRESS, which verify-deployment.sh requires as a
mandatory variable. After initialize() the deployer is the owner, so:

# scripts/deploy-devnet.sh — new line in save_contract_addresses()
OWNER_ADDRESS="$deployer_address"

The full flow ./scripts/deploy-devnet.sh && ./scripts/verify-deployment.sh
now runs without a missing required variable: OWNER_ADDRESS error.


Issue #299 — Reconcile TotalDeposits with share-based TotalAssets after yield

Design decision (already correct in code, now documented explicitly):

TotalDeposits is intentionally not synced when update_total_assets() is
called. It is a principal-only counter useful for off-chain reporting. All
on-chain economic calculations — share minting, user redemption, TVL cap
enforcement — use TotalAssets (principal + yield).

Field Updated by Includes yield? Used for
TotalDeposits deposit, withdraw No Principal bookkeeping only
TotalAssets deposit, withdraw, update_total_assets Yes Share pricing, TVL cap guard

Changes:

Regression coverage (all 4 tests pass):

  • test_tvl_cap_blocks_deposit_after_yield_accrual — cap check rejects deposits
    once TotalAssets (not TotalDeposits) exceeds the cap.
  • test_deposit_accepted_when_total_assets_plus_amount_within_cap — deposit
    accepted while TotalAssets remains below cap after yield.
  • test_deposit_yield_withdraw_cap_regression — full lifecycle: deposit → yield
    → withdraw → cap check.
  • test_total_assets_reflects_yield_while_total_deposits_stays_as_principal
    confirms TotalDeposits is unchanged by yield while TotalAssets grows.

Checklist

  • I have updated CHANGELOG.md under [Unreleased] for any contract behavior, event, or error-code changes.
  • If this PR bumps get_version(), the new version number is noted in CHANGELOG.md. (no version bump — documentation/script only)
  • I have confirmed the release entry matches the expected contract Version storage value. (N/A)
  • I have included tests or documentation updates for new contract behavior.
  • New or changed events are reflected in EVENTS.md. (no new events)

Closes #298
Closes #299

… and document TotalDeposits/TotalAssets relationship

Issue Neurowealth#298 – verify-deployment.sh smoke checks:
- deploy-devnet.sh now writes OWNER_ADDRESS to devnet-contracts.env so that
  verify-deployment.sh can run end-to-end without a missing-variable error.
  The deployer is the initial owner after initialize(), so OWNER_ADDRESS is
  set equal to DEPLOYER_ADDRESS in devnet environments.

Issue Neurowealth#299 – reconcile TotalDeposits with share-based TotalAssets after yield:
- Document the design decision explicitly: TotalDeposits is intentionally not
  synced on yield updates; it is a principal-only counter.  All cap guards and
  share-pricing use TotalAssets (already correct in code).
- Update lib.rs module-level storage doc and get_total_deposits() doc comment
  with a relationship table and a cross-reference to ARCHITECTURE.md.
- Update ARCHITECTURE.md section to reference issue Neurowealth#299, add the
  design-decision note, and link to the regression tests.
- Update test_total_assets_cap.rs module doc to reference Neurowealth#299 and state the
  design rationale inline for readers of the test file.
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Mrwicks00 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

@Mrwicks00

Copy link
Copy Markdown
Contributor Author

@Abidoyesimze check

@Abidoyesimze Abidoyesimze merged commit c995d3b into Neurowealth:main Jun 29, 2026
6 of 12 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

Development

Successfully merging this pull request may close these issues.

Reconcile TotalDeposits with share-based TotalAssets after yield Add scripts/verify-deployment.sh for post-deploy smoke checks

2 participants