Skip to content

feat: direct payment to organizer for non-refundable tickets#20

Merged
dadadave80 merged 6 commits into
devfrom
feat/direct-payment-to-organizer
Apr 3, 2026
Merged

feat: direct payment to organizer for non-refundable tickets#20
dadadave80 merged 6 commits into
devfrom
feat/direct-payment-to-organizer

Conversation

@dadadave80
Copy link
Copy Markdown
Member

@dadadave80 dadadave80 commented Apr 3, 2026

Summary

  • Non-refundable ticket purchases now send the ticket fee directly to the organizer instead of escrowing in the contract. For ERC20 payments, the transfer is split: ticket fee to organizer, platform fee to the contract.
  • Refundable tickets continue to escrow all funds as before.
  • Expanded marketplace test suite from 8 to 58 tests covering both direct payment and refundable escrow flows across ETH, USDT, and USDC, including revert cases and mixed scenarios.
  • Cleaned up unused imports in deploy scripts and refactored test helpers.

Test plan

  • All 89 tests pass (forge test) — 58 marketplace, 15 ticket, 13 factory, 3 check-in
  • Verify direct ETH payment reaches organizer wallet on testnet
  • Verify direct ERC20 payment splits correctly (fee to organizer, hostIt fee to contract)
  • Verify refundable ticket flow still escrows funds correctly
  • Verify withdrawHostItBalance works for all fee types after direct payment

Remove unused imports from deploy scripts, extract fee constants,
inline facet deployment, add vm labels, and simplify mintTicketETH helper.
Split payment flow: refundable tickets escrow funds in the contract,
non-refundable tickets send the ticket fee directly to the organizer.
For ERC20 non-refundable payments, the fee is sent to the organizer
and the hostIt fee is sent to the contract separately. Also updates
_payWithToken to accept a destination address parameter.
Update assertions for non-refundable tickets where fees go directly
to the organizer. Comment out refund and ticket balance withdrawal
tests (no longer applicable for non-refundable tickets). Add receive()
to test contract for ETH transfers.
…le flows

Expand from 8 to 58 marketplace tests covering:
- Non-refundable direct payment: organizer receives fee, contract
  holds only hostIt fee, no escrow (ETH, USDT, USDC)
- Refundable escrow: funds escrowed, refund claims, withdraw after
  refund period, time-window revert cases (ETH, USDT, USDC)
- Revert cases: insufficient balance/allowance, refund on non-refundable,
  withdraw zero balance, disabled fee type
- Mixed scenarios: hostIt fee accumulation across ticket types
- Add refundable ticket helpers to DeployedHostItTickets base
@dadadave80 dadadave80 merged commit d5f1655 into dev Apr 3, 2026
2 checks passed
@dadadave80 dadadave80 deleted the feat/direct-payment-to-organizer branch April 3, 2026 05:08
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.

1 participant