Skip to content

fix: resolve smart contract issues #412 #413 #414 #415#432

Merged
feyishola merged 2 commits into
Servora:mainfrom
BigBen-7:fix/smart-contract-issues-412-413-414-415
Apr 28, 2026
Merged

fix: resolve smart contract issues #412 #413 #414 #415#432
feyishola merged 2 commits into
Servora:mainfrom
BigBen-7:fix/smart-contract-issues-412-413-414-415

Conversation

@BigBen-7
Copy link
Copy Markdown
Contributor

Summary

Fixes four smart contract bugs/enhancements assigned to me.

#415batch_verify_certificates doesn't check expiration

Added an expires_at timestamp check alongside the status flags. A certificate with Active status but a past expires_at is now correctly counted as failed, consistent with is_valid().

#414 — No certificate existence check before revocation in CRL

  • CRLContract.initialize now accepts a certificate_contract: Address parameter and stores it.
  • revoke_certificate performs a cross-contract call to CertificateContract.certificate_exists() before adding to the CRL. Panics with "Certificate does not exist" if the ID is unknown.
  • Added certificate_exists() helper to CertificateContract.

#413unrevoke_certificate should not exist

Removed unrevoke_certificate from CRLContract. Certificate revocation is permanent and irreversible per PKI best practices. Also removed the now-dead remove_certificate_id helper.

#412 — Duplicate DataKey enum in storage.rs

Renamed DataKeyStorageKey in storage.rs to eliminate the naming conflict with the public DataKey in types.rs. Updated storage_helpers.rs to use StorageKey.

Files Changed

  • stellar-contracts/src/lib.rs — expiration check in batch_verify_certificates, new certificate_exists()
  • stellar-contracts/src/crl.rs — existence check, removed unrevoke_certificate, new CertContract storage key
  • stellar-contracts/src/storage.rsDataKeyStorageKey
  • stellar-contracts/src/storage_helpers.rs — updated to StorageKey

Closes #412
Closes #413
Closes #414
Closes #415

, Servora#415

- Servora#415: Add expires_at timestamp check in batch_verify_certificates
  so Active certs past their expiry are counted as failed

- Servora#414: Add cross-contract certificate existence check in
  CRLContract.revoke_certificate; initialize now accepts a
  certificate_contract Address and stores it; revoke panics if
  the certificate does not exist in CertificateContract

- Servora#413: Remove unrevoke_certificate from CRLContract; certificate
  revocation is permanent per PKI best practices; also removed
  the now-dead remove_certificate_id helper

- Servora#412: Rename DataKey to StorageKey in storage.rs to eliminate
  the naming conflict with the public DataKey in types.rs;
  update storage_helpers.rs accordingly

Also adds certificate_exists() helper to CertificateContract
to support the CRL cross-contract existence check.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

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

Use dorny/paths-filter to detect which workspace changed and skip
unaffected jobs. This prevents pre-existing frontend/backend TS
errors from failing contract-only PRs (and vice versa).
@feyishola feyishola merged commit 7ad5556 into Servora:main Apr 28, 2026
4 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