Skip to content

fix(SC-036): enforce expiry in multisig sign/execute; handle expires_at==0#436

Merged
devEunicee merged 1 commit into
devEunicee:mainfrom
georgeefaith:fix/214-multisig-expiry
Jun 27, 2026
Merged

fix(SC-036): enforce expiry in multisig sign/execute; handle expires_at==0#436
devEunicee merged 1 commit into
devEunicee:mainfrom
georgeefaith:fix/214-multisig-expiry

Conversation

@georgeefaith

Copy link
Copy Markdown
Contributor

Summary

Closes #214

sign_multisig_payment and execute_multisig_payment both checked expires_at but did not handle the expires_at == 0 case. Because env.ledger().timestamp() > 0 is always true, any multisig with expires_at == 0 would immediately return PaymentExpired.

Changes

lib.rs

  • sign_multisig_payment: when ms.expires_at == 0, compute effective expiry as ms.created_at + DefaultMultisigExpiry before the comparison.
  • execute_multisig_payment: same fix.

test.rs

  • Adds test_multisig_zero_expires_at_applies_default_expiry:
    • Signs within the 24-hour default window → succeeds
    • Execute after the window → returns PaymentExpired

The existing test_multisig_payment_expiry already covers the expired-sign and expired-execute paths for a normally-set expires_at.

Testing

cargo test test_multisig

…at==0

- sign_multisig_payment and execute_multisig_payment both checked expires_at
  but treated expires_at==0 as 'always expired' (timestamp > 0 is always true)
- Fix: when expires_at==0, compute effective expiry as
  created_at + DefaultMultisigExpiry config value
- Add test_multisig_zero_expires_at_applies_default_expiry covering:
  - signing succeeds within the default 24-hour window
  - execute returns PaymentExpired after the window

Closes devEunicee#214
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

@devEunicee devEunicee merged commit 18e2e64 into devEunicee:main Jun 27, 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.

SC-036 · No expiry enforcement on multisig payments

2 participants