Skip to content

feat(contracts): implement issues #93, #94, #95, #96 — dispute sync, TTL, storage optimization, upgradeability#223

Merged
soomtochukwu merged 2 commits into
DXmakers:mainfrom
Cybermaxi7:feat/contracts-93-96
Apr 23, 2026
Merged

feat(contracts): implement issues #93, #94, #95, #96 — dispute sync, TTL, storage optimization, upgradeability#223
soomtochukwu merged 2 commits into
DXmakers:mainfrom
Cybermaxi7:feat/contracts-93-96

Conversation

@Cybermaxi7
Copy link
Copy Markdown
Contributor

Summary

This PR implements four improvements to the Soroban smart contracts.

Closes #93 — Cross-contract dispute sync (Escrow → JobRegistry)

  • EscrowContract::sync_dispute_to_job_registry calls JobRegistryClient::mark_job_disputed on dispute open
  • Added set_job_registry admin setter and JobRegistryClient cross-contract client in escrow
  • Tests cover the sync path via local integration with the job_registry crate

Closes #94 — TTL / storage fee handling

  • bump_instance_ttl and bump_job_ttl helpers added to escrow and job_registry
  • bump_instance_ttl + per-profile TTL extension added to reputation (read + write paths)
  • TTL thresholds use LEDGER_THRESHOLD / LEDGER_BUMP constants (150 000 / 200 000 ledgers)

Closes #95 — Storage layout optimization

  • Lazy Bids(job_id) allocation in job_registry: vector only created on first bid
  • Reputation contract unified to a single Profile(address) key (removed separate score storage)
  • set_job_registry admin check prevents redundant writes

Closes #96 — Upgradeability pattern

  • All three contracts (escrow, job_registry, reputation) expose an upgrade(caller, new_wasm_hash) entry point
  • Uses env.deployer().update_current_contract_wasm()
  • Admin-gated; emits ContractUpgradedEvent
  • job_registry includes full upgrade-admin lifecycle (init_upgrade_admin, set_upgrade_admin, get_upgrade_admin)

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 23, 2026

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

@soomtochukwu soomtochukwu merged commit 2ca5331 into DXmakers:main Apr 23, 2026
3 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