Skip to content

fix: resolve issues #887 #888 #889 #890 in treasury contract and backend - #993

Open
ahmadrabiumustapha wants to merge 1 commit into
WHEELBACK:mainfrom
ahmadrabiumustapha:fix/issues-887-888-889-890
Open

ahmadrabiumustapha wants to merge 1 commit into
WHEELBACK:mainfrom
ahmadrabiumustapha:fix/issues-887-888-889-890

Conversation

@ahmadrabiumustapha

Copy link
Copy Markdown
Contributor

#887 - deposit() now rejects all tokens when the allowlist is empty.
Previously the guard was if !allowlist.contains(&token) which passed
on an empty Vec, allowing any token. Changed to
if allowlist.is_empty() || !allowlist.contains(&token).

#888 - withdraw() now actually transfers tokens to the recipient.
The _to parameter was declared but never used; the token transfer
call was missing entirely. Renamed to to and added
token::Client::new(&e, &token).transfer(..., &to, &(amount as i128)).

#889 - executeSettlementWithBalanceCheck: fixed runtime crash caused by
res.locals.logger reference in the exported function (res is not in
scope outside the route handler). Replaced with console.info. Added
idempotency guard: if settlement.status === 'Executed' return early
instead of re-submitting.

#890 - After a failed submitContractCall the handler now re-fetches the
on-chain settlement status and treasury balance. If the balance dropped
but the settlement is still Pending it surfaces an EscrowBalanceMismatch
error (409) so the caller can reconcile rather than blindly re-executing.

Also: added missing TreasuryError variants to the enum (SettlementNotFound=15, SettlementExpired=16, NotDisputed=17, InvalidSettlementTtl=18) that were referenced in contract code but absent from the declaration, causing a compile-time error. Fixed missing closing paren on asyncHandler call in the execute-settlement route. Deduplicated .gitignore (removed repeated entries for playwright-report, playwright/.auth, vitest-report, .vite/, coverage/, html/, lcov.info).

Pull Request

Summary

  • Describe the purpose of this PR in one or two sentences.

Checklist

  • PR description includes: Closes #[issue_id]
  • Tests added or updated
  • ABI snapshot updated if contract sources changed (abis/ and COMEBACKHERE-contracts/)
  • Screenshots attached if UI changed
  • Documentation updated if needed

Notes

…CK#890 in treasury contract and backend

WHEELBACK#887 - deposit() now rejects all tokens when the allowlist is empty.
  Previously the guard was `if !allowlist.contains(&token)` which passed
  on an empty Vec, allowing any token. Changed to
  `if allowlist.is_empty() || !allowlist.contains(&token)`.

WHEELBACK#888 - withdraw() now actually transfers tokens to the recipient.
  The `_to` parameter was declared but never used; the token transfer
  call was missing entirely. Renamed to `to` and added
  `token::Client::new(&e, &token).transfer(..., &to, &(amount as i128))`.

WHEELBACK#889 - executeSettlementWithBalanceCheck: fixed runtime crash caused by
  `res.locals.logger` reference in the exported function (res is not in
  scope outside the route handler). Replaced with `console.info`. Added
  idempotency guard: if settlement.status === 'Executed' return early
  instead of re-submitting.

WHEELBACK#890 - After a failed submitContractCall the handler now re-fetches the
  on-chain settlement status and treasury balance. If the balance dropped
  but the settlement is still Pending it surfaces an EscrowBalanceMismatch
  error (409) so the caller can reconcile rather than blindly re-executing.

Also: added missing TreasuryError variants to the enum (SettlementNotFound=15,
SettlementExpired=16, NotDisputed=17, InvalidSettlementTtl=18) that were
referenced in contract code but absent from the declaration, causing a
compile-time error. Fixed missing closing paren on asyncHandler call in the
execute-settlement route. Deduplicated .gitignore (removed repeated entries
for playwright-report, playwright/.auth, vitest-report, .vite/, coverage/,
html/, lcov.info).
@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant