All notable changes to the Finchippay-Solution smart contract will be documented in this file.
- #69: soroban-sdk v20 → v27.0.1 — Upgraded the Soroban SDK to the latest stable release.
- Updated build target to
wasm32v1-none(required by soroban-sdk v27+). - Migrated
register_contract→registerwith new signature(contract, salt). - Migrated
register_stellar_asset_contract→register_stellar_asset_contract_v2which returnsStellarAssetContractinstead ofAddress. - Added
testutils::Ledgerimport forwith_muton test ledger. - Guarded
bump()call inrequire_not_pausedwith.has()check — soroban-env-host v27 panics onextend_ttlfor non-existent keys.
- Updated build target to
- Updated escrow test amounts to meet
MIN_ESCROW_AMOUNT(1,000 base units). - Fixed stream overflow safety test to advance enough ledgers for full deposit coverage.
- Deprecation warnings: 25
publishdeprecation warnings remain from pre-existing code. Migration to#[contractevent]macro is tracked separately; suppressed with#[allow(deprecated)]on the test module. - Testnet deployment: Not verified in this environment; pending manual verification via
scripts/deploy-contract.sh.
- #1: Initialization guard — Added
require_initialized()guard to all operational entry points (send_tip,mint_receipt,create_escrow,open_stream,create_multisig,batch_send). Prevents use of the contract beforeinitialize()is called. - #2: Batch size enforcement — Added
MAX_BATCH_SIZEconstant (50 recipients) and validation inbatch_sendto prevent DoS via oversized batch operations. - #3: Duplicate signer detection —
create_multisignow rejects signer lists containing duplicate addresses, preventing threshold spoofing attacks. - #4: Self-tipping prevention —
send_tipnow rejects transfers wherefrom == to, preventing on-chain stat inflation. - #5: Self-escrowing prevention —
create_escrownow rejects transfers wherefrom == to, preventing state bloat from self-escrows. - #6: Atomic batch pre-validation —
batch_sendvalidates all amounts are positive before initiating any token transfers, ensuring atomicity. - #16: Self-streaming prevention —
open_streamnow rejects streams wherepayer == recipient. - #17: Self-multisig prevention —
create_multisignow rejects proposals whereproposer == recipient. - #18: Minimum amount enforcement — Added
MIN_ESCROW_AMOUNTandMIN_MULTISIG_AMOUNT(1,000 base units) to prevent dust attacks. - #22: Empty input validation — Rejects empty signers lists in
create_multisigand empty recipient arrays inbatch_send. - #23: Memo length validation — Added
MAX_MEMO_LENGTH(32 chars) and enforcement inmint_receipt.
- #7: RBAC pauser role — Introduced a separate
Pauserrole viaset_pauser()/get_pauser(). The pauser can callpause()andunpause()without holding admin upgrade rights. - #12: Approval progress in events —
multisig_approveevent now emits(signer, current_approvals, threshold)for real-time indexer tracking. - #13: Escrow recipient index — Added
get_user_escrows(recipient)andEscrowByRecipientstorage key for querying all escrows directed to an address. - #14: Multi-sig expiration — Added
expiration_ledgerfield andtimeout_multisig()function. Expired proposals can be closed by anyone, refunding locked funds. - #15: Recipient stream rejection — Added
reject_stream()allowing recipients to opt out of incoming streams for compliance or personal reasons. - #19: Partial escrow claims — Added
claim_escrow_partial(id, amount)supporting incremental withdrawals from escrows. - #20: Memo support — Added optional
memo: Symbolfield toTipRecord,Escrow,send_tip(), andcreate_escrow(). - #21: Admin token rescue — Added
rescue_tokens()to sweep accidentally-sent tokens from the contract address. - #25: Stream recipient transfer — Added
transfer_stream()allowing recipients to reassign incoming streams to a new address. - Diagnostic endpoint — Added
get_contract_stats()returning(escrow_count, stream_count, multisig_count)for monitoring dashboards.
- #8: Extended error enum — Added
SelfTransfer,BatchTooLarge,DuplicateSigner, andProposalExpiredvariants toContractError. - #9/#10: DRY helpers — Introduced
get_token_client()helper for token client instantiation, adopted across all 15+ call sites in production code. - #11: Iterator usage — Replaced manual for-loop indexing in
approve_multisigwith idiomatic.iter().any()closures.
- #21: Pause/circuit-breaker tests — Added 3 tests verifying
send_tip,create_escrow, andopen_streamare blocked when paused. - #22/#24: Batch send & stream rejection tests — Added success and error-path tests for
batch_sendandreject_stream. - #23: Stream overflow safety — Added test verifying claimable amount caps at deposit for extreme ledger values.
- #24: Escrow boundary tests — Added tests for
MAX_ESCROW_LEDGERSenforcement and minimum amount rejection. - #25: Initialization guard tests — Added tests verifying
send_tipandcreate_escrowpanic before initialization. - Multi-sig tests — Added tests for duplicate signer rejection, proposal timeout/expiry, and minimum amount enforcement.
- Partial escrow tests — Added test verifying incremental claim lifecycle from Pending to Released.
- Contract stats test — Added test verifying aggregate counts are correctly reported.
- Self-transfer tests — Added tests verifying self-tipping and self-escrowing panics.
send_tip()now requires amemo: Symbolparameter.create_escrow()now requires amemo: Symbolparameter.create_multisig()now requires anexpiration_ledger: u32parameter (pass 0 for no expiration).pause()andunpause()parameter renamed fromadmintocaller(supports either admin or pauser).CONTRACT_VERSIONbumped from 2 to 3.
- Updated
contracts/finchippay-contract/README.mdwith all new functions, security features, and event emissions.
- Initial production-grade Soroban contract with tips, receipts, escrow, streaming, multi-sig, batch send, pause/unpause, and upgrade functionality.