forked from Qortal/q-fund-v2
2.8 KiB
2.8 KiB
Q‑Fund v1.0.0 — Release Notes
Release date: 2025‑08‑23
Highlights
- Dual AT support (v1 refund / v2 non‑refund) with creator‑selectable payout policy.
- Awardee address field with validation and optional name resolution.
- Clear in‑app labeling of Status, Awardee, and Payout behavior.
- Robust dataBytes builder with canonical v1/v2 code bytes and ABI parity.
Changes
1) Dual Crowdfund AT Variants
- Added a variant toggle during creation: “Refund Donors (if goal not reached)”.
- Off (default) → v2 non‑refund: pays the awardee even if goal not met.
- On → v1 refund: refunds donors if the goal is not met.
- Implementation details:
- Pinned canonical codeBytes Base64 and codeHash:
- v1 (refund): codeHash
9gS2L74FdaG3zuEeYv815xVyHkhvLguq7ZGD6pf24i8F, length 167. - v2 (non‑refund): codeHash
HaqJBVVr9gZqgARZ5UZd7EU9ybyvVK2fCo9sx3gMMFsr, length 104.
- v1 (refund): codeHash
- ABI parity respected:
- Common:
[0..7]sleepMinutes,[8..15]goalAtoms (u64, big‑endian). - v1: write
PAYMENT(2) at[64..71]; awardee at[80..111]. - v2: awardee at
[48..79].
- Common:
- Creation parity: codeBytes are immutable; only dataBytes vary per deployment.
- Pinned canonical codeBytes Base64 and codeHash:
2) Awardee Address Input + Validation
- New optional Awardee field on the creation form.
- Defaults to creator’s address if left blank.
- Validates using
/addresses/validate/{address}. - If the input appears to be a Qortal name, resolves via
GET_NAME_DATAto the owner address, then validates. - Address encoding: Base58 decode is written into a 32‑byte slot; if the decoded length < 32 (typical 25 bytes), the remainder is zero‑filled for ABI compatibility.
3) In‑App Labels for Donors
- Crowdfund page now displays:
- Status (existing),
- Awardee (with optional name lookup via
GET_PRIMARY_NAME), - Payout behavior (v1 refund vs v2 non‑refund).
4) Technical: Centralized AT Builder
- Added
src/lib/at/crowdfund.tswith:- Pinned code bytes / codeHash constants,
- Variant‑aware
buildCrowdfundDataBytes()using big‑endian u64 writes, qortToAtoms()utility,- Optional
assertCreationParity()to verify codeBytes hash fromcreationBytes.
Also included since last pre‑release
-
Fix back button
- Ensures consistent navigation back to the homepage and avoids stale state when returning from crowdfund details.
-
Add multiple name support
- Accounts with multiple registered names are now supported. We load and show the primary name while retaining the full list for selection.
Developer Notes
- When adding new variants in future, keep codeBytes immutable and adjust only dataBytes offsets.
- Unit tests recommended for:
- BE u64 writes for sleep/goal,
- v1 payment type constant at byte 64,
- awardee placement offsets per variant,
- codeHash parity via
assertCreationParity().