Problem
The refund processing fee is hardcoded as a compile-time constant:
const REFUND_FEE_BPS: i128 = 100; // 1% — lib.rs line 16
This cannot be changed post-deployment without a full contract upgrade. As business requirements evolve (promotions, regulatory changes, tiered merchants), the inability to adjust fees is a significant operational limitation.
Proposed Solution
Store refund_fee_bps in instance storage, initialized during initialize_refund_manager and updatable by admin.
DataKey::RefundFeeBps // instance storage key
Add:
set_refund_fee_bps(env, admin, bps: i128) — admin-only setter
get_refund_fee_bps(env) → i128 — public getter
Acceptance Criteria
Branch & Commit Examples
branch: feat/configurable-refund-fee
commit: feat(refund-manager): make refund fee bps admin-configurable via instance storage
Problem
The refund processing fee is hardcoded as a compile-time constant:
This cannot be changed post-deployment without a full contract upgrade. As business requirements evolve (promotions, regulatory changes, tiered merchants), the inability to adjust fees is a significant operational limitation.
Proposed Solution
Store
refund_fee_bpsin instance storage, initialized duringinitialize_refund_managerand updatable by admin.Add:
set_refund_fee_bps(env, admin, bps: i128)— admin-only setterget_refund_fee_bps(env)→i128— public getterAcceptance Criteria
REFUND_FEE_BPSconstant is replaced by a storage-backed valueset_refund_fee_bpsrequires admin auth and validates0 <= bps <= 1000(max 10%)get_refund_fee_bpsis publicly readableprocess_refundreads from storage rather than the constantCHANGELOG.mdnotes this as a storage key change (bumps version if storage layout changes)Branch & Commit Examples