Skip to content

Keep DataKey and event types in sync with the contract #17

Description

@N-thnI

Description

Document and guard the coupling between SDK types and the on-chain contract.

Problem Statement

src/types/index.ts mirrors DataKey from vero-core-contracts/src/contracts/storage_layout.rs. Nothing currently detects drift between them. If the contract renames a key, the SDK keeps writing the old one and silently orphans on-chain entries — a failure with no error message anywhere.

Proposed Changes

  • Document the mirroring relationship in src/types/index.ts, naming the source file
  • Add a check — script or test — that fails if the contract's key names diverge from the SDK's
  • Note the update procedure in CONTRIBUTING.md

Technical Implementation Scaffolding

  • Target Repository: vero-sdk
  • Target Path: src/types/index.ts
  • Branch Naming: chore/issue--datakey-sync-guard
  • Authority Context: Correctness — on-chain data compatibility

Acceptance Criteria

  • A rename in the contract causes a detectable failure rather than silent drift
  • The procedure is documented
  • npm test, npm run typecheck, npm run lint, and npm run build all pass

Definition of Done

  • Reviewed by lead maintainer
  • Pull request merged via verified status check

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions