Skip to content

docs(#210): sync README interface with current mint_wrap signature - #621

Merged
Calebux merged 4 commits into
zintarh:mainfrom
web3nova:feat/210-readme-mint-signature
Aug 7, 2026
Merged

docs(#210): sync README interface with current mint_wrap signature#621
Calebux merged 4 commits into
zintarh:mainfrom
web3nova:feat/210-readme-mint-signature

Conversation

@web3nova

@web3nova web3nova commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Closes #210

Summary

The README documented an older mint flow: mint_wrap was missing the payload_version parameter, the signature-payload description used a stale 0x01 version byte layout, and the CLI example omitted --payload_version.

Changes

  • Public interface / Write methods: corrected mint_wrap to mint_wrap(e, user, period, archetype, data_hash, payload_version, signature) and added the currently-exposed write methods that were missing (mint_wrap_batch, revoke_wrap, transfer_wrap, expire_wrap, upgrade).
  • Mint signature payload versioning: replaced the obsolete 0x01 version byte description with the actual encoding — MINT_DOMAIN_SEPARATOR ("stellar-wrap-v1" raw bytes) followed by XDR(payload_version), XDR(contract_id), XDR(user), XDR(period), XDR(archetype), XDR(data_hash) — and linked docs/signing-payload.md as the full reference.
  • Step 4: Mint your first wrap: documents user, period, archetype, data_hash, payload_version, signature in the correct order and adds --payload_version 1 to both the sign and invoke CLI examples.

Acceptance criteria

  • README lists the exact public function signatures exposed by the contract client.
  • The minting section explains user, period, archetype, data_hash, and signature in the correct order.
  • No obsolete three-argument mint_wrap examples remain.

Verification

Docs-only change; cargo test → 175 passed / 0 failed / 1 ignored + 1 integration test unchanged.

Note: branch stacked on #618 (baseline SDK 27 repair) so CI can compile.

EmannuellaO and others added 4 commits August 1, 2026 07:41
…revoke

Add a persistent per-user last-updated marker (DataKey::LastUpdated)
that records the ledger timestamp of the most recent successful mint
(mint_wrap / mint_wrap_batch) or revoke. Expose it via a new
get_last_updated query and cover it with monotonicity tests.

The baseline main branch did not compile against Soroban SDK 27 (broken
merge ec4e11a plus pre-existing drift), so this change also repairs the
crate to green: FSM transitions (Draft/Pending->Expired, Active->Pending
for bridging), strict expiry deadline semantics, updated contract-error
codes in tests, stake tests now set an explicit ledger timestamp (SDK 27
defaults it to 0), SDK 27 event-buffer reset handling, and clippy/fmt/doc
cleanliness (-D warnings).
An all-zero Ed25519 public key has no known private key, so accepting it
would silently brick every future mint_wrap call while leaving the
contract in an initialized state. Reject it at initialize time with a new
InvalidAdminPubKey error and cover the behavior with tests:
- zero admin pubkey is rejected (Error(Contract, zintarh#52))
- a rejected zero-key attempt leaves the contract uninitialized so a
  valid initialize still succeeds
Add verify_data_succeeds_with_representative_large_payload, which mints a
wrap for a ~260KB off-chain JSON-style report and asserts:
- verify_data returns true for the exact bytes,
- the monotonic cpu budget grows,
- the ComputeSha256Hash cost tracker reports the full payload as hashed
  input, so large payloads do not surprise budget or hash behavior.
The README documented the older mint flow:
- mint_wrap was missing the payload_version parameter (now
  mint_wrap(user, period, archetype, data_hash, payload_version, signature))
- the signature-payload description used a stale '0x01 version byte'
  layout instead of the real MINT_DOMAIN_SEPARATOR + XDR(fields) encoding
- the CLI example omitted --payload_version

Update the public-interface write-method list to the exact current
signatures (also adding mint_wrap_batch, revoke_wrap, transfer_wrap,
expire_wrap, upgrade), document the canonical versioned payload, and fix
the mint example to pass payload_version in the correct order.
@drips-wave

drips-wave Bot commented Aug 1, 2026

Copy link
Copy Markdown

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

@Calebux
Calebux merged commit 920ce12 into zintarh:main Aug 7, 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.

docs: Sync README interface with current mint_wrap signature

3 participants